# Create credit card token

URL: https://docs.emergingtravel.com/docs/affiliate-api/booking/create-credit-card-token/

Tags: affiliate

---


```
https://api.payota.net/api/public/v1/manage/init_partners
```

> [!NOTE]
> The call is <strong>required</strong> for bookings where the `is_need_credit_card_data` field was passed with the `true` value.



The call creates and returns a credit card token for the order payment. The [PCI DSS](https://www.pcisecuritystandards.org/) standard guarantees safe and secure processing.

## Request example

```shell
curl --user '<KEY_ID>:<API_KEY>' 'https://api.payota.net/api/public/v1/manage/init_partners' \
--header 'Content-Type: application/json' \
--data '{
  "object_id": "32165487",
  "pay_uuid": "797870e3-e1f0-470a-87b3-38694f58bed1",
  "init_uuid": "c44ef1ba-595b-437f-ad14-74ce39a0f9ad",
  "user_last_name": "LastName",
  "cvc": "123",
  "is_cvc_required": true,
  "credit_card_data_core": {
    "year": "18",
    "card_number": "4111111111111111",
    "card_holder": "TEST",
    "month": "01"
  },
  "user_first_name": "Name"
}'
```

## Request body



- **object_id** *(String, required)*

  <p>The booking order ID.</p>
  <p>You can find this value of the <code>item_id</code> field in the response to the [Create booking process](/docs/affiliate-api/booking/create-booking-process/)
   call.</p>
  > [!NOTE]
  > <ul><li>The minimum length is `1` character.</li>
  > <li>The maximum length is `20` characters.</li></ul>


- **pay_uuid** *(String, required)*

  <p>The external booking payment ID in the [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier)
   format.</p>
  > [!NOTE]
  > * The length is `36` characters.
  > * Must be unique for every payment. Otherwise, the ETG will return an error.
  > * The value matches the pattern: `^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$`.


- **init_uuid** *(String, required)*

  <p>The external booking token ID in the [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier)
   format.</p>
  > [!NOTE]
  > * The length is `36` characters.
  > * Must be unique for every payment. Otherwise, the ETG will return an error.
  > * The value matches the pattern: `^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$`.


- **user_first_name** *(String, required)*

  <p>The guest first name.</p>
  > [!NOTE]
  > * The minimum length is `1` character.


- **user_last_name** *(String, required)*

  <p>The guest last name.</p>
  > [!NOTE]
  > * The minimum length is `1` character.


- **cvc** *(String, optional)*

  <p>The CVC.</p>
  > [!NOTE]
  > * The length is `3` characters.


- **is_cvc_required** *(Boolean, required)*

  <p>Whether the CVC is required or not.</p>


- **credit_card_data_core** *(Object, required)*

  <p>The credit card information.</p>
  <ul>
  <li>
  <p><strong>year</strong> <em>(String, required)</em></p>
  <p>The valid thru year.</p>
  > [!NOTE]
  > * The length is `2` characters.
  </li>
  <li>
  <p><strong>card_number</strong> <em>(String, required)</em></p>
  <p>The credit card number without spaces.</p>
  > [!NOTE]
  > * The minimum length is `13` characters.
  > * The maximum length is `19` characters.
  </li>
  <li>
  <p><strong>card_holder</strong> <em>(String, required)</em></p>
  <p>The cardholder name.</p>
  > [!NOTE]
  > * The minimum length is `1` character.
  </li>
  <li>
  <p><strong>month</strong> <em>(String, required)</em></p>
  <p>The valid thru month.</p>
  > [!NOTE]
  > * The length is `2` characters.
  </li>
  </ul>





## Response example

```json
{
  "status": "ok"
}
```

## Errors

The `error` field has the value specified in the headers below.

### `body_error`

The passed JSON isn’t valid.

### `validation_error`

Not all required field values are passed.

### `invalid_pay_uuid`

The `invalid_pay_uuid` field value doesn’t match the pattern.

### `invalid_init_uuid`

The `invalid_init_uuid` field value doesn’t match the pattern.

### `invalid_month`

The month is invalid. Try a different one.

### `invalid_year`

The year is invalid. Try a different one.

### `invalid_cvc`

Incorrect CVC code.

### `invalid_card_number`

The credit card data is invalid. Try a different one.

### `invalid_card_holder`

The cardholder name is invalid. Try a different one.

### `invalid_is_cvc_required`

The `is_cvc_required` field value is required.

### `luhn_algorithm_error`

The credit card number hasn’t passed the [Luhn algorithm](https://en.wikipedia.org/wiki/Luhn_algorithm) check.
