# Update a customer token's status

> `PATCH https://api.kustom.co/customer-token/v1/tokens/{customerToken}/status`

Cancels a customer token. Internally served by MerchantApiController's `/merchant/{merchantId}/v1/tokens/{tokenId}/status` route, reached through `MerchantRequestRewriteFilter`. Merchant log action: UPDATE_TOKEN.

## Parameters

- `customerToken` (string, path, required)

## Request body

`application/json`

- `status` (string, required) — The token status to update to. Enum: `CANCELLED`.

### Example request

```json
{
  "status": "CANCELLED"
}
```

## Responses

### 202

Token status update request has been accepted and is being processed.

### 400

The status field was missing, the request failed validation, or the token is not currently ACTIVE.

`application/json`

- `authorized_payment_method` (object)
  - `number_of_days` (integer)
  - `number_of_installments` (integer)
  - `type` (string, required) Enum: `invoice`, `fixed_amount`, `pix`, `base_account`, `deferred_interest`, `direct_debit`, `direct_bank_transfer`, `b2b_invoice`, `card`, `slice_it_by_card`, `pay_later_by_card`, `fixed_sum_credit`, `pay_by_card`, `wallet`.
- `correlation_id` (string)
- `error_code` (string)
- `error_messages[]` (array<string>)
- `fraud_status` (string)
- `reason` (string)

```json
{
  "authorized_payment_method": {
    "number_of_days": 0,
    "number_of_installments": 0,
    "type": "invoice"
  },
  "correlation_id": "<string>",
  "error_code": "BAD_VALUE",
  "error_messages": [
    "<string>"
  ],
  "fraud_status": "ACCEPTED",
  "reason": "Purchase for payment method failed"
}
```

### 404

The merchant is not migrated, or the token or merchant was not found.

### 500

An unexpected error occurred.
