curl --request POST \
--url https://api.cope.com/v1/commerce/offers/{id}/cancel \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"cancellation_reason": "<string>"
}
'import requests
url = "https://api.cope.com/v1/commerce/offers/{id}/cancel"
payload = { "cancellation_reason": "<string>" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({cancellation_reason: '<string>'})
};
fetch('https://api.cope.com/v1/commerce/offers/{id}/cancel', 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://api.cope.com/v1/commerce/offers/{id}/cancel",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'cancellation_reason' => '<string>'
]),
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://api.cope.com/v1/commerce/offers/{id}/cancel"
payload := strings.NewReader("{\n \"cancellation_reason\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", 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.post("https://api.cope.com/v1/commerce/offers/{id}/cancel")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"cancellation_reason\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.cope.com/v1/commerce/offers/{id}/cancel")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"cancellation_reason\": \"<string>\"\n}"
response = http.request(request)
puts response.read_bodyCancel an offer
Cancels an active offer and returns it. The buyer’s link stops offering checkout and
shows a cancelled offer instead, so a cancelled offer can no longer be paid.
Only an active offer can be cancelled: one already ordered, already cancelled, or
lapsed is refused with 422 invalid_state. Cancellation is final — there is no
re-activation, and a new offer has to be created.
The optional cancellation_reason is stored with the offer and read back as
cancelled_reason. It is for your own records; nothing is sent to the buyer.
curl --request POST \
--url https://api.cope.com/v1/commerce/offers/{id}/cancel \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"cancellation_reason": "<string>"
}
'import requests
url = "https://api.cope.com/v1/commerce/offers/{id}/cancel"
payload = { "cancellation_reason": "<string>" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({cancellation_reason: '<string>'})
};
fetch('https://api.cope.com/v1/commerce/offers/{id}/cancel', 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://api.cope.com/v1/commerce/offers/{id}/cancel",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'cancellation_reason' => '<string>'
]),
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://api.cope.com/v1/commerce/offers/{id}/cancel"
payload := strings.NewReader("{\n \"cancellation_reason\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", 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.post("https://api.cope.com/v1/commerce/offers/{id}/cancel")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"cancellation_reason\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.cope.com/v1/commerce/offers/{id}/cancel")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"cancellation_reason\": \"<string>\"\n}"
response = http.request(request)
puts response.read_bodyAuthorizations
Bearer credential for the public API. Vendor integrations should send a live COPE API key (cope_sk_live_*). Clerk bearer tokens are also accepted when paired with X-Cope-Business-Id.
Path Parameters
id public identifier.
^of_[A-Za-z0-9]{12}$"of_A1b2C3d4E5f6"
Body
Free text kept with the offer and read back as cancelled_reason. The buyer is never shown it.
500Response
Successful response
Show child attributes
Show child attributes
Was this page helpful?