Criar layout de checkout
curl --request POST \
--url https://api.upag.io/v1/checkout/layouts \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({name: '<string>'})
};
fetch('https://api.upag.io/v1/checkout/layouts', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));const url = 'https://api.upag.io/v1/checkout/layouts';
const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({name: '<string>'})
};
fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error(err));Layouts de checkout
Criar layout de checkout
Cria um layout de checkout da conta
POST
https://api.upag.io
/
v1
/
checkout
/
layouts
Criar layout de checkout
curl --request POST \
--url https://api.upag.io/v1/checkout/layouts \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({name: '<string>'})
};
fetch('https://api.upag.io/v1/checkout/layouts', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));const url = 'https://api.upag.io/v1/checkout/layouts';
const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({name: '<string>'})
};
fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error(err));Permissão:
checkout_layout.write (chave secreta; chave publicável não é aceita).
Endpoint
curl -X POST https://api.upag.dev/v1/checkout/layouts \
-H "Authorization: Bearer sk_test_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"name": "Tema escuro",
"favicon": "https://example.com/favicon.png"
}'
import { Upag } from 'upag';
const upag = new Upag('sk_test_your_api_key');
// Sem `theme`, a API aplica o tema padrão.
const layout = await upag.checkoutLayouts.create({
name: 'Tema escuro',
favicon: 'https://example.com/favicon.png',
});
Em produção use
https://api.upag.io/v1 com sk_live_....Parâmetros
string
required
Nome do layout (1 a 255 caracteres).
object
Tema completo (todas as chaves listadas na referência, exceto
font, que é opcional). Padrão: tema padrão da Upag.string | null
Até 255 caracteres.
object | null
Configuração de blocos para desktop.
object | null
Configuração de blocos para mobile.
Resposta
201 Created
Response
{
"id": "c1d2e3f4-5a6b-4c7d-8e9f-0a1b2c3d4e5f",
"name": "Tema escuro",
"theme": {
"radius": "0.65rem",
"background": "oklch(0.985 0 0)",
"foreground": "oklch(0.145 0 0)",
"card": "oklch(1 0 0)",
"card-foreground": "oklch(0.145 0 0)",
"popover": "oklch(1 0 0)",
"popover-foreground": "oklch(0.145 0 0)",
"primary": "oklch(0.7 0.133 226.05)",
"primary-foreground": "oklch(0.985 0.002 247.839)",
"secondary": "oklch(0.97 0 0)",
"secondary-foreground": "oklch(0.205 0 0)",
"muted": "oklch(0.97 0 0)",
"muted-foreground": "oklch(0.556 0 0)",
"accent": "oklch(0.97 0 0)",
"accent-foreground": "oklch(0.205 0 0)",
"destructive": "oklch(0.57 0.18 29.23)",
"destructive-foreground": "oklch(0.97 0 0)",
"success": "oklch(0.64 0.17 171.45)",
"success-foreground": "oklch(1 0 0)",
"warning": "oklch(0.82 0.20 100.24)",
"warning-foreground": "oklch(1 0 0)",
"border": "oklch(0.922 0 0)",
"input": "oklch(0.922 0 0)",
"ring": "oklch(0.8 0.0906 223.63)"
},
"favicon": "https://example.com/favicon.png",
"desktop": null,
"mobile": null,
"createdAt": "2026-03-18T11:15:00.000Z",
"updatedAt": "2026-03-18T11:15:00.000Z"
}
422 se o corpo for inválido (por exemplo, theme com chaves faltando).