Settlements
Every request goes to https://api.lemak.cash. About the reference.
List settlements
GET /v1/settlements
Returns a list of settlements in the mode of the API key, newest first. The list leaves out the items of each settlement; retrieve one settlement to read them.
Authentication
Bearer key. Your secret API key, which starts with sk_test_ or sk_live_. Send it as Authorization: Bearer <key>. A test key works as soon as your account exists. A production key returns 403 live_not_enabled until your account is activated.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
Api-Version optional | header | string | The API version for this request, as a date in YYYY-MM-DD format. When omitted, your account's version applies, which is set to the latest version on your first request. An unknown version returns 400 invalid_api_version. Pattern ^[0-9]{4}-[0-9]{2}-[0-9]{2}$. |
limit optional | query | integer | The maximum number of objects to return, from 1 to 100. Minimum 1. Maximum 100. Default 20. |
starting_after optional | query | string | A pagination cursor. Pass the ID of the last object on the previous page to get the next page. |
status optional | query | string | Only return settlements with this status. Any other value returns 400 invalid_status. One of pending, processing, paid, failed. |
Responses
200
A list of settlements.
application/json
SettlementList
| Field | Type | Description | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
object required | list | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
data required | array of Settlement | Fields of data
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
has_more required | boolean | Whether more objects exist after this page. |
Errors
Every error answers with the error object.
| Status | When |
|---|---|
| Other | An error. The status tells you the kind: 400 invalid request, 401 invalid API key, 402 payment could not be placed, 403 forbidden, 404 not found, 409 conflict, 413 body over 64 KiB, 422 idempotency key reused, 429 too many requests, 5xx server error. A test mode key takes at most 5 requests a second. |
Example
curl https://api.lemak.cash/v1/settlements \
-H "Authorization: Bearer sk_test_..." \
-H "Api-Version: 2026-12-01"
Create a settlement
POST /v1/settlements
Withdraws from your available balance. This is the only way a settlement starts: no schedule pays you. In production the settlement is pending until we review and approve it, and only then is it paid; in test mode a simulated destination is paid at once. Without amount it pays every released payment; with it, any amount up to the available balance. Without payout_method it pays the default destination; in production, with no default destination either, it is 400 payout_method_required. In production this endpoint takes a withdrawal key (wk_live_...) only: a payments key is 403 withdrawals_require_withdrawal_key.
Authentication
Bearer key. Your secret API key, which starts with sk_test_ or sk_live_. Send it as Authorization: Bearer <key>. A test key works as soon as your account exists. A production key returns 403 live_not_enabled until your account is activated.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
Idempotency-Key required | header | string | A unique key you generate for this request, up to 255 characters. A retry with the same key and body returns the original response. Without it, the request returns 400 idempotency_key_required. At most 255 characters. |
Api-Version optional | header | string | The API version for this request, as a date in YYYY-MM-DD format. When omitted, your account's version applies, which is set to the latest version on your first request. An unknown version returns 400 invalid_api_version. Pattern ^[0-9]{4}-[0-9]{2}-[0-9]{2}$. |
Request body
application/json
SettlementCreate
| Field | Type | Description |
|---|---|---|
amount optional | integer (int64) | Minor units to withdraw. Absent pays every released payment. The oldest payments are paid first, and the last one in part. Minimum 1. |
currency optional | string | The balance to draw. Required with amount. Absent is USD. A balance in any other currency is converted at a rate fixed when the platform approves the settlement. Any balance may go to any destination; the destination's flat payout fee comes off what is paid, and an amount that does not cover it is 400 amount_below_payout_fee. Pattern ^[A-Z]{3,5}$. |
payout_method optional | string | An address book entry. Absent is the default. |
Responses
202
The merchant's policy holds the change for a second approver. The answer is the request; the change runs when someone other than its maker approves it.
application/json
MerchantRequest
| Field | Type | Description |
|---|---|---|
id required | string | Pattern ^mrq_[A-Z2-7]+$. |
object required | merchant_request | |
mode required | string | One of live, test. |
kind required | string | One of withdrawal, payout_method.create, payout_method.remove, payout_method.default. |
status required | string | One of pending, approved, rejected, expired. |
summary required | object | What the change does, masked: the amount and the destination of a withdrawal, the type, label and last four characters of a destination. A map of string keys to string values. |
requested_by optional | string | The dashboard user who asked. |
requested_by_key optional | string | The withdrawal key that asked. |
decided_by optional | string | |
decided_at optional | string (date-time) | |
note optional | string | |
result optional | string | The settlement or the payout destination the approval made. |
expires_at required | string (date-time) | |
created_at required | string (date-time) |
201
Returns the settlement. A retry with the same Idempotency-Key returns the original response.
application/json
Settlement
| Field | Type | Description | |||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
id required | string | Unique identifier for the settlement. Pattern ^st_[A-Z2-7]+$. | |||||||||||||||||||||||||||||||||
object required | settlement | ||||||||||||||||||||||||||||||||||
mode required | string | live for production, test for test mode. One of live, test. | |||||||||||||||||||||||||||||||||
status required | string | The status of the settlement. One of pending, processing, paid, failed. | |||||||||||||||||||||||||||||||||
amount required | Money | The amount paid to you: the total of the settled payments, plus any balance adjustment the platform credited to you.Fields of amount
| |||||||||||||||||||||||||||||||||
payments optional | integer | The number of payment intents in this settlement. | |||||||||||||||||||||||||||||||||
period_start required | string (date-time) | The start of the period this settlement covers. | |||||||||||||||||||||||||||||||||
period_end required | string (date-time) | The end of the period this settlement covers. | |||||||||||||||||||||||||||||||||
created required | string (date-time) | The time the settlement was created. | |||||||||||||||||||||||||||||||||
paid_at optional | string (date-time) | The time the settlement was paid. Present only when status is paid. | |||||||||||||||||||||||||||||||||
destination optional | SettlementDestination | Where the settlement is paid. Absent when the settlement names no destination.Fields of destination
| |||||||||||||||||||||||||||||||||
payout optional | SettlementPayout | What a production settlement pays on its destination's rail: USDT, USDC or a USD wire. Present once the platform approved the settlement, which fixes the rate. Always whole cents.Fields of payout
| |||||||||||||||||||||||||||||||||
items optional | array of SettlementItem | The payment intents this settlement pays. Present only when you retrieve one settlement. The item amounts add up to amount, less any balance adjustment it pays.Fields of items
|
Errors
Every error answers with the error object.
| Status | When |
|---|---|
| 400 | The amount is not positive (invalid_amount), below your minimum withdrawal (amount_below_minimum) or above your available balance (balance_insufficient). Or a production withdrawal names no payout_method and you have no default destination (payout_method_required). |
| 403 | Your payouts are on hold (payouts_held): the default destination changed in the last 24 hours, or we hold the account. Or a production withdrawal used a payments key (withdrawals_require_withdrawal_key). |
| 404 | No payout destination with that ID is yours in this mode (resource_missing). |
| 409 | There is nothing to settle (nothing_to_settle), the destination is unverified (destination_unverified) or inside its 24-hour hold (destination_cooling), or a request with the same Idempotency-Key is still in progress (request_in_progress). |
| 423 | A fund password reset froze withdrawals for 24 hours (money_frozen). |
| 422 | The Idempotency-Key was already used with a different request body (idempotency_key_reused). |
| Other | An error. The status tells you the kind: 400 invalid request, 401 invalid API key, 402 payment could not be placed, 403 forbidden, 404 not found, 409 conflict, 413 body over 64 KiB, 422 idempotency key reused, 429 too many requests, 5xx server error. A test mode key takes at most 5 requests a second. |
Example
curl -X POST https://api.lemak.cash/v1/settlements \
-H "Authorization: Bearer sk_test_..." \
-H "Idempotency-Key: <Idempotency-Key>" \
-H "Api-Version: 2026-12-01" \
-H "Content-Type: application/json" \
-d '{
"amount": 1000,
"currency": "PHP",
"payout_method": "<payout_method>"
}'
Retrieve a settlement
GET /v1/settlements/{id}
Retrieves a settlement by its ID, with the payment intents it pays in items. The item amounts add up to the settlement amount, less any balance adjustment the settlement also pays, which names no payment intent.
Authentication
Bearer key. Your secret API key, which starts with sk_test_ or sk_live_. Send it as Authorization: Bearer <key>. A test key works as soon as your account exists. A production key returns 403 live_not_enabled until your account is activated.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
id required | path | string | The ID of the settlement. Pattern ^st_[0-9A-Za-z]+$. |
Api-Version optional | header | string | The API version for this request, as a date in YYYY-MM-DD format. When omitted, your account's version applies, which is set to the latest version on your first request. An unknown version returns 400 invalid_api_version. Pattern ^[0-9]{4}-[0-9]{2}-[0-9]{2}$. |
Responses
200
Returns the settlement and its items.
application/json
Settlement
| Field | Type | Description | |||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
id required | string | Unique identifier for the settlement. Pattern ^st_[A-Z2-7]+$. | |||||||||||||||||||||||||||||||||
object required | settlement | ||||||||||||||||||||||||||||||||||
mode required | string | live for production, test for test mode. One of live, test. | |||||||||||||||||||||||||||||||||
status required | string | The status of the settlement. One of pending, processing, paid, failed. | |||||||||||||||||||||||||||||||||
amount required | Money | The amount paid to you: the total of the settled payments, plus any balance adjustment the platform credited to you.Fields of amount
| |||||||||||||||||||||||||||||||||
payments optional | integer | The number of payment intents in this settlement. | |||||||||||||||||||||||||||||||||
period_start required | string (date-time) | The start of the period this settlement covers. | |||||||||||||||||||||||||||||||||
period_end required | string (date-time) | The end of the period this settlement covers. | |||||||||||||||||||||||||||||||||
created required | string (date-time) | The time the settlement was created. | |||||||||||||||||||||||||||||||||
paid_at optional | string (date-time) | The time the settlement was paid. Present only when status is paid. | |||||||||||||||||||||||||||||||||
destination optional | SettlementDestination | Where the settlement is paid. Absent when the settlement names no destination.Fields of destination
| |||||||||||||||||||||||||||||||||
payout optional | SettlementPayout | What a production settlement pays on its destination's rail: USDT, USDC or a USD wire. Present once the platform approved the settlement, which fixes the rate. Always whole cents.Fields of payout
| |||||||||||||||||||||||||||||||||
items optional | array of SettlementItem | The payment intents this settlement pays. Present only when you retrieve one settlement. The item amounts add up to amount, less any balance adjustment it pays.Fields of items
|
Errors
Every error answers with the error object.
| Status | When |
|---|---|
| 404 | No settlement with that ID exists in the mode of the API key (resource_missing). |
| Other | An error. The status tells you the kind: 400 invalid request, 401 invalid API key, 402 payment could not be placed, 403 forbidden, 404 not found, 409 conflict, 413 body over 64 KiB, 422 idempotency key reused, 429 too many requests, 5xx server error. A test mode key takes at most 5 requests a second. |
Example
curl https://api.lemak.cash/v1/settlements/st_123 \
-H "Authorization: Bearer sk_test_..." \
-H "Api-Version: 2026-12-01"