The Split Payments solution enables a "Marketplace" model where a customer can create a single aggregated order containing products or services from multiple vendors (sites).
When a customer pays for this aggregated order, the system automatically handles the distribution of funds. The main order is processed on the primary (sending) site, and corresponding "internal" orders and transactions are instantly created on the vendor (receiving) sites.
- Aggregated Order: You create a single order request on the primary merchant site (the "marketplace site").
- Split Definition: Inside this request, you declare the destination sites and amounts using the
transactionOptionsparameter with thesplitPaymentschema. - Automatic Distribution: Upon a successful payment:
- A primary Order and Transaction are created on the sending site.
- New Orders are automatically created on each "receiving site" defined in the split schema.
- Funds Transfer: Internal credit and deposit transactions are executed to move funds from the sending site to the receiving sites.
You can implement Split Payments using either the Direct API or the Hosted Checkout solution.
Use this method if you are integrating directly via the POST /order endpoint.
Because this integration method requires you to collect and transmit raw card details (PAN, CVV) directly in the API request, your organization must be fully PCI DSS compliant.
If you are not PCI DSS compliant, you strictly cannot use this method for card payments. Please utilize the Hosted Checkout solution instead, which offloads compliance requirements by handling card data on our secure payment pages.
In addition to the standard Create Order parameters (such as amount, currency, customerId, orderType), you must include the transactionOptions object containing the splitPayment definition.
Example Request In this example, a customer purchases items totaling 100.00 EUR.
- 50.00 EUR goes to Vendor A (Site 9825).
- 30.00 EUR goes to Vendor B (Site 9792).
- 20.00 EUR remains on the Marketplace (Sending Site) as commission/fees.
{
"amount": 100.00,
"currency": "EUR",
"orderType": "purchase",
"customerId": 12345,
"description": "Marketplace Aggregated Order #5501",
"transactionOptions": {
"splitPayment": {
"splitSchema": [
{
"toSite": 9825,
"amount": 50.00,
"description": "Payment to Vendor A",
"tag": ["vendorA", "electronics"]
},
{
"toSite": 9792,
"amount": 30.00,
"description": "Payment to Vendor B",
"tag": ["vendorB", "accessories"]
}
]
}
}
}Use this method if you are using the Hosted Checkout page. The configuration is passed within the encrypted jsonRequest payload used to initialize the payment session. This method is suitable for merchants who are not PCI DSS compliant.
Request Structure Add the transactionOptions object to the root of your jsonRequest structure.
Ensure that your checksum calculation includes this new transactionOptions field, as the entire JSON payload is used to generate the signature.
Example jsonRequest
{
"siteId": 1,
"customer": {
"identifier": "your-unique-customer-id",
"firstName": "John",
"lastName": "Doe",
"country": "RO",
"city": "Bucharest",
"email": "john.doe@test.com"
},
"order": {
"orderId": "your-unique-order-id",
"description": "Order Description",
"type": "purchase",
"amount": 2194.98,
"currency": "RON"
},
"cardTransactionMode": "authAndCapture",
"backUrl": "https://myshop.com/payment-back-url",
"transactionOptions": {
"splitPayment": {
"splitSchema": [
{
"toSite": 9825,
"amount": 1000.00,
"description": "Payment for Vendor A",
"tag": ["vendorA"]
},
{
"toSite": 9792,
"amount": 500.00,
"description": "Payment for Vendor B",
"tag": ["vendorB"]
}
]
}
}
}transactionOptions Schema
| Field | Type | Description |
|---|---|---|
splitPayment | Object | The root object for the split configuration. |
splitPayment.splitSchema | Array | A list of objects defining where funds should be routed. |
splitSchema Item Details
| Field | Type | Description |
|---|---|---|
toSite | Integer | The Site ID of the vendor receiving the funds. Note: Do not use the sending site's ID here |
amount | Float | The amount to be transferred to this site |
description | String | A description for this specific portion of the payment. |
tag | Array | Optional tags for categorization or reconciliation. |
The sum of amount in the split schema must not exceed the total amount of the main order. Any remainder stays on the sending site.
Once the transaction is successful, the system generates several linked entities to represent the flow of funds.
- Order: A standard purchase order is created.
- Transaction: A transaction of
type='credit'andtransactionMethod='transfer'is created.- This transaction will have a component named "internal-credit".
For every item in the splitSchema, the following are automatically generated on the specific toSite:
- New Customer:
- Created with identifier format:
"internal-{customerId from sending site}".
- Created with identifier format:
- New Order:
- Created with
orderType='purchase'. - Linked via
externalOrderIdformat:"internal-{orderId from sending site}".
- Created with
- New Transaction:
- Created with
type='deposit'andtransactionMethod='transfer'. - This transaction will have a component named
"internal-deposit".
- Created with
Determine Integration Type & Scope:
- Direct API: Confirm your organization is PCI DSS Compliant (typically SAQ D or Level 1 audit) to handle raw card data.
- Hosted Checkout: Confirm you qualify for SAQ A (all card data handling offloaded to xMoney).
Credentials Management:
- Ensure
Private Keyis never exposed in client-side code (browser/mobile app).
Amount Verification:
- Sum Check: Total of
amountinsplitSchema<= Main Orderamount. - Remainder: Confirm that any unallocated remainder is intended to stay on the Sending Site (Marketplace) as commission.
Site ID Rules:
- No Self-Loop:
toSitemust not equal the Sending Site ID. - No Duplicates:
toSiteIDs must be unique within thesplitSchemaarray.
Currency Consistency:
- Ensure all split amounts assume the same currency as the main order (cross-currency splits are not supported in this schema).
If using Hosted Checkout:
- Payload Structure:
-
transactionOptionsis placed inside the root of thejsonRequestobject.
-
- Checksum Calculation:
- The checksum calculation (HMAC-SHA-512) includes the entire JSON payload, including the new
transactionOptionsobject. - Verify the JSON stringification order does not alter the checksum (ensure consistent serialization).
- The checksum calculation (HMAC-SHA-512) includes the entire JSON payload, including the new
If using Direct API:
- Payload Structure:
-
transactionOptionsis a sibling to amount and customerId in the POST body.
-
End-to-End Flow:
- Perform a successful transaction using a Test Card.
Verify Sending Site:
- Confirm 1 Order and 1 Transaction (
internal-credit) created.
Verify Receiving Site(s):
- Login to vendor dashboard (or use API) to confirm 1 Order and 1 Transaction (
internal-deposit) created per split. - Verify
externalOrderIdmatches the formatinternal-{parent_order_id}. - Verify
amountmatches the specific split value.
- Implement logic to handle
400 Bad Requestif the split amount exceeds the total order amount. - Handle partial failures (e.g., if a vendor account is suspended) based on xMoney's specific error codes.