Excluir cliente
curl --request DELETE \
--url https://api.upag.io/v1/customers/{customerId} \
--header 'Authorization: Bearer <token>'const options = {method: 'DELETE', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.upag.io/v1/customers/{customerId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));const url = 'https://api.upag.io/v1/customers/{customerId}';
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));Clientes
Excluir cliente
Remove um cliente da conta
DELETE
https://api.upag.io
/
v1
/
customers
/
{customerId}
Excluir cliente
curl --request DELETE \
--url https://api.upag.io/v1/customers/{customerId} \
--header 'Authorization: Bearer <token>'const options = {method: 'DELETE', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.upag.io/v1/customers/{customerId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));const url = 'https://api.upag.io/v1/customers/{customerId}';
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));Exclui o cliente (exclusão lógica). Ele deixa de aparecer em consultas e listagens; cobranças que já o referenciam continuam apontando para ele.
Permissão:
customer.write. Apenas chave secreta (sk_…).
Os exemplos usam o sandbox (
https://api.upag.dev/v1). Em produção use https://api.upag.io/v1 com sk_live_….Endpoint
curl -X DELETE https://api.upag.dev/v1/customers/8c1f0a26-5d3b-4f1e-9c72-1a4e6b9d0f83 \
-H "Authorization: Bearer sk_test_your_api_key"
import { Upag } from 'upag';
const upag = new Upag('sk_test_your_api_key');
await upag.customers.delete('8c1f0a26-5d3b-4f1e-9c72-1a4e6b9d0f83');
Parâmetros
string (uuid)
required
ID do cliente.
Resposta
204 No Content, sem corpo.
Erros
| Status | Mensagem | Causa |
|---|---|---|
404 | Customer not found | Cliente inexistente, já excluído (a segunda exclusão retorna 404) ou de outra conta |
422 | VALIDATION_FAILED | customerId não é UUID |