> ## 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.

# Store Digital Wallet Credentials

> Store credentials for a digital wallet payment method.

<Card title="Payments Library Credentials Guide" icon="book" href="/account-setup/payments-library-credentials">
  Configure credentials for Payments Library integrations
</Card>

Stores a set of credentials for a digital wallet under the specified ID. You reference this ID in the `AllowedeWalletAccountIds` field when [creating a session](/api-reference/payments-library/create-session).

<Warning>
  If you store credentials with an ID that already exists, the new credentials overwrite the existing ones. This cannot be undone.
</Warning>

## Error Responses

| Code    | HTTP Status | Condition                                                                                                |
| ------- | ----------- | -------------------------------------------------------------------------------------------------------- |
| `-1003` | `401`       | API key is missing or invalid, or user type is not `Booker`.                                             |
| `-125`  | `400`       | Request body failed validation (e.g. invalid or missing digital wallet name, malformed credential data). |

## 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="credentialsId" type="string" required>
  The unique ID to assign to this set of credentials. You reference this ID when [creating a Payments Library session](/api-reference/payments-library/create-session).
</ParamField>

### Request Body

<ParamField body="name" type="string" required>
  The digital wallet name (e.g. `GooglePay`, `ApplePay`). Retrieve the full list of supported names using the [Retrieve Credential Structure](/api-reference/payments-library-accounts/retrieve-credential-structure) endpoint.
</ParamField>

The remaining body fields are the credential key-value pairs required for the chosen digital wallet. Retrieve the required fields for each wallet using the [Retrieve Credential Structure](/api-reference/payments-library-accounts/retrieve-credential-structure) endpoint.

<RequestExample>
  ```javascript Node.js theme={null}
  const credentialsId = 'my-googlepay';
  const response = await fetch(`https://service.pcibooking.net/api/eWalletAccounts/${credentialsId}`, {
    method: 'PUT',
    headers: {
      'Authorization': 'APIKEY your-api-key',
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      name: 'GooglePay',
      MerchantId: 'BCR2DN4T7654321',
      MerchantName: 'My Store'
    })
  });
  console.log(response.status); // 200 on success
  ```

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

  credentials_id = 'my-googlepay'
  response = requests.put(
      f'https://service.pcibooking.net/api/eWalletAccounts/{credentials_id}',
      headers={
          'Authorization': 'APIKEY your-api-key',
          'Content-Type': 'application/json'
      },
      json={
          'name': 'GooglePay',
          'MerchantId': 'BCR2DN4T7654321',
          'MerchantName': 'My Store'
      }
  )
  print(response.status_code)  # 200 on success
  ```
</RequestExample>

## Response

<ResponseExample>
  ```text 200 theme={null}
  Credentials stored successfully. No content returned.
  ```

  ```json 400 theme={null}
  {
      "code": -125,
      "message": "Bad input data",
      "moreInfo": "...",
      "errorList": null
  }
  ```
</ResponseExample>
