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 POST \ --url https://api.centralcart.io/v1/app/upsell \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data ' { "offered_package_id": 305, "type": "ADDITIONAL", "trigger_package_ids": [ 301 ], "offer_price": 9.9 } '
import requests url = "https://api.centralcart.io/v1/app/upsell" payload = { "offered_package_id": 305, "type": "ADDITIONAL", "trigger_package_ids": [301], "offer_price": 9.9 } headers = { "Authorization": "Bearer <token>", "Content-Type": "application/json" } response = requests.post(url, json=payload, headers=headers) print(response.text)
const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: JSON.stringify({ offered_package_id: 305, type: 'ADDITIONAL', trigger_package_ids: [301], offer_price: 9.9 }) }; fetch('https://api.centralcart.io/v1/app/upsell', 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", CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => "", CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 30, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => "POST", CURLOPT_POSTFIELDS => json_encode([ 'offered_package_id' => 305, 'type' => 'ADDITIONAL', 'trigger_package_ids' => [ 301 ], 'offer_price' => 9.9 ]), 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" payload := strings.NewReader("{\n \"offered_package_id\": 305,\n \"type\": \"ADDITIONAL\",\n \"trigger_package_ids\": [\n 301\n ],\n \"offer_price\": 9.9\n}") req, _ := http.NewRequest("POST", 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.post("https://api.centralcart.io/v1/app/upsell") .header("Authorization", "Bearer <token>") .header("Content-Type", "application/json") .body("{\n \"offered_package_id\": 305,\n \"type\": \"ADDITIONAL\",\n \"trigger_package_ids\": [\n 301\n ],\n \"offer_price\": 9.9\n}") .asString();
require 'uri' require 'net/http' url = URI("https://api.centralcart.io/v1/app/upsell") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Post.new(url) request["Authorization"] = 'Bearer <token>' request["Content-Type"] = 'application/json' request.body = "{\n \"offered_package_id\": 305,\n \"type\": \"ADDITIONAL\",\n \"trigger_package_ids\": [\n 301\n ],\n \"offer_price\": 9.9\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>" } ] }
Cria um upsell.
Token de API gerado no painel da CentralCart.
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 criado.
ID do upsell
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