Menu

DEVELOPER DOCUMENTATION

Build crypto payments into your product.

Create invoices from your backend, send customers to a hosted payment page and fulfil orders from signed webhooks. Start in the test environment with free test funds, then switch one key to go live.

BASE URL https://aulspay.com/api/v1
Create an invoice
curl -X POST https://aulspay.com/api/v1/invoices \
  -H "Authorization: Bearer cg_test_your_key" \
  -H "Idempotency-Key: order-5012" \
  -H "Content-Type: application/json" \
  -d '{
    "amount": "75.00",
    "currency": "USD",
    "external_ref": "order-5012",
    "description": "Order #5012",
    "customer": { "reference": "cus_1042", "display_name": "John D." },
    "return_url": "https://acme-store.com/checkout/thank-you",
    "expires_in": 30
  }'
201 Created Returns the invoice with its payment_url.

GET STARTED

Overview

The AulsPay API is a JSON REST API for the website an API key belongs to. Your server creates an invoice, the customer pays it on a hosted page from any wallet, and AulsPay tells your server when the payment is confirmed.

Base URLhttps://aulspay.com/api/v1
AuthenticationAuthorization: Bearer <API key>
FormatJSON in, JSON out (UTF-8)Amounts are strings; times are ISO 8601 in UTC.
EnvironmentsThis platform runs on test networksUse cg_test_ keys while it runs on test networks and cg_live_ keys on live networks. A key of the other kind is refused with 403.
1Your serverPOST /invoices
2CustomerPays on payment_url
3AulsPayConfirms on-chain
4Your serverReceives invoice.paid

Live and test networks

Every coin has a live network, where real money moves, and a test network with free test coins. They are separate blockchains: an address, a transaction or a token on one does not exist on the other. Base and Base Sepolia, for example, are different networks with different chain IDs.

This platform currently runs on the test networks below. Payments, balances and withdrawals here have no real value. Production uses the live networks.

CoinsLive networkTest network
USDC, EURC, ETHBase Chain ID 8453Base Sepolia Chain ID 84532
USDTEthereum Chain ID 1Ethereum Sepolia Chain ID 11155111
BTCBitcoin mainnetBitcoin testnet4 testnet4
LTCLitecoin mainnetLitecoin testnet testnet
DOGEDogecoin mainnetDogecoin testnet testnet
SOLSolana mainnet-betaSolana devnet devnet

In API responses, payment.network names the network and payment.chain_id identifies it, for example 84532 for Base Sepolia.

Quick start

A developer can take a store from nothing to a fulfilled test order in about an hour.

  1. 1

    Create your merchant account

    Register your business, confirm your email and set up two-factor authentication.

  2. 2

    Add your website

    Under Integrations → Websites, add the domain that will take payments.

  3. 3

    Create a test API key

    Under Integrations → API keys, pick the website and the Test environment.

  4. 4

    Create an invoice and redirect

    Call POST /api/v1/invoices from your server and send the customer to payment_url.

  5. 5

    Fulfil from the webhook

    Verify the signed invoice.paid event, then mark the order as paid.

Get your test credentials

Everything in the test environment runs on test networks. Test payments move no real money, and test balances have no value and cannot be withdrawn as real funds.

  1. 1

    Sign up and secure the account

    Create a merchant account, confirm your email address and set up two-factor authentication. It is required before you can create API keys.

    Create an account
  2. 2

    Add the website

    Open Integrations → Websites and add the domain of the store or app that will create invoices. Each key and webhook belongs to one website.

  3. 3

    Create a test API key

    Open Integrations → API keys, choose the website, set the environment to Test and keep the default scopes. The key starts with cg_test_ and is shown only once, so copy it straight into your server configuration.

  4. 4

    Save a webhook endpoint

    Open Integrations → Webhooks, enter your HTTPS endpoint, choose the events and save. Copy the signing secret (whsec_…) that appears, then press Send test event to check delivery.

  5. 5

    Fund a test wallet

    Install a wallet such as MetaMask or Coinbase Wallet, switch it to Base Sepolia and request test USDC or EURC from Circle's faucet. Add a little Base Sepolia ETH from a network faucet to pay gas.

    Open Circle's faucet
Server configuration .env
# .env on your server. Never commit it or send it to a browser.
AULSPAY_API_KEY=cg_test_your_key
AULSPAY_WEBHOOK_SECRET=whsec_your_signing_secret

Test network for USDC and EURC: Base Sepolia

Network
Base Sepolia
Chain ID
84532
Test USDC contract
0x036CbD53842c5426634e7929541eC2318f3dCF7e
Test EURC contract
0x808456652fdb597867f38412077A9182bf77359F

Credentials at a glance

CredentialLooks likeWhere to find itUse it for
Test API keycg_test_…Integrations → API keys, environment "Test"Authorization header from your server while you build
Live API keycg_live_…Integrations → API keys, environment "Live"Production traffic, once your business is approved
Webhook signing secretwhsec_…Integrations → Webhooks, after saving an endpointVerifying the X-Gateway-Signature header

Keep keys on your server. API keys and signing secrets are shown once. Never put them in a browser, a mobile app or a public repository. If one is exposed, revoke it under Integrations and create a new one.

Test payments

Create invoices with your test key and pay them from your test wallet on Base Sepolia. Within seconds the payment page shows the payment as detected; after the required confirmations the invoice is paid and the webhook is sent.

ScenarioHow to trigger itInvoice statusWebhook
Successful paymentSend the exact amount shown on the payment page before it expires.detected → paidinvoice.detected, invoice.paid
Split paymentSend the amount in two transactions to the same address.detected → paidinvoice.detected, invoice.paid
UnderpaymentSend less than the amount shown.underpaidinvoice.underpaid
OverpaymentSend more than the amount shown.overpaidinvoice.paid ("status": "overpaid")
Late paymentPay an invoice after it expired.expired, held for reviewinvoice.paid ("late_paid") if credited
Expired invoiceCreate an invoice with "expires_in": 15 and do not pay it.expiredinvoice.expired
Webhook deliveryPress Send test event under Integrations → Webhooks.2xx in Recent deliveriesTest event
Forged webhookChange one byte of a saved payload and post it to your endpoint.Your endpoint answers 400None

API REFERENCE

Authentication

Send the website's API key as a Bearer token on every request. Each key belongs to one website and carries scopes; a request outside its scopes returns 403.

ScopeAllowsDefault
invoices:writeCreate invoicesOn
readRead invoices and paymentsOn
balances:readRead merchant-wide balancesOff
Authenticated request cURL
curl https://aulspay.com/api/v1/invoices/INV-1261 \
  -H "Authorization: Bearer cg_test_your_key"
POST/api/v1/invoicesinvoices:write

Create an invoice

Call this when the customer chooses to pay with crypto. Use your order ID as the Idempotency-Key so a retried request never creates a second invoice.

amount string required
Invoice total with 2 decimals, e.g. "75.00". Strings avoid rounding errors.
currency USD | EUR required
The currency your store charges in.
external_ref string
Your order ID. Returned in every webhook so you can find the order.
description string
Shown to the customer on the payment page.
customer.reference string
Your customer ID. We store only this and the display name.
customer.display_name string
Shown in your dashboard, e.g. "John D."
return_url https URL
Where the "Return to store" button goes after payment.
expires_in integer
Minutes until the link expires: 15 to 1440, default 30.
accepted_assets array of asset keys
Limit the coins the customer can choose, e.g. ["usdc-base", "btc-bitcoin"]. Default: every coin on offer.
metadata object
Up to 20 keys of your own data, returned with the invoice.
Request
curl -X POST https://aulspay.com/api/v1/invoices \
  -H "Authorization: Bearer cg_test_your_key" \
  -H "Idempotency-Key: order-5012" \
  -H "Content-Type: application/json" \
  -d '{
    "amount": "75.00",
    "currency": "USD",
    "external_ref": "order-5012",
    "description": "Order #5012",
    "customer": { "reference": "cus_1042", "display_name": "John D." },
    "return_url": "https://acme-store.com/checkout/thank-you",
    "expires_in": 30
  }'
Response JSON
HTTP/1.1 201 Created

{
  "data": {
    "id": "INV-1261",
    "status": "awaiting_selection",
    "amount": "75.00",
    "currency": "USD",
    "external_ref": "order-5012",
    "description": "Order #5012",
    "customer": { "reference": "cus_1042", "display_name": "John D." },
    "accepted_assets": null,
    "payment_url": "https://aulspay.com/pay/INV-1261",
    "return_url": "https://acme-store.com/checkout/thank-you",
    "metadata": null,
    "payment": null,
    "expires_at": "2026-10-15T12:30:00Z",
    "paid_at": null,
    "created_at": "2026-10-15T12:00:00Z"
  }
}

Hosted payment page

Redirect the customer to payment_url, or show it as a link or button. The page shows the amount, the address and a QR code, and updates itself as the payment confirms. Customers do not need an account.

A visit to return_url is not proof of payment. When the invoice is paid, the page shows a Return to store button that opens your return_url, but anyone can open that address. Fulfil orders from the webhook, or by retrieving the invoice.

GET/api/v1/invoices/{id}read

Retrieve an invoice

Ask for the current status at any time. It is a good idea before shipping a large order.

awaiting_selection

The customer has not chosen a coin yet. Wait.

pending

Waiting for the payment. Wait.

detected

Seen on the network, not confirmed yet. Show "payment received, confirming". Do not ship yet.

paid

Confirmed and added to your balance. Fulfil the order.

underpaid

Less than the invoice amount arrived. Ask the customer to send the rest before the link expires.

overpaid

More than the invoice amount arrived. Fulfil the order; contact support about the excess.

expired

Nothing arrived in time. Cancel the order or create a new invoice.

late_paid

Paid after the link expired; held for review. Wait for our team to contact you.

Request cURL
curl https://aulspay.com/api/v1/invoices/INV-1261 \
  -H "Authorization: Bearer cg_test_your_key"
Response JSON
{
  "data": {
    "id": "INV-1261",
    "status": "paid",
    "amount": "75.00",
    "currency": "USD",
    "external_ref": "order-5012",
    "payment": {
      "asset": "usdc-base",
      "network": "Base",
      "chain_id": 84532,
      "address": "0x7d3e…19c4",
      "amount": "75000000",
      "amount_received": "75000000",
      "tx_hash": "0x9f1c…a83e",
      "confirmations_level": "safe"
    },
    "paid_at": "2026-10-15T12:08:41Z"
  }
}
GET/api/v1/invoicesread

List invoices

The website's invoices, newest first, in pages.

status string
Only invoices with this status, e.g. paid.
per_page integer
Invoices per page: 1 to 100, default 25.
page integer
The page to return. Follow links.next until it is null.
Request cURL
curl "https://aulspay.com/api/v1/invoices?status=paid&per_page=25" \
  -H "Authorization: Bearer cg_test_your_key"
Response JSON
{
  "data": [
    {
      "id": "INV-1261",
      "status": "paid",
      "amount": "75.00",
      "currency": "USD",
      "external_ref": "order-5012",
      "paid_at": "2026-10-15T12:08:41Z"
    }
  ],
  "links": {
    "next": "https://aulspay.com/api/v1/invoices?status=paid&per_page=25&page=2",
    "prev": null
  },
  "meta": { "current_page": 1, "per_page": 25, "total": 41 }
}
GET/api/v1/balancebalances:read

Balances

The merchant's balance per asset. Amounts are whole base units as strings: divide by 10 to the power of decimals to get the coin amount.

The balances:read scope is off by default because it shows merchant-wide totals. Turn it on only for keys that need it.

Request cURL
curl https://aulspay.com/api/v1/balance \
  -H "Authorization: Bearer cg_test_your_key"
Response JSON
{
  "data": [
    {
      "asset": "usdc-base",
      "decimals": 6,
      "available": "1250000000",
      "pending": "75000000"
    }
  ]
}

Idempotency

Networks fail. Send an Idempotency-Key header (1 to 100 characters, your order ID works well) with every POST, and retry safely with the same key.

Same key, same body

Returns the invoice created the first time, with status 200 instead of 201.

Same key, different body

Rejected with 409. Use a new key for a different request.

Server error

On a 5xx, retry with the same key and body after a short wait.

Errors and limits

Errors return JSON with a message, and for 422 an errors object keyed by field. Each API key can make 120 requests per minute; above that you receive 429 with a Retry-After header.

HTTP statusMeaning
400The request body is not valid JSON
401Missing, wrong or revoked API key
403The key lacks the scope, or your business is not verified yet
404No invoice with that ID for your account
409The Idempotency-Key was already used with a different body
422A field is invalid; the errors object says which
429Too many requests; wait for the Retry-After seconds
5xxOur error; retry with the same Idempotency-Key

WEBHOOKS

Signed webhooks

Add an HTTPS endpoint under Integrations → Webhooks. AulsPay sends a signed POST for each event you choose.

  • Reply with any 2xx status within 10 seconds. Anything else is retried after 1 min, 5 min, 30 min, 2 h, 6 h, 12 h and 24 h, stopping after about 3 days.
  • The same event can arrive more than once. Store each event id and skip ones you have already handled.
  • Events can arrive out of order. Use status in the payload, or retrieve the invoice, rather than assuming an order.
invoice.detectedA payment is seen on the network, not confirmed yet
invoice.paidThe payment is confirmed and credited; status is paid, overpaid or late_paid
invoice.underpaidLess than the invoice amount arrived and is confirmed
invoice.expiredThe invoice expired without a full payment
test.pingYou pressed Send test event under Integrations → Webhooks
Headers HTTP
POST /webhooks/aulspay HTTP/1.1
Content-Type: application/json
X-Gateway-Signature: t=1760529600,v1=5f2b9c…e41a
Payload JSON
{
  "id": "evt_8f2c1a9b4d7e0c55e1a2b3c4",
  "type": "invoice.paid",
  "created_at": "2026-10-15T12:08:41Z",
  "invoice_id": "INV-1258",
  "external_ref": "order-5012",
  "status": "paid",
  "amount": "75.00",
  "currency": "USD",
  "asset": "usdc-base",
  "amount_received": "75000000",
  "tx_hash": "0x9f1c…a83e"
}

Payment outcomes and their webhooks

Customers do not always pay exactly once and on time. This is what AulsPay does in each case, the invoice status you see, and the webhook your website receives. invoice.paid is the only event that means "fulfil the order"; read its status for the detail.

CaseWhat happensStatusWebhooksWhat to do
Exact paymentThe amount arrives within 0.5% of the invoice total (wallet rounding).detected → paidinvoice.detected, then invoice.paidFulfil the order on invoice.paid.
Split paymentThe customer pays in several transactions to the same address. AulsPay adds them together.detected → paidinvoice.detected for the first, invoice.paid when the total is reachedFulfil on invoice.paid.
UnderpaymentLess arrives. The customer can send the rest to the same address before the invoice expires.underpaid → paid, or expiredinvoice.underpaid; invoice.paid if completed in timeWait. If it expires, our team reviews the partial payment and may credit it, which sends invoice.paid.
OverpaymentMore than 0.5% above the total arrives. The full amount is credited to your balance.overpaidinvoice.paid with "status": "overpaid"Fulfil the order; refund the difference to your customer if you choose.
Late paymentA payment arrives after the invoice expired. It is held for review, not credited automatically.expired → late_paidinvoice.expired; invoice.paid with "status": "late_paid" if our team credits itDo not fulfil on invoice.expired; wait for invoice.paid.
Wrong coin or networkA coin other than the one chosen, or a different network. It is held for review.unchangedNone until our team resolves itContact support with the transaction ID.
No paymentNothing arrives before the invoice expires.expiredinvoice.expiredCancel the order or create a new invoice.

Payments above $1,000 wait until their block is final before they are credited, so invoice.paid can take longer for them.

Verify signatures

The X-Gateway-Signature header is t=<unix time>,v1=<signature>. The signature is an HMAC-SHA256 of t.body with your signing secret.

  1. Read the raw request body before any JSON parsing.
  2. Split the header into t and v1.
  3. Compute the HMAC of t + "." + body with your secret.
  4. Compare in constant time, and reject a timestamp older than 5 minutes.
  5. Skip event IDs you have handled, then update the order.

Use the exact bytes you received. Re-encoding the JSON changes the body and the signature will not match. Compare with hash_equals or timingSafeEqual.

Webhook endpoint
<?php
// POST /webhooks/aulspay
$secret = getenv('AULSPAY_WEBHOOK_SECRET');
$payload = file_get_contents('php://input');

$parts = [];
foreach (explode(',', $_SERVER['HTTP_X_GATEWAY_SIGNATURE'] ?? '') as $pair) {
    [$key, $value] = array_pad(explode('=', $pair, 2), 2, '');
    $parts[$key] = $value;
}

$timestamp = (int) ($parts['t'] ?? 0);
$expected = hash_hmac('sha256', $timestamp.'.'.$payload, $secret);

if (abs(time() - $timestamp) > 300 || ! hash_equals($expected, $parts['v1'] ?? '')) {
    http_response_code(400); // Not from AulsPay, or too old.
    exit;
}

$event = json_decode($payload, true);

if (! already_processed($event['id'])) {       // Store event IDs you have handled.
    if ($event['type'] === 'invoice.paid') {
        mark_order_paid($event['external_ref'], $event['tx_hash']);
    }
}

http_response_code(200); // Anything else is retried.

GO LIVE

Go-live checklist

Before you switch to live keys, make sure each item below is true.

  • You created an invoice, paid it on Base Sepolia, and your order was fulfilled from the webhook.
  • Your endpoint rejects a request with a wrong signature, and handles the same event twice without fulfilling twice.
  • Your webhook URL uses HTTPS and your keys are stored as server secrets, not in code or a browser.
  • You replaced the cg_test_ key with a cg_live_ key, which works once your business is verified.
  • You revoked test keys you no longer need.

Withdrawals

A merchant saves a payout address and requests a withdrawal from an available balance. Administrators review the request, and the configured wallet process sends the funds. AulsPay shows the withdrawal as complete after it verifies the transaction on the selected network.

Save an address

Saved with your authenticator code.

Review and payout

One to three staff approvals, then an authorized wallet holder sends it manually.

Verified on-chain

Completed after the transaction is verified. You are told by email and in the dashboard; withdrawals do not send webhooks.

Plugins

WordPress / WooCommerce Available

Add "Pay with crypto" to a WooCommerce checkout without writing code. Upload the zip in WordPress under Plugins → Add New → Upload Plugin; the setup guide is in your merchant dashboard under Integrations.

Download plugin

READY TO BUILD?

Create your account and get a test key in minutes.

Questions about your integration? The team is happy to help.