Invoke
curl --request PATCH \
--url https://{defaultHost}/v1/purchases/{id}/invoke \
--header 'Authorization: Bearer <token>'import requests
url = "https://{defaultHost}/v1/purchases/{id}/invoke"
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}/invoke', 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}/invoke",
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}/invoke"
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}/invoke")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://{defaultHost}/v1/purchases/{id}/invoke")
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": "db9440e5-cd87-41d9-a363-8bd6505608d2",
"object": "purchase",
"live_mode": true,
"quantity": 1,
"revoked": false,
"revoked_at": null,
"revoke_at": null,
"customer": "c9b1a010-7e20-431f-a61c-fbc6b78181a7",
"initial_order": "6e81ded7-4d93-4e3a-906d-17c72586a781",
"license": null,
"price": "de5a70a4-3cbb-43e7-b1e4-6d3e6fe54adc",
"product": "4ab702c8-717f-4c39-95b6-f9cf367cc5c2",
"subscription": null,
"variant": null,
"review": null,
"created_at": 1795639242,
"updated_at": 1795639242
}Purchases
Invoke
Invokes a specific purchase.
PATCH
/
v1
/
purchases
/
{id}
/
invoke
Invoke
curl --request PATCH \
--url https://{defaultHost}/v1/purchases/{id}/invoke \
--header 'Authorization: Bearer <token>'import requests
url = "https://{defaultHost}/v1/purchases/{id}/invoke"
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}/invoke', 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}/invoke",
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}/invoke"
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}/invoke")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://{defaultHost}/v1/purchases/{id}/invoke")
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": "db9440e5-cd87-41d9-a363-8bd6505608d2",
"object": "purchase",
"live_mode": true,
"quantity": 1,
"revoked": false,
"revoked_at": null,
"revoke_at": null,
"customer": "c9b1a010-7e20-431f-a61c-fbc6b78181a7",
"initial_order": "6e81ded7-4d93-4e3a-906d-17c72586a781",
"license": null,
"price": "de5a70a4-3cbb-43e7-b1e4-6d3e6fe54adc",
"product": "4ab702c8-717f-4c39-95b6-f9cf367cc5c2",
"subscription": null,
"variant": null,
"review": null,
"created_at": 1795639242,
"updated_at": 1795639242
}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?