POST
/
billing
/
create
curl --request POST \
  --url https://api.abacatepay.com/v1/billing/create \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "frequency": "ONE_TIME",
  "methods": [
    "PIX"
  ],
  "products": [
    {
      "externalId": "prod-1234",
      "name": "Assinatura de Programa Fitness",
      "description": "Acesso ao programa fitness premium por 1 mês.",
      "quantity": 2,
      "price": 2000
    }
  ],
  "returnUrl": "https://example.com/billing",
  "completionUrl": "https://example.com/completion",
  "customerId": "cust_abcdefghij",
  "customer": {
    "name": "Daniel Lima",
    "cellphone": "(11) 4002-8922",
    "email": "daniel_lima@abacatepay.com",
    "taxId": "123.456.789-01"
  },
  "allowCoupons": false,
  "coupons": [
    "ABKT10",
    "ABKT5",
    "PROMO10"
  ]
}'
{
  "data": {
    "id": "bill_123456",
    "url": "https://pay.abacatepay.com/bill-5678",
    "amount": 4000,
    "status": "PENDING",
    "devMode": true,
    "methods": [
      "PIX"
    ],
    "products": [
      {
        "id": "prod_123456",
        "externalId": "prod-1234",
        "quantity": 2
      }
    ],
    "frequency": "ONE_TIME",
    "nextBilling": "null",
    "customer": {
      "id": "bill_123456",
      "metadata": {
        "name": "Daniel Lima",
        "cellphone": "(11) 4002-8922",
        "email": "daniel_lima@abacatepay.com",
        "taxId": "123.456.789-01"
      }
    },
    "allowCoupons": false,
    "coupons": []
  },
  "error": null
}

Authorizations

Authorization
string
header
required

Cabeçalho de autenticação Bearer no formato Bearer <abacatepay-api-key> onde <abacatepay-api-key> é a sua chave de API.

Body

application/json

Response

200
application/json

Cobrança criada com sucesso.

The response is of type object.