Skip to main content
By the end of this guide you’ll have a CWM Pay account, a working API key, and a successful test payment under your belt. Every step builds directly on the last, so follow them in order and you’ll be ready to integrate CWM Pay into your application in just a few minutes.

Prerequisites

1

Create your account

Go to dashboard.cwmpay.com and click Sign up. Enter your email address and a password, then verify your email. Once you’re in the dashboard, complete the onboarding checklist to activate your account.
2

Get your API key

In the dashboard, navigate to Settings → API Keys. You’ll see two keys:
  • Test secret key (sk_test_...) — use this for development and testing. Charges made with this key are simulated and never touch real money.
  • Live secret key (sk_live_...) — use this only in your production environment once you’re ready to accept real payments.
Copy your test secret key for the next step. Keep it somewhere safe — you won’t be able to view it again after you leave this page, but you can always rotate it and generate a new one.
3

Create a payment

Make a POST request to the /v1/payments endpoint to create a Payment Intent. Replace sk_test_your_key_here with the test key you copied in the previous step.
A successful request returns a Payment Intent object:
Response
The amount is always expressed in the smallest currency unit — so 1000 equals $10.00 USD. The initial status of requires_payment_method means the payment intent is ready and waiting for card details to be supplied.
4

Confirm the payment

Pass the client_secret from the response to your front-end integration. Your front end uses the CWM Pay.js library (or a pre-built UI component) to securely collect your customer’s card details and call the confirmPayment() method with the client_secret.Card data flows directly from the browser to CWM Pay — it never passes through your server, which keeps you out of PCI scope. Once confirmed, the Payment Intent status transitions from requires_payment_method to succeeded.
5

Verify via webhook

Rather than polling the API, register a webhook endpoint so CWM Pay can push confirmation to your server the moment a payment succeeds or fails.
  1. Go to Settings → Webhooks in the dashboard.
  2. Click Add endpoint and enter your server’s publicly accessible URL (e.g., https://yourapp.com/webhooks/cwmpay).
  3. Select the payment.succeeded and payment.failed events.
  4. Click Save. CWM Pay will send a signed POST request to your endpoint whenever one of those events fires.
Your endpoint should respond with a 200 OK status to acknowledge receipt. If CWM Pay doesn’t receive a 200, it will retry the delivery with exponential backoff.
Before going live, use sandbox test card numbers to simulate successful payments, declines, and edge cases like insufficient funds or expired cards. See the Testing guide for a full list of magic card numbers and how to trigger specific scenarios.