Checkout API

Programmatically get a hosted checkout URL to redirect buyers.

Create checkout session

POST /api/checkout — returns a redirect_url. No API key required.

Request body

JSON

{
  "productId": "your-product-uuid",
  "success_url": "https://yoursite.com/thank-you",
  "cancel_url": "https://yoursite.com/cancelled",
  "email": "[email protected]",
  "quantity": 2,
  "coupon": "SPRING10"
}

Only productId is required. Do not pass payment method fields — the buyer chooses on checkout.

quantity preselects how many units the buyer gets (up to the product's “Maximum per order” and remaining stock). coupon applies one of your discount codes when the page opens. Both are checked again on our servers; prices you send are ignored.

Response

200 OK

{
  "redirect_url": "https://flintpay.cc/checkout/your-product-uuid?success_url=..."
}

Example

cURL

curl -X POST https://flintpay.cc/api/checkout \
  -H "Content-Type: application/json" \
  -d '{
    "productId": "your-product-uuid",
    "success_url": "https://yoursite.com/success",
    "cancel_url": "https://yoursite.com/cancel",
    "email": "[email protected]"
  }'