Cobrança
Criar uma nova Cobrança
Cobrança
Criar uma nova Cobrança
Permite que você crie um link de cobrança pro seu cliente pagar você.
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"
}
}'
{
"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"
}
}
},
"error": "<any>"
}
Authorizations
Bearer authentication header of the form Bearer <token>
, where <token>
is your auth token.
Body
application/json
Response
200
application/json
Cobrança criada com sucesso.
The response is of type object
.
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"
}
}'
{
"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"
}
}
},
"error": "<any>"
}