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 GET \ --url https://api.centralcart.io/v1/app/promo/{promo-id} \ --header 'Authorization: Bearer <token>'
import requests url = "https://api.centralcart.io/v1/app/promo/{promo-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.centralcart.io/v1/app/promo/{promo-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/promo/{promo-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.centralcart.io/v1/app/promo/{promo-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.centralcart.io/v1/app/promo/{promo-id}") .header("Authorization", "Bearer <token>") .asString();
require 'uri' require 'net/http' url = URI("https://api.centralcart.io/v1/app/promo/{promo-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
{ "id": 123, "store_id": 123, "name": "<string>", "type": "PROGRESSIVE", "condition_mode": "QUANTITY", "enabled": true, "stacks_with_coupon": true, "starts_at": "<string>", "ends_at": "<string>", "created_at": "<string>", "updated_at": "<string>", "targets": [ { "type": "STORE", "id": 123 } ], "tiers": [ { "id": 123, "store_id": 123, "promo_id": 123, "min_amount": 123, "reward_type": "PERCENTAGE", "reward_value": 123, "reward_quantity": 123, "created_at": "<string>", "updated_at": "<string>", "targets": [ { "type": "STORE", "id": 123 } ] } ] }
Retorna uma promoção.
Token de API gerado no painel da CentralCart.
ID da promoção
OK
ID da loja
Nome da promoção
Tipo da promoção
PROGRESSIVE
BUY_X_PAY_Y
Se o mínimo das faixas é em unidades ou em valor (R$)
QUANTITY
VALUE
Indica se a promoção está ativada
Se a promoção soma com cupom de desconto. false tira a promoção de pedido com cupom
false
Início da promoção
Fim da promoção. null não expira
null
Data de criação
Data da última atualização
Produtos que contam para atingir o mínimo
Show child attributes
Faixas, do menor para o maior mínimo