Criar checkout externo
curl --request POST \
--url https://apiv3.usecorvex.com.br/stores/external/checkout \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"cart": {
"token": "uuid-unico-deste-carrinho",
"currency": "BRL",
"items": [
{
"title": "Nome do produto",
"quantity": 1,
"unitPrice": 9990,
"image": "https://cdn.exemplo.com/produto.jpg"
}
],
"subtotalPrice": null,
"totalPrice": null,
"totalDiscount": 0,
"requiresShipping": true,
"discounts": [],
"metadata": null
},
"customer": {
"name": null,
"email": null,
"phone": null,
"document": null
},
"redirect": {
"successUrl": null,
"cancelUrl": null
},
"metadata": null
}
'const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
cart: {
token: 'uuid-unico-deste-carrinho',
currency: 'BRL',
items: [
{
title: 'Nome do produto',
quantity: 1,
unitPrice: 9990,
image: 'https://cdn.exemplo.com/produto.jpg'
}
],
subtotalPrice: null,
totalPrice: null,
totalDiscount: 0,
requiresShipping: true,
discounts: [],
metadata: null
},
customer: {name: null, email: null, phone: null, document: null},
redirect: {successUrl: null, cancelUrl: null},
metadata: null
})
};
fetch('https://apiv3.usecorvex.com.br/stores/external/checkout', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://apiv3.usecorvex.com.br/stores/external/checkout"
payload = {
"cart": {
"token": "uuid-unico-deste-carrinho",
"currency": "BRL",
"items": [
{
"title": "Nome do produto",
"quantity": 1,
"unitPrice": 9990,
"image": "https://cdn.exemplo.com/produto.jpg"
}
],
"subtotalPrice": None,
"totalPrice": None,
"totalDiscount": 0,
"requiresShipping": True,
"discounts": [],
"metadata": None
},
"customer": {
"name": None,
"email": None,
"phone": None,
"document": None
},
"redirect": {
"successUrl": None,
"cancelUrl": None
},
"metadata": None
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"success": true,
"checkoutId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"checkoutUrl": "https://minhaloja.com.br/pay/a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"storeId": "11111111-1111-4111-8111-111111111111",
"cartToken": "uuid-unico-deste-carrinho"
}{
"success": false,
"error": {
"code": "INVALID_PAYLOAD",
"message": "Payload inválido",
"details": {}
}
}{
"success": false,
"error": {
"code": "MISSING_API_KEY",
"message": "Header x-api-key é obrigatório"
}
}{
"success": false,
"error": {
"code": "STORE_INACTIVE",
"message": "Loja está inativa"
}
}{
"success": false,
"error": {
"code": "STORE_NOT_FOUND",
"message": "Loja não encontrada"
}
}{
"success": false,
"error": {
"code": "INTERNAL_ERROR",
"message": "Erro interno ao processar checkout"
}
}Checkout externo
Criar checkout externo
Abre um checkout Corvex a partir do carrinho do seu front (Lovable, Framer, HTML, etc.).
Autenticação: header x-api-key copiado em Configuração da loja. Não use Authorization: Bearer cvx_live_... nem X-Store-Id.
Preços: inteiros em centavos (R$ 99,90 → 9990).
cart.token: identificador único do carrinho no seu app (recomendado: crypto.randomUUID()). checkoutId só vem na resposta.
Alias equivalente: POST /api/stores/external/checkout.
POST
/
stores
/
external
/
checkout
Criar checkout externo
curl --request POST \
--url https://apiv3.usecorvex.com.br/stores/external/checkout \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"cart": {
"token": "uuid-unico-deste-carrinho",
"currency": "BRL",
"items": [
{
"title": "Nome do produto",
"quantity": 1,
"unitPrice": 9990,
"image": "https://cdn.exemplo.com/produto.jpg"
}
],
"subtotalPrice": null,
"totalPrice": null,
"totalDiscount": 0,
"requiresShipping": true,
"discounts": [],
"metadata": null
},
"customer": {
"name": null,
"email": null,
"phone": null,
"document": null
},
"redirect": {
"successUrl": null,
"cancelUrl": null
},
"metadata": null
}
'const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
cart: {
token: 'uuid-unico-deste-carrinho',
currency: 'BRL',
items: [
{
title: 'Nome do produto',
quantity: 1,
unitPrice: 9990,
image: 'https://cdn.exemplo.com/produto.jpg'
}
],
subtotalPrice: null,
totalPrice: null,
totalDiscount: 0,
requiresShipping: true,
discounts: [],
metadata: null
},
customer: {name: null, email: null, phone: null, document: null},
redirect: {successUrl: null, cancelUrl: null},
metadata: null
})
};
fetch('https://apiv3.usecorvex.com.br/stores/external/checkout', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://apiv3.usecorvex.com.br/stores/external/checkout"
payload = {
"cart": {
"token": "uuid-unico-deste-carrinho",
"currency": "BRL",
"items": [
{
"title": "Nome do produto",
"quantity": 1,
"unitPrice": 9990,
"image": "https://cdn.exemplo.com/produto.jpg"
}
],
"subtotalPrice": None,
"totalPrice": None,
"totalDiscount": 0,
"requiresShipping": True,
"discounts": [],
"metadata": None
},
"customer": {
"name": None,
"email": None,
"phone": None,
"document": None
},
"redirect": {
"successUrl": None,
"cancelUrl": None
},
"metadata": None
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"success": true,
"checkoutId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"checkoutUrl": "https://minhaloja.com.br/pay/a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"storeId": "11111111-1111-4111-8111-111111111111",
"cartToken": "uuid-unico-deste-carrinho"
}{
"success": false,
"error": {
"code": "INVALID_PAYLOAD",
"message": "Payload inválido",
"details": {}
}
}{
"success": false,
"error": {
"code": "MISSING_API_KEY",
"message": "Header x-api-key é obrigatório"
}
}{
"success": false,
"error": {
"code": "STORE_INACTIVE",
"message": "Loja está inativa"
}
}{
"success": false,
"error": {
"code": "STORE_NOT_FOUND",
"message": "Loja não encontrada"
}
}{
"success": false,
"error": {
"code": "INTERNAL_ERROR",
"message": "Erro interno ao processar checkout"
}
}Authorizations
Chave de checkout copiada em Configuração da loja no painel. Não é cvx_live_....
Body
application/json