Skip to main content
POST
/
v1
/
billing
/
top-up
Top Up Credits
curl --request POST \
  --url https://identity.contra.id/v1/billing/top-up

Request

curl -X POST https://identity.contra.id/v1/billing/top-up \
  -H "x-api-key: $CONTRA_KEY" -H "Content-Type: application/json" \
  -d '{
    "amount_in_dollars": 200,
    "success_url":       "https://yourapp.com/billing/success",
    "cancel_url":        "https://yourapp.com/billing/cancel"
  }'
BodyTypeRequiredDescription
amount_in_dollarsnumberyesMinimum $50.
success_urlurlnoRedirect after successful payment.
cancel_urlurlnoRedirect on cancel.

Response · 200

{
  "checkout_session_id":  "cs_live_a1b2…",
  "checkout_session_url": "https://checkout.stripe.com/c/pay/cs_live_a1b2…"
}
Redirect the user to checkout_session_url. The balance updates within ~5 seconds of a successful payment.