Charge cards, manage subscriptions, and create payment links over a simple REST API. All amounts are integer cents. Authenticate with your secret key as a Bearer token.
Send your secret key (find it under Developers) in the Authorization header.
Authorization: Bearer sk_sandbox_xxx
Publishable keys (pk_…) may only make GET requests. Secret keys can move money — keep them private.
/v1/charges| amount | Integer, cents. Minimum 50. |
| currency | Defaults to usd. |
| description | Optional text. |
| customer_email | Optional receipt email. |
| card | Object: number, exp_month, exp_year, cvc. |
curl http://localhost:4242/v1/charges \
-H "Authorization: Bearer sk_sandbox_xxx" \
-H "Content-Type: application/json" \
-d '{
"amount": 2500,
"description": "Order #1234",
"customer_email": "buyer@example.com",
"card": { "number": "4242424242424242", "exp_month": 12, "exp_year": 2030, "cvc": "123" }
}'
/v1/charges · GET/v1/charges/:idList charges or retrieve one. Each charge includes a fees breakdown (merchant fee, processor cost, platform margin, net).
/v1/refunds| charge | The charge id to refund. |
| amount | Optional partial amount in cents. Omit for a full refund. |
/v1/subscriptions| amount | Per-cycle amount in cents. |
| interval | week, month, or year. |
| product_name | Name shown to the customer. |
| card | Card object (first cycle is charged immediately). |
curl http://localhost:4242/v1/subscriptions \
-H "Authorization: Bearer sk_sandbox_xxx" \
-H "Content-Type: application/json" \
-d '{ "amount": 2900, "interval": "month", "product_name": "Gold Plan",
"card": { "number":"4242424242424242","exp_month":12,"exp_year":2030,"cvc":"123" } }'
/v1/subscriptions/:id/cancel/v1/payment_links| name | Link title. |
| mode | payment (one-time) or subscription. |
| amount | Cents (omit with allow_custom_amount). |
| interval | For subscription mode. |
Returns a url you can share. Customers pay on a hosted checkout page.
/v1/balance · GET/v1/account| 4242 4242 4242 4242 | Visa — approves |
| 5555 5555 5555 4444 | Mastercard — approves |
| 3782 822463 10005 | Amex — approves |
| 4000 0000 0000 0002 | Declined (generic) |
| 4000 0000 0000 9995 | Declined (insufficient funds) |
Use any future expiry and any 3-digit CVC (4 for Amex).