Skip to main content

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​

  1. Log in to the Merchant Dashboard.
  2. Go to the Stores page.
  3. Find your store in the table — the API Key and Merchant ID columns are displayed directly.
  4. 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
  1. Your backend receives a payment request from the client.
  2. Your backend calls PayerScan API with the x-api-key header.
  3. PayerScan verifies the API Key, checks that the store and merchant account are active.
  4. 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 StatusError CodeDescription
401MISSING_API_KEYThe x-api-key header is missing or empty.
401INVALID_API_KEYThe API Key is incorrect or doesn't belong to any active store.
403ACCOUNT_INACTIVEYour merchant account has been disabled. Contact support.
403STORE_INACTIVEYour store has been disabled. Contact support.
500AUTHENTICATION_FAILEDInternal 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.