API Keys
API ReferenceApi KeysCreate
Create API Key
Create a new API key for your merchant account.
POST /api_keys/:merchant_id
Path Parameters
| Parameter | Type | Description |
|---|---|---|
merchant_id | string | Required. Your merchant ID. |
Body Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
name | string | Yes | A human-readable name for the API key. |
description | string | No | Description of the API key's purpose. |
expiration | string | No | Expiration setting: "never" or ISO 8601 date. |
Request Example
curl -X POST 'https://api.v2.paychtec.com/api_keys/mer_123456' \ -H "Content-Type: application/json" \ -H "api-key: admin_YOUR_ADMIN_KEY" \ -d '{ "name": "Production Key", "description": "Main production API key", "expiration": "never"}'Response
{
"key_id": "key_1234567890",
"merchant_id": "mer_123456",
"name": "Production Key",
"description": "Main production API key",
"api_key": "snd_abcdef123456...",
"created": "2024-01-22T10:00:00Z",
"expiration": null
}The api_key value is only shown once when created. Store it securely — you won't be able to retrieve it again.