Skip to content

Create a settlement

POST
/api/v1/settlements
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.

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"
]
}

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
Allowed values: UNAUTHORIZED NOT_FOUND INTERNAL_ERROR BAD_REQUEST FORBIDDEN CONFLICT
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
Allowed values: UNAUTHORIZED NOT_FOUND INTERNAL_ERROR BAD_REQUEST FORBIDDEN CONFLICT
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
Allowed values: UNAUTHORIZED NOT_FOUND INTERNAL_ERROR BAD_REQUEST FORBIDDEN CONFLICT
message
required
string
Example
{
"error_code": "UNAUTHORIZED",
"message": "Authentication credentials were not provided or are invalid."
}