Criar produto
curl --request POST \
--url https://api.upag.io/v1/products \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"description": "<string>"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({name: '<string>', description: '<string>'})
};
fetch('https://api.upag.io/v1/products', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));const url = 'https://api.upag.io/v1/products';
const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({name: '<string>', description: '<string>'})
};
fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error(err));Produtos
Criar produto
Cria um produto, opcionalmente com seu preço padrão
POST
https://api.upag.io
/
v1
/
products
Criar produto
curl --request POST \
--url https://api.upag.io/v1/products \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"description": "<string>"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({name: '<string>', description: '<string>'})
};
fetch('https://api.upag.io/v1/products', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));const url = 'https://api.upag.io/v1/products';
const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({name: '<string>', description: '<string>'})
};
fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error(err));Cria um produto da conta. Se
Corpo inválido retorna
defaultPrice for enviado, o preço é criado junto com o produto.
Permissão: product.write (chave secreta; chave publicável não é aceita).
Endpoint
curl -X POST https://api.upag.dev/v1/products \
-H "Authorization: Bearer sk_test_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"name": "Plano Pro",
"description": "Acesso completo à plataforma",
"image": "https://example.com/plano-pro.png",
"defaultPrice": {
"name": "Mensal",
"amount": 4990,
"currency": "brl",
"billingType": "recurring",
"interval": "month",
"intervalCount": 1
}
}'
import { Upag } from 'upag';
const upag = new Upag('sk_test_your_api_key');
const product = await upag.products.create({
name: 'Plano Pro',
description: 'Acesso completo à plataforma',
image: 'https://example.com/plano-pro.png',
defaultPrice: {
name: 'Mensal',
amount: 4990,
currency: 'brl',
billingType: 'recurring',
interval: 'month',
intervalCount: 1,
},
});
Em produção use
https://api.upag.io/v1 com sk_live_....Parâmetros
string
required
Nome do produto (mínimo 1 caractere).
string
required
Descrição (mínimo 1 caractere).
string
URL da imagem.
object
Preço criado junto com o produto. Mesmos campos de Criar preço, exceto
metadata: name, amount (centavos, mínimo 100), currency (brl ou usd), billingType (one_time ou recurring) e, se recorrente, interval (day, week, month, year) e intervalCount (inteiro ≥ 1).Resposta
201 Created
A resposta traz apenas o produto; o preço padrão é listado em Listar preços.
Response
{
"id": "0b9c1f3e-6a4d-4c1e-9d55-3f1f6a7c2e10",
"name": "Plano Pro",
"description": "Acesso completo à plataforma",
"image": "https://example.com/plano-pro.png",
"createdAt": "2026-03-18T11:00:00.000Z",
"updatedAt": "2026-03-18T11:00:00.000Z"
}
422. Campos: Referência de produtos.