Create a settlement
POST
/api/v1/settlements
const url = 'https://example.com/api/v1/settlements';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"customer_id":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0","workspace_id":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0","partner_id":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0","commission_ids":["2489E9AD-2EE2-8E00-8EC9-32D5F69181C0"]}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://example.com/api/v1/settlements \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "customer_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "workspace_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "partner_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "commission_ids": [ "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0" ] }'Computes the settlement amount for the given commissions (actual amount minus already settled amount) and persists a draft settlement.
Authorizations
Section titled “Authorizations ”Request Body required
Section titled “Request Body required ” Media type application/json
object
customer_id
required
ID of the customer this settlement belongs to
string format: uuid
workspace_id
required
ID of the workspace this settlement belongs to
string format: uuid
partner_id
required
ID of the partner to settle commissions for
string format: uuid
commission_ids
required
IDs of the commissions to include in this settlement
Array<string>
Example generated
{ "customer_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "workspace_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "partner_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "commission_ids": [ "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0" ]}Responses
Section titled “ Responses ”Settlement created successfully
Media type application/json
object
id
required
ID of the created settlement
string format: uuid
Example generated
{ "id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0"}Bad request
Media type application/json
object
error_code
required
string
message
required
string
Example
{ "error_code": "UNAUTHORIZED", "message": "Authentication credentials were not provided or are invalid."}Unauthorized
Media type application/json
object
error_code
required
string
message
required
string
Example
{ "error_code": "UNAUTHORIZED", "message": "Authentication credentials were not provided or are invalid."}Internal server error
Media type application/json
object
error_code
required
string
message
required
string
Example
{ "error_code": "UNAUTHORIZED", "message": "Authentication credentials were not provided or are invalid."}