Security

Authentication

All API requests require authentication using an API key.

API Key Authentication

Include your API key in the X-API-Key header:

request.sh
curl -X POST "https://cashier.flowpayment.net/api/v1/checkout" \
  -H "X-API-Key: sk_live_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "merchant_id": "your_merchant_id",
    "amount": 150.00,
    "currency": "BRL",
    "country": "BRA",
    "success_url": "https://your-site.com/success",
    "cancel_url": "https://your-site.com/cancel"
  }'

Security

Keep your API key secure. Never expose it in client-side code or public repositories.

API Key Format

PrefixEnvironmentExample
sk_live_Productionsk_live_abc123...
sk_test_Sandboxsk_test_xyz789...

Alternative: Bearer Token

You can also use the Authorization header with Bearer token:

bash
curl -X POST "https://cashier.flowpayment.net/api/v1/checkout" \
  -H "Authorization: Bearer sk_live_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{...}'

Idempotency

Use the X-Idempotency-Key header to prevent duplicate requests:

bash
curl -X POST "https://cashier.flowpayment.net/api/v1/checkout" \
  -H "X-API-Key: sk_live_your_api_key" \
  -H "X-Idempotency-Key: order_12345_attempt_1" \
  -H "Content-Type: application/json" \
  -d '{...}'

If you send the same request with the same idempotency key within 24 hours, you'll receive the cached response instead of creating a new checkout session.

Authentication Errors

StatusErrorDescription
401UnauthorizedMissing or invalid API key
403ForbiddenAPI key doesn't have permission for this resource
409ConflictIdempotency key is still processing
422UnprocessableIdempotency key used with different request body

Getting Your API Key

1
Log in to the Dashboard
2
Go to ConfigurationAPI Keys
3
Click Show API Key to reveal your key
4
Copy and store it securely

Tip

Use sandbox keys (sk_test_) for development and testing. Switch to live keys (sk_live_) when ready for production.

Security Best Practices

Environment Variables

Store API keys in environment variables, never in code

Key Rotation

Rotate your API keys periodically for better security

Server-Side Only

Never expose API keys in client-side JavaScript

Separate Keys

Use different keys for test and production environments