Atualizar preço
curl --request PATCH \
--url https://api.upag.io/v1/products/{productId}/prices/{priceId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"amount": 123,
"intervalCount": 123,
"metadata": {}
}
'const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({name: '<string>', amount: 123, intervalCount: 123, metadata: {}})
};
fetch('https://api.upag.io/v1/products/{productId}/prices/{priceId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));const url = 'https://api.upag.io/v1/products/{productId}/prices/{priceId}';
const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({name: '<string>', amount: 123, intervalCount: 123, metadata: {}})
};
fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error(err));Preços
Atualizar preço
Atualiza nome, valor, quantidade de intervalos ou metadata
PATCH
https://api.upag.io
/
v1
/
products
/
{productId}
/
prices
/
{priceId}
Atualizar preço
curl --request PATCH \
--url https://api.upag.io/v1/products/{productId}/prices/{priceId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"amount": 123,
"intervalCount": 123,
"metadata": {}
}
'const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({name: '<string>', amount: 123, intervalCount: 123, metadata: {}})
};
fetch('https://api.upag.io/v1/products/{productId}/prices/{priceId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));const url = 'https://api.upag.io/v1/products/{productId}/prices/{priceId}';
const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({name: '<string>', amount: 123, intervalCount: 123, metadata: {}})
};
fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error(err));Atualização parcial.
currency, billingType e interval não podem ser alterados; para isso, crie outro preço.
Permissão: price.write (chave secreta).
Endpoint
curl -X PATCH https://api.upag.dev/v1/products/0b9c1f3e-6a4d-4c1e-9d55-3f1f6a7c2e10/prices/5f2d7a90-3b1c-4e8a-8f6d-1c9e4b7a2d33 \
-H "Authorization: Bearer sk_test_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"amount": 5990,
"metadata": { "tier": "pro-plus" }
}'
import { Upag } from 'upag';
const upag = new Upag('sk_test_your_api_key');
// upag.prices.update(productId, priceId, params)
const price = await upag.prices.update(
'0b9c1f3e-6a4d-4c1e-9d55-3f1f6a7c2e10',
'5f2d7a90-3b1c-4e8a-8f6d-1c9e4b7a2d33',
{ amount: 5990, metadata: { tier: 'pro-plus' } },
);
Em produção use
https://api.upag.io/v1 com sk_live_....Parâmetros
string (uuid)
required
ID do produto.
string (uuid)
required
ID do preço.
string
Novo nome (mínimo 1 caractere).
integer
Novo valor em centavos (mínimo 100).
integer
Nova quantidade de intervalos (inteiro ≥ 1).
object
Mesclada com a metadata existente (chaves enviadas sobrescrevem as atuais). Mesmos limites da criação.
Resposta
200 OK
Response
{
"id": "5f2d7a90-3b1c-4e8a-8f6d-1c9e4b7a2d33",
"name": "Mensal",
"billingType": "recurring",
"interval": "month",
"intervalCount": 1,
"currency": "brl",
"amount": 5990,
"metadata": { "tier": "pro-plus" },
"createdAt": "2026-03-18T11:05:00.000Z",
"updatedAt": "2026-03-18T12:30:00.000Z"
}
404 — PRODUCT_NOT_FOUND ou PRICE_NOT_FOUND.