-
Notifications
You must be signed in to change notification settings - Fork 0
Withdrawals
Ronaldo Meneguite edited this page Jul 4, 2018
·
1 revision
GET/v1/gateway-units/{unit}/withdrawals - Retorna a listagem dos saque de uma unidade de negócioGET/v1/gateway-units/{unit}/withdrawals/{hash} - Retorna os detalhes de saque para uma unidade de negócio por seu identificadorPOST/v1/gateway-units/{unit}/withdrawals - Cadastra um saque para uma unidade no gatewayPATCH/v1/gateway-units/{unit}/withdrawals/{hash}/cancel - Cancela uma solicitação de saque para uma unidade de negócio
Required Permission: withdrawals.list
[
{
"name": "Authorization",
"in": "header",
"type": "string",
"required": true,
"description": "Token válido"
},
{
"name": "unit",
"in": "path",
"type": "string",
"required": true,
"description": "Identificador da unidade de negócio"
},
{
"name": "type",
"in": "query",
"type": "list",
"required": false,
"accepted": ["BANK", "WALLET", "PREPAID_CARD"],
"description": "Tipo de conta do saque"
},
{
"name": "limit",
"in": "query",
"type": "number",
"required": false,
"description": "Limite de registros por página",
"default": 10
},
{
"name": "orderBy",
"in": "query",
"type": "string",
"required": false,
"description": "Campo referência para a ordenação",
"default": "id"
},
{
"name": "orderByDirection",
"in": "query",
"type": "list",
"accepted": ["asc", "desc"],
"required": false,
"description": "Direção da ordenação",
"default": "desc"
},
{
"name": "include",
"in": "query",
"type": "string",
"accepted": ["unit", "user", "account", "receipt", "transfers", "transactions"],
"required": false,
"description": "Inclui relacionamentos separados por virgula"
},
{
"name": "filters",
"in": "query",
"type": "array[json]",
"required": false,
"description": "Inclui um array com os filtros avançados para limitar a listagem",
"definition": [
{
"name": "field",
"type": "string",
"required": true,
"description": "Nome do campo a ser usado no filtro",
"example": "status"
},
{
"name": "operation",
"type": "list",
"required": true,
"accepted": ["=", ">", ">=", "<", "<=", "<>", "in", "nin"],
"description": "Operação a ser utilizada na comparação do filtro",
"example": "="
},
{
"name": "value",
"type": "string|array",
"required": true,
"description": "Valor para o filtro",
"example": "name"
}
]
}
]{
"limit": "2",
"orderBy": "created_at",
"orderByDirection": "desc",
"include": "user,unit,account,receipt,transfers,transactions",
"filters": [
{"field": "status", "operation": "=", "value": "FINISHED"}
]
}Resultando em uma url como:
https://sandbox.hashlee.com/v1/gateway-units/vojvzo/withdrawals?limit=10&orderBy=id&orderByDirection=asc&filters[]={"field":"status", "operation":"=","value":"FINISHED"}&include=user,unit,account,receipt,transfers,transactions
{
"data": [
{
"hash": "70e00550-06f2-4a37-84bb-8d7f30dc1eac",
"gateway_unit_id": "vojvzo",
"user_id": "oqrwgk",
"receipt_id": null,
"currency": "BTC",
"amount": "259180.80032041",
"fee": "0.53333096",
"net_amount": "259181.33365137",
"status": "FINISHED",
"identify": "9fc80af5-b845-427f-9064-e5eaed6e843f",
"description": "Quia perspiciatis ab facere corrupti.",
"verified_at": null,
"finished_at": "2018-05-26T12:11:16-03:00",
"created_at": "2018-06-26T11:38:56-03:00",
"updated_at": "2018-06-26T11:38:56-03:00"
}
],
"meta": {
"pagination": {
"total": 61,
"count": 2,
"per_page": 2,
"current_page": 1,
"total_pages": 31,
"links": {
"next": "https://sandbox.hashlee.com/v1/gateway-units/vojvzo/withdrawals?page=2"
}
}
}
}
{
"message":"Unauthorized"
}{
"message":"Exceeded the limit of attempts. Wait for 5 minutes for another try."
}
GET /v1/gateway-units/{unit}/withdrawals/{hash} - Retorna os detalhes de saque para uma unidade de negócio por seu identificador
Required Permission: withdrawals.show
[
{
"name": "Authorization",
"in": "header",
"type": "string",
"required": true,
"description": "Token válido"
},
{
"name": "unit",
"in": "path",
"type": "string",
"required": true,
"description": "Identificador da unidade de negócio"
},
{
"name": "hash",
"in": "path",
"type": "string",
"required": true,
"description": "Identificador do saque"
},
{
"name": "include",
"in": "query",
"type": "list",
"accepted": ["unit", "user", "account", "receipt", "transfers", "transactions"],
"required": false,
"description": "Inclui relacionamentos separados por virgula"
}
]{
"data": {
"hash": "70e00550-06f2-4a37-84bb-8d7f30dc1eac",
"gateway_unit_id": "vojvzo",
"user_id": "oqrwgk",
"receipt_id": null,
"currency": "BTC",
"amount": "259180.80032041",
"fee": "0.53333096",
"net_amount": "259181.33365137",
"status": "FINISHED",
"identify": "9fc80af5-b845-427f-9064-e5eaed6e843f",
"description": "Quia perspiciatis ab facere corrupti.",
"verified_at": null,
"finished_at": "2018-05-26T12:11:16-03:00",
"created_at": "2018-06-26T11:38:56-03:00",
"updated_at": "2018-06-26T11:38:56-03:00"
}
}{
"message": "Invalid identifier to requested resource"
}{
"message":"Unauthorized"
}{
"message":"Exceeded the limit of attempts. Wait for 5 minutes for another try."
}Required Permission: withdrawals.store
[
{
"name": "Authorization",
"in": "header",
"type": "string",
"required": true,
"description": "Token válido"
},
{
"name": "Signature",
"in": "header",
"type": "string",
"required": false,
"description": "Assinatura do usuário",
"comment": "Parâmetro obrigatório caso o 2fa não esteja habilitado para o usuário"
},
{
"name": "Code",
"in": "header",
"type": "string",
"required": false,
"description": "Código do 2fa para a conta",
"comment": "Parâmetro obrigatório caso o 2fa esteja habilitado para o usuário"
},
{
"name": "unit",
"in": "path",
"type": "string",
"required": true,
"description": "Identificador da unitdade do gateway"
},
{
"name": "gateway_unit_account_id",
"in": "formData",
"type": "string",
"required": true,
"description": "Identificador da conta a proceder com o saque"
},
{
"name": "currency",
"in": "formData",
"type": "list",
"accepted": ["BRL", "BTC"],
"required": true,
"description": "Identificador moeda para a conta"
},
{
"name": "net_amount",
"in": "formData",
"type": "number",
"required": true,
"description": "Valor líquido esperado para o saque"
},
{
"name": "description",
"in": "formData",
"type": "string",
"required": false,
"description": "Descrição a ser salva junto a solicitação"
}
]{
"gateway_unit_account_id": "jqozmk",
"currency": "BRL",
"net_amount": "100.00",
"description": ""
}{
"data": {
"hash": "eea55e84-33e9-4bf1-a6ea-a6f853c801c7",
"gateway_unit_id": "vojvzo",
"user_id": "jqozmk",
"receipt_id": null,
"withdrawal_profile_id": "jqozmk",
"gateway_unit_account_id": "jqozmk",
"currency": "BRL",
"amount": "105.00000000",
"fee": "5.00000000",
"net_amount": "100.00000000",
"status": "OPEN",
"identify": null,
"description": null,
"verified_at": null,
"finished_at": null,
"created_at": "2018-06-28T12:44:30-03:00",
"updated_at": "2018-06-28T12:44:30-03:00"
}
}{
"message": "The given data was invalid.",
"errors": {
"currency": [
"The currency field is required."
],
"net_amount": [
"The net_amount field is required."
]
}
}{
"message":"Unauthorized"
}{
"message":"Exceeded the limit of attempts. Wait for 5 minutes for another try."
}
PATCH /v1/gateway-units/{unit}/withdrawals/{hash}/cancel - Cancela uma solicitação de saque para uma unidade de negócio
Required Permission: withdrawals.cancel
** Só é permitido o cancelamento de um saque que esteja com o status igual 'OPEN', salvo usuários internos que podem solicitar quando já estiver como 'PENDING' ou 'EXPORTED'
[
{
"name": "Authorization",
"in": "header",
"type": "string",
"required": true,
"description": "Token válido"
},
{
"name": "unit",
"in": "path",
"type": "string",
"required": true,
"description": "Identificador da unidade de negócio"
},
{
"name": "hash",
"in": "path",
"type": "string",
"required": true,
"description": "Identificador do saque"
}
]{
}{
"message": "Invalid identifier to requested resource"
}{
"message":"Unauthorized"
}{
"message":"Exceeded the limit of attempts. Wait for 5 minutes for another try."
}{
"message": "Error on process your request"
}