A Split Rule object defines how payments in xenPlatform can be routed and split to multiple sub-accounts or the Master account.
Include the split_rule_id
returned in the response in supported transaction endpoints to automatically route and split payments to multiple account destinations once payments settle.
{
"name": "Platform and Delivery Fees",
"description": "Platform fee and delivery fee for a Marketplace",
"routes": [
{
"flat_amount": 3000,
"currency": "IDR",
"destination_account_id": "5f8d0c0603ffe06b7d4d9fcf",
"reference_id": "reference-1"
},
{
"percent_amount": 5.25,
"currency": "IDR",
"destination_account_id": "5f8d0c0603ffe06b7d4d9fcf",
"reference_id": "reference-2"
}
]
}
Name to identify a split rule. Typically based on transaction and/or sub-merchant types and does not have to be unique. e.g. "standard platform fee and delivery fee", "commission"
Describes the purpose of the object
Defines a single amount and destination within a split rule
Amount of payments to be split, using a flat rate as a unit. This will be null if not applicable, and is required if percent_amount
is null. All units must be a positive number
Amount of payments to be split, using a percent rate as unit. This will be null if not applicable. This will be required if flat_amount
is null All units must be a positive number, with decimals supported up to 2 decimal places. Percent amounts have to be between 0 and 100 Percent amounts are rounded off to the nearest monetary unit (e.g. 0.50 IDR will be rounded to 1 IDR; 0.49 IDR will be rounded to 0 IDR)
ISO 4217 Currency Code
ID of your Account, use this in the for-user-id header to create transactions on behalf of your Account
Reference ID which acts as an identifier of the route itself. This is used to distinguish in case one split rule has multiple routes of the same destinations. Its value must be unique and case sensitive for every route object under the same Split Rule. Limit: 255 characters.
{
"id": "splitru_d9e069f2-4da7-4562-93b7-ded87023d749",
"name": "Standard platform fee",
"description": "Platform fee for all transactions accepted on behalf of vendors",
"routes": [
{
"flat_amount": 3000,
"currency": "IDR",
"destination_account_id": "5f8d0c0603ffe06b7d4d9fcf",
"reference_id": "reference-1"
},
{
"percent_amount": 5.25,
"currency": "IDR",
"destination_account_id": "5cafeb170a2b18519b1b8768",
"reference_id": "reference-2"
}
],
"created": "2020-09-01T07:00:00.007Z",
"updated": "2020-09-01T07:00:00.007Z",
"metadata": {}
}
The unique Split Rule ID
Name to identify a split rule. Typically based on transaction and/or sub-merchant types and does not have to be unique. e.g. "standard platform fee and delivery fee", "commission"
Describes the purpose of the object
Defines a single amount and destination within a split rule
Amount of payments to be split, using a flat rate as a unit. This will be null if not applicable, and is required if percent_amount
is null. All units must be a positive number
Amount of payments to be split, using a percent rate as unit. This will be null if not applicable. This will be required if flat_amount
is null All units must be a positive number, with decimals supported up to 2 decimal places. Percent amounts have to be between 0 and 100 Percent amounts are rounded off to the nearest monetary unit (e.g. 0.50 IDR will be rounded to 1 IDR; 0.49 IDR will be rounded to 0 IDR)
ISO 4217 Currency Code
ID of your Account, use this in the for-user-id header to create transactions on behalf of your Account
Reference ID which acts as an identifier of the route itself. This is used to distinguish in case one split rule has multiple routes of the same destinations. Its value must be unique and case sensitive for every route object under the same Split Rule. Limit: 255 characters.
Timestamp of when the object was created
Timestamp of when the object was updated
Object of additional key-value pairs that the merchants may use like internal system parameters (business ID, shopping cart). User defines the JSON properties and values. You can specify up to 50 keys, with key names up to 40 characters long and values up to 500 characters long. Otherwise NULL
Validation error
{
"error_code": "INVALID_CONFIGURATION",
"message": "Inputs are failing validation. The errors field contains details about which fields are violating validation.",
"errors": [
"Detailed description here"
]
}
{
"error_code": "INVALID_FEE_AMOUNT",
"message": "Fee amount and/or unit is negative number or incorrect format.",
"errors": [
"Detailed description here"
]
}
{
"error_code": "DUPLICATE_ERROR",
"message": "Returned if provided `reference_id` is not unique for the routes",
"errors": [
"Detailed description here"
]
}
Inputs are failing validation. The errors field contains details about which fields are violating validation.
Validation error
{
"error_code": "DESTINATION_ACCOUNT_NOT_FOUND",
"message": "Returned when destination_account_id is invalid or not connected to this xenPlatform account",
"errors": [
"Detailed description here"
]
}
The object being referenced does not exist