Consultar transação
curl --request GET \
--url https://api.nasten.net/v1/transactions/{transactionId} \
--header 'Authorization: Bearer <token>'const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.nasten.net/v1/transactions/{transactionId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.nasten.net/v1/transactions/{transactionId}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.nasten.net/v1/transactions/{transactionId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.nasten.net/v1/transactions/{transactionId}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.nasten.net/v1/transactions/{transactionId}")
.header("Authorization", "Bearer <token>")
.asString();{
"success": true,
"data": {
"id": "clm8x9y0z1234567890abcdef",
"companyId": "<string>",
"customerId": "<string>",
"paymentMethod": "pix",
"amount": 5000,
"netAmount": 4850,
"fees": 150,
"externalId": "<string>",
"status": "pending",
"description": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"aprovedAt": "2023-11-07T05:31:56Z",
"contestResolution": "pending",
"canSubmitContest": true,
"customer": {
"id": "<string>",
"name": "<string>",
"phone": "<string>",
"documentType": "CPF",
"document": "<string>",
"emails": [
{
"email": "jsmith@example.com"
}
]
},
"TransactionItems": [
{
"id": 981,
"transactionId": "<string>",
"name": "Curso Completo",
"description": "<string>",
"quantity": 1,
"unitPrice": 5000,
"amount": 5000,
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}
],
"Pix": {
"key": "<string>",
"endToEndId": "<string>",
"payerInfo": "<unknown>"
},
"saleType": "producer",
"installments": 1,
"trackingParameters": {},
"origin": "checkout",
"parentTransactionId": "<string>",
"paymentLink": {
"id": "clpaylink1234567890abcdef",
"externalReference": "pedido-1042"
},
"payments": [
{
"method": "credit_card",
"amount": 7000,
"status": "pending"
}
]
}
}{
"success": false,
"message": "Descrição do erro",
"code": "NST-400-3f7a",
"errors": [
{
"path": "customer.document",
"message": "Documento inválido"
}
]
}{
"success": false,
"message": "Token inválido ou expirado",
"code": "NST-401-rcp9"
}{
"success": false,
"message": "Descrição do erro",
"code": "NST-400-3f7a"
}{
"success": false,
"message": "Descrição do erro",
"code": "NST-400-3f7a",
"error": "Too Many Requests",
"retryAfterMs": 42000,
"limit": 1800,
"window": "1 minute"
}{
"success": false,
"message": "Internal server error",
"code": "NST-500-9e2b"
}Transações
Consultar transação
Devolve a venda com os mesmos campos da listagem, menos origemId. Acha também as vendas de afiliado e coprodução.
GET
/
v1
/
transactions
/
{transactionId}
Consultar transação
curl --request GET \
--url https://api.nasten.net/v1/transactions/{transactionId} \
--header 'Authorization: Bearer <token>'const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.nasten.net/v1/transactions/{transactionId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.nasten.net/v1/transactions/{transactionId}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.nasten.net/v1/transactions/{transactionId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.nasten.net/v1/transactions/{transactionId}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.nasten.net/v1/transactions/{transactionId}")
.header("Authorization", "Bearer <token>")
.asString();{
"success": true,
"data": {
"id": "clm8x9y0z1234567890abcdef",
"companyId": "<string>",
"customerId": "<string>",
"paymentMethod": "pix",
"amount": 5000,
"netAmount": 4850,
"fees": 150,
"externalId": "<string>",
"status": "pending",
"description": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"aprovedAt": "2023-11-07T05:31:56Z",
"contestResolution": "pending",
"canSubmitContest": true,
"customer": {
"id": "<string>",
"name": "<string>",
"phone": "<string>",
"documentType": "CPF",
"document": "<string>",
"emails": [
{
"email": "jsmith@example.com"
}
]
},
"TransactionItems": [
{
"id": 981,
"transactionId": "<string>",
"name": "Curso Completo",
"description": "<string>",
"quantity": 1,
"unitPrice": 5000,
"amount": 5000,
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}
],
"Pix": {
"key": "<string>",
"endToEndId": "<string>",
"payerInfo": "<unknown>"
},
"saleType": "producer",
"installments": 1,
"trackingParameters": {},
"origin": "checkout",
"parentTransactionId": "<string>",
"paymentLink": {
"id": "clpaylink1234567890abcdef",
"externalReference": "pedido-1042"
},
"payments": [
{
"method": "credit_card",
"amount": 7000,
"status": "pending"
}
]
}
}{
"success": false,
"message": "Descrição do erro",
"code": "NST-400-3f7a",
"errors": [
{
"path": "customer.document",
"message": "Documento inválido"
}
]
}{
"success": false,
"message": "Token inválido ou expirado",
"code": "NST-401-rcp9"
}{
"success": false,
"message": "Descrição do erro",
"code": "NST-400-3f7a"
}{
"success": false,
"message": "Descrição do erro",
"code": "NST-400-3f7a",
"error": "Too Many Requests",
"retryAfterMs": 42000,
"limit": 1800,
"window": "1 minute"
}{
"success": false,
"message": "Internal server error",
"code": "NST-500-9e2b"
}
