Get My Order
curl --request GET \
--url https://api.centralcart.io/v1/webstore/account/order/{order_id} \
--header 'Authorization: Bearer <token>' \
--header 'x-store-domain: <x-store-domain>'import requests
url = "https://api.centralcart.io/v1/webstore/account/order/{order_id}"
headers = {
"x-store-domain": "<x-store-domain>",
"Authorization": "Bearer <token>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {'x-store-domain': '<x-store-domain>', Authorization: 'Bearer <token>'}
};
fetch('https://api.centralcart.io/v1/webstore/account/order/{order_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.centralcart.io/v1/webstore/account/order/{order_id}",
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>",
"x-store-domain: <x-store-domain>"
],
]);
$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.centralcart.io/v1/webstore/account/order/{order_id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-store-domain", "<x-store-domain>")
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.centralcart.io/v1/webstore/account/order/{order_id}")
.header("x-store-domain", "<x-store-domain>")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.centralcart.io/v1/webstore/account/order/{order_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-store-domain"] = '<x-store-domain>'
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"id": "KgCzCUtJDsvM",
"status": "APPROVED",
"price": 49.9,
"currency": "BRL",
"gateway": "PIX",
"created_at": "2024-03-03T23:40:02.000-03:00",
"paid_at": "2024-03-03T23:43:12.000-03:00",
"coupon": "PROMO10",
"fields": [
{
"name": "nickname",
"value": "jogador123"
}
],
"packages": [
{
"id": 1,
"name": "VIP Inicial",
"quantity": 1,
"price": 49.9,
"image": "https://cdn.centralcart.io/stores/1/packages/image.png",
"options": [
{
"name": "Duração",
"value": "30 dias"
}
]
}
],
"deliveries": [
{
"id": 91,
"type": "LICENSE_KEY",
"value": "XXXX-YYYY-ZZZZ",
"render": true,
"created_at": "2024-03-03T23:43:14.000-03:00"
}
]
}{
"errors": [
{
"message": "Sessão inválida ou expirada.",
"code": "CUSTOMER_UNAUTHENTICATED"
}
]
}{
"errors": [
{
"message": "Pedido não encontrado."
}
]
}Conta do cliente
Get My Order
Detalhe de um pedido do comprador autenticado, com os campos do checkout e o conteúdo entregue.
O conteúdo em
deliveries só sai para pedidos aprovados. Reembolso, cancelamento, recusa e chargeback revogam o acesso ao que foi comprado, e a lista volta vazia. A checagem é feita no servidor, então vale para qualquer front.Um pedido que não pertence ao comprador da sessão responde
404, e não 403: para quem pergunta, o pedido de outra pessoa simplesmente não existe.GET
/
webstore
/
account
/
order
/
{order_id}
Get My Order
curl --request GET \
--url https://api.centralcart.io/v1/webstore/account/order/{order_id} \
--header 'Authorization: Bearer <token>' \
--header 'x-store-domain: <x-store-domain>'import requests
url = "https://api.centralcart.io/v1/webstore/account/order/{order_id}"
headers = {
"x-store-domain": "<x-store-domain>",
"Authorization": "Bearer <token>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {'x-store-domain': '<x-store-domain>', Authorization: 'Bearer <token>'}
};
fetch('https://api.centralcart.io/v1/webstore/account/order/{order_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.centralcart.io/v1/webstore/account/order/{order_id}",
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>",
"x-store-domain: <x-store-domain>"
],
]);
$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.centralcart.io/v1/webstore/account/order/{order_id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-store-domain", "<x-store-domain>")
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.centralcart.io/v1/webstore/account/order/{order_id}")
.header("x-store-domain", "<x-store-domain>")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.centralcart.io/v1/webstore/account/order/{order_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-store-domain"] = '<x-store-domain>'
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"id": "KgCzCUtJDsvM",
"status": "APPROVED",
"price": 49.9,
"currency": "BRL",
"gateway": "PIX",
"created_at": "2024-03-03T23:40:02.000-03:00",
"paid_at": "2024-03-03T23:43:12.000-03:00",
"coupon": "PROMO10",
"fields": [
{
"name": "nickname",
"value": "jogador123"
}
],
"packages": [
{
"id": 1,
"name": "VIP Inicial",
"quantity": 1,
"price": 49.9,
"image": "https://cdn.centralcart.io/stores/1/packages/image.png",
"options": [
{
"name": "Duração",
"value": "30 dias"
}
]
}
],
"deliveries": [
{
"id": 91,
"type": "LICENSE_KEY",
"value": "XXXX-YYYY-ZZZZ",
"render": true,
"created_at": "2024-03-03T23:43:14.000-03:00"
}
]
}{
"errors": [
{
"message": "Sessão inválida ou expirada.",
"code": "CUSTOMER_UNAUTHENTICATED"
}
]
}{
"errors": [
{
"message": "Pedido não encontrado."
}
]
}Autorizações
access_token do comprador, devolvido por POST /webstore/auth/verify.
Cabeçalhos
Domínio da sua loja (ex: sualoja.centralcart.ai)
Parâmetros de caminho
Identificador público do pedido.
Resposta
Pedido
Identificador público do pedido, o mesmo que aparece na URL.
Opções disponíveis:
PENDING, APPROVED, REJECTED, CANCELED, REFUNDED, CHARGEDBACK Show child attributes
Show child attributes
Campos personalizados de checkout preenchidos no pedido.
Show child attributes
Show child attributes
Conteúdo entregue. Vazio para pedidos que não estão aprovados.
Show child attributes
Show child attributes
⌘I