API reference

Top up your balance

Add dollars to your open.sume.com balance with your API key.

POST /v1/open/top-ups

Host https://api.open.sume.com · Auth your open.sume.com API key

Starts a top-up of the balance your key is billed to. It is the same top-up as Add funds on the Billing page: you get a Stripe Checkout link, the payment happens there, and the balance grows once it is paid. A team key tops up the team's balance.

Send an Idempotency-Key. A retry with the same key returns the same top-up and the same checkout link, so a dropped connection never leads to a second payment. Reusing a key for a different amount fails with 409 idempotency_conflict.

Request

Headers

NameRequiredDescription
AuthorizationYesBearer <your open.sume.com API key>
Idempotency-KeyRecommendedUp to 255 characters. One key, one top-up.

Body

NameTypeRequiredDescription
amount_usd_centsintegerYesDollars to add, in cents. 2000 is $20. From 500 ($5) to 1000000 ($10,000).
success_urlstringNoWhere the payer lands after paying (https). Defaults to the Billing page.
cancel_urlstringNoWhere the payer lands on cancel (https). Defaults to the Billing page.

Example

Open checkout_url in a browser and pay. Then poll Get a top-up until status is paid.

Response

201 Created, or 200 OK for a retry with the same Idempotency-Key.

statusMeaning
pendingThe checkout is open and not paid yet.
paidPaid; the dollars are in your balance.
failedThe payment failed. Nothing was charged.
expiredThe checkout closed unpaid. Start a new top-up with a new Idempotency-Key.

Errors

StatuscodeWhen
400invalid_amountThe amount is under $5 or over $10,000, or not whole cents.
400invalid_requestA return URL is not https, or the Idempotency-Key is not 1 to 255 printable characters.
403open_key_requiredThe key is not an open.sume.com key.
409idempotency_conflictThe Idempotency-Key was used for a different amount.
502stripe_errorStripe could not open the checkout. Retry with the same Idempotency-Key.
503stripe_not_configuredTop-ups are not available in this environment.

All error codes