Revoke
curl --request PATCH \
--url https://{defaultHost}/v1/purchases/{id}/revoke \
--header 'Authorization: Bearer <token>'import requests
url = "https://{defaultHost}/v1/purchases/{id}/revoke"
headers = {"Authorization": "Bearer <token>"}
response = requests.patch(url, headers=headers)
print(response.text)const options = {method: 'PATCH', headers: {Authorization: 'Bearer <token>'}};
fetch('https://{defaultHost}/v1/purchases/{id}/revoke', 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}/revoke",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
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/{id}/revoke"
req, _ := http.NewRequest("PATCH", 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.patch("https://{defaultHost}/v1/purchases/{id}/revoke")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://{defaultHost}/v1/purchases/{id}/revoke")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"id": "b2253429-383c-4255-9a20-6200dafbbda5",
"object": "purchase",
"live_mode": true,
"quantity": 1,
"revoked": true,
"revoked_at": 1794901840,
"revoke_at": null,
"customer": "84ea356e-0968-4928-bd51-0f765fd2f1dd",
"initial_order": "4f582ec7-2b4f-45b3-af3f-5df169ce8a17",
"license": null,
"price": "c3b8612f-1f8d-4cde-92f3-da6db7620ce5",
"product": "4732519e-3ec8-4b75-8b48-82fe78558bdb",
"subscription": null,
"variant": null,
"review": null,
"created_at": 1794901840,
"updated_at": 1794901840
}Purchases
Revoke
Revokes a specific purchase.
PATCH
/
v1
/
purchases
/
{id}
/
revoke
Revoke
curl --request PATCH \
--url https://{defaultHost}/v1/purchases/{id}/revoke \
--header 'Authorization: Bearer <token>'import requests
url = "https://{defaultHost}/v1/purchases/{id}/revoke"
headers = {"Authorization": "Bearer <token>"}
response = requests.patch(url, headers=headers)
print(response.text)const options = {method: 'PATCH', headers: {Authorization: 'Bearer <token>'}};
fetch('https://{defaultHost}/v1/purchases/{id}/revoke', 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}/revoke",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
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/{id}/revoke"
req, _ := http.NewRequest("PATCH", 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.patch("https://{defaultHost}/v1/purchases/{id}/revoke")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://{defaultHost}/v1/purchases/{id}/revoke")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"id": "b2253429-383c-4255-9a20-6200dafbbda5",
"object": "purchase",
"live_mode": true,
"quantity": 1,
"revoked": true,
"revoked_at": 1794901840,
"revoke_at": null,
"customer": "84ea356e-0968-4928-bd51-0f765fd2f1dd",
"initial_order": "4f582ec7-2b4f-45b3-af3f-5df169ce8a17",
"license": null,
"price": "c3b8612f-1f8d-4cde-92f3-da6db7620ce5",
"product": "4732519e-3ec8-4b75-8b48-82fe78558bdb",
"subscription": null,
"variant": null,
"review": null,
"created_at": 1794901840,
"updated_at": 1794901840
}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?