Base URLs, the two API specifications, and how to authenticate your first request.
1Pick a language
2Try It!
Loading…
Try It! to start a request and see the response here!The Payment Labs API is a JSON REST API. Every request and response body is JSON, and every authenticated request carries a bearer token.
Base URLs
| Environment | Base URL |
|---|---|
| Sandbox | https://api-sandbox.paymentlabs.io |
| Production | https://api.paymentlabs.io |
Sandbox and production are separate environments with separate credentials and data. Build and test in sandbox first. See Environments and Authentication.
Two API specifications
| Specification | Who uses it | What it covers |
|---|---|---|
| Payout API | Payors: accounts that send money | The login, your account and ledger accounts, payees and onboarding, batches, payments, payment imports, payment requests, wallets, wallet disputes, and webhook registration |
| Payin API | Merchants: accounts that accept money | Your merchant account, checkouts, refunds, subscriptions, terminals and settlements |
Both specifications use the same base URLs and the same login. Webhook registration lives in the Payout API, and it covers payin events too, such as checkout-status-changed.
Authenticate
Payment Labs has one login for the whole platform. Payors and merchants use the same operation, and the token works for every API your credential's roles allow.
- Exchange your client credentials for a token with Create Access Token (
POST /login). - Send the token on every other request in the
Authorizationheader.
curl https://api-sandbox.paymentlabs.io/payors/me \
-H "Authorization: Bearer <token>"If your credential only has a payin role, call GET /merchants/me (Get Merchant) instead.
A token expires 3 hours after it is issued. Call POST /login again to get a new one. See Environments and Authentication.
Learn the conventions
- Introduction to Payment Labs: what Payment Labs does and which product fits your use case.
- Environments and Authentication: credentials, tokens, roles, and
401versus403. - Errors: the error body, validation details, and the status codes the API returns.
- Search, Exports and Pagination: filters, sorting, and paging for every search operation.
- Webhooks: register an endpoint, verify signatures, and handle retries.
