curl --request PATCH \
--url https://api-sandbox.beinfi.com/products/{productID} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"description": "<string>",
"imageObjectKey": "<string>",
"requiresShipping": true
}
'import requests
url = "https://api-sandbox.beinfi.com/products/{productID}"
payload = {
"name": "<string>",
"description": "<string>",
"imageObjectKey": "<string>",
"requiresShipping": True
}
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({
name: '<string>',
description: '<string>',
imageObjectKey: '<string>',
requiresShipping: true
})
};
fetch('https://api-sandbox.beinfi.com/products/{productID}', 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-sandbox.beinfi.com/products/{productID}",
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([
'name' => '<string>',
'description' => '<string>',
'imageObjectKey' => '<string>',
'requiresShipping' => true
]),
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-sandbox.beinfi.com/products/{productID}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"imageObjectKey\": \"<string>\",\n \"requiresShipping\": true\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-sandbox.beinfi.com/products/{productID}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"imageObjectKey\": \"<string>\",\n \"requiresShipping\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-sandbox.beinfi.com/products/{productID}")
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 \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"imageObjectKey\": \"<string>\",\n \"requiresShipping\": true\n}"
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"key": "<string>",
"name": "<string>",
"type": "agent",
"description": "<string>",
"pricingModel": "subscription",
"currency": "BRL",
"status": "active",
"imageUrl": "<string>",
"requiresShipping": true,
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}{
"message": "<string>",
"error_code": "internal_error",
"tracer_id": "<string>"
}{
"message": "<string>",
"error_code": "internal_error",
"tracer_id": "<string>",
"resource": "<string>"
}{
"message": "<string>",
"error_code": "internal_error",
"tracer_id": "<string>",
"errors": [
{
"field": "<string>",
"value": "<string>",
"constraint": "<string>",
"description": "<string>"
}
]
}Update a product
Replaces the product’s details: name, description and status are always written, so send all three. Omitting description clears it, and omitting status leaves the product without a status.
imageObjectKey and requiresShipping are the exception: when absent, they stay as they are. Pricing is not changed here; create a new version instead.
curl --request PATCH \
--url https://api-sandbox.beinfi.com/products/{productID} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"description": "<string>",
"imageObjectKey": "<string>",
"requiresShipping": true
}
'import requests
url = "https://api-sandbox.beinfi.com/products/{productID}"
payload = {
"name": "<string>",
"description": "<string>",
"imageObjectKey": "<string>",
"requiresShipping": True
}
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({
name: '<string>',
description: '<string>',
imageObjectKey: '<string>',
requiresShipping: true
})
};
fetch('https://api-sandbox.beinfi.com/products/{productID}', 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-sandbox.beinfi.com/products/{productID}",
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([
'name' => '<string>',
'description' => '<string>',
'imageObjectKey' => '<string>',
'requiresShipping' => true
]),
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-sandbox.beinfi.com/products/{productID}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"imageObjectKey\": \"<string>\",\n \"requiresShipping\": true\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-sandbox.beinfi.com/products/{productID}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"imageObjectKey\": \"<string>\",\n \"requiresShipping\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-sandbox.beinfi.com/products/{productID}")
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 \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"imageObjectKey\": \"<string>\",\n \"requiresShipping\": true\n}"
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"key": "<string>",
"name": "<string>",
"type": "agent",
"description": "<string>",
"pricingModel": "subscription",
"currency": "BRL",
"status": "active",
"imageUrl": "<string>",
"requiresShipping": true,
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}{
"message": "<string>",
"error_code": "internal_error",
"tracer_id": "<string>"
}{
"message": "<string>",
"error_code": "internal_error",
"tracer_id": "<string>",
"resource": "<string>"
}{
"message": "<string>",
"error_code": "internal_error",
"tracer_id": "<string>",
"errors": [
{
"field": "<string>",
"value": "<string>",
"constraint": "<string>",
"description": "<string>"
}
]
}Authorizations
Your account's secret key: Authorization: Bearer sk_test_… or sk_live_…. Server-side only.
Headers
A unique key per operation (a UUID works). Retrying with the same key returns the original response.
Path Parameters
Product ID.
Body
Product name.
Product description. Omitting it or sending null clears the current one.
active or archived. Always send it.
active, archived The objectKey returned by POST /catalog/images/presign. Absent keeps the current photo; "" removes it. Refused if the key was not issued for your account.
Whether the purchase requires physical delivery. When true, the checkout asks for a shipping address. Absent keeps the current value.
Response
The updated product.
A catalog entry. Pricing lives on the product's versions.
A stable key you choose for the product, unique in your account. Lets you create the same product again without duplicating it.
item (default) or agent.
agent, item How the product is charged: subscription, one_time, usage or prepaid.
subscription, one_time, usage, prepaid 3-letter ISO 4217 code, such as BRL.
"BRL"
active or archived.
"active"
Public address of the product photo.
Whether the purchase requires physical delivery; when true, the checkout asks for an address.