Adicionar bump ao link
curl --request POST \
--url https://api.upag.io/v1/payment-links/{paymentLinkId}/bumps \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"price": {}
}'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({price: {}})
};
fetch('https://api.upag.io/v1/payment-links/{paymentLinkId}/bumps', 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';
const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({price: {}})
};
fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error(err));Links de pagamento
Adicionar bump ao link
Adiciona uma oferta adicional (order bump) ao link de pagamento
POST
https://api.upag.io
/
v1
/
payment-links
/
{paymentLinkId}
/
bumps
Adicionar bump ao link
curl --request POST \
--url https://api.upag.io/v1/payment-links/{paymentLinkId}/bumps \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"price": {}
}'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({price: {}})
};
fetch('https://api.upag.io/v1/payment-links/{paymentLinkId}/bumps', 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';
const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({price: {}})
};
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 POST https://api.upag.dev/v1/payment-links/d4e5f6a7-b8c9-4d0e-9f1a-2b3c4d5e6f70/bumps \
-H "Authorization: Bearer sk_test_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"price": "6a3e8b01-4c2d-4f9b-9a7e-2d0f5c8b3e44",
"amount": 1990,
"title": "Adicione o guia de boas práticas",
"description": "Oferta única, só neste checkout"
}'
import { Upag } from 'upag';
const upag = new Upag('sk_test_your_api_key');
// upag.paymentLinks.createBump(paymentLinkId, params)
const bump = await upag.paymentLinks.createBump('d4e5f6a7-b8c9-4d0e-9f1a-2b3c4d5e6f70', {
price: '6a3e8b01-4c2d-4f9b-9a7e-2d0f5c8b3e44',
amount: 1990,
title: 'Adicione o guia de boas práticas',
description: 'Oferta única, só neste checkout',
});
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 preço oferecido no bump.
integer
default:"1"
Quantidade (≥ 1).
integer
Valor do bump em centavos (≥ 0). Padrão: valor do preço ×
quantity.string | null
Título exibido no checkout (até 255 caracteres).
string | null
Descrição exibida no checkout.
Resposta
201 Created
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,PRICE_NOT_FOUNDouPRODUCT_NOT_FOUND.400—PAYMENT_LINK_CURRENCY_MISMATCH(o bump deve ter a mesma moeda dos itens).