Easy Split
To process split payments you need to pass the split information in the API calls.
If you have Easy Split enabled for your merchant account, you can use these APIs to send split information for every order and refund.
Enable Easy split
Please reach out to your account manager or write to us at [email protected] to enable Easy Split for your account. Read more about Easy split here.
Create Order
When creating an order you can pass the split information to Cashfree. Cashfree will ensure that you are passing valid vendor details to process these payments. Please make sure that the vendors that are being
Below is a request and response where we have provided split information in the order_splits
attribute.
curl --request POST \
--url https://api.cashfree.com/pg/orders \
--header 'Content-Type: application/json' \
--header 'x-api-version: <<x-api-version>>' \
--header 'x-client-id: xxxx' \
--header 'x-client-secret: xxxx' \
--data '{
"customer_details": {
"customer_email": "[email protected]",
"customer_id": "LD09755CSCON10092021",
"customer_name": "Rohit",
"customer_phone": "9999911111"
},
"order_amount": 22,
"order_currency": "INR",
"order_note": "5% club",
"order_splits": [{
"vendor_id": "Vendor_1",
"amount": 10
},
{
"vendor_id": "Vendor_2",
"amount": 12
}
]
}'
{
"cf_order_id": 621544485,
"order_id": "order_863621zDkWCqM0TOLNQv5T57EsGiRohm",
"entity": "order",
"order_currency": "INR",
"order_amount": 22.00,
"order_expiry_time": "2021-11-07T16:17:54+05:30",
"customer_details": {
"customer_id": "LD09755CSCON10092021",
"customer_name": "Rohit",
"customer_email": "[email protected]",
"customer_phone": "9999911111"
},
"order_meta": {
"return_url": null,
"notify_url": null,
"payment_methods": null,
},
"settlements": {
"url": "https://api.cashfree.com/pg/orders/order_863621zDkWCqM0TOLNQv5T57EsGiRohm/settlements"
},
"payments": {
"url": "https://api.cashfree.com/pg/orders/order_863621zDkWCqM0TOLNQv5T57EsGiRohm/payments"
},
"refunds": {
"url": "https://api.cashfree.com/pg/orders/order_863621zDkWCqM0TOLNQv5T57EsGiRohm/refunds"
},
"order_status": "ACTIVE",
"order_token": "wk8J2zJwwjaWKcrL2g7p",
"order_note": "5% club",
"payment_link": "https://payments.cashfree.com/order/#wk8J2zJwwjaWKcrL2g7p",
"order_tags": null,
"order_splits": [
{
"vendor_id": "Vendor_1",
"amount": 10,
"percentage": null
},
{
"vendor_id": "Vendor_2",
"amount": 12,
"percentage": null
}
]
}
Currently, we only support INR currency for Easy Split.
In the above example, we have passed split information as raw amount. But you can also pass the split information in percentages.
"order_splits": [
{
"vendor_id": "SAUL",
"percentage": 50
},
{
"vendor_id": "DIEGO",
"percentage": 50
}
]
Refunds
To create refund with split information, you can provide split information in the attribute refund_splits
.
curl --request POST \
--url https://api.cashfree.com/pg/orders/order_863621zDkWCqM0TOLNQv5T57EsGiRohm/refunds \
--header 'Content-Type: application/json' \
--header 'x-api-version: <<x-api-version>>' \
--header 'x-client-id: xxxx' \
--header 'x-client-secret: xxxx' \
--data '{
"refund_id": "refund_1ZGV1mQKR1X2OB3OKDz5p92VU11",
"refund_amount": 22,
"refund_note": "hell1o world",
"refund_splits": [
{
"vendor_id": "Vendor_1",
"amount": 10
},
{
"vendor_id": "Vendor_2",
"amount": 12
}
]
}'
{
"bank_reference": null,
"cf_payment_id": 561400287,
"cf_refund_id": "refund_7630294",
"created_at": "2021-10-08T16:40:04+05:30",
"entity": "refund",
"failure_reason": null,
"order_id": "order_863621zDkWCqM0TOLNQv5T57EsGiRohm",
"processed_on": null,
"refund_amount": 22.00,
"refund_currency": "INR",
"refund_id": "refund_1ZGV1mQKR1X2OB3OKDz5p92VU11",
"refund_note": "hell1o world",
"refund_splits": [
{
"vendor_id": "Vendor_1",
"amount": 10
},
{
"vendor_id": "Vendor_2",
"amount": 12
}
],
"refund_status": "PENDING",
"refund_type": "refund"
}
Updated about 1 year ago