Update offer
curl --request PATCH \
--url https://commet.co/api/v1/offers/{id} \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"name": "<string>",
"phases": [
{
"type": "percentage",
"durationCycles": 4503599627370495,
"percentage": 5000
}
]
}
'const options = {
method: 'PATCH',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
phases: [{type: 'percentage', durationCycles: 4503599627370495, percentage: 5000}]
})
};
fetch('https://commet.co/api/v1/offers/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://commet.co/api/v1/offers/{id}"
payload = {
"name": "<string>",
"phases": [
{
"type": "percentage",
"durationCycles": 4503599627370495,
"percentage": 5000
}
]
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://commet.co/api/v1/offers/{id}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"phases\": [\n {\n \"type\": \"percentage\",\n \"durationCycles\": 4503599627370495,\n \"percentage\": 5000\n }\n ]\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("x-api-key", "<api-key>")
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://commet.co/api/v1/offers/{id}")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"phases\": [\n {\n \"type\": \"percentage\",\n \"durationCycles\": 4503599627370495,\n \"percentage\": 5000\n }\n ]\n}")
.asString();<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://commet.co/api/v1/offers/{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([
'name' => '<string>',
'phases' => [
[
'type' => 'percentage',
'durationCycles' => 4503599627370495,
'percentage' => 5000
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}{
"id": "<string>",
"name": "<string>",
"phases": [
{
"type": "percentage",
"durationCycles": 4503599627370495,
"percentage": 5000,
"durationInterval": "weekly"
}
],
"metadata": {},
"startsAt": "2023-11-07T05:31:56Z",
"endsAt": "2023-11-07T05:31:56Z",
"active": true,
"managedBy": "dub",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"object": "offer",
"livemode": true
}{
"error": {
"type": "<string>",
"code": "<string>",
"message": "<string>",
"doc_url": "<string>",
"param": "<string>",
"details": "<unknown>"
}
}{
"error": {
"type": "<string>",
"code": "<string>",
"message": "<string>",
"doc_url": "<string>",
"param": "<string>",
"details": "<unknown>"
}
}{
"error": {
"type": "<string>",
"code": "<string>",
"message": "<string>",
"doc_url": "<string>",
"param": "<string>",
"details": "<unknown>"
}
}{
"error": {
"type": "<string>",
"code": "<string>",
"message": "<string>",
"doc_url": "<string>",
"param": "<string>",
"details": "<unknown>"
}
}{
"error": {
"type": "<string>",
"code": "<string>",
"message": "<string>",
"doc_url": "<string>",
"param": "<string>",
"details": "<unknown>"
}
}{
"error": {
"type": "<string>",
"code": "<string>",
"message": "<string>",
"doc_url": "<string>",
"param": "<string>",
"details": "<unknown>"
}
}{
"error": {
"type": "<string>",
"code": "<string>",
"message": "<string>",
"doc_url": "<string>",
"param": "<string>",
"details": "<unknown>"
}
}{
"error": {
"type": "<string>",
"code": "<string>",
"message": "<string>",
"doc_url": "<string>",
"param": "<string>",
"details": "<unknown>"
}
}Offers
Update offer
Replace reusable offer terms. Existing applications keep their immutable accepted terms.
PATCH
/
offers
/
{id}
Update offer
curl --request PATCH \
--url https://commet.co/api/v1/offers/{id} \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"name": "<string>",
"phases": [
{
"type": "percentage",
"durationCycles": 4503599627370495,
"percentage": 5000
}
]
}
'const options = {
method: 'PATCH',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
phases: [{type: 'percentage', durationCycles: 4503599627370495, percentage: 5000}]
})
};
fetch('https://commet.co/api/v1/offers/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://commet.co/api/v1/offers/{id}"
payload = {
"name": "<string>",
"phases": [
{
"type": "percentage",
"durationCycles": 4503599627370495,
"percentage": 5000
}
]
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://commet.co/api/v1/offers/{id}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"phases\": [\n {\n \"type\": \"percentage\",\n \"durationCycles\": 4503599627370495,\n \"percentage\": 5000\n }\n ]\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("x-api-key", "<api-key>")
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://commet.co/api/v1/offers/{id}")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"phases\": [\n {\n \"type\": \"percentage\",\n \"durationCycles\": 4503599627370495,\n \"percentage\": 5000\n }\n ]\n}")
.asString();<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://commet.co/api/v1/offers/{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([
'name' => '<string>',
'phases' => [
[
'type' => 'percentage',
'durationCycles' => 4503599627370495,
'percentage' => 5000
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}{
"id": "<string>",
"name": "<string>",
"phases": [
{
"type": "percentage",
"durationCycles": 4503599627370495,
"percentage": 5000,
"durationInterval": "weekly"
}
],
"metadata": {},
"startsAt": "2023-11-07T05:31:56Z",
"endsAt": "2023-11-07T05:31:56Z",
"active": true,
"managedBy": "dub",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"object": "offer",
"livemode": true
}{
"error": {
"type": "<string>",
"code": "<string>",
"message": "<string>",
"doc_url": "<string>",
"param": "<string>",
"details": "<unknown>"
}
}{
"error": {
"type": "<string>",
"code": "<string>",
"message": "<string>",
"doc_url": "<string>",
"param": "<string>",
"details": "<unknown>"
}
}{
"error": {
"type": "<string>",
"code": "<string>",
"message": "<string>",
"doc_url": "<string>",
"param": "<string>",
"details": "<unknown>"
}
}{
"error": {
"type": "<string>",
"code": "<string>",
"message": "<string>",
"doc_url": "<string>",
"param": "<string>",
"details": "<unknown>"
}
}{
"error": {
"type": "<string>",
"code": "<string>",
"message": "<string>",
"doc_url": "<string>",
"param": "<string>",
"details": "<unknown>"
}
}{
"error": {
"type": "<string>",
"code": "<string>",
"message": "<string>",
"doc_url": "<string>",
"param": "<string>",
"details": "<unknown>"
}
}{
"error": {
"type": "<string>",
"code": "<string>",
"message": "<string>",
"doc_url": "<string>",
"param": "<string>",
"details": "<unknown>"
}
}{
"error": {
"type": "<string>",
"code": "<string>",
"message": "<string>",
"doc_url": "<string>",
"param": "<string>",
"details": "<unknown>"
}
}This reference describes API version
2026-07-31. Send Commet-Version: 2026-07-31 with your request.Headers
Body
application/json
Response
Success
Was this page helpful?