curl --request POST \
--url https://api.example.com/organizations/{organizationId}/payment-methods \
--header 'Authorization: <authorization>' \
--header 'Content-Type: application/json' \
--data '
{
"type": "<string>",
"cardToken": "<string>",
"isDefault": true,
"billingDetails": {
"name": "<string>",
"email": "<string>",
"phone": "<string>",
"address": {}
}
}
'{
"statusCode": 400,
"message": "Bad Request Error",
"errors": [{"message": "required", "path": "field"}]
}
Registrar um novo metodo de pagamento por cartao ou boleto para a organizacao.
curl --request POST \
--url https://api.example.com/organizations/{organizationId}/payment-methods \
--header 'Authorization: <authorization>' \
--header 'Content-Type: application/json' \
--data '
{
"type": "<string>",
"cardToken": "<string>",
"isDefault": true,
"billingDetails": {
"name": "<string>",
"email": "<string>",
"phone": "<string>",
"address": {}
}
}
'{
"statusCode": 400,
"message": "Bad Request Error",
"errors": [{"message": "required", "path": "field"}]
}
curl -X POST https://api.awsales.io/studio/organizations/ORG_ID/payment-methods \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"type": "CARD",
"cardToken": "tok_visa_4242",
"isDefault": false,
"billingDetails": {
"name": "John Doe",
"email": "john@example.com"
}
}'
409.payment_method:write.CARD, BOLETO.CARD.CARD ou BOLETO).CARD.CARD.CARD.CARD.{
"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 |
409 | payment_method.max_of_3_card_payment_methods_reached | Maximo de 3 metodos de pagamento por cartao atingido |
409 | payment_method.max_of_1_boleto_payment_methods_reached | Maximo de 1 metodo de pagamento por boleto atingido |
409 | payment_method.token_already_used | O token do metodo de pagamento ja foi utilizado |
500 | internal_server_error | Ocorreu um erro inesperado |