Prerequisites
- A CWM Pay account — sign up for free at dashboard.cwmpay.com
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.
3
Create a payment
Make a A successful request returns a Payment Intent object:The
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.Response
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.
- Go to Settings → Webhooks in the dashboard.
- Click Add endpoint and enter your server’s publicly accessible URL (e.g.,
https://yourapp.com/webhooks/cwmpay). - Select the
payment.succeededandpayment.failedevents. - Click Save. CWM Pay will send a signed
POSTrequest to your endpoint whenever one of those events fires.
200 OK status to acknowledge receipt. If CWM Pay doesn’t receive a 200, it will retry the delivery with exponential backoff.