Settlements

Every request goes to https://api.lemak.cash. About the reference.

Create settlement

POST /v1/settlements

Settle the available balance now. Only a merchant whose settlement_schedule is manual may ask. Every other merchant is paid by the batch, on its own period.

Authentication

Bearer key. The merchant API key, sk_live_ or sk_test_. It reaches /v1 alone. A test key works from the moment the merchant exists. A live key answers 403 live_not_enabled until the merchant's review opens live mode, before any rate limit is spent.

Parameters

NameInTypeDescription
Idempotency-Key requiredheaderstringAt most 255 characters.
Api-Version optionalheaderstringThe version this request is answered at. Absent, the account's pinned version applies, and an account is pinned to info.version on its first request. A version this service does not render is refused with 400 invalid_api_version. api/CHANGELOG.md lists every version. Pattern ^[0-9]{4}-[0-9]{2}-[0-9]{2}$.

Responses

201

Created, or the replay of an earlier identical request.

application/json

Settlement

FieldTypeDescription
id requiredstringPattern ^st_[A-Z2-7]+$.
object requiredsettlement
mode requiredstringOne of live, test.
status requiredstringOne of pending, processing, paid, failed.
amount requiredMoneyWhat the merchant is paid, and the sum of the settled payments.
Fields of amount
FieldTypeDescription
amount requiredinteger (int64)Minor units. Never a decimal.
currency requiredstringPattern ^[A-Z]{3}$.
payments optionalintegerHow many payment intents this settlement covers.
period_start requiredstring (date-time)
period_end requiredstring (date-time)
created requiredstring (date-time)

Errors

Every error answers with the error object.

StatusWhen
403The merchant is paid on a schedule and may not ask.
409Nothing waits to be settled, the available balance does not cover it, or a request with this idempotency key is still running.
422The idempotency key was reused with a different body.
Other400 bad parameter, 401 authentication, 402 payment failed, 403 forbidden, 404 not found, 409 conflict, 413 request_too_large (a body over 64 KiB), 422 idempotency key reused, 429 rate limited, 5xx api error.

Example

curl -X POST https://api.lemak.cash/v1/settlements \
  -H "Authorization: Bearer sk_test_..." \
  -H "Idempotency-Key: <Idempotency-Key>" \
  -H "Api-Version: 2026-09-01"