Atualizar link de pagamento
curl --request PATCH \
--url https://api.upag.io/v1/payment-links/{paymentLinkId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"description": {},
"checkoutLayout": {},
"paymentMethods": [
"<string>"
],
"billingAddressCollection": "<string>",
"successUrl": {},
"cancelUrl": {},
"active": true,
"couponEnabled": true,
"subscriptionData": {},
"paymentMethodCollection": "<string>"
}
'const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
description: {},
checkoutLayout: {},
paymentMethods: ['<string>'],
billingAddressCollection: '<string>',
successUrl: {},
cancelUrl: {},
active: true,
couponEnabled: true,
subscriptionData: {},
paymentMethodCollection: '<string>'
})
};
fetch('https://api.upag.io/v1/payment-links/{paymentLinkId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));const url = 'https://api.upag.io/v1/payment-links/{paymentLinkId}';
const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
description: {},
checkoutLayout: {},
paymentMethods: ['<string>'],
billingAddressCollection: '<string>',
successUrl: {},
cancelUrl: {},
active: true,
couponEnabled: true,
subscriptionData: {},
paymentMethodCollection: '<string>'
})
};
fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error(err));Links de pagamento
Atualizar link de pagamento
Atualiza dados, ativação, cupons e trial do link
PATCH
https://api.upag.io
/
v1
/
payment-links
/
{paymentLinkId}
Atualizar link de pagamento
curl --request PATCH \
--url https://api.upag.io/v1/payment-links/{paymentLinkId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"description": {},
"checkoutLayout": {},
"paymentMethods": [
"<string>"
],
"billingAddressCollection": "<string>",
"successUrl": {},
"cancelUrl": {},
"active": true,
"couponEnabled": true,
"subscriptionData": {},
"paymentMethodCollection": "<string>"
}
'const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
description: {},
checkoutLayout: {},
paymentMethods: ['<string>'],
billingAddressCollection: '<string>',
successUrl: {},
cancelUrl: {},
active: true,
couponEnabled: true,
subscriptionData: {},
paymentMethodCollection: '<string>'
})
};
fetch('https://api.upag.io/v1/payment-links/{paymentLinkId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));const url = 'https://api.upag.io/v1/payment-links/{paymentLinkId}';
const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
description: {},
checkoutLayout: {},
paymentMethods: ['<string>'],
billingAddressCollection: '<string>',
successUrl: {},
cancelUrl: {},
active: true,
couponEnabled: true,
subscriptionData: {},
paymentMethodCollection: '<string>'
})
};
fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error(err));Atualização parcial: campos omitidos permanecem.
null limpa description, checkoutLayout, successUrl e cancelUrl. Para alterar itens e bumps use as rotas de itens e bumps.
Permissão: payment_link.write (chave secreta).
Endpoint
curl -X PATCH https://api.upag.dev/v1/payment-links/d4e5f6a7-b8c9-4d0e-9f1a-2b3c4d5e6f70 \
-H "Authorization: Bearer sk_test_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"couponEnabled": true,
"subscriptionData": {
"trial": { "interval": "day", "intervalCount": 14 }
}
}'
import { Upag } from 'upag';
const upag = new Upag('sk_test_your_api_key');
const link = await upag.paymentLinks.update('d4e5f6a7-b8c9-4d0e-9f1a-2b3c4d5e6f70', {
couponEnabled: true,
subscriptionData: { trial: { interval: 'day', intervalCount: 14 } }, // trial: null remove o trial
});
Em produção use
https://api.upag.io/v1 com sk_live_....Parâmetros
string (uuid)
required
ID do link de pagamento.
string
1 a 255 caracteres.
string | null
Descrição.
string (uuid) | null
ID de um layout de checkout da conta.
string[]
pix e/ou card (mínimo 1).string
auto, required ou none.string (url) | null
URL de sucesso.
string (url) | null
URL de cancelamento.
boolean
Ativa ou desativa o link.
boolean
Permite o comprador aplicar cupons.
object
trial ({ interval, intervalCount } ou null para remover) e/ou trialSettings.endBehavior.missingPaymentMethod (create_invoice ou cancel). Campos omitidos mantêm o valor atual.string
always ou if_required.Resposta
200 OK
Response
{
"id": "d4e5f6a7-b8c9-4d0e-9f1a-2b3c4d5e6f70",
"name": "Plano Pro com trial",
"description": null,
"checkoutLayout": null,
"active": true,
"amount": 4990,
"url": "https://checkout.upag.io/buy/Xk3mPq9RtVw2Zd7B",
"paymentMethods": ["pix", "card"],
"couponEnabled": true,
"billingAddressCollection": "auto",
"successUrl": "https://example.com/obrigado",
"cancelUrl": null,
"subscriptionData": {
"trial": { "interval": "day", "intervalCount": 14 },
"trialSettings": { "endBehavior": { "missingPaymentMethod": "cancel" } }
},
"paymentMethodCollection": "always",
"items": [
{
"id": "e5f6a7b8-c9d0-4e1f-8a2b-3c4d5e6f7a81",
"product": "0b9c1f3e-6a4d-4c1e-9d55-3f1f6a7c2e10",
"price": "5f2d7a90-3b1c-4e8a-8f6d-1c9e4b7a2d33",
"quantity": 1,
"amount": 4990
}
],
"bumps": [],
"createdAt": "2026-03-18T11:20:00.000Z",
"updatedAt": "2026-03-18T12:30:00.000Z"
}
404—PAYMENT_LINK_NOT_FOUNDouCHECKOUT_LAYOUT_NOT_FOUND.400— alterações de trial ou métodos que violem as regras de consistência.