Skip to main content

Split Payments Integration

Split payment configurations may be specified similarly across different GraphQL mutations, depending on what API is being used to initiate the transaction:

  • Individual Transactions (whether once-off, or tokenized)
  • Batch Collections

Individual Transaction Split Payment

The splitSettlements field is available for any initiateTransaction call and accepts an array of settlement objects. Refer to Once-off or Tokenized transaction initiation documentation, for complete integration details.

The example below demonstrates initiating a R400 transaction with R120 split to a destination merchant:

Batch Collection Split Payment

The splitSettlements field is an optional array on each CollectionInput within clientCollectionBatchCreate. Refer to Batch Collection documentation, for complete integration details.

The following example creates a batch with one collection that splits a fixed R120 to the destination merchant:

Split Payment Request Fields

FieldTypeDescription
splitSettlementsarray (optional)Split payment instructions for an individual transaction or batch collection. Only a single entry is supported at present.
[].merchantIdstringPre-registered merchant identifier, provisioned by Stitch.
[].amountobjectFixed amount to settle to the merchant.
[].amount.currencystringMust match collection currency (ZAR).
[].amount.quantitynumericAmount in rands (up to 2 decimal places). Must be > 0 and ≤ collection amount.

Split Payment Response Fields

Settlement outcomes are returned on the transaction or collection node. primarySettlement.amount and splitSettlements[].amount are the gross designated amounts. The amount actually settled to each beneficiary is its netAmount (the gross amount minus its feeAmount). Every Money object carries a currency and a quantity. feeAmount and netAmount are null until fees are computed (while the transaction is still pending), never zero.

FieldTypeDescription
splitSettlements[].amountobjectGross amount designated to this destination merchant.
splitSettlements[].feeAmountobjectThis destination merchant's fee. Null until computed.
splitSettlements[].netAmountobjectThis destination merchant's net settlement (amount minus feeAmount). Null until computed.
primarySettlementobjectThe client's own settlement: amount (gross, always present), feeAmount, and netAmount.
feeAmountobjectAggregate fee across all beneficiaries. Null until computed.
netAmountobjectAggregate net across all beneficiaries (amount minus feeAmount). Null until computed.

Querying Split Payment Status

Individual Transaction

Query the split payment outcome on a single transaction using the node query with a CardTransaction fragment:

Batch Collection

Query the split payment outcome per collection using GetPaymentCollectionBatch. Include primarySettlement, splitSettlements, and the aggregate feeAmount/netAmount on each collection node to retrieve the settlement breakdown.

Webhooks

The transaction webhook fires as normal when a transaction transitions through its lifecycle statuses. No additional webhook configuration is required for split payment. The webhook payload does not deliver any split-settlement data in this phase: it carries neither the per-split merchantId/amount, the primarySettlement, nor any feeAmount/netAmount field. To retrieve split-settlement detail, query the transaction or collection from the read API (see Querying Split Payment Status above). See Webhooks for details.

Error Handling

Split payment validation surfaces differently depending on which API you use.

On initiateTransaction, a split validation failure is returned as a UserInputError. The specific split code is available on the error's extensions.code, and extensions.failures lists each failing split instruction. The specific codes below apply to this path only.

CodeDescription
invalid_split_amountThe split amount exceeds the collection amount or is not positive.
split_settlement_not_enabledSplit payments are not enabled for this client. Contact Stitch to enable.
invalid_merchantThe merchantId is not recognised, or is not registered as a sub-merchant under the calling client.
duplicate_merchantThe same merchantId appears more than once in splitSettlements.
splits_limit_exceededMore split instructions were provided than are allowed (see the single destination merchant limitation).

On clientCollectionBatchCreate, split validation runs per collection but the specific code is not surfaced. Any split validation failure collapses to a single generic entry in the errors array for the affected row:

CodeDescription
invalid_split_settlementA split instruction on this collection failed validation. Returned per failing row in the batch errors array, with the row's nonce. Use initiateTransaction to obtain the specific validation code.