List
curl --request GET \
--url https://{defaultHost}/v1/purchases \
--header 'Authorization: Bearer <token>'import requests
url = "https://{defaultHost}/v1/purchases"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://{defaultHost}/v1/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://{defaultHost}/v1/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://{defaultHost}/v1/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://{defaultHost}/v1/purchases")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://{defaultHost}/v1/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{
"object": "list",
"pagination": {
"count": 2,
"limit": 20,
"page": 1,
"url": "/v1/purchases"
},
"data": [
{
"id": "7ef01101-a032-4319-b9c4-049bb27e9b8b",
"object": "purchase",
"live_mode": true,
"quantity": 1,
"revoked": false,
"revoked_at": null,
"revoke_at": null,
"customer": "e9c4f657-87c2-4dfb-a005-625c863dcced",
"initial_order": "ae6a5cee-84e1-489f-b04a-2b53a7b168cd",
"license": null,
"price": "6c2a7e52-522d-4f45-ba34-87dc2322daaa",
"product": "f2768584-193c-4d77-9b0c-2b1ce8e04dfe",
"subscription": null,
"variant": null,
"review": null,
"created_at": 1796063967,
"updated_at": 1796063967
},
{
"id": "113a34e2-ea5f-4e3c-90c9-dddb59102175",
"object": "purchase",
"live_mode": true,
"quantity": 1,
"revoked": false,
"revoked_at": null,
"revoke_at": null,
"customer": "e9c4f657-87c2-4dfb-a005-625c863dcced",
"initial_order": null,
"license": null,
"price": "6c2a7e52-522d-4f45-ba34-87dc2322daaa",
"product": "f2768584-193c-4d77-9b0c-2b1ce8e04dfe",
"subscription": null,
"variant": null,
"review": null,
"created_at": 1796063967,
"updated_at": 1796063967
}
]
}Purchases
List
Returns a list of purchases.
GET
/
v1
/
purchases
List
curl --request GET \
--url https://{defaultHost}/v1/purchases \
--header 'Authorization: Bearer <token>'import requests
url = "https://{defaultHost}/v1/purchases"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://{defaultHost}/v1/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://{defaultHost}/v1/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://{defaultHost}/v1/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://{defaultHost}/v1/purchases")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://{defaultHost}/v1/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{
"object": "list",
"pagination": {
"count": 2,
"limit": 20,
"page": 1,
"url": "/v1/purchases"
},
"data": [
{
"id": "7ef01101-a032-4319-b9c4-049bb27e9b8b",
"object": "purchase",
"live_mode": true,
"quantity": 1,
"revoked": false,
"revoked_at": null,
"revoke_at": null,
"customer": "e9c4f657-87c2-4dfb-a005-625c863dcced",
"initial_order": "ae6a5cee-84e1-489f-b04a-2b53a7b168cd",
"license": null,
"price": "6c2a7e52-522d-4f45-ba34-87dc2322daaa",
"product": "f2768584-193c-4d77-9b0c-2b1ce8e04dfe",
"subscription": null,
"variant": null,
"review": null,
"created_at": 1796063967,
"updated_at": 1796063967
},
{
"id": "113a34e2-ea5f-4e3c-90c9-dddb59102175",
"object": "purchase",
"live_mode": true,
"quantity": 1,
"revoked": false,
"revoked_at": null,
"revoke_at": null,
"customer": "e9c4f657-87c2-4dfb-a005-625c863dcced",
"initial_order": null,
"license": null,
"price": "6c2a7e52-522d-4f45-ba34-87dc2322daaa",
"product": "f2768584-193c-4d77-9b0c-2b1ce8e04dfe",
"subscription": null,
"variant": null,
"review": null,
"created_at": 1796063967,
"updated_at": 1796063967
}
]
}Authorizations
Query Parameters
Was this page helpful?