Update
curl --request PATCH \
--url https://{defaultHost}/v1/purchases/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"purchase": {
"revoke_at": "2026-11-26 20:40:44 UTC"
}
}
'import requests
url = "https://{defaultHost}/v1/purchases/{id}"
payload = { "purchase": { "revoke_at": "2026-11-26 20:40:44 UTC" } }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({purchase: {revoke_at: '2026-11-26 20:40:44 UTC'}})
};
fetch('https://{defaultHost}/v1/purchases/{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://{defaultHost}/v1/purchases/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'purchase' => [
'revoke_at' => '2026-11-26 20:40:44 UTC'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://{defaultHost}/v1/purchases/{id}"
payload := strings.NewReader("{\n \"purchase\": {\n \"revoke_at\": \"2026-11-26 20:40:44 UTC\"\n }\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://{defaultHost}/v1/purchases/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"purchase\": {\n \"revoke_at\": \"2026-11-26 20:40:44 UTC\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{defaultHost}/v1/purchases/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"purchase\": {\n \"revoke_at\": \"2026-11-26 20:40:44 UTC\"\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "7d0a21e3-1af7-493a-b479-6ef3fe6b2b8c",
"object": "purchase",
"live_mode": true,
"quantity": 1,
"revoked": false,
"revoked_at": null,
"revoke_at": 1795725644,
"customer": "f085e7b1-5d4e-469f-bb45-aa123eb3baf7",
"initial_order": "bd81e9cf-d41a-4c61-a787-e43d5ce7b708",
"license": null,
"price": "d0e3487a-1830-4a28-8607-09c61bb872c9",
"product": "7d042abe-73ef-4121-819b-9e68e0ca01cc",
"subscription": null,
"variant": null,
"review": null,
"created_at": 1795639244,
"updated_at": 1795639244
}Purchases
Update
Updates a specific purchase.
PATCH
/
v1
/
purchases
/
{id}
Update
curl --request PATCH \
--url https://{defaultHost}/v1/purchases/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"purchase": {
"revoke_at": "2026-11-26 20:40:44 UTC"
}
}
'import requests
url = "https://{defaultHost}/v1/purchases/{id}"
payload = { "purchase": { "revoke_at": "2026-11-26 20:40:44 UTC" } }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({purchase: {revoke_at: '2026-11-26 20:40:44 UTC'}})
};
fetch('https://{defaultHost}/v1/purchases/{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://{defaultHost}/v1/purchases/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'purchase' => [
'revoke_at' => '2026-11-26 20:40:44 UTC'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://{defaultHost}/v1/purchases/{id}"
payload := strings.NewReader("{\n \"purchase\": {\n \"revoke_at\": \"2026-11-26 20:40:44 UTC\"\n }\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://{defaultHost}/v1/purchases/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"purchase\": {\n \"revoke_at\": \"2026-11-26 20:40:44 UTC\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{defaultHost}/v1/purchases/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"purchase\": {\n \"revoke_at\": \"2026-11-26 20:40:44 UTC\"\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "7d0a21e3-1af7-493a-b479-6ef3fe6b2b8c",
"object": "purchase",
"live_mode": true,
"quantity": 1,
"revoked": false,
"revoked_at": null,
"revoke_at": 1795725644,
"customer": "f085e7b1-5d4e-469f-bb45-aa123eb3baf7",
"initial_order": "bd81e9cf-d41a-4c61-a787-e43d5ce7b708",
"license": null,
"price": "d0e3487a-1830-4a28-8607-09c61bb872c9",
"product": "7d042abe-73ef-4121-819b-9e68e0ca01cc",
"subscription": null,
"variant": null,
"review": null,
"created_at": 1795639244,
"updated_at": 1795639244
}Authorizations
Response
200 - application/json
Success
Expandable – The associated customer ID.
The first order that initiated this purchase.
Expandable – The associated order ID.
Expandable – The associated license ID.
Expandable – Property not returned unless expanded.
Expandable – Property not returned unless expanded.
Expandable – The associated price ID.
Expandable – The associated product ID.
Expandable – The associated subscription ID.
Expandable – The associated variant ID.
Expandable – The associated review ID.
Was this page helpful?