API Reference

Simple, privacy-first integration for modern crypto businesses.

Authentication

Secure your requests using the x-api-key header. Your key consists of your Business ID and a Secret Key separated by a dot.

x-api-key: 97ea8012-820e...pk_live_51P...
Invoices
POST /invoice/create

Create Invoice

Initialize a payment and receive a secure checkout URL.

Request Body
Parameter Type Description
amount string Amount as string with decimals (e.g. "100.00" for $100)
currency string Currency symbol ("USD" or "EUR")
description string OPTIONAL Payment description (max 100 characters)
Response
Field Type Description
id string Unique invoice identifier (UUID)
curl -X POST https://layerpay.org/invoice/create \
  -H "Content-Type: application/json" \
  -H "x-api-key: YOUR_BUSINESS_ID.SECRET" \
  -d '{
    "amount": "100.00",
    "currency": "USD"
  }'

# Response:
{
  "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
}
GET /invoice/{id}/status

Check Status

Poll for the real-time status of a specific invoice.

Response Fields
Field Type Description
id string Invoice identifier
status string Current invoice status
expires_at_ts integer Unix timestamp when invoice expires
Possible Statuses
Pending
Waiting for payment
Confirmed
Payment received
Expired
Invoice expired
curl https://layerpay.org/invoice/a1b2c3d4-e5f6-7890-abcd-ef1234567890/status

# Response:
{
  "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  "status": "Pending",
  "expires_at_ts": 1707523200
}
Sandbox

Test Mode

Use sandbox mode to test your integration without real transactions. Sandbox uses a separate database — accounts, businesses, and invoices are independent from production.

How it works
Feature Sandbox behavior
Base URL sandbox.layerpay.org instead of layerpay.org
Registration Separate account required — mainnet credentials don't work in sandbox
API Keys Sandbox business keys only work against the sandbox API
Payments Invoices auto-confirm — no blockchain transaction needed
Withdrawals Disabled — returns 400 Bad Request
Example: Create a test invoice
# Use sandbox URL instead of production
curl -X POST https://sandbox.layerpay.org/invoice/create \
  -H "Content-Type: application/json" \
  -H "x-api-key: YOUR_SANDBOX_BUSINESS_ID.SECRET" \
  -d '{
    "amount": "10.00",
    "currency": "USD"
  }'

# Response:
{
  "id": "f7a1b2c3-d4e5-6789-abcd-ef0123456789"
}
Test payment flow
1
Create invoice
POST https://sandbox.layerpay.org/invoice/create with your sandbox API key
2
Open payment page
Navigate to https://sandbox.layerpay.org/payment?id={invoice_id}
3
Payment confirms instantly
Select any network and token — status changes to "Confirmed" automatically