Remover item do link
curl --request DELETE \
--url https://api.upag.io/v1/payment-links/{paymentLinkId}/items/{itemId} \
--header 'Authorization: Bearer <token>'const options = {method: 'DELETE', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.upag.io/v1/payment-links/{paymentLinkId}/items/{itemId}', 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}/items/{itemId}';
const options = {method: 'DELETE', headers: {Authorization: 'Bearer <token>'}};
fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error(err));Links de pagamento
Remover item do link
Remove um item do link de pagamento
DELETE
https://api.upag.io
/
v1
/
payment-links
/
{paymentLinkId}
/
items
/
{itemId}
Remover item do link
curl --request DELETE \
--url https://api.upag.io/v1/payment-links/{paymentLinkId}/items/{itemId} \
--header 'Authorization: Bearer <token>'const options = {method: 'DELETE', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.upag.io/v1/payment-links/{paymentLinkId}/items/{itemId}', 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}/items/{itemId}';
const options = {method: 'DELETE', headers: {Authorization: 'Bearer <token>'}};
fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error(err));O último item de um link não pode ser removido.
Permissão:
payment_link.write (chave secreta).
Endpoint
curl -X DELETE https://api.upag.dev/v1/payment-links/d4e5f6a7-b8c9-4d0e-9f1a-2b3c4d5e6f70/items/e5f6a7b8-c9d0-4e1f-8a2b-3c4d5e6f7a81 \
-H "Authorization: Bearer sk_test_your_api_key"
import { Upag } from 'upag';
const upag = new Upag('sk_test_your_api_key');
// upag.paymentLinks.deleteItem(paymentLinkId, itemId)
await upag.paymentLinks.deleteItem(
'd4e5f6a7-b8c9-4d0e-9f1a-2b3c4d5e6f70',
'e5f6a7b8-c9d0-4e1f-8a2b-3c4d5e6f7a81',
);
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 item.
Resposta
204 No Content — sem corpo em caso de sucesso.
404—PAYMENT_LINK_NOT_FOUNDouPAYMENT_LINK_ITEM_NOT_FOUND.400(PAYMENT_LINK_LAST_ITEM) — o link precisa manter pelo menos um item. Adicione outro antes de remover.