Same key, same body
Returns the invoice created the first time, with status 200 instead of 201.
DEVELOPER DOCUMENTATION
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.
https://aulspay.com/api/v1
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
}'
<?php
$request = curl_init('https://aulspay.com/api/v1/invoices');
curl_setopt_array($request, [
CURLOPT_POST => true,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer '.getenv('AULSPAY_API_KEY'),
'Idempotency-Key: order-5012',
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => json_encode([
'amount' => '75.00',
'currency' => 'USD',
'external_ref' => 'order-5012',
'description' => 'Order #5012',
'return_url' => 'https://acme-store.com/checkout/thank-you',
]),
]);
$invoice = json_decode(curl_exec($request), true)['data'];
curl_close($request);
header('Location: '.$invoice['payment_url']); // Send the customer to pay.
const response = await fetch('https://aulspay.com/api/v1/invoices', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.AULSPAY_API_KEY}`,
'Idempotency-Key': 'order-5012',
'Content-Type': 'application/json',
},
body: JSON.stringify({
amount: '75.00',
currency: 'USD',
external_ref: 'order-5012',
description: 'Order #5012',
return_url: 'https://acme-store.com/checkout/thank-you',
}),
});
const { data: invoice } = await response.json();
res.redirect(invoice.payment_url); // Send the customer to pay.
import os
import requests
response = requests.post(
"https://aulspay.com/api/v1/invoices",
headers={
"Authorization": f"Bearer {os.environ['AULSPAY_API_KEY']}",
"Idempotency-Key": "order-5012",
},
json={
"amount": "75.00",
"currency": "USD",
"external_ref": "order-5012",
"description": "Order #5012",
"return_url": "https://acme-store.com/checkout/thank-you",
},
timeout=15,
)
response.raise_for_status()
invoice = response.json()["data"]
# Redirect the customer to invoice["payment_url"].
201 Created Returns the invoice with its payment_url.GET STARTED
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.
https://aulspay.com/api/v1Authorization: Bearer <API key>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.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.
| Coins | Live network | Test network |
|---|---|---|
| USDC, EURC, ETH | Base Chain ID 8453 | Base Sepolia Chain ID 84532 |
| USDT | Ethereum Chain ID 1 | Ethereum Sepolia Chain ID 11155111 |
| BTC | Bitcoin mainnet | Bitcoin testnet4 testnet4 |
| LTC | Litecoin mainnet | Litecoin testnet testnet |
| DOGE | Dogecoin mainnet | Dogecoin testnet testnet |
| SOL | Solana mainnet-beta | Solana devnet devnet |
In API responses, payment.network names the network and payment.chain_id identifies it, for example 84532 for Base Sepolia.
A developer can take a store from nothing to a fulfilled test order in about an hour.
Register your business, confirm your email and set up two-factor authentication.
Under Integrations → Websites, add the domain that will take payments.
Under Integrations → API keys, pick the website and the Test environment.
Call POST /api/v1/invoices from your server and send the customer to payment_url.
Verify the signed invoice.paid event, then mark the order as paid.
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.
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 accountOpen Integrations → Websites and add the domain of the store or app that will create invoices. Each key and webhook belongs to one website.
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.
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.
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# .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
Base Sepolia845320x036CbD53842c5426634e7929541eC2318f3dCF7e0x808456652fdb597867f38412077A9182bf77359F| Credential | Looks like | Where to find it | Use it for |
|---|---|---|---|
| Test API key | cg_test_… | Integrations → API keys, environment "Test" | Authorization header from your server while you build |
| Live API key | cg_live_… | Integrations → API keys, environment "Live" | Production traffic, once your business is approved |
| Webhook signing secret | whsec_… | Integrations → Webhooks, after saving an endpoint | Verifying 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.
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.
| Scenario | How to trigger it | Invoice status | Webhook |
|---|---|---|---|
| Successful payment | Send the exact amount shown on the payment page before it expires. | detected → paid | invoice.detected, invoice.paid |
| Split payment | Send the amount in two transactions to the same address. | detected → paid | invoice.detected, invoice.paid |
| Underpayment | Send less than the amount shown. | underpaid | invoice.underpaid |
| Overpayment | Send more than the amount shown. | overpaid | invoice.paid ("status": "overpaid") |
| Late payment | Pay an invoice after it expired. | expired, held for review | invoice.paid ("late_paid") if credited |
| Expired invoice | Create an invoice with "expires_in": 15 and do not pay it. | expired | invoice.expired |
| Webhook delivery | Press Send test event under Integrations → Webhooks. | 2xx in Recent deliveries | Test event |
| Forged webhook | Change one byte of a saved payload and post it to your endpoint. | Your endpoint answers 400 | None |
API REFERENCE
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.
| Scope | Allows | Default |
|---|---|---|
invoices:write | Create invoices | On |
read | Read invoices and payments | On |
balances:read | Read merchant-wide balances | Off |
curl https://aulspay.com/api/v1/invoices/INV-1261 \
-H "Authorization: Bearer cg_test_your_key"
/api/v1/invoicesinvoices:writeCall 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 currency USD | EUR required external_ref string description string customer.reference string customer.display_name string return_url https URL expires_in integer accepted_assets array of asset keys metadata object 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
}'
<?php
$request = curl_init('https://aulspay.com/api/v1/invoices');
curl_setopt_array($request, [
CURLOPT_POST => true,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer '.getenv('AULSPAY_API_KEY'),
'Idempotency-Key: order-5012',
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => json_encode([
'amount' => '75.00',
'currency' => 'USD',
'external_ref' => 'order-5012',
'description' => 'Order #5012',
'return_url' => 'https://acme-store.com/checkout/thank-you',
]),
]);
$invoice = json_decode(curl_exec($request), true)['data'];
curl_close($request);
header('Location: '.$invoice['payment_url']); // Send the customer to pay.
const response = await fetch('https://aulspay.com/api/v1/invoices', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.AULSPAY_API_KEY}`,
'Idempotency-Key': 'order-5012',
'Content-Type': 'application/json',
},
body: JSON.stringify({
amount: '75.00',
currency: 'USD',
external_ref: 'order-5012',
description: 'Order #5012',
return_url: 'https://acme-store.com/checkout/thank-you',
}),
});
const { data: invoice } = await response.json();
res.redirect(invoice.payment_url); // Send the customer to pay.
import os
import requests
response = requests.post(
"https://aulspay.com/api/v1/invoices",
headers={
"Authorization": f"Bearer {os.environ['AULSPAY_API_KEY']}",
"Idempotency-Key": "order-5012",
},
json={
"amount": "75.00",
"currency": "USD",
"external_ref": "order-5012",
"description": "Order #5012",
"return_url": "https://acme-store.com/checkout/thank-you",
},
timeout=15,
)
response.raise_for_status()
invoice = response.json()["data"]
# Redirect the customer to invoice["payment_url"].
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"
}
}
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.
/api/v1/invoices/{id}readAsk for the current status at any time. It is a good idea before shipping a large order.
awaiting_selectionThe customer has not chosen a coin yet. Wait.
pendingWaiting for the payment. Wait.
detectedSeen on the network, not confirmed yet. Show "payment received, confirming". Do not ship yet.
paidConfirmed and added to your balance. Fulfil the order.
underpaidLess than the invoice amount arrived. Ask the customer to send the rest before the link expires.
overpaidMore than the invoice amount arrived. Fulfil the order; contact support about the excess.
expiredNothing arrived in time. Cancel the order or create a new invoice.
late_paidPaid after the link expired; held for review. Wait for our team to contact you.
curl https://aulspay.com/api/v1/invoices/INV-1261 \
-H "Authorization: Bearer cg_test_your_key"
{
"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"
}
}
/api/v1/invoicesreadThe website's invoices, newest first, in pages.
status stringpaid.per_page integerpage integerlinks.next until it is null.curl "https://aulspay.com/api/v1/invoices?status=paid&per_page=25" \
-H "Authorization: Bearer cg_test_your_key"
{
"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 }
}
/api/v1/balancebalances:readThe 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.
curl https://aulspay.com/api/v1/balance \
-H "Authorization: Bearer cg_test_your_key"
{
"data": [
{
"asset": "usdc-base",
"decimals": 6,
"available": "1250000000",
"pending": "75000000"
}
]
}
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.
Returns the invoice created the first time, with status 200 instead of 201.
Rejected with 409. Use a new key for a different request.
On a 5xx, retry with the same key and body after a short wait.
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 status | Meaning |
|---|---|
400 | The request body is not valid JSON |
401 | Missing, wrong or revoked API key |
403 | The key lacks the scope, or your business is not verified yet |
404 | No invoice with that ID for your account |
409 | The Idempotency-Key was already used with a different body |
422 | A field is invalid; the errors object says which |
429 | Too many requests; wait for the Retry-After seconds |
5xx | Our error; retry with the same Idempotency-Key |
WEBHOOKS
Add an HTTPS endpoint under Integrations → Webhooks. AulsPay sends a signed POST for each event you choose.
id and skip ones you have already handled.status in the payload, or retrieve the invoice, rather than assuming an order.invoice.detectedA payment is seen on the network, not confirmed yetinvoice.paidThe payment is confirmed and credited; status is paid, overpaid or late_paidinvoice.underpaidLess than the invoice amount arrived and is confirmedinvoice.expiredThe invoice expired without a full paymenttest.pingYou pressed Send test event under Integrations → WebhooksPOST /webhooks/aulspay HTTP/1.1
Content-Type: application/json
X-Gateway-Signature: t=1760529600,v1=5f2b9c…e41a
{
"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"
}
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.
| Case | What happens | Status | Webhooks | What to do |
|---|---|---|---|---|
| Exact payment | The amount arrives within 0.5% of the invoice total (wallet rounding). | detected → paid | invoice.detected, then invoice.paid | Fulfil the order on invoice.paid. |
| Split payment | The customer pays in several transactions to the same address. AulsPay adds them together. | detected → paid | invoice.detected for the first, invoice.paid when the total is reached | Fulfil on invoice.paid. |
| Underpayment | Less arrives. The customer can send the rest to the same address before the invoice expires. | underpaid → paid, or expired | invoice.underpaid; invoice.paid if completed in time | Wait. If it expires, our team reviews the partial payment and may credit it, which sends invoice.paid. |
| Overpayment | More than 0.5% above the total arrives. The full amount is credited to your balance. | overpaid | invoice.paid with "status": "overpaid" | Fulfil the order; refund the difference to your customer if you choose. |
| Late payment | A payment arrives after the invoice expired. It is held for review, not credited automatically. | expired → late_paid | invoice.expired; invoice.paid with "status": "late_paid" if our team credits it | Do not fulfil on invoice.expired; wait for invoice.paid. |
| Wrong coin or network | A coin other than the one chosen, or a different network. It is held for review. | unchanged | None until our team resolves it | Contact support with the transaction ID. |
| No payment | Nothing arrives before the invoice expires. | expired | invoice.expired | Cancel 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.
The X-Gateway-Signature header is t=<unix time>,v1=<signature>. The signature is an HMAC-SHA256 of t.body with your signing secret.
t and v1.t + "." + body with your secret.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.
<?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.
import crypto from 'node:crypto';
import express from 'express';
const app = express();
const secret = process.env.AULSPAY_WEBHOOK_SECRET;
// Use the raw body: the signature covers the exact bytes we sent.
app.post('/webhooks/aulspay', express.raw({ type: 'application/json' }), (req, res) => {
const parts = Object.fromEntries(
(req.get('X-Gateway-Signature') ?? '').split(',').map((pair) => pair.split('=')),
);
const timestamp = Number(parts.t);
const expected = crypto
.createHmac('sha256', secret)
.update(`${timestamp}.${req.body}`)
.digest('hex');
const valid =
Math.abs(Date.now() / 1000 - timestamp) <= 300 &&
typeof parts.v1 === 'string' &&
parts.v1.length === expected.length &&
crypto.timingSafeEqual(Buffer.from(parts.v1), Buffer.from(expected));
if (!valid) return res.sendStatus(400);
const event = JSON.parse(req.body);
// Skip event IDs you have already handled, then update the order.
if (event.type === 'invoice.paid') markOrderPaid(event.external_ref, event.tx_hash);
res.sendStatus(200); // Anything else is retried.
});
GO LIVE
Before you switch to live keys, make sure each item below is true.
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.
Saved with your authenticator code.
One to three staff approvals, then an authorized wallet holder sends it manually.
Completed after the transaction is verified. You are told by email and in the dashboard; withdrawals do not send webhooks.
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.
READY TO BUILD?
Questions about your integration? The team is happy to help.