Criar cobrança
curl --request POST \
--url https://onlyascent.pro/api/v1/charges \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"amount_cents": 2990,
"description": "Cobrança Pix",
"external_id": "pedido-1042"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({amount_cents: 2990, description: 'Cobrança Pix', external_id: 'pedido-1042'})
};
fetch('https://onlyascent.pro/api/v1/charges', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://onlyascent.pro/api/v1/charges"
payload = {
"amount_cents": 2990,
"description": "Cobrança Pix",
"external_id": "pedido-1042"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"amount_cents": 123,
"fee_cents": 123,
"external_id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"object": "charge",
"status": "pending",
"method": "<string>",
"description": "<string>",
"net_cents": 123,
"paid_at": "2023-11-07T05:31:56Z",
"checkout_url": "<string>",
"pix": {
"copy_paste": "<string>",
"qr_code": "<string>"
}
}{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"amount_cents": 123,
"fee_cents": 123,
"external_id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"object": "charge",
"status": "pending",
"method": "<string>",
"description": "<string>",
"net_cents": 123,
"paid_at": "2023-11-07T05:31:56Z",
"checkout_url": "<string>",
"pix": {
"copy_paste": "<string>",
"qr_code": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}Cobranças
Criar cobrança
Crie um Pix com valor superior à tarifa da conta.
POST
/
charges
Criar cobrança
curl --request POST \
--url https://onlyascent.pro/api/v1/charges \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"amount_cents": 2990,
"description": "Cobrança Pix",
"external_id": "pedido-1042"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({amount_cents: 2990, description: 'Cobrança Pix', external_id: 'pedido-1042'})
};
fetch('https://onlyascent.pro/api/v1/charges', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://onlyascent.pro/api/v1/charges"
payload = {
"amount_cents": 2990,
"description": "Cobrança Pix",
"external_id": "pedido-1042"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"amount_cents": 123,
"fee_cents": 123,
"external_id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"object": "charge",
"status": "pending",
"method": "<string>",
"description": "<string>",
"net_cents": 123,
"paid_at": "2023-11-07T05:31:56Z",
"checkout_url": "<string>",
"pix": {
"copy_paste": "<string>",
"qr_code": "<string>"
}
}{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"amount_cents": 123,
"fee_cents": 123,
"external_id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"object": "charge",
"status": "pending",
"method": "<string>",
"description": "<string>",
"net_cents": 123,
"paid_at": "2023-11-07T05:31:56Z",
"checkout_url": "<string>",
"pix": {
"copy_paste": "<string>",
"qr_code": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}Headers
Body
application/json
Response
Operação existente ou finalizada.