Atualizar Sessão de Checkout
curl --request PUT \
--url https://api.billing.upag.io/v1/checkout-sessions/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"customerId": "<string>",
"items": [
{}
],
"paymentMethods": [
"<string>"
],
"successUrl": "<string>",
"cancelUrl": "<string>"
}
'const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
customerId: '<string>',
items: [{}],
paymentMethods: ['<string>'],
successUrl: '<string>',
cancelUrl: '<string>'
})
};
fetch('https://api.billing.upag.io/v1/checkout-sessions/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));const url = 'https://api.billing.upag.io/v1/checkout-sessions/{id}';
const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
customerId: '<string>',
items: [{}],
paymentMethods: ['<string>'],
successUrl: '<string>',
cancelUrl: '<string>'
})
};
fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error(err));Sessões de Checkout
Atualizar Sessão de Checkout
Atualiza os dados de uma sessão de checkout existente
PUT
https://api.billing.upag.io
/
v1
/
checkout-sessions
/
{id}
Atualizar Sessão de Checkout
curl --request PUT \
--url https://api.billing.upag.io/v1/checkout-sessions/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"customerId": "<string>",
"items": [
{}
],
"paymentMethods": [
"<string>"
],
"successUrl": "<string>",
"cancelUrl": "<string>"
}
'const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
customerId: '<string>',
items: [{}],
paymentMethods: ['<string>'],
successUrl: '<string>',
cancelUrl: '<string>'
})
};
fetch('https://api.billing.upag.io/v1/checkout-sessions/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));const url = 'https://api.billing.upag.io/v1/checkout-sessions/{id}';
const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
customerId: '<string>',
items: [{}],
paymentMethods: ['<string>'],
successUrl: '<string>',
cancelUrl: '<string>'
})
};
fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error(err));Atualiza uma sessão de checkout aberta. Todos os campos do body são opcionais no schema; envie apenas o que deseja alterar.
Endpoint
cURL
curl -X PUT https://api.billing.upag.io/v1/checkout-sessions/cs_abc123xyz \
-H "Authorization: Bearer {token}" \
-H "Content-Type: application/json" \
-d '{
"customerId": "cus_ahwDXrgYvur89iPs",
"items": [
{
"priceId": "price_def456ghi",
"quantity": 2
}
],
"paymentMethods": ["credit_card", "pix"],
"successUrl": "https://seusite.com/sucesso",
"cancelUrl": "https://seusite.com/cancelado"
}'
Parâmetros
string
required
ID único da sessão de checkout, começando com
cs_.string
Opcional. ID do cliente (
cus_...).array
Opcional. Se enviado, deve ter pelo menos um item com
priceId e quantity (mínimo 1).string[]
Opcional.
credit_card, pix.string
Opcional. URL válida de sucesso.
string
Opcional. URL válida de cancelamento.
Resposta
Response
{
"id": "cs_abc123xyz",
"status": "open",
"customerId": "cus_ahwDXrgYvur89iPs",
"url": "https://checkout.upag.io/cs_abc123xyz",
"billingAddressCollection": false,
"successUrl": "https://example.com/success",
"cancelUrl": "https://example.com/cancel",
"latitude": null,
"longitude": null,
"country": null,
"region": null,
"city": null,
"expiresAt": "2024-11-16T10:00:00.000Z",
"createdAt": "2024-11-15T10:00:00.000Z",
"updatedAt": "2024-11-15T11:00:00.000Z",
"items": []
}