Skip to content

Conventions

What is the same for every request of the Baiyar Merchant API: host, bodies, and where the details of each convention are.


Sandbox Live
Host https://api.baiyar.com https://api.baiyar.com
Key bk_test_… bk_live_…

Sandbox and live share one host: the key you send decides which environment a request reaches, and their data is separate. See Authentication.

Requests and answers are JSON. A field the API does not know is refused instead of ignored, so a misspelled field is an error. Send Content-Type: application/json when there is a body.

A success answers { "data": …, "meta": { "request_id": … } } and a failure { "error": …, "meta": { "request_id": … } }: see Success responses. Every response also carries an x-request-id header, the same as meta.request_id. Quote it when you ask us about a request.

Topic What it covers
Authentication Keys, environments, restrictions
Permissions What a key may do, and the permission each operation needs
Rate limits Requests per minute and how to handle a 429
Idempotency Retrying without a second payment
Data types Amounts, times, booleans and null
Identifiers What pay_… and the other prefixes mean
Pagination and Filter lists Reading lists
Metadata Your own text on a payment
Success responses and Errors What comes back
Delete and cancel and Rotate API keys Ending and replacing things