curl --request POST \
--url https://api.example.com/organizations/{organizationId}/invoices/{invoiceId}/pay \
--header 'Authorization: <authorization>' \
--header 'Content-Type: application/json' \
--data '
{
"paymentMethodId": "<string>"
}
'{
"statusCode": 400,
"message": "Bad Request Error",
"errors": [{"message": "required", "path": "field"}]
}
Processar pagamento de uma fatura aberta ou com falha usando um metodo de pagamento especifico.
curl --request POST \
--url https://api.example.com/organizations/{organizationId}/invoices/{invoiceId}/pay \
--header 'Authorization: <authorization>' \
--header 'Content-Type: application/json' \
--data '
{
"paymentMethodId": "<string>"
}
'{
"statusCode": 400,
"message": "Bad Request Error",
"errors": [{"message": "required", "path": "field"}]
}
curl -X POST https://api.awsales.io/studio/organizations/ORG_ID/invoices/INVOICE_ID/pay \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"paymentMethodId": "pm_abc123"
}'
OPEN ou PAYMENT_FAILED podem ser pagas. Tentar pagar uma fatura ja paga ou anulada retornara 409 invoice.not_payable.invoice:pay.CARD.BOLETO.{
"statusCode": 400,
"message": "Bad Request Error",
"errors": [{"message": "required", "path": "field"}]
}
| Status | Codigo | Descricao |
|---|---|---|
400 | validation_error | Entrada invalida ou campos obrigatorios ausentes |
401 | unauthorized | Autenticacao ausente ou invalida |
403 | forbidden | Permissoes insuficientes |
404 | organization.not_found | Organizacao nao encontrada |
404 | invoice.not_found | Fatura nao encontrada |
409 | invoice.not_payable | Fatura nao esta em estado pagavel |
500 | internal_server_error | Ocorreu um erro inesperado |