Authentication
PayerScan API uses API Key authentication. Each store has its own unique API Key, which must be included in every request.
Request Header
All API requests must include the x-api-key header:
x-api-key: YOUR_API_KEY
Example Request
curl -X POST https://api.payerscan.com/payment/crypto \
-H "Content-Type: application/json" \
-H "x-api-key: YOUR_API_KEY" \
-d '{"merchant_id": "YOUR_MERCHANT_ID", "amount": 10, "callback_url": "https://your-server.com/webhook"}'
Getting Your API Key
- Log in to the Merchant Dashboard.
- Go to the Stores page.
- Find your store in the table — the API Key and Merchant ID columns are displayed directly.
- Click the Copy button to copy. Use the Regenerate button if you need a new key.
Security Warning
- Never expose your API Key in client-side code (browser, mobile app).
- Only make API calls from your backend server.
- Rotate your API Key immediately if you suspect it has been compromised.
How It Works
Client → Your Backend → PayerScan API
↑
x-api-key header
- Your backend receives a payment request from the client.
- Your backend calls PayerScan API with the
x-api-keyheader. - PayerScan verifies the API Key, checks that the store and merchant account are active.
- If valid, the request is processed and a response is returned.
Error Response Format
When authentication fails, the API returns a JSON response:
{
"status": "error",
"message": "Invalid API key. Please check your API key and try again.",
"error_code": "INVALID_API_KEY"
}
Authentication Error Codes
| HTTP Status | Error Code | Description |
|---|---|---|
401 | MISSING_API_KEY | The x-api-key header is missing or empty. |
401 | INVALID_API_KEY | The API Key is incorrect or doesn't belong to any active store. |
403 | ACCOUNT_INACTIVE | Your merchant account has been disabled. Contact support. |
403 | STORE_INACTIVE | Your store has been disabled. Contact support. |
500 | AUTHENTICATION_FAILED | Internal server error during authentication. Try again later. |
tip
If you receive ACCOUNT_INACTIVE or STORE_INACTIVE, please contact support at payerscan.com to reactivate your account.