Update License Keys (Batch)
curl --request POST \
--url https://api.centralcart.io/v1/app/package/{package-id}/license-keys/batch \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"license_keys": [
{
"id": 123,
"value": "<string>"
}
]
}
'import requests
url = "https://api.centralcart.io/v1/app/package/{package-id}/license-keys/batch"
payload = { "license_keys": [
{
"id": 123,
"value": "<string>"
}
] }
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({license_keys: [{id: 123, value: '<string>'}]})
};
fetch('https://api.centralcart.io/v1/app/package/{package-id}/license-keys/batch', 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/package/{package-id}/license-keys/batch",
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([
'license_keys' => [
[
'id' => 123,
'value' => '<string>'
]
]
]),
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/package/{package-id}/license-keys/batch"
payload := strings.NewReader("{\n \"license_keys\": [\n {\n \"id\": 123,\n \"value\": \"<string>\"\n }\n ]\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/package/{package-id}/license-keys/batch")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"license_keys\": [\n {\n \"id\": 123,\n \"value\": \"<string>\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.centralcart.io/v1/app/package/{package-id}/license-keys/batch")
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 \"license_keys\": [\n {\n \"id\": 123,\n \"value\": \"<string>\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"message": "3 chave(s) de licença atualizada(s) com sucesso.",
"updated_count": 3,
"license_keys": [
{
"id": 12345,
"store_id": 1,
"package_id": 100214,
"value": "NOVO-ABC123-XYZ789",
"position": 0,
"created_at": "2024-02-25T12:27:33.000-03:00",
"updated_at": "2026-04-09T13:43:55.610-03:00"
},
{
"id": 12346,
"store_id": 1,
"package_id": 100214,
"value": "NOVO-GHI789-JKL012",
"position": 1,
"created_at": "2024-02-25T12:27:33.000-03:00",
"updated_at": "2026-04-09T13:43:55.610-03:00"
},
{
"id": 12347,
"store_id": 1,
"package_id": 100214,
"value": "NOVO-MNO345-PQR678",
"position": 2,
"created_at": "2024-02-25T12:27:33.000-03:00",
"updated_at": "2026-04-09T13:43:55.610-03:00"
}
]
}Linhas / Licenças
Update License Keys (Batch)
Atualiza múltiplas chaves de licença do estoque de um pacote em lote.
POST
/
app
/
package
/
{package-id}
/
license-keys
/
batch
Update License Keys (Batch)
curl --request POST \
--url https://api.centralcart.io/v1/app/package/{package-id}/license-keys/batch \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"license_keys": [
{
"id": 123,
"value": "<string>"
}
]
}
'import requests
url = "https://api.centralcart.io/v1/app/package/{package-id}/license-keys/batch"
payload = { "license_keys": [
{
"id": 123,
"value": "<string>"
}
] }
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({license_keys: [{id: 123, value: '<string>'}]})
};
fetch('https://api.centralcart.io/v1/app/package/{package-id}/license-keys/batch', 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/package/{package-id}/license-keys/batch",
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([
'license_keys' => [
[
'id' => 123,
'value' => '<string>'
]
]
]),
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/package/{package-id}/license-keys/batch"
payload := strings.NewReader("{\n \"license_keys\": [\n {\n \"id\": 123,\n \"value\": \"<string>\"\n }\n ]\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/package/{package-id}/license-keys/batch")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"license_keys\": [\n {\n \"id\": 123,\n \"value\": \"<string>\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.centralcart.io/v1/app/package/{package-id}/license-keys/batch")
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 \"license_keys\": [\n {\n \"id\": 123,\n \"value\": \"<string>\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"message": "3 chave(s) de licença atualizada(s) com sucesso.",
"updated_count": 3,
"license_keys": [
{
"id": 12345,
"store_id": 1,
"package_id": 100214,
"value": "NOVO-ABC123-XYZ789",
"position": 0,
"created_at": "2024-02-25T12:27:33.000-03:00",
"updated_at": "2026-04-09T13:43:55.610-03:00"
},
{
"id": 12346,
"store_id": 1,
"package_id": 100214,
"value": "NOVO-GHI789-JKL012",
"position": 1,
"created_at": "2024-02-25T12:27:33.000-03:00",
"updated_at": "2026-04-09T13:43:55.610-03:00"
},
{
"id": 12347,
"store_id": 1,
"package_id": 100214,
"value": "NOVO-MNO345-PQR678",
"position": 2,
"created_at": "2024-02-25T12:27:33.000-03:00",
"updated_at": "2026-04-09T13:43:55.610-03:00"
}
]
}Autorizações
Token de API gerado no painel da CentralCart.
Parâmetros de caminho
O ID do pacote que contém as chaves de licença
Parâmetros de consulta
Se true, IDs de chaves inexistentes são ignorados em vez de gerar erro de validação. Os IDs ignorados são retornados em skipped_ids.
Corpo
application/json
Array com as chaves de licença a serem atualizadas (mínimo 1, máximo 5.000 chaves).
Show child attributes
Show child attributes