Esta API permite a criação de um novo pagamento ou transação.
application/json
stringapplication/json
stringBearer {{access_token}}
string| Campo | Obrigatório | Tipo | Descrição |
|---|---|---|---|
status | Sim | String | Status da transação (pending, canceled, paid, processing, expired, liquided). |
type | Sim | String | Tipo da transação (payment, cancelation). |
installments | Sim | String | Número de parcelas (>= 1). |
external_id | Sim | String | ID externo (<= 100 caracteres). |
terminal_id | Sim | String | ID do terminal (UUID). |
payment_date | Sim | String | Data do pagamento (formato ISO 8601). |
payment_method | Não | String | Método de pagamento (credit, debit, pix, voucher, vale). |
merchant_id | Não | String | ID do comerciante (<= 36 caracteres). |
customer_name | Não | String | Nome do cliente (<= 200 caracteres). |
customer_identifier | Não | String | Identificador do cliente (<= 50 caracteres). |
value | Não | String | Valor da transação (>= 0). |
discount_value | Não | String | Valor do desconto (>= 0). |
net_value | Não | String | Valor líquido da transação (>= 0). |
url | Não | String | URL do webhook (<= 1024 caracteres). |
token_type | Não | String | Tipo de token (none, Bearer, Basic). |
token | Não | String | Token de autenticação (<= 1024 caracteres). |
| Código | Significado | Descrição |
|---|---|---|
| 200 | OK | Transação criada com sucesso. |
| 400 | Bad Request | Parâmetros inválidos na requisição. |
| 401 | Unauthorized | Token de autenticação inválido ou ausente. |
| 422 | Unprocessable Entity | Dados da requisição inválidos. |
| 500 | Internal Server Error | Erro interno no servidor. |
curl --location 'https://api-h.nuvende.com.br/api/v1/pagamentos/transactions' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer {{ access_token }}' \
--data '{
"status": "pending",
"type": "payment",
"installments": "1",
"external_id": "{{ $randomUUID }}",
"terminal_id": "{{ terminal_id }}",
"payment_date": "2024-12-24T14:15:22Z",
"payment_method": "credit",
"merchant_id": "{{ merchant_id }}",
"customer_name": "{{ $randomFullName }}",
"customer_identifier": "{{ $randomUUID }}",
"value": "100.50",
"discount_value": "0.00",
"net_value": "100.50",
"url": "https://webhook-test.com/d6df4d27ec979d9bb6e78fc06c4d44b5",
"token_type": "none",
"token": "none"
}'
const axios = require("axios");
const data = {
status: "pending",
type: "payment",
installments: "1",
external_id: "{{ $randomUUID }}",
terminal_id: "{{ terminal_id }}",
payment_date: "2024-12-24T14:15:22Z",
payment_method: "credit",
merchant_id: "{{ merchant_id }}",
customer_name: "{{ $randomFullName }}",
customer_identifier: "{{ $randomUUID }}",
value: "100.50",
discount_value: "0.00",
net_value: "100.50",
url: "https://webhook-test.com/d6df4d27ec979d9bb6e78fc06c4d44b5",
token_type: "none",
token: "none",
};
const config = {
method: "post",
url: "https://api-h.nuvende.com.br/api/v1/pagamentos/transactions",
headers: {
"Content-Type": "application/json",
Accept: "application/json",
Authorization: "Bearer {{ access_token }}",
},
data: data,
};
axios(config)
.then((response) => {
console.log(JSON.stringify(response.data));
})
.catch((error) => {
console.log(error);
});
import requests
import json
url = "https://api-h.nuvende.com.br/api/v1/pagamentos/transactions"
payload = {
"status": "pending",
"type": "payment",
"installments": "1",
"external_id": "{{ $randomUUID }}",
"terminal_id": "{{ terminal_id }}",
"payment_date": "2024-12-24T14:15:22Z",
"payment_method": "credit",
"merchant_id": "{{ merchant_id }}",
"customer_name": "{{ $randomFullName }}",
"customer_identifier": "{{ $randomUUID }}",
"value": "100.50",
"discount_value": "0.00",
"net_value": "100.50",
"url": "https://webhook-test.com/d6df4d27ec979d9bb6e78fc06c4d44b5",
"token_type": "none",
"token": "none"
}
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json',
'Authorization': 'Bearer {{ access_token }}'
}
response = requests.post(url, headers=headers, data=json.dumps(payload))
print(response.text)
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://api-h.nuvende.com.br/api/v1/pagamentos/transactions',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS => json_encode(array(
'status' => 'pending',
'type' => 'payment',
'installments' => '1',
'external_id' => '{{ $randomUUID }}',
'terminal_id' => '{{ terminal_id }}',
'payment_date' => '2024-12-24T14:15:22Z',
'payment_method' => 'credit',
'merchant_id' => '{{ merchant_id }}',
'customer_name' => '{{ $randomFullName }}',
'customer_identifier' => '{{ $randomUUID }}',
'value' => '100.50',
'discount_value' => '0.00',
'net_value' => '100.50',
'url' => 'https://webhook-test.com/d6df4d27ec979d9bb6e78fc06c4d44b5',
'token_type' => 'none',
'token' => 'none'
)),
CURLOPT_HTTPHEADER => array(
'Content-Type: application/json',
'Accept: application/json',
'Authorization: Bearer {{ access_token }}'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
?>
{
"data": {
"id": "9dd1b450-2520-4abd-b0e9-3ef1acdcb79d",
"status": "pending",
"payment_method": "credit",
"type": "payment",
"installments": 1,
"merchant_code": null,
"merchant_id": null,
"transaction_identifier": null,
"authorization": null,
"customer_name": "Oscar Anderson",
"customer_identifier": "4b3d795f-c5be-4de3-ba01-b7516ba792a4",
"value": "100.50",
"discount_value": "0.00",
"net_value": "100.50",
"external_id": "3e85b45e-e1c2-47f8-b088-667471e32b6e",
"url": "https://webhook-test.com/d6df4d27ec979d9bb6e78fc06c4d44b5",
"terminal_id": "32a080cb-eb8a-4a51-9e6b-d1e2d22cbdb9",
"payment_date": "2024-12-24T14:15:22.000000Z",
"created_at": "2024-12-26T19:06:28.000000Z",
"updated_at": "2024-12-26T19:06:28.000000Z"
}
}