Retrieve a product
curl --request GET \
--url https://api.cope.com/v1/commerce/products/{id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.cope.com/v1/commerce/products/{id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
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 => "GET",
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://api.cope.com/v1/commerce/products/{id}"
req, _ := http.NewRequest("GET", 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.get("https://api.cope.com/v1/commerce/products/{id}")
.header("Authorization", "Bearer <token>")
.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::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"data": {
"approval_status": "<string>",
"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>"
}
],
"installment_sales_enabled": true,
"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,
"status": "<string>",
"stock_level": {
"available_stock": 123,
"visibility": "<string>"
},
"stock_level_settings_enabled": true,
"tags": [
"<string>"
],
"trial_period_days": 123,
"updated_at": "<string>"
}
}{
"code": "invalid_request",
"detail": null,
"errors": [
{
"code": "missing",
"detail": "param is missing or the value is empty: product_id",
"param": "product_id"
}
],
"request_id": "req_123",
"status": 400,
"title": "Invalid Request",
"type": "https://docs.cope.com/errors/invalid_request"
}{
"code": "<string>",
"request_id": "<string>",
"status": 123,
"title": "<string>",
"type": "<string>",
"detail": "<string>",
"errors": [
{
"code": "<string>",
"detail": "<string>",
"param": "<string>"
}
]
}{
"code": "<string>",
"request_id": "<string>",
"status": 123,
"title": "<string>",
"type": "<string>",
"detail": "<string>",
"errors": [
{
"code": "<string>",
"detail": "<string>",
"param": "<string>"
}
]
}{
"code": "<string>",
"request_id": "<string>",
"status": 123,
"title": "<string>",
"type": "<string>",
"detail": "<string>",
"errors": [
{
"code": "<string>",
"detail": "<string>",
"param": "<string>"
}
]
}Retrieve a product
GET
/
v1
/
commerce
/
products
/
{id}
Retrieve a product
curl --request GET \
--url https://api.cope.com/v1/commerce/products/{id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.cope.com/v1/commerce/products/{id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
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 => "GET",
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://api.cope.com/v1/commerce/products/{id}"
req, _ := http.NewRequest("GET", 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.get("https://api.cope.com/v1/commerce/products/{id}")
.header("Authorization", "Bearer <token>")
.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::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"data": {
"approval_status": "<string>",
"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>"
}
],
"installment_sales_enabled": true,
"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,
"status": "<string>",
"stock_level": {
"available_stock": 123,
"visibility": "<string>"
},
"stock_level_settings_enabled": true,
"tags": [
"<string>"
],
"trial_period_days": 123,
"updated_at": "<string>"
}
}{
"code": "invalid_request",
"detail": null,
"errors": [
{
"code": "missing",
"detail": "param is missing or the value is empty: product_id",
"param": "product_id"
}
],
"request_id": "req_123",
"status": 400,
"title": "Invalid Request",
"type": "https://docs.cope.com/errors/invalid_request"
}{
"code": "<string>",
"request_id": "<string>",
"status": 123,
"title": "<string>",
"type": "<string>",
"detail": "<string>",
"errors": [
{
"code": "<string>",
"detail": "<string>",
"param": "<string>"
}
]
}{
"code": "<string>",
"request_id": "<string>",
"status": 123,
"title": "<string>",
"type": "<string>",
"detail": "<string>",
"errors": [
{
"code": "<string>",
"detail": "<string>",
"param": "<string>"
}
]
}{
"code": "<string>",
"request_id": "<string>",
"status": 123,
"title": "<string>",
"type": "<string>",
"detail": "<string>",
"errors": [
{
"code": "<string>",
"detail": "<string>",
"param": "<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"
Response
Successful response
Show child attributes
Show child attributes
Was this page helpful?
⌘I