# Charge the next instalment.

> Splits a payment into 2 to 4 instalments, then charges the next one on each call, in sandbox and, on Mobile Money channels, in live. The merchant has to turn instalments on in Settings › Regional first. Takes the same `channel` and `data` as `POST /payments/{id}`. The first call sets the plan. Each later call charges the next instalment: send it without `split_count` and `split_amounts`, or with the same plan; another plan answers `422`. The payment is `processing` while an instalment waits for the payer, `partial` between two, and `succeeded` with the last one. Each instalment is credited to your balance as it clears, with its share of the fee. A declined instalment answers `402` and is charged again by the next call; the instalments already paid stay paid. A call made while an instalment is still with the payer charges nothing and answers `202` with that instalment. To stop before the last one, close the payment (`POST /payments/{id}/close`).

`POST https://api.wajub.com/payments/{id}/splits`

## Path parameters

- `id` (string, required): Payment `id`.

## Headers

- `Idempotency-Key` (string): Your key for this request, 1 to 128 characters of letters, digits and `. _ : -`. The same request sent again with the same key returns the first answer instead of doing the work twice. See [Idempotency](https://docs.wajub.com/fr/api/idempotency).

## Body (application/json)

- `channel` (string, required): Same as `POST /payments/{id}`. In live, a Mobile Money channel.
- `data` (object): The payer's details for this channel.
  - `data.phone` (string): Mobile Money number, in international format.
- `split_count` (integer): Split into this many equal instalments: 2, 3 or 4, in whole units, the last one taking the rest. Sets the plan on the first call.
- `split_amounts` (array of number): Or give each instalment's amount, 2 to 4 of them, adding up to what the payer pays: `amount`, or `amount_total` when the payer bears the fee.
- `split_currency` (string): Currency of `split_amounts`, ISO 4217.

## Responses

- `200`: Instalment confirmed at once, the payment partial
- `202`: Accepted
- `402`: Instalment declined, the payment back to partial
- `403`: A seller frozen with `block_payments`
- `404`: Unknown payment
- `422`: Unprocessable Content

## Example response (200)

```json
{
  "code": 200,
  "status": "OK",
  "message": "Confirm the transaction on your phone.",
  "transaction": {
    "id": "trx_Rk4Wm8Zq2Lp6Xv9Tb3Nh",
    "amount": 600000,
    "amount_paid": 300000,
    "currency": "XAF",
    "status": "partial",
    "split": {
      "id": "splt_Jc5Ny7Qd1Hs8Mv3Ka6Wf",
      "split_number": 1,
      "total_splits": 2,
      "split_currency": "XAF",
      "amount": 300000,
      "status": "succeeded"
    }
  }
}
```
