Documentation IndexFetch the complete documentation index at: /llms.txtUse this file to discover all available pages before exploring further.
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
cURL
curl --request PATCH \ --url https://api.centralcart.io/v1/app/upsell/{upsell-id} \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data ' { "offered_package_id": 305, "type": "ADDITIONAL", "all_triggers": true, "offer_price": null, "enabled": false } '
import requests url = "https://api.centralcart.io/v1/app/upsell/{upsell-id}" payload = { "offered_package_id": 305, "type": "ADDITIONAL", "all_triggers": True, "offer_price": None, "enabled": False } 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({ offered_package_id: 305, type: 'ADDITIONAL', all_triggers: true, offer_price: null, enabled: false }) }; fetch('https://api.centralcart.io/v1/app/upsell/{upsell-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.centralcart.io/v1/app/upsell/{upsell-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([ 'offered_package_id' => 305, 'type' => 'ADDITIONAL', 'all_triggers' => true, 'offer_price' => null, 'enabled' => false ]), 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.centralcart.io/v1/app/upsell/{upsell-id}" payload := strings.NewReader("{\n \"offered_package_id\": 305,\n \"type\": \"ADDITIONAL\",\n \"all_triggers\": true,\n \"offer_price\": null,\n \"enabled\": false\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.centralcart.io/v1/app/upsell/{upsell-id}") .header("Authorization", "Bearer <token>") .header("Content-Type", "application/json") .body("{\n \"offered_package_id\": 305,\n \"type\": \"ADDITIONAL\",\n \"all_triggers\": true,\n \"offer_price\": null,\n \"enabled\": false\n}") .asString();
require 'uri' require 'net/http' url = URI("https://api.centralcart.io/v1/app/upsell/{upsell-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 \"offered_package_id\": 305,\n \"type\": \"ADDITIONAL\",\n \"all_triggers\": true,\n \"offer_price\": null,\n \"enabled\": false\n}" response = http.request(request) puts response.read_body
{ "id": 123, "store_id": 123, "offered_package_id": 123, "type": "ADDITIONAL", "all_triggers": true, "offer_price": 123, "position": 123, "enabled": true, "created_at": "<string>", "updated_at": "<string>", "offered": { "id": 123, "name": "<string>", "image": "<string>", "price": 123, "slug": "<string>" }, "triggers": [ { "id": 123, "name": "<string>", "image": "<string>", "price": 123, "slug": "<string>" } ] }
Atualiza um upsell.
Token de API gerado no painel da CentralCart.
ID do upsell
ID do produto ofertado
ADDITIONAL soma ao carrinho, ALTERNATIVE troca o gatilho pelo ofertado (upgrade) e POST_SALE aparece depois da compra
ADDITIONAL
ALTERNATIVE
POST_SALE
Se true, qualquer produto do carrinho dispara a oferta e trigger_package_ids é ignorado. Padrão false
true
trigger_package_ids
false
IDs dos produtos que disparam a oferta. Obrigatório quando all_triggers não é true
all_triggers
Preço do produto ofertado nesta oferta. Omita ou envie null para usar o preço normal
null
Ordem de exibição, do menor para o maior. Padrão 0 na criação
0
Ativa o upsell. Padrão true na criação
Upsell atualizado.
ID da loja
Indica se qualquer produto do carrinho dispara a oferta
Preço do produto ofertado nesta oferta. null usa o preço normal
Ordem de exibição, do menor para o maior
Indica se o upsell está ativado
Data de criação
Data da última atualização
Show child attributes
Produtos que disparam a oferta. Vazio quando all_triggers é true