# Patch token

`PATCH /v3/token/{tokenId}`

Section: Tokenized Payment Methods. Base URLs: Playground https://playground-api.briqpay.com, Production https://api.briqpay.com. Auth: HTTP Basic.

Patch data of a tokenized payment method.

## Path parameters

- `tokenId` (string, required): **Format:** UUID. The tokenId is retrieved from **data.tokenization.tokenId** on a completed session with intent: "payment_tokenize" or "payment_tokenize_and_charge".

## Headers

- `Accept` (string, one of: `"application/json"`)
- `Authorization` (string): Format: "Basic <base64(username:secret)>"

## Request body

- `data` (object, required)
  - `billing` (object)
    - `streetAddress` (string, max length 100)
    - `streetAddress2` (string, max length 100)
    - `zip` (string, max length 100)
    - `city` (string, max length 100)
    - `region` (string, max length 100): State / region. Example: "CA" for California in the US.
    - `firstName` (string, max length 100)
    - `lastName` (string, max length 100)
    - `email` (string, max length 100)
    - `phoneNumber` (string)
    - `country` (string): Country code in ISO 3166-1 alpha-2 format.
  - `shipping` (object)
    - `streetAddress` (string, max length 100)
    - `streetAddress2` (string, max length 100)
    - `zip` (string, max length 100)
    - `city` (string, max length 100)
    - `region` (string, max length 100): State / region. Example: "CA" for California in the US.
    - `firstName` (string, max length 100)
    - `lastName` (string, max length 100)
    - `email` (string, max length 100)
    - `phoneNumber` (string)
    - `country` (string): Country code in ISO 3166-1 alpha-2 format.

## Request example

```bash
curl -X PATCH 'https://playground-api.briqpay.com/v3/token/{tokenId}' \
  -H 'Authorization: Basic <base64(merchantId:secret)>' \
  -H 'Content-Type: application/json'
```

No request body example in the spec yet.

## Responses

### 200

- `tokenId` (string)
- `initialSessionId` (string)
- `state` (string, one of: `"active"`, `"inactive"`)
- `country` (string): Country code in ISO 3166-1 alpha-2 format.
- `locale` (string): Locale in "sv-se" / "en-gb" format.
- `product` (object)
  - `type` (string, one of: `"payment"`, `"signup"`): Type of Briqpay product.
  - `id` (string, deprecated): Provide this if you have created an alternate variant configuration in the backoffice that you want to use.
  - `variantId` (string): Provide this if you have created an alternate variant configuration in the backoffice that you want to use.
- `customerType` (string, one of: `"business"`, `"consumer"`): Which type of customer this session is for.
- `expiryDate` (string)
- `createdAt` (string)
- `paymentMethod` (object)
  - `pspId` (string)
  - `name` (string)
  - `category` (string)
  - `pspDisplayName` (string)
- `chargeSessions` (array of object)
  - `sessionId` (string)
  - `completedAt` (string)
  - `order` (object)
    - `amountIncVat` (integer)
    - `amountExVat` (integer)
    - `currency` (string)
- `data` (object)
  - `company` (object)
    - `cin` (string): Company identification number. Example formats: Sweden: Orgnr / VAT Norway: Orgnr / VAT Denmark: CVR / VAT Finland: Business ID / VAT Germany: HRB / VAT Netherlands: KVK / VAT France: SIREN / SIRET / VAT United Kingdom: CRN United States: EIN
    - `name` (string): Company name.
  - `consumer` (object)
    - `dateOfBirth` (string): Date of birth (YYYY-MM-DD).
    - `name` (string): Name of the person.
  - `billing` (object)
    - `companyName` (string): B2B only.
    - `cin` (string): Company identification number. Example formats: Sweden: Orgnr / VAT Norway: Orgnr / VAT Denmark: CVR / VAT Finland: Business ID / VAT Germany: HRB / VAT Netherlands: KVK / VAT France: SIREN / SIRET / VAT United Kingdom: CRN United States: EIN
    - `streetAddress` (string)
    - `streetAddress2` (string)
    - `zip` (string)
    - `city` (string)
    - `region` (string): State / region. Example: "CA" for California in the US.
    - `firstName` (string)
    - `lastName` (string)
    - `email` (string)
    - `phoneNumber` (string)
    - `country` (string): Country code in ISO 3166-1 alpha-2 format.
  - `shipping` (object)
    - `companyName` (string): B2B only.
    - `cin` (string): Company identification number. Example formats: Sweden: Orgnr / VAT Norway: Orgnr / VAT Denmark: CVR / VAT Finland: Business ID / VAT Germany: HRB / VAT Netherlands: KVK / VAT France: SIREN / SIRET / VAT United Kingdom: CRN United States: EIN
    - `streetAddress` (string)
    - `streetAddress2` (string)
    - `zip` (string)
    - `city` (string)
    - `region` (string): State / region. Example: "CA" for California in the US.
    - `firstName` (string)
    - `lastName` (string)
    - `email` (string)
    - `phoneNumber` (string)
    - `country` (string): Country code in ISO 3166-1 alpha-2 format.

### 204

No content.

### 400

- `error` (object)
  - `code` (string, one of: `"INVALID_CREDENTIALS"`, `"INVALID_DATA"`, `"OPERATION_NOT_SUPPORTED"`, `"UNKNOWN"`)
  - `message` (string)

### 403

- `error` (object)
  - `code` (string, one of: `"INVALID_CREDENTIALS"`, `"INVALID_API_KEY"`, `"AUTH_SECRET_EXPIRED"`)
  - `message` (string)
