> ## Documentation Index
> Fetch the complete documentation index at: https://docs.dintero.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Create a split-payment session

> Create Dintero Checkout sessions with split payouts that route funds to multiple sellers — for marketplaces, platform fees, and multi-merchant transactions.

With Dintero Payout, you can split the funds between any number of sellers. For example, when a customer
pays on your platform, you can split the funds so that a part goes to your own seller as platform fee and
the sale amount goes to the sales location seller

## Providing split information

You can provide split information:

* When [creating](/api-reference/session/checkout_session_profile_post) new payment
  session
* When [capturing](/api-reference/transactions/transactions_id_capture_post) the payment
  transaction
* When [refunding](/api-reference/transactions/transactions_id_refund_post) the payment
  transaction

To split the payment, you will need to include the **splits** array in the session order items. For each split object in
the array, you need to specify the following fields:

* **`payout_destination_id`**: The destination that will receive the split
* **`amount`**: The split amount

For example, a customer pays for goods for 499,90 NOK, you can split the payment such that:

* 399,90 NOK goes to the merchant
* 70,00 NOK goes to the platform
* 30,00 NOK is a donation to a charity

<Info>
  Dintero supports as many sellers as you need, but there might be limitations based on item amounts.
</Info>

```json theme={null}
{
  "order": {
    "items": [
      {
        "splits": [
          {
            "payout_destination_id": "merchant",
            "amount": 39990
          },
          {
            "payout_destination_id": "platform",
            "amount": 7000
          },
          {
            "payout_destination_id": "charitable_organization",
            "amount": 3000
          }
        ]
      }
    ]
  }
}
```

### Aggregators

Aggregators must specify the merchant of record of the transaction.

<Info>
  You will be informed during onboarding to Dintero about whether you are a marketplace or aggregator.
</Info>

To specify the merchant of record, include `store.payout_destination_id` in the order:

```json theme={null}
{
  "order": {
    "store": {
      "id": "my-store-id",
      "payout_destination_id": "merchant"
    }
  }
}
```

## Validating split information

The Checkout service only validate the format of the split data. The seller in the splits will **not** be
validated.

If you provide split data with a seller that does not exist or the seller is not approved for
payout, the payout for the destination will be postponed until the issue with the seller has been resolved

## Providing fee split information

The default behaviour when splits are used is to let the fees be shared proportional with all split destinations.

The default behaviour can be overridden by including `fee_split` when setting
**splits**

### Override default fee split

Example under shows how a split destination can be configured to handle the fees.

```json theme={null}
{
  "order": {
    "items": [
      {
        "splits": [
          {
            "payout_destination_id": "merchant",
            "amount": 39990
          },
          {
            "payout_destination_id": "platform",
            "amount": 7000
          },
          {
            "payout_destination_id": "charitable_organization",
            "amount": 3000
          }
        ],
        "fee_split": {
          "type": "proportional",
          "destinations": [
            "platform"
          ]
        }
      }
    ]
  }
}

```

<Info>
  Sellers that are excluded from fees will receive the whole amount when the payout is settled
</Info>

## Full example of creating a session

When put together, we can call [https://checkout.dintero.com/v1/sessions-profile](/api-reference/session/checkout_session_profile_post) with a payload with the following
content.

If you want non-standard fee splits, see "Override default fee split" above.

```json theme={null}
{
  "url": {
    "return_url": "https://example.com/accept",
    "callback_url": "https://example.com/callback?method=GET",
    "merchant_terms_url": "https://example.com/terms.html"
  },
  "customer": {
    "email": "john.doe@example.com",
    "phone_number": "+4799999999"
  },
  "order": {
    "amount": 49990,
    "currency": "NOK",
    "vat_amount": 6000,
    "items": [
      {
        "id": "item_01",
        "line_id": "1",
        "description": "Stablestol",
        "quantity": 1,
        "amount": 49990,
        "vat_amount": 9998,
        "vat": 25,
        "splits": [
          {
            "payout_destination_id": "merchant",
            "amount": 39990
          },
          {
            "payout_destination_id": "platform",
            "amount": 7000
          },
          {
            "payout_destination_id": "charitable_organization",
            "amount": 3000
          }
        ]
      }
    ],
    "merchant_reference": "merchants_unique_id"
  },
  "profile_id": "default"
}
```

<Info>
  Most new accounts should have the `default` profile\_id available. If you have an old account, go [here](/docs/checkout/payment-profiles) to learn how to create one.
</Info>

## Capture and Refund

When capturing or refunding a split-payment you can do a full capture or full refund using only the total order amount defined in the payment session. For full captures and refunds the capture and refund operation will use the splits as defined in the payment session.

If you want to do a partial capture or a partial refund, the operation request body will also need to include the items and the splits for the items that are captured or refunded. It is also possible to use a different split from what is defined in the payment session when the items with splits are defined in the capture and refund operations. It is also possible to capture and refund asymmetrically, for instance it is possible to define that one party in the split will cover the entire refund.

* [API specification for the capture operation](/api-reference/transactions/transactions_id_capture_post)
* [API specification for the refund operation](/api-reference/transactions/transactions_id_refund_post)
