# Charge a payment.

> Sends a payment created with `POST /payments` to the payer's channel, from your server: the Mobile Money prompt on the payer's phone, or the charge on a bank or crypto channel. A payment collected on the hosted payment page never needs this call. Every field under `data` is also accepted at the root of the body. Card numbers are accepted in sandbox only, for test cards: live refuses raw card data. The answer is `200` when the channel confirms at once, and `202` while it waits for the payer: the outcome then arrives by webhook. Send an `Idempotency-Key` unique to this charge: sending the same key again returns the first answer instead of charging twice. When the provider behind the channel needs the payer to do something first, the `202` names that step in `action` and carries what it needs: `action_url` to send the payer to for `redirect`, `otp_id` for the code to confirm for `confirm_otp`.

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

## Path parameters

- `id` (string, required): The prepared 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/api/idempotency).

## Body (application/json)

- `channel` (string, required): A channel slug from `GET /channels`, or `mobile` to let Wajub find the operator from the phone number.
- `data` (object): The payer's details for this channel. A sandbox card charge also takes `card.number` (a test card), `card.holder`, `exp` (`MM/YY` or `MM/YYYY`) and `cvc` (3 or 4 digits), keys with a dot in their name; live refuses raw card data.
  - `data.phone` (string): Mobile Money number, in international format.
  - `data.account_number` (string): Account or wallet number, for channels that use one.
  - `data.iban` (string): For a bank channel.
  - `data.wallet_address` (string): For a crypto channel.
  - `data.save_payment_method` (boolean): Save this payment method on the customer for a later payment. Defaults to `false`.
  - `data.cvc` (string): Sandbox only: three or four digits.
  - `data.exp` (string): Sandbox only: the expiry, `MM/YY` or `MM/YYYY`, a year from this one to thirty years ahead.
  - `data.card` (object): Sandbox only: the test card, `number` and `holder`.
    - `data.card.holder` (string): Sandbox only: the name on the card. `card_holder` is accepted too.
    - `data.card.number` (string): Sandbox only: a published test card. Its number decides the outcome.

## Responses

- `202`: Accepted
- `402`: Declined, the payment is back to pending and can be charged again
- `403`: Forbidden
- `404`: Unknown payment
- `409`: A charge is already in progress
- `422`: Unprocessable Content
