---
title: "Create Merchant Key"
description: "Add an encryption key for a merchant. New keys start deactivated, so activate them with Activate Merchant Key."
url: https://app.visacli.sh/docs/reference/vmrs/create-merchant-key
updated: 2026-11-09
---

# Create Merchant Key

> Add an encryption key for a merchant. New keys start deactivated, so activate them with Activate Merchant Key.

Canonical: https://app.visacli.sh/docs/reference/vmrs/create-merchant-key. Updated: 2026-11-09. Full index: /llms.txt.

```text
POST /vmrs/v1/merchants/{merchantId}/keys
```

Related guide: [Register a merchant](/docs/register-a-merchant.md).

**Base URL:** `https://sandbox.api.visa.com`. **Authentication:** not declared in the public VMRS OpenAPI; configure the selected VDP product/project method.

## Parameters

| Parameter | Location | Required | Type / meaning |
| --- | --- | --- | --- |
| `merchantId` | path | Yes | `string`<br>Unique merchant identifier (UUID) |

## Request body

Required `application/json` body: [`KeyCreate`](/docs/reference/schemas.md#vmrs-schema-KeyCreate).

| Field | Type | Presence | Description / constraints |
| --- | --- | --- | --- |
| `keyName` | `string` | Required | Unique identifier for the key *minimum characters: 1 · maximum characters: 255* |
| `algorithm` | `string` | Required | Key wrapping algorithm *Values: RSA-OAEP, RSA-OAEP-256, RSA-OAEP-384, RSA-OAEP-512* |
| `encryptionKey` | `string` | Required | Base64-encoded asymmetric public key (DER, PEM, JWK, or OpenSSH format) |
| `encryptionType` | `string` | Required | Content encryption algorithm *Values: A256GCM, A128GCM, C20P, A256CBC_HS512, A128CBC_HS256, A256CCM, A128CCM* |
| `expirationDate` | `string · date-time` | Optional | Key expiration date (must be in the future) |

```json title="Illustrative request"
{
  "keyName": "primary-key",
  "algorithm": "RSA-OAEP",
  "encryptionKey": "BASE64_ENCODED_ASYMMETRIC_PUBLIC_KEY",
  "encryptionType": "A256GCM",
  "expirationDate": "2026-12-31T23:59:59.000Z"
}
```

## Responses

| HTTP | Meaning | Response schema |
| --- | --- | --- |
| `201` | Key created successfully (deactivated by default) | [`KeyResponse`](/docs/reference/schemas.md#vmrs-schema-KeyResponse) |
| `404` | Merchant not found | [`ErrorResponse`](/docs/reference/schemas.md#vmrs-schema-ErrorResponse) |
| `422` | Validation Error | [`ValidationError`](/docs/reference/schemas.md#vmrs-schema-ValidationError) |

```json title="Visa-published HTTP 201 response example"
{
  "id": "a1b2c384-56c7-48d9-be0f-1e2d3c4b5a6f",
  "keyName": "primary-key",
  "isActive": false,
  "algorithm": "RSA-OAEP",
  "createdAt": "2024-01-15T10:30:00.000Z",
  "updatedAt": "2024-01-15T10:30:00.000Z",
  "merchantId": "7f4c82a1-305e-4f9c-8d2a-1b3e5f7c502a",
  "merchantName": "Acme Corp",
  "encryptionKey": "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA...",
  "encryptionType": "A256GCM",
  "expirationDate": "2026-12-31T23:59:59.000Z"
}
```

> [!NOTE] Contract detail
> New encryption keys are explicitly created deactivated. Store the returned key id and call the activate endpoint. expirationDate is optional but must be in the future when provided; no default expiry is published.

```bash title="Request template — project authentication in vmrs-auth.curl"
curl --config ./vmrs-auth.curl \
  --request POST \
  'https://sandbox.api.visa.com/vmrs/v1/merchants/YOUR_MERCHANT_ID/keys' \
  --header 'Accept: application/json' \
  --header 'Content-Type: application/json' \
  --data-binary @vmrs-request.json
```

The auth configuration file supplies the method approved for your VMRS project. The public schema does not specify its headers, API-key query, certificates or transport mode.

Sources: [Current TAP API reference / endpoint catalog](https://developer.visa.com/api-reference/trusted-agent-protocol), [Current TAP API reference as Markdown](https://developer.visa.com/api-reference/trusted-agent-protocol.md).
