API REFERENCE
Create a payment split
Tip
YabandPay sends asynchronous notifications from the IP addresses below. We recommend adding them to your firewall allowlist.
8.211.41.31 8.211.10.244 8.211.8.123
This API creates a payment split for a successfully paid YabandPay order.
Tip
Note:
- A maximum of 10 payment splits can be created for each payment order;
- Before calling this API, you must configure a payment split solution and obtain approval;
- When split_completed is 1, the payment split is complete and no further payment splits can be initiated.
| Parameter | Type | Description | Required |
|---|---|---|---|
| user | String | UID of the super administrator account | Required |
| sign | String | Signature | Required |
| method | String | v3.SplitPayment | Required |
| time | Long | Timestamp | Required |
- Parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
| command | String | createSplitPayment | Required |
| trade_id | String | trade_id of the paid YabandPay order | Required |
| split_solution_id | String | ID of the payment split solution configured in the management portal | Required |
| currency | String | Settlement currency of the original order, Settlement Currency | Required |
| notify_url | String | Asynchronous payment split notification URL | Required |
| nonce_string | String | Random string, no longer than 32 characters | Required |
| split_completed | String | Whether the payment split is complete: 0: No, 1: Yes | Required |
| reference_id | String | Unique merchant-defined payment split ID, no longer than 32 characters | Required |
| reference | String | Description, no longer than 128 characters | Optional |
| receivers | String | Payment split recipient information, a JSON string generated from a two-dimensional array using json_encode | Required when splitting a payment. Omit this parameter if you only want to mark the order as fully split without providing recipient information. |
| receivers.mid | String | mid of the payment split recipient | Required when splitting a payment |
| receivers.detail_reference_id | String | Custom payment split detail number for the recipient | Required when splitting a payment |
| receivers.split_amount | String | Payment split amount; for example, 24.99 should be written as 24.99 | Required when splitting a payment |
| receivers.role | String | Payment split recipient role | Required when splitting a payment |
| receivers.description | String | Payment split detail description | Optional when splitting a payment |
Recipient roles
| receivers.role parameter | Description |
|---|---|
| 1 | Sub-merchant |
| 2 | Supplier |
| 3 | Distributor |
| 4 | Tax withholding and remittance service |
| 5 | Technical services |
| 6 | Influencer |
| 7 | Other |
Signature example:
Sorted parameters concatenated into a URL-style query string
"command=createSplitPayment¤cy=EUR&method=v3.SplitPayment&nonce_string=1704693939376¬ify_url=https://www.yabandpay.com/notify&receivers=[{"mid":104006,"split_amount":0.01,"role":7,"detail_reference_id":"123456-2","description":"分账描述2"}]&reference=1704693939376&reference_id=1704693939376&split_completed=0&split_solution_id=102&time=1704693939&trade_id=23a199b8-b82b-81b0-a4cd-8485ca4feb3c&user=9212776037"
Sign stringA using secret_key
The resulting signature is:
"YOUR_SIGNATURE"
Request example:
{
"user": "9212776037",
"sign": "YOUR_SIGNATURE",
"method": "v3.SplitPayment",
"time": 1704693939,
"data": {
"command": "createSplitPayment",
"trade_id": "23a199b8-b82b-81b0-a4cd-8485ca4feb3c",
"split_solution_id": "102",
"currency": "EUR",
"notify_url": "https://www.yabandpay.com/notify",
"nonce_string": "1704693939376",
"split_completed": 0,
"reference_id": "1704693939376",
"reference": "1704693939376",
"receivers": "[{\"mid\":104006,\"split_amount\":0.01,\"role\":7,\"detail_reference_id\":\"123456-2\",\"description\":\"分账描述2\"}]"
}
}
Response example:
{
"status": true,
"code": "200",
"data": {
"user": "9212776037",
"split_id": "20240108162134979318",
"trade_id": "23a199b8-b82b-81b0-a4cd-8485ca4feb3c",
"split_solution_id": "102",
"state": "Processing",
"merchant_mid": "102300",
"merchant_name": "Yaband Telecom B.V.",
"created_at": "1704702094",
"currency": "EUR",
"notify_url": "https://www.yabandpay.com/notify",
"split_completed": 0,
"reference_id": "1704693939376",
"reference": "1704693939376",
"receivers": [
{
"merchant_mid": "104006",
"merchant_name": "ybtest",
"split_detail_id": "20240108162134979318-1",
"detail_reference_id": "123456-2",
"split_type": "Split",
"split_amount": "0.01",
"role": "7",
"result": "Processing",
"description": "分账描述2",
"error_msg": null
}
],
"type": "splitPayment"
},
"message": ""
}
- Response parameters
| Parameter | Type | Description |
|---|---|---|
| user | String | UID of the cashier account |
| split_id | String | Payment split order number generated when the payment split is created |
| trade_id | String | trade_id of the YabandPay order |
| split_solution_id | String | Payment split solution ID |
| state | String | Status: Processing, Success, Failed, Cancelled |
| merchant_mid | String | mid of the merchant splitting the payment |
| merchant_name | String | Name of the merchant splitting the payment |
| created_at | String | Creation timestamp |
| currency | String | Order settlement currency, Settlement Currency |
| notify_url | String | Asynchronous notification URL |
| split_completed | String | Whether the payment split is complete: 0: No, 1: Yes |
| reference_id | String | Merchant's payment split ID, no longer than 32 characters |
| reference | String | Description, no longer than 128 characters |
| type | String | Type: splitPayment or splitRefund |
| receivers | String | Payment split recipient information in JSON format |
| receivers.merchant_mid | String | mid of the payment split recipient |
| receivers.merchant_name | String | Merchant name of the payment split recipient |
| receivers.split_detail_id | String | Payment split detail number generated when the payment split is created |
| receivers.detail_reference_id | String | Merchant's payment split detail number |
| receivers.split_type | String | Payment split type: Split or Return |
| receivers.split_amount | String | Payment split amount |
| receivers.role | String | Payment split recipient role |
| receivers.result | String | Status: Processing, Success, Failed, Cancelled |
| receivers.description | String | Payment split detail description |
| receivers.error_msg | String | Error message for the payment split detail; populated when result is Failed |
