Atualizar bump do link
curl --request PATCH \
--url https://api.upag.io/v1/payment-links/{paymentLinkId}/bumps/{bumpId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"price": {},
"quantity": 123,
"amount": 123,
"title": {},
"description": {}
}
'const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({price: {}, quantity: 123, amount: 123, title: {}, description: {}})
};
fetch('https://api.upag.io/v1/payment-links/{paymentLinkId}/bumps/{bumpId}', 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}/bumps/{bumpId}';
const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({price: {}, quantity: 123, amount: 123, title: {}, description: {}})
};
fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error(err));Links de pagamento
Atualizar bump do link
Altera preço, quantidade, valor, título ou descrição de um bump
PATCH
https://api.upag.io
/
v1
/
payment-links
/
{paymentLinkId}
/
bumps
/
{bumpId}
Atualizar bump do link
curl --request PATCH \
--url https://api.upag.io/v1/payment-links/{paymentLinkId}/bumps/{bumpId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"price": {},
"quantity": 123,
"amount": 123,
"title": {},
"description": {}
}
'const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({price: {}, quantity: 123, amount: 123, title: {}, description: {}})
};
fetch('https://api.upag.io/v1/payment-links/{paymentLinkId}/bumps/{bumpId}', 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}/bumps/{bumpId}';
const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({price: {}, quantity: 123, amount: 123, title: {}, description: {}})
};
fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error(err));Permissão:
payment_link.write (chave secreta).
Endpoint
curl -X PATCH https://api.upag.dev/v1/payment-links/d4e5f6a7-b8c9-4d0e-9f1a-2b3c4d5e6f70/bumps/f6a7b8c9-d0e1-4f2a-9b3c-4d5e6f7a8b92 \
-H "Authorization: Bearer sk_test_your_api_key" \
-H "Content-Type: application/json" \
-d '{ "amount": 1990, "title": "Adicione o guia de boas práticas" }'
import { Upag } from 'upag';
const upag = new Upag('sk_test_your_api_key');
// upag.paymentLinks.updateBump(paymentLinkId, bumpId, params)
const bump = await upag.paymentLinks.updateBump(
'd4e5f6a7-b8c9-4d0e-9f1a-2b3c4d5e6f70',
'f6a7b8c9-d0e1-4f2a-9b3c-4d5e6f7a8b92',
{ amount: 1990, title: 'Adicione o guia de boas práticas' },
);
Em produção use
https://api.upag.io/v1 com sk_live_....Parâmetros
string (uuid)
required
ID do link de pagamento.
string (uuid)
required
ID do bump.
string (uuid)
Novo preço.
integer
Nova quantidade (≥ 1).
integer
Novo valor em centavos (≥ 0).
string | null
Título (até 255 caracteres) ou
null.string | null
Descrição ou
null.Resposta
200 OK
Response
{
"id": "f6a7b8c9-d0e1-4f2a-9b3c-4d5e6f7a8b92",
"product": "1c0d2e4f-7b5e-4d2f-8e66-4a2a7b8d3f21",
"price": "6a3e8b01-4c2d-4f9b-9a7e-2d0f5c8b3e44",
"quantity": 1,
"amount": 1990,
"title": "Adicione o guia de boas práticas",
"description": "Oferta única, só neste checkout"
}
404—PAYMENT_LINK_NOT_FOUND,PAYMENT_LINK_BUMP_NOT_FOUND,PRICE_NOT_FOUNDouPRODUCT_NOT_FOUND.400— violação das regras de consistência (veja a referência).