Skip to content

Acme API v2024-06 is live — see the changelog for what changed.

Dashboard

API snippets

Reference API examples and schemas from any page.

Request snippet

POST/payments
curl -X POST https://api.acme.dev/v1/payments \
     -H "Authorization: Bearer <token>" \
     -H "Content-Type: application/json" \
     -d '{
         "amount": 2500,
         "currency": "usd",
         "customer": "cus_8f3k2",
         "description": "Pro plan — June"
       }'
POST/refunds
curl -X POST https://api.acme.dev/v1/refunds \
     -H "Authorization: Bearer <token>" \
     -H "Content-Type: application/json" \
     -d '{
         "payment": "string"
       }'

Response snippet

{
  "id": "pay_3Jk2Lm",
  "object": "payment",
  "amount": 2500,
  "currency": "usd",
  "status": "requires_payment_method",
  "customer": {
    "id": "cus_8f3k2",
    "email": "user@example.com",
    "name": "Ada Lovelace",
    "address": {
      "line1": "string",
      "city": "string",
      "country": "US"
    }
  },
  "created_at": "2024-01-15T09:30:00Z",
  "refunds": [
    {
      "id": "string",
      "amount": 1
    }
  ]
}

Endpoint schema

Request

This endpoint expects an object.
amountintegerRequired

Amount in the smallest currency unit.

currencystringRequired

Three-letter ISO currency code.

customerstringOptional

ID of an existing customer.

descriptionstringOptional<=500 characters
metadatamap from strings to stringsOptional

Up to 50 key/value pairs.

payment_methodobjectOptional
typeenumRequired
Allowed values:
tokenstringRequired

Token from Acme.js.

Webhook payload

HOOKpaymentSucceeded
{
  "id": "evt_1",
  "type": "payment.succeeded",
  "data": {
    "id": "pay_3Jk2Lm",
    "object": "payment",
    "amount": 2500,
    "currency": "usd",
    "status": "requires_payment_method",
    "customer": {
      "id": "cus_8f3k2",
      "email": "user@example.com",
      "name": "Ada Lovelace",
      "address": {
        "line1": "string",
        "city": "string",
        "country": "US"
      }
    },
    "created_at": "2024-01-15T09:30:00Z",
    "refunds": [
      {
        "id": "string",
        "amount": 1
      }
    ]
  }
}

Types

The Customer object
{
  "id": "cus_8f3k2",
  "email": "user@example.com",
  "name": "Ada Lovelace",
  "address": {
    "line1": "string",
    "city": "string",
    "country": "US"
  }
}
idstringOptional
emailemailOptional
namestringOptional
addressobjectOptional
line1stringOptional
citystringOptional
countrystringOptional

Runnable endpoint

GEThttps://api.acme.dev/v1/payments/:payment_id