Update a product
curl --request PATCH \
--url https://api.cope.com/v1/commerce/products/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"product": {
"name": "<string>"
}
}
'import requests
url = "https://api.cope.com/v1/commerce/products/{id}"
payload = { "product": { "name": "<string>" } }
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({product: {name: '<string>'}})
};
fetch('https://api.cope.com/v1/commerce/products/{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://api.cope.com/v1/commerce/products/{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([
'product' => [
'name' => '<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/products/{id}"
payload := strings.NewReader("{\n \"product\": {\n \"name\": \"<string>\"\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://api.cope.com/v1/commerce/products/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"product\": {\n \"name\": \"<string>\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.cope.com/v1/commerce/products/{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 \"product\": {\n \"name\": \"<string>\"\n }\n}"
response = http.request(request)
puts response.read_body{
"data": {
"attachments": [
{
"access_pending": true,
"access_trial": true,
"byte_size": 123,
"content_type": "<string>",
"filename": "<string>",
"id": "att_A1b2C3d4E5f6G7h8",
"kind": "<string>",
"url": "<string>"
}
],
"created_at": "<string>",
"description": "<string>",
"headline": "<string>",
"id": "prd_A1b2C3d4E5f6G7h8",
"images": [
{
"byte_size": 123,
"content_type": "<string>",
"filename": "<string>",
"id": "img_A1b2C3d4E5f6G7h8",
"kind": "<string>",
"thumbnail_url": "<string>",
"url": "<string>"
}
],
"name": "<string>",
"payment_plans": [
{
"currency": "<string>",
"display_name": "<string>",
"first_payment_amount_cents": 123,
"interval": "<string>",
"interval_count": 123,
"next_payments_amount_cents": 123,
"next_payments_count": 123,
"plan_type": "<string>",
"position": 123,
"shipping_price_cents": 123
}
],
"product_type": "<string>",
"product_url": "<string>",
"quantity": 123,
"quantity_selection_enabled": true,
"requires_shipping": true,
"stock_level": {
"available_stock": 123,
"visibility": "<string>"
},
"stock_level_settings_enabled": true,
"tags": [
"<string>"
],
"trial_period_days": 123,
"updated_at": "<string>"
}
}
Update a product
PATCH
/
v1
/
commerce
/
products
/
{id}
Update a product
curl --request PATCH \
--url https://api.cope.com/v1/commerce/products/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"product": {
"name": "<string>"
}
}
'import requests
url = "https://api.cope.com/v1/commerce/products/{id}"
payload = { "product": { "name": "<string>" } }
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({product: {name: '<string>'}})
};
fetch('https://api.cope.com/v1/commerce/products/{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://api.cope.com/v1/commerce/products/{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([
'product' => [
'name' => '<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/products/{id}"
payload := strings.NewReader("{\n \"product\": {\n \"name\": \"<string>\"\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://api.cope.com/v1/commerce/products/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"product\": {\n \"name\": \"<string>\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.cope.com/v1/commerce/products/{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 \"product\": {\n \"name\": \"<string>\"\n }\n}"
response = http.request(request)
puts response.read_body{
"data": {
"attachments": [
{
"access_pending": true,
"access_trial": true,
"byte_size": 123,
"content_type": "<string>",
"filename": "<string>",
"id": "att_A1b2C3d4E5f6G7h8",
"kind": "<string>",
"url": "<string>"
}
],
"created_at": "<string>",
"description": "<string>",
"headline": "<string>",
"id": "prd_A1b2C3d4E5f6G7h8",
"images": [
{
"byte_size": 123,
"content_type": "<string>",
"filename": "<string>",
"id": "img_A1b2C3d4E5f6G7h8",
"kind": "<string>",
"thumbnail_url": "<string>",
"url": "<string>"
}
],
"name": "<string>",
"payment_plans": [
{
"currency": "<string>",
"display_name": "<string>",
"first_payment_amount_cents": 123,
"interval": "<string>",
"interval_count": 123,
"next_payments_amount_cents": 123,
"next_payments_count": 123,
"plan_type": "<string>",
"position": 123,
"shipping_price_cents": 123
}
],
"product_type": "<string>",
"product_url": "<string>",
"quantity": 123,
"quantity_selection_enabled": true,
"requires_shipping": true,
"stock_level": {
"available_stock": 123,
"visibility": "<string>"
},
"stock_level_settings_enabled": true,
"tags": [
"<string>"
],
"trial_period_days": 123,
"updated_at": "<string>"
}
}
Authorizations
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.
Pattern:
^prd_[A-Za-z0-9]{16}$Example:
"prd_A1b2C3d4E5f6G7h8"
Body
application/json
Show child attributes
Show child attributes
Response
Successful response
Show child attributes
Show child attributes
Was this page helpful?
⌘I