API reference

The merchant API, generated from openapi.yaml. Version 2026-12-01.

Basics

Every request goes to https://api.lemak.cash over HTTPS. Every /v1 request carries your secret key as Authorization: Bearer sk_test_... or sk_live_.... A test key reaches only test data.

Send Api-Version to choose the version that answers one request. Without it, the version your account is pinned to answers. The changelog lists every version.

Every write takes an Idempotency-Key. A retry with the same key and the same body replays the first answer.

Errors

Every error answers with this object. code is stable and is the field to branch on. message is for a person and can change.

ErrorEnvelope

The body of every error response.

FieldTypeDescription
error requiredError
Fields of error
FieldTypeDescription
type requiredstringThe category of the error. One of invalid_request_error, authentication_error, idempotency_error, rate_limit_error, api_error.
code requiredstringA short, stable string that identifies the error, such as resource_missing. Use it to handle errors in code.
message requiredstringA readable explanation of the error. The text can change.
param optionalstringThe parameter the error relates to, if any.
decline_code optionalstringPresent on payment_blocked alone: the kind of risk rule that declined the payment. velocity is too many payments in a short time, blocklist is a payer on a block list, geo is the payer's country, amount is the amount, and generic is any other rule. One of velocity, blocklist, geo, amount, generic.
request_id optionalstringThe ID of the request, also sent in the Request-Id header.

Resources

Payment intents

Disputes

Payment exceptions

Files

Refunds

Settlements

Balance

Balance transactions

Statements

FX quotes

Payment methods

Currencies

Events

Webhook public keys

IP addresses