Endpoint
POST https://api.digitzs.com/payments
Overview
Use this endpoint to perform a second split on an existing transaction. This allows you to distribute proceeds to a third merchant account after the original payment has been processed.
This feature requires special configuration. Contact Digitzs support to enable second split functionality for your merchant accounts.
Authentication
Header Value Required
x-api-keyYour API key from onboarding Yes AuthorizationBearer {appToken}Yes appIdYour application ID Yes Content-Typeapplication/jsonYes
Request Body
Container for payment attributes
data.attributes.paymentType
Must be "secondSplit"
data.attributes.parentPaymentId
The payment ID of the original transaction to split from
Split configuration data.attributes.split.merchantId
Merchant account to receive the second split amount
data.attributes.split.amount
Amount to split in cents. Must be less than remaining available balance.
Optional JSON string with additional metadata
Example Request
{
"data" : {
"type" : "payments" ,
"attributes" : {
"paymentType" : "secondSplit" ,
"parentPaymentId" : "pay_abc123xyz" ,
"split" : {
"merchantId" : "merchant_third_789" ,
"amount" : "50"
},
"miscData" : "{ \" reason \" : \" referral_fee \" }"
}
}
}
Response
Success Response (201 Created)
{
"links" : {
"self" : "https://api.digitzs.com/payments"
},
"data" : {
"type" : "payments" ,
"id" : "pay_split2_xyz789" ,
"attributes" : {
"paymentType" : "secondSplit" ,
"parentPaymentId" : "pay_abc123xyz" ,
"transaction" : {
"code" : "0" ,
"message" : "Success" ,
"amount" : "50" ,
"currency" : "USD"
}
}
}
}
Code Examples
cURL
JavaScript
Python
PHP
Ruby
curl -X POST https://api.digitzs.com/payments \
-H "x-api-key: your-api-key" \
-H "Authorization: Bearer your-app-token" \
-H "appId: your-app-id" \
-H "Content-Type: application/json" \
-d '{
"data": {
"type": "payments",
"attributes": {
"paymentType": "secondSplit",
"parentPaymentId": "pay_abc123xyz",
"split": {
"merchantId": "merchant_third_789",
"amount": "50"
}
}
}
}'
Important Notes
Configuration Required: Second split functionality must be enabled for your merchant accounts. Contact Digitzs support before using this feature.
Available Balance: The second split amount cannot exceed the available balance after the first split and processing fees.
Use Case: This is useful for complex revenue sharing scenarios like referral fees, affiliate commissions, or multi-party marketplaces.
Best Practices
Verify Parent Payment: Ensure the parent payment has settled before creating a second split
Track All Splits: Maintain records of all split transactions for reconciliation
Validate Amount: Check that sufficient funds remain for the second split
Clear Documentation: Document the reason for each split in the miscData field
Next Steps
Get Payment Details View complete payment details including all splits