API Docs
API Keys
API ReferenceApi KeysCreate

Create API Key

Create a new API key for your merchant account.

POST /api_keys/:merchant_id

Path Parameters

ParameterTypeDescription
merchant_idstringRequired. Your merchant ID.

Body Parameters

ParameterTypeRequiredDescription
namestringYesA human-readable name for the API key.
descriptionstringNoDescription of the API key's purpose.
expirationstringNoExpiration 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.