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": "6edb868f-df7b-4a38-a92d-f1d997ebbbe9",
"object": "purchase",
"live_mode": true,
"quantity": 1,
"revoked": false,
"revoked_at": null,
"revoke_at": null,
"customer": "d0b19ff9-6f7f-435b-9889-038bf8ddfbb4",
"initial_order": "90e230a3-4678-44de-a270-752fc7b18f46",
"license": null,
"price": "54180ebc-a117-4323-b0f8-bf2c4dae93e6",
"product": "ba02e232-7150-4539-a411-da89895ae751",
"subscription": null,
"variant": null,
"review": null,
"created_at": 1787228444,
"updated_at": 1787228444
},
{
"id": "1f36cfd2-3ebf-4616-a892-f61498340495",
"object": "purchase",
"live_mode": true,
"quantity": 1,
"revoked": false,
"revoked_at": null,
"revoke_at": null,
"customer": "d0b19ff9-6f7f-435b-9889-038bf8ddfbb4",
"initial_order": null,
"license": null,
"price": "54180ebc-a117-4323-b0f8-bf2c4dae93e6",
"product": "ba02e232-7150-4539-a411-da89895ae751",
"subscription": null,
"variant": null,
"review": null,
"created_at": 1787228444,
"updated_at": 1787228444
}
]
}List
Returns a list of purchases.
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": "6edb868f-df7b-4a38-a92d-f1d997ebbbe9",
"object": "purchase",
"live_mode": true,
"quantity": 1,
"revoked": false,
"revoked_at": null,
"revoke_at": null,
"customer": "d0b19ff9-6f7f-435b-9889-038bf8ddfbb4",
"initial_order": "90e230a3-4678-44de-a270-752fc7b18f46",
"license": null,
"price": "54180ebc-a117-4323-b0f8-bf2c4dae93e6",
"product": "ba02e232-7150-4539-a411-da89895ae751",
"subscription": null,
"variant": null,
"review": null,
"created_at": 1787228444,
"updated_at": 1787228444
},
{
"id": "1f36cfd2-3ebf-4616-a892-f61498340495",
"object": "purchase",
"live_mode": true,
"quantity": 1,
"revoked": false,
"revoked_at": null,
"revoke_at": null,
"customer": "d0b19ff9-6f7f-435b-9889-038bf8ddfbb4",
"initial_order": null,
"license": null,
"price": "54180ebc-a117-4323-b0f8-bf2c4dae93e6",
"product": "ba02e232-7150-4539-a411-da89895ae751",
"subscription": null,
"variant": null,
"review": null,
"created_at": 1787228444,
"updated_at": 1787228444
}
]
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Query Parameters
Only return objects that belong to the given checkouts.
Only return records that were created during the given date interval.
Show child attributes
Show child attributes
Only return objects that belong to the given customers.
Only return objects that have associated downloads.
Only return objects with the given IDs.
Only return objects that belong to the given licenses.
A limit on the number of items to be returned, between 1 and 100.
Only return objects that are live mode or test mode.
Only return objects that belong to the given orders.
The page of items you want returned.
Only return objects that belong to the given products.
Only return objects that are revoked or not revoked.
Only return objects that belong to the given subscriptions.
Was this page helpful?