Criar
POST
/cashouts
Você pode usar essa rota para criar um cashout.
Fields
Nome | Tipo | Descrição | Obrigatório |
---|---|---|---|
external_id | string | Identificador externo | Sim |
amount | number | Valor inteiro que representa o valor do cashout | Sim |
payee | object | Dados do pagador | Sim |
payee.name | string | Nome do pagador | Sim |
payee.document | string | Documento do pagador (CPF ou CNPJ) | Sim |
dict_key | object | Dados da chave do recebedor | Sim |
dict_key.value | object | Chave do recebedor | Sim |
Exemplo de Payload
- Minimo
- Completo
{
"external_id": "71900d60-0ec6-4f48-a966-92c8a03198",
"amount": 50,
"dict_key": {
"value": "12345679810"
}
}
{
"external_id": "71900d60-0ec6-4f48-a966-92c8a03198",
"amount": 50,
"payee": {
"name": "ZEMOBANK",
"document": "11223344556"
},
"dict_key": {
"value": "12345679810"
}
}
Aviso
- Certifique-se de inserir na chave 'número de telefone' o DDI (código do país, precedido pelo símbolo +), seguido pelo DDD e, por fim, o número do telefone. Exemplo: +5511999999999
Exemplo de Resposta
- 200 - Success
- 403 - Unauthorized/Forbidden
Status Code: 200
{
"status": "received",
"message": "cashout in processing",
"data": {
"cashout_id": "4245648248e24461818fe421ac7a02a1"
}
}
Observação
O cashout_id
retornado pode ser usado posteriormente para fazer buscas.
Status Code: 403
{
"status": "error",
"message": "Not Authorized"
}
Eventos
Após o cashout ser criado, os seguintes eventos serão disparados.
- RECEIVED
- CREATING
- CREATED
- TRANSFERRED
- ERROR_ON_CREATION
- TRANSFER_FAILED
{
"amount": 50,
"cashout_id": "4245648248e24461818fe421ac7a02a1",
"created_at": "2023-06-14T00:00:00.000",
"dict_type": "cpf",
"dict_value": "12345679810",
"external_id": "71900d60-0ec6-4f48-a966-92c8a03198",
"status": "RECEIVED",
"topic": "pix.cashout.received"
}
{
"amount": 50,
"cashout_id": "4245648248e24461818fe421ac7a02a1",
"created_at": "2023-06-14T00:00:00.000",
"dict_type": "cpf",
"dict_value": "12345679810",
"external_id": "71900d60-0ec6-4f48-a966-92c8a03198",
"status": "CREATING",
"topic": "pix.cashout.creating"
}
{
"amount": 50,
"cashout_id": "4245648248e24461818fe421ac7a02a1",
"created_at": "2023-06-14T00:00:00.000",
"dict_type": "cpf",
"dict_value": "12345679810",
"external_id": "71900d60-0ec6-4f48-a966-92c8a03198",
"payee_document": "***.123.456-**",
"payee_name": "ZEMOBANK",
"provider": "starkbank",
"provider_id": "6040249824182272",
"status": "CREATED",
"topic": "pix.cashout.created",
"updated_at": "2023-06-19T09:40:04.921"
}
Estado final
Não haverá mais mudanças no status desse cashout.
{
"amount": 50,
"cashout_id": "4245648248e24461818fe421ac7a02a1",
"created_at": "2023-06-14T00:00:00.000",
"dict_type": "cpf",
"dict_value": "12345679810",
"end2end": "E33944193212501251844So2aAcDlVu10",
"external_id": "71900d60-0ec6-4f48-a966-92c8a03198",
"provider": "starkbank",
"provider_id": "6040249824182272",
"status": "TRANSFERRED",
"topic": "pix.cashout.transferred",
"transfer_amount": 5,
"transfer_at": "2023-04-20T12:40:41",
"transfer_to_document": "***.123.456-**",
"transfer_to_name": "Zemo Bank",
"updated_at": "2023-06-19T09:40:04.921"
}
Estado final
Não haverá mais mudanças no status desse cashout.
{
"amount": 50,
"cashout_id": "4245648248e24461818fe421ac7a02a1",
"created_at": "2023-06-14T00:00:00.000",
"dict_type": "cpf",
"dict_value": "12345679810",
"error_reason": "invalid dict key",
"external_id": "71900d60-0ec6-4f48-a966-92c8a03198",
"payload": {
"external_id": "71900d60-0ec6-4f48-a966-92c8a03198",
"payee": {
"name": "ZEMOBANK",
"document": "11223344556"
},
"dict_key": {
"value": "12345679810",
"type": "cpf"
},
"amount": 50
},
"status": "ERROR_ON_CREATION",
"topic": "pix.cashout.error_on_creation"
}
Estado final
Não haverá mais mudanças no status desse cashout.
{
"amount": 50,
"cashout_id": "4245648248e24461818fe421ac7a02a1",
"external_id": "71900d60-0ec6-4f48-a966-92c8a03198",
"created_at": "2023-06-14T00:00:00.000",
"dict_type": "cpf",
"dict_value": "12345679810",
"status": "TRANSFER_FAILED",
"topic": "pix.cashout.transfer_failed",
"error_reason": "Invalid account type"
}