# Activate a prepared payment.

> Creates the payment prepared with `deferred: true`, once your order is placed. Call it from your server, with the secret key, while the component waits in `onBeforeSubmit`: the component charges only after this call succeeded. The payment keeps the prepared `id`, appears in your payments, and `payment.created` is sent now. `amount` and `currency` must still match the prepared payment: change them first with `PATCH /payments/{id}`. `reference` and `description` replace the ones given at preparation, when your order did not exist yet. Sending the same body again answers `200` and changes nothing. Another body on an activated payment answers `409`.

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

## Path parameters

- `id` (string, required): The prepared payment `id`.

## Body (application/json)

- `amount` (number, required): The order total, equal to the prepared payment's amount.
- `currency` (string, required): ISO 4217 currency code, equal to the prepared payment's.
- `customer` (object, required): The buyer, as your order recorded them. At least one of `email` or `phone`.
  - `customer.email` (string, nullable): The buyer's email address.
  - `customer.phone` (string, nullable): The buyer's phone number (international format).
  - `customer.name` (string, nullable): The buyer's full name.
- `callback` (string, nullable): Redirect URL after payment.
- `metadata` (object, nullable): Merged into the payment's metadata.
- `reference` (string, nullable): Your own reference for this payment, now that the order exists (max 128 chars), as `POST /payments` takes it: free and not unique. Absent, the prepared one stays.
- `description` (string, nullable): A label shown to the customer on the payment page (max 500 chars). Absent, the prepared one stays.

## Responses

- `200`: Activated
- `403`: A seller frozen with `block_payments`
- `404`: Not found
- `406`: Publishable key
- `409`: Expired, cancelled, or activated with another body
- `422`: Total changed

## Example response (200)

```json
{
  "activated": true
}
```
