> For the complete documentation index, see [llms.txt](https://plexo.gitbook.io/rest-api/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://plexo.gitbook.io/rest-api/payment-links/split-payments.md).

# Split Payments

Split payments let you distribute a single payment across multiple destination merchants. This is useful for marketplace platforms, franchise models, or any scenario where a payment needs to be allocated to multiple parties.

## How splits work with Payment Links

Any Payment Link — regardless of type (`regular`, `one-time`, or `quick-pay`) — can have `splitDestinations`. When a payer completes a payment through a split-enabled link, Plexo automatically distributes the funds according to the configured rules.

{% hint style="info" %}
Split is a **feature**, not a link type. You can add split destinations to any link type.
{% endhint %}

## Amount allocation rules

Each split destination has an `amountRule` that defines how much of the payment it receives:

| Rule type    | Description                                            | Example                                |
| ------------ | ------------------------------------------------------ | -------------------------------------- |
| `percentage` | A percentage of the total payment amount (0–100).      | Platform gets 15% as commission.       |
| `fixed`      | A fixed currency amount deducted from the total.       | Platform fee of $5.00 per transaction. |
| `residual`   | Receives whatever remains after all other allocations. | Seller gets the remainder.             |

### Allocation rules

* The sum of all `percentage` rules must not exceed 100.
* The sum of all `fixed` rules must not exceed the payment total.
* Only one destination can use the `residual` rule.
* Exactly one destination should be `residual` to capture rounding differences.

## Example: Marketplace split with platform fee

A marketplace takes a 15% commission on each sale, and the seller receives the remainder:

```bash
curl -X POST "https://api.plexo.com.uy/v1/payment-links" \
  -u "YOUR_USERNAME:YOUR_PASSWORD" \
  -H "Content-Type: application/json" \
  -d '{
    "merchantId": 12345,
    "type": "regular",
    "amount": {
      "currency": "UYU",
      "total": 10000.00
    },
    "settings": {
      "amountMode": "fixed",
      "paymentMethods": ["VISA", "MASTERCARD"],
      "installments": { "*": [1, 3] }
    },
    "displayName": "Platform purchase",
    "description": "Order #ORD-5678",
    "splitDestinations": [
      {
        "destinationMerchantId": 12345,
        "amountRule": { "type": "percentage", "value": 15 }
      },
      {
        "destinationMerchantId": 67890,
        "amountRule": { "type": "residual" }
      }
    ]
  }'
```

In this example:

* Merchant 12345 (platform) receives 15% = UYU 1,500.00
* Merchant 67890 (seller) receives the residual = UYU 8,500.00

## Example: Fixed platform fee

```json
{
  "splitDestinations": [
    {
      "destinationMerchantId": 12345,
      "amountRule": { "type": "fixed", "value": 500.00 }
    },
    {
      "destinationMerchantId": 67890,
      "amountRule": { "type": "residual" }
    }
  ]
}
```

## Example: Three-way split

```json
{
  "splitDestinations": [
    {
      "destinationMerchantId": 11111,
      "amountRule": { "type": "percentage", "value": 70 }
    },
    {
      "destinationMerchantId": 22222,
      "amountRule": { "type": "percentage", "value": 20 }
    },
    {
      "destinationMerchantId": 12345,
      "amountRule": { "type": "residual" }
    }
  ]
}
```

## VAT allocation

Each split destination can optionally include a `vatRule` to allocate tax separately:

```json
{
  "splitDestinations": [
    {
      "destinationMerchantId": 67890,
      "amountRule": { "type": "percentage", "value": 85 },
      "vatRule": { "type": "percentage", "value": 85 }
    },
    {
      "destinationMerchantId": 12345,
      "amountRule": { "type": "residual" },
      "vatRule": { "type": "residual" }
    }
  ]
}
```

## Routing metadata

Use `routingMetadata` to pass key-value pairs that help processors route the split correctly:

```json
{
  "destinationMerchantId": 67890,
  "subMerchantReference": "seller-abc-123",
  "amountRule": { "type": "residual" },
  "routingMetadata": {
    "mcc": "5411",
    "softDescriptor": "ACME*Seller"
  }
}
```

## Managing split destinations after creation

You can update split destinations on an existing Payment Link using the dedicated endpoint:

```bash
curl -X PUT "https://api.plexo.com.uy/v1/payment-links/a1b2c3d4-e5f6-7890-abcd-ef1234567890/split-destinations" \
  -u "YOUR_USERNAME:YOUR_PASSWORD" \
  -H "Content-Type: application/json" \
  -d '[
    {
      "destinationMerchantId": 67890,
      "amountRule": { "type": "percentage", "value": 80 }
    },
    {
      "destinationMerchantId": 12345,
      "amountRule": { "type": "residual" }
    }
  ]'
```

{% hint style="warning" %}
Replacing split destinations uses **delete-all / insert-all** semantics. All existing destinations are removed and replaced with the ones you provide. To modify a single destination, you must send the complete list.
{% endhint %}

## Removing splits from a link

To remove all split destinations from a link, send an empty array:

```bash
curl -X PUT "https://api.plexo.com.uy/v1/payment-links/a1b2c3d4-e5f6-7890-abcd-ef1234567890/split-destinations" \
  -u "YOUR_USERNAME:YOUR_PASSWORD" \
  -H "Content-Type: application/json" \
  -d '[]'
```

## Best practices

* **Always include a `residual` destination** to capture rounding differences and ensure the full payment amount is allocated.
* **Use `subMerchantReference`** for external tracking when the destination merchant is a sub-merchant in a PayFac model.
* **Validate allocations client-side** before sending to the API — percentages should sum to ≤ 100 and fixed amounts should not exceed the payment total.

## Related

* [Split Destinations API Reference](/rest-api/api-reference/payment-links/split-destinations.md)
* [Payment Facilitators (PayFacs)](/rest-api/core-concepts/payment-facilitators.md)
* [Gateway Mode vs PayFac Mode](/rest-api/core-concepts/gateway-vs-payfac.md)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://plexo.gitbook.io/rest-api/payment-links/split-payments.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
