List customer purchases
curl --request GET \
--url https://api.bevits.com/v1/customers/{customer_id}/purchases \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.bevits.com/v1/customers/{customer_id}/purchases"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.bevits.com/v1/customers/{customer_id}/purchases', 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.bevits.com/v1/customers/{customer_id}/purchases",
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.bevits.com/v1/customers/{customer_id}/purchases"
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.bevits.com/v1/customers/{customer_id}/purchases")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.bevits.com/v1/customers/{customer_id}/purchases")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"has_more": true,
"data": [
{
"object": "<string>",
"id": "<string>",
"customer_id": "<string>",
"purchase_value_in_cents": 123,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"order_id_on_integration_platform": "<string>",
"order_number": "<string>",
"platform": "<string>",
"status": "<string>",
"payment_status": "<string>",
"shipping_status": "<string>",
"currency": "BRL",
"subtotal_amount_in_cents": 123,
"total_amount_in_cents": 123,
"discount_in_cents": 123,
"shipping_cost_customer_in_cents": 123,
"coupons": [
{
"id": "<string>",
"code": "<string>",
"value": 123,
"type": "<string>"
}
],
"attributed_flow_ids": [
"<string>"
]
}
]
}{
"error": {
"message": "<string>",
"request_id": "<string>",
"param": "<string>"
}
}{
"error": {
"type": "authentication_error",
"message": "Invalid API key.",
"request_id": "req_07f6cdc3c20249d6afcd90b4"
}
}{
"error": {
"message": "<string>",
"request_id": "<string>",
"param": "<string>"
}
}{
"error": {
"type": "validation_error",
"message": "Invalid query parameters.",
"param": "limit",
"request_id": "req_07f6cdc3c20249d6afcd90b4"
}
}{
"error": {
"message": "<string>",
"request_id": "<string>",
"param": "<string>"
},
"retry_after": 2
}{
"error": {
"message": "<string>",
"request_id": "<string>",
"param": "<string>"
}
}Reference
List customer purchases
Lists purchases for a specific customer.
GET
/
v1
/
customers
/
{customer_id}
/
purchases
List customer purchases
curl --request GET \
--url https://api.bevits.com/v1/customers/{customer_id}/purchases \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.bevits.com/v1/customers/{customer_id}/purchases"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.bevits.com/v1/customers/{customer_id}/purchases', 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.bevits.com/v1/customers/{customer_id}/purchases",
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.bevits.com/v1/customers/{customer_id}/purchases"
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.bevits.com/v1/customers/{customer_id}/purchases")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.bevits.com/v1/customers/{customer_id}/purchases")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"has_more": true,
"data": [
{
"object": "<string>",
"id": "<string>",
"customer_id": "<string>",
"purchase_value_in_cents": 123,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"order_id_on_integration_platform": "<string>",
"order_number": "<string>",
"platform": "<string>",
"status": "<string>",
"payment_status": "<string>",
"shipping_status": "<string>",
"currency": "BRL",
"subtotal_amount_in_cents": 123,
"total_amount_in_cents": 123,
"discount_in_cents": 123,
"shipping_cost_customer_in_cents": 123,
"coupons": [
{
"id": "<string>",
"code": "<string>",
"value": 123,
"type": "<string>"
}
],
"attributed_flow_ids": [
"<string>"
]
}
]
}{
"error": {
"message": "<string>",
"request_id": "<string>",
"param": "<string>"
}
}{
"error": {
"type": "authentication_error",
"message": "Invalid API key.",
"request_id": "req_07f6cdc3c20249d6afcd90b4"
}
}{
"error": {
"message": "<string>",
"request_id": "<string>",
"param": "<string>"
}
}{
"error": {
"type": "validation_error",
"message": "Invalid query parameters.",
"param": "limit",
"request_id": "req_07f6cdc3c20249d6afcd90b4"
}
}{
"error": {
"message": "<string>",
"request_id": "<string>",
"param": "<string>"
},
"retry_after": 2
}{
"error": {
"message": "<string>",
"request_id": "<string>",
"param": "<string>"
}
}Authorizations
API key created in the organization settings.
Path Parameters
Public customer ID.
Pattern:
^cus_[A-Za-z0-9_-]+$Query Parameters
Maximum number of items per page.
Required range:
1 <= x <= 100ID of the last purchase on the previous page.
Pattern:
^pur_[A-Za-z0-9_-]+$Filters by purchase payment status.
Available options:
any, pending, authorized, paid, abandoned, refunded, voided Filters by source platform.
Available options:
nuvemshop, shopify, woocommerce, bling, instagram, popup Includes items created at or after this instant.
Includes items created at or before this instant.
Minimum purchase amount in cents.
Required range:
x >= 0Maximum purchase amount in cents.
Required range:
x >= 0⌘I