Make your first request
The Paid API lives at https://api.paid.ai/v1. It takes and returns JSON over HTTPS. You need an API key from Set up your account, exported as PAID_API_KEY.
The headers every request sends
Send the request
Your first request gets your account’s API version. It reads your settings and changes nothing, so it’s a safe way to check your key:
pinned is the version your account uses for a request that sends no Paid-Version, and latest is the newest version. Send Paid-Version on every request anyway, so upgrading the account’s version never changes what your code receives. Versioning explains how to move to a new version.
If the request fails
Every error has the same JSON body. code says what went wrong, and docUrl links to how to fix it:
The errors a first request is most likely to hit:
Errors lists every code and what to do about it.
Headers you’ll meet next
Paid-Betaswitches on a feature that’s in beta. Customers, for example, needPaid-Beta: customers=v1. See Betas and stability.Idempotency-Keymakes a create or update safe to retry: send a new unique value with everyPOSTandPATCH. See Idempotency.
Next steps
- Create a customer: your first write to the API.
- Examples: complete pricing set-ups, from a catalog to an invoice.