Orders, balance & refunds API

Versioned /api/v1 endpoints for reading payments, creating checkout links and issuing refunds.

Authentication & limits

  • Send Authorization: Bearer flint_sk_…. Keys are either full access (read + write) or read-only.
  • Each key is limited to 120 requests per minute; excess requests get HTTP 429.
  • All amounts are integers in cents (USD). Errors return { "error": "message" } with a 4xx/5xx status.
  • POST endpoints accept an Idempotency-Key header (stored 7 days) so retries never create duplicates.

Endpoints

  • GET /api/v1/orders?status=completed&limit=25&starting_after=<created_at> — list orders (newest first, cursor pagination via next_cursor)
  • GET /api/v1/orders/<id> — retrieve one order
  • POST /api/v1/orders/<id>/refund — refund all or part of a completed order ({ "amount": 500, "reason": "…" })
  • GET /api/v1/balance — available balance and pending withdrawals
  • POST /api/v1/checkout_links — hosted checkout URL for a product
  • GET|POST /api/v1/products, GET|PATCH|DELETE /api/v1/products/<id> — see Products API

Order statuses

  • pending — checkout created, waiting for payment
  • completed — payment verified with the provider and credited
  • expired — payment window closed without full payment
  • failed — the payment could not be created
  • refunded — fully refunded (partial refunds keep completed)

Examples

Create a checkout link

cURL

curl -X POST https://flintpay.cc/api/v1/checkout_links \
  -H "Authorization: Bearer flint_sk_your_secret_key" \
  -H "Content-Type: application/json" \
  -d '{ "product_id": "PRODUCT_ID", "success_url": "https://yoursite.com/thanks" }'

Refund an order (idempotent)

cURL

curl -X POST https://flintpay.cc/api/v1/orders/ORDER_ID/refund \
  -H "Authorization: Bearer flint_sk_your_secret_key" \
  -H "Idempotency-Key: refund-ORDER_ID-1" \
  -H "Content-Type: application/json" \
  -d '{ "amount": 1000, "reason": "Customer request" }'

Refunds are deducted from your available balance (platform fees are not returned) and are sent back to the customer by the FlintPay team; you receive an order.refunded webhook.