Bag is live โ€” accept USDC & card payments globally. Get started โ†’
BagBag Docs
API ReferenceCustomers

Create a customer

Manually creates a customer record. Customers are also created automatically when a payment completes. If a customer with the same email already exists, a 409 error is returned.

POST
/api/customers
AuthorizationBearer <token>

API key authentication for programmatic access. Include your key in the Authorization header:

Authorization: Bearer bag_live_sk_a1b2c3d4e5f6...

Keys are prefixed with bag_live_sk_ (production) or bag_test_sk_ (sandbox). Generate keys from the Bag Dashboard.

In: header

Request Body

application/json

Response Body

application/json

application/json

application/json

application/json

curl -X POST "https://getbags.app/api/customers" \  -H "Content-Type: application/json" \  -d '{    "email": "alice@example.com",    "name": "Alice Johnson",    "country": "US"  }'
{
  "status": "success",
  "data": {
    "id": "c1d2e3f4-a5b6-4c7d-8e9f-0a1b2c3d4e5f",
    "email": "alice@example.com",
    "name": "Alice Johnson",
    "walletAddress": "0xCuStOmEr1234567890abCdEf1234567890aBcDeF",
    "country": "US",
    "metadata": {},
    "totalSpent": 89.97,
    "transactionCount": 3,
    "createdAt": "2026-02-15T10:00:00.000Z",
    "updatedAt": "2026-03-28T14:22:00.000Z"
  }
}
{
  "status": "error",
  "message": "amount: Amount must be a positive number up to 999,999,999.99; network: Invalid enum value",
  "code": "BAD_REQUEST"
}
{
  "status": "error",
  "message": "Invalid or revoked API key",
  "code": "UNAUTHORIZED",
  "hint": "Include a valid API key in the Authorization header: Bearer bag_live_sk_..."
}
{
  "status": "error",
  "message": "Invalid or revoked API key",
  "code": "UNAUTHORIZED",
  "hint": "Include a valid API key in the Authorization header: Bearer bag_live_sk_..."
}