Contas

API de gestão de contas digitais

A rota da API para sandbox é: https://apigw-sandbox.zoop.ws

get
Listagem de contas digitais

https://api-beta.zoop.ws/v2/marketplaces/:marketplace_id/accounts
Este serviço retorna uma listagem paginada de contas digitais cadastradas em um determinado marketplace
Request
Response
Request
Path Parameters
marketplace_id
required
string
ID do marketplace
Query Parameters
offset
optional
number
Determina o ponto de inicio dos registros retornados
limit
optional
number
Quantidade máxima de itens por página (<100)
Response
200: OK
Listagem de contas realizado com sucesso
{
"items": [
{
"id": "942e0d178dd64644b2eb054705268c94",
"holder": "803b1b5a52894201b2a034caaf3f2cce",
"balance": "0.00",
"currency": "BRL",
"routing_number": "001",
"number": "80428948",
"status": "active",
"metadata": {},
"created_at": "2019-07-18T22:39:22.440745",
"updated_at": "2019-08-06T22:07:41.73356",
"primary": true,
"uri": "/v2/marketplaces/303102c1161c450f94d72b30f9903f89/accounts/942e0d178dd64644b2eb054705268c94",
"resource": "payment_account"
},
{
"id": "d872d729796146d48df82cd94f326adb",
"holder": "803b1b5a52894201b2a034caaf3f2cce",
"balance": 0,
"currency": "BRL",
"routing_number": "001",
"number": "14322117",
"status": "active",
"metadata": {},
"created_at": "2019-07-18T22:39:22.440751",
"updated_at": "2019-08-06T22:07:41.729463",
"primary": false,
"uri": "/v2/marketplaces/303102c1161c450f94d72b30f9903f89/accounts/d872d729796146d48df82cd94f326adb",
"resource": "payment_account"
}
],
"has_more": true,
"limit": 2,
"total_pages": 214,
"page": 6,
"offset": 10,
"total": "427",
"query_count": "427"
}
401: Unauthorized
403: Forbidden
404: Not Found
Indica que algum recurso não foi encontrado
{
"status": "not_found",
"type": "not_found",
"code": 3000,
"message": "Marketplace not found",
"category": "business",
"status_code": 404
}
500: Internal Server Error
Indica que a requisição acarretou em algum problema interno no servidor
{
"status": "internal_server_error",
"type": "server_error",
"code": 9999,
"message": "Internal Server Error",
"category": "unexpected",
"status_code": 500
}
503: Service Unavailable
Indica que o serviço alvo está indisponível no momento
{
"status": "service_unavailable",
"type": "service_unavailable",
"code": 9998,
"message": "Service Unavailable",
"category": "unexpected",
"status_code": 503
}

post
Criação de conta digital

https://api-beta.zoop.ws/v2/marketplaces/:marketplace_id/holders/:holder_id/accounts
Este serviço permite a criação de uma conta digital para um usuário final cadastrado previamente através do recurso de holders.
Request
Response
Request
Path Parameters
holder_id
required
string
ID do usuário final portador da conta digital
marketplace_id
required
string
ID do marketplace
Headers
Content-Type
required
string
application/json
Body Parameters
currency
optional
string
moeda (default: BRL)
metadata
optional
object
Metadados associados ao documento dono da conta
Response
201: Created
{
"id": "496a00f3ab5b4fe7ac8351d449e5fd1f",
"holder_id": "646cec9816fe4610b0e799a988aa6f74",
"balance": "0.00",
"currency": "BRL",
"number": "54081927",
"routing_number": "001",
"status": "active",
"primary": false,
"resource": "payment_account",
"uri": "/v2/marketplaces/303102c1161c450f94d72b30f9903f89/accounts/496a00f3ab5b4fe7ac8351d449e5fd1f",
"created_at": "2019-08-12T19:26:48.334027",
"updated_at": "2019-08-12T19:26:48.334027",
"metadata": {}
}
400: Bad Request
{
"status": "bad_request",
"type": "invalid_request",
"message": "Invalid JSON.",
"category": "business",
"status_code": 400
}
401: Unauthorized
403: Forbidden
404: Not Found
Indica que algum recurso não foi encontrado
{
"status": "not_found",
"type": "not_found",
"code": 3000,
"message": "Marketplace not found",
"category": "business",
"status_code": 404
}
412: Precondition Failed
Indica que algum pré-requisito de estado do sistema não foi atendido
{
"status": "precondition_failed",
"type": "invalid_request",
"code": 4000,
"message": "Maximum entry count allowed reached",
"category": "business",
"status_code": 412
}
500: Internal Server Error
Indica que a requisição acarretou em algum problema interno no servidor
{
"status": "internal_server_error",
"type": "server_error",
"code": 9999,
"message": "Internal Server Error",
"category": "unexpected",
"status_code": 500
}
503: Service Unavailable
Indica que o serviço alvo está indisponível no momento
{
"status": "service_unavailable",
"type": "service_unavailable",
"code": 9998,
"message": "Service Unavailable",
"category": "unexpected",
"status_code": 503
}

get
Recuperar detalhes de uma conta digital

https://api-beta.zoop.ws/v2/marketplaces/:marketplace_id/accounts/:account_id
Este serviço retorna os detalhes de uma conta digital
Request
Response
Request
Path Parameters
account_id
required
string
ID da conta digital
marketplace_id
required
string
ID do marketplace
Response
200: OK
{
"id": "496a00f3ab5b4fe7ac8351d449e5fd1f",
"holder_id": "646cec9816fe4610b0e799a988aa6f74",
"balance": "0.00",
"currency": "BRL",
"number": "54081927",
"routing_number": "001",
"status": "active",
"primary": false,
"resource": "payment_account",
"uri": "/v2/marketplaces/303102c1161c450f94d72b30f9903f89/accounts/496a00f3ab5b4fe7ac8351d449e5fd1f",
"created_at": "2019-08-12T19:26:48.334027",
"updated_at": "2019-08-12T19:26:48.334027",
"metadata": {}
}
401: Unauthorized
403: Forbidden
404: Not Found
Erro em caso de conta não existente
{
"status": "not_found",
"type": "not_found",
"message": "Account with status active and id 0162893710a6495e86542eeff192baa1 not found in marketplace ceaeaa4a-f6d6-4d2d-a22a-da2944ceead6",
"category": "business",
"status_code": 404
}

get
Listagem de contas digital por usuário

https://api-beta.zoop.ws/v2/marketplaces/:marketplace_id/holders/:holder_id/accounts
Serviço que lista todas as contas digitais cadastradas em nome de um usuário final portador
Request
Response
Request
Path Parameters
holder_id
required
string
ID do usuário final portador de conta digital
marketplace_id
required
string
ID do marketplace
Query Parameters
limit
optional
number
Quantidade máxima de itens por página (<100)
offset
optional
number
Cursor que identifica o início da paginação
Response
200: OK
Retorno de listagem paginada de contas por usuário
{
"items": [
{
"id": "496a00f3ab5b4fe7ac8351d449e5fd1f",
"holder_id": "646cec9816fe4610b0e799a988aa6f74",
"balance": "0.00",
"currency": "BRL",
"number": "54081927",
"routing_number": "001",
"status": "active",
"primary": false,
"resource": "payment_account",
"uri": "/v2/marketplaces/303102c1161c450f94d72b30f9903f89/accounts/496a00f3ab5b4fe7ac8351d449e5fd1f",
"created_at": "2019-08-12T19:26:48.334027",
"updated_at": "2019-08-12T19:26:48.334027",
"metadata": {}
}
],
"has_more": false,
"limit": 50,
"total_pages": 1,
"page": 1,
"offset": 0,
"total": "1",
"query_count": "1"
}

get
Extrato de operações por conta

https://api-beta.zoop.ws/v2/marketplaces/:marketplace_id/accounts/:account_id/operations
Serviço que retorna o extrato de operações de um conta digital a partir de uma listagem paginada lançamentos de conta
Request
Response
Request
Path Parameters
account_id
required
string
ID da conta digital
marketplace_id
required
string
ID do marketplace
Query Parameters
type
optional
string
Retorna lançamentos onde o tipo da operação seja igual a um dos valores informado. O valor pode ser uma string ou uma lista de valores concatenados por ', '. (ex: charge, charge_refunded, transfer, transfer_refunded, deposit, deposit_refunded, adjustment)
created_date_range
optional
string
Retorna lançamentos onde a data for igual o valor informado. O valor pode ser uma string com um horário em UTC timestamp ou ISO (YYYY-DD-MM HH:MM:SS), ou pode ser uma lista com os parâmetros a seguir.
created_date_range[gt]
optional
string
Retorna lançamentos onde a data for maior o valor informado
created_date_range[gte]
optional
string
Retorna lançamentos onde a data for maior ou igual o valor informado
created_date_range[lt]
optional
string
Retorna lançamentos onde a data for menor o valor informado
created_date_range[lte]
optional
string
Retorna lançamentos onde a data for menor ou igual o valor informado
offset
optional
string
Cursor que identifica o inicio da paginação
limit
optional
number
Limita o número de objetos retornados, podendo ser entre 1 e 100 máxima de itens por página
Response
200: OK
{
"resource": "list",
"uri": "/v2/marketplaces/303102c1161c450f94d72b30f9903f89/accounts/496a00f3ab5b4fe7ac8351d449e5fd1f/operations",
"items": {
"2019-08-14": {
"items": [
{
"id": "b5f7537b76684ef4b0a4fbf91936219a",
"date": "2019-08-14T18:04:33+00:00",
"amount": "-0.01",
"gross_amount": "-0.01",
"blocked_amount": "0.00",
"current_balance": "2.09",
"resource": "entry",
"nsu": "4",
"fee": "0.00",
"description": "teste de transferência entre contas",
"type": "transfer",
"object_id": "6ea854d7d1eb4befb194268f28a23d1a",
"object_type": "transfer",
"transfer": {
"id": "b5f7537b76684ef4b0a4fbf91936219a",
"authorization_code": "fba84c9292024c9f9b375998a0925b4f"
}
},
{
"id": "cb32a9c186804962816b152b742025b4",
"date": "2019-08-14T18:27:55+00:00",
"amount": "1.00",
"gross_amount": "1.00",
"blocked_amount": "0.00",
"current_balance": "2.10",
"resource": "entry",
"nsu": "3",
"fee": "0.00",
"description": "saldo positivo",
"type": "charge",
"object_id": "cb32a9c186804962816b152b742025b4",
"object_type": "transfer",
"transaction": {
"id": "cb32a9c186804962816b152b742025b4",
"authorization_code": "cb32a9c186804962816b152b742025b4"
}
},
{
"id": "cb2a0ed4ead9473c9b304d560ab83107",
"date": "2019-08-14T18:27:55+00:00",
"amount": "1.00",
"gross_amount": "1.00",
"blocked_amount": "0.00",
"current_balance": "1.10",
"resource": "entry",
"nsu": "2",
"fee": "0.00",
"description": "saldo positivo",
"type": "charge",
"object_id": "cb2a0ed4ead9473c9b304d560ab83107",
"object_type": "transfer",
"transaction": {
"id": "cb2a0ed4ead9473c9b304d560ab83107",
"authorization_code": "cb2a0ed4ead9473c9b304d560ab83107"
}
},
{
"id": "75dd8b3498d0488eafcdd5a6bd75c9c8",
"date": "2019-08-14T18:27:55+00:00",
"amount": "0.10",
"gross_amount": "0.10",
"blocked_amount": "0.00",
"current_balance": "0.10",
"resource": "entry",
"nsu": "1",
"fee": "0.00",
"description": "saldo positivo",
"type": "charge",
"object_id": "75dd8b3498d0488eafcdd5a6bd75c9c8",
"object_type": "transfer",
"transaction": {
"id": "75dd8b3498d0488eafcdd5a6bd75c9c8",
"authorization_code": "75dd8b3498d0488eafcdd5a6bd75c9c8"
}
}
],
"currentBalance": "2.09"
}
},
"has_more": false,
"limit": 50,
"total_pages": 1,
"page": 1,
"offset": 0,
"total": "4",
"query_count": "4"
}