> ## Documentation Index
> Fetch the complete documentation index at: https://developers.pcibooking.net/llms.txt
> Use this file to discover all available pages before exploring further.

# Associate with Customer

> Associate a token with another PCI Booking customer, allowing them to perform actions on this token.

<Card title="Third-Party Permissions Guide" icon="book" href="/manage-tokens/third-party-permissions">
  Learn how to share tokens with other PCI Booking customers
</Card>

Associates a token with another PCI Booking customer (sub-account), granting them permission to use the token in their own API calls. This is useful in marketplace or platform scenarios where multiple parties need access to the same stored card.

## Error Responses

| Code  | HTTP Status | Condition             |
| ----- | ----------- | --------------------- |
| -1003 | 401         | User is not the owner |
| -179  | 400         | userId is empty       |

## Parameters

### Headers

<ParamField header="Authorization" type="string" required>
  Your API key prefixed with `APIKEY`. Example: `APIKEY your-api-key`. See the [Authentication guide](/getting-started/authentication).
</ParamField>

### Path Parameters

<ParamField path="cardToken" type="string" required>
  The token ID as returned by one of the tokenization methods.
</ParamField>

<ParamField path="userID" type="string" required>
  The user ID of a PCI Booking customer ("Booker") that the token should be associated with. You will need to collect this userID from the booker you wish to associate the card with.
</ParamField>

<RequestExample>
  ```javascript Node.js theme={null}
  const response = await fetch(
    'https://service.pcibooking.net/api/payments/paycard/2821a46d80e14d1b96a7f18f1b81926d/user/booker-user-123',
    {
      method: 'PUT',
      headers: {
        'Authorization': 'APIKEY your-api-key'
      }
    }
  );

  console.log(response.status);
  ```

  ```python Python theme={null}
  import requests

  response = requests.put(
      'https://service.pcibooking.net/api/payments/paycard/2821a46d80e14d1b96a7f18f1b81926d/user/booker-user-123',
      headers={'Authorization': 'APIKEY your-api-key'}
  )

  print(response.status_code)
  ```
</RequestExample>

## Response

**200** - Association created. Empty response body.

<ResponseExample>
  ```text 200 theme={null}
  Empty response body. Association created successfully.
  ```

  ```json 400 theme={null}
  {
      "code": -125,
      "message": "Bad input data",
      "moreInfo": "Could not find a valid user",
      "errorList": null
  }
  ```

  ```json 401 theme={null}
  {
      "code": -1003,
      "message": "Not authorized to access this resource",
      "moreInfo": "Bad or missing authorization data, expected APIKEY",
      "errorList": null
  }
  ```
</ResponseExample>
