hugo belém / software engineer

brazil • porto/pt

depoc api

api reference

introduction

Here you'll find comprehensive documentation and resources to help you build and integrate with the Depoc API.

conventions

The base URL to send all API requests is https://api.depoc.com.br. HTTPS is required for all API requests.

The Depoc API follows RESTful conventions when possible, with most operations performed via GET, POST, PATCH, and DELETE, requests on page and database resources. Request and response bodies are encoded as JSON.

json conventions

Top-level resources are wrapped by a single root property whose name identifies the resource type (e.g. user, owner). This root property can be used to determine the type of the resource.

Top-level resources are addressable by a ULID id, property.

Property names are in snake_case(not camelCase, or kebab-case).

Temporal values (dates and datetimes) are encoded in ISO 8601 strings. Datetimes will include the time value (2020-08-12T02:12:33.231Z) while dates will include only the date (2020-08-12).

pagination

Endpoints that may return large datasets support offset pagination requests. By default, Depoc returns 50 items per API call. If the number of items in a response from a support endpoint exceeds the default, then an integration can use pagination to request the next pages of the resource.

supported endpoints

GET
endpoint
/contact
/contact/customer
/contact/supplier
/finance/accounts
/finance/categories
/finance/transactions
/members
/products
/products/categories
/products/costs
/products/inventory
/products/inventory/transactions
/payables
/receivables
/orders

responses

If an endpoint supports pagination, then the response object contains the fields

fieldtypedescription
countnumberThe number items included in the results.
nextstring | nullLink the the next page if any.
previousstring | nullLink the the previous page if any.
resultsarrayThe list, or partial list, of endpoint-specific results.

request limits

To ensure a consistent developer experience for all API users, the Depoc API is rate limited.

rate limit

Rate-limited requests will return "detail": "Request was throttled. Expected available in X seconds." (HTTP response status 429).The rate limit for incoming requests per integration is an average of 60 requests per minute.

status codes

Responses from the API use HTTP response codes to indicate general classes of success and error.

sucess codes

http status codedescription
200Successfully processed the request.
201Resource created Successfully.
204Request succeeded, no data returned.

error codes

http status codedescription
400• Validation error.
• Invalid request.
• Invalid JSON.
401The bearer token is not valid.
403Client doesn't have permission to perform this operation.
404Resource does not exist.
405Method not allowed.
429This request exceeds the number of requests allowed.
500An unexpected error occurred.

authentication

Requests use the HTTP Authorization header to both authenticate and authorize operations. The Depoc API accepts bearer tokens in this header.

objects

user

Authorization Bearer Token

GET retrieve current user

https://api.acoh.com.br/me

request

curl

curl -H "Authorization: Bearer TOKEN" https://api.acoh.com.br/me

response

json
{
"user": {
"id": "01JM68P43G7QPHF07X67P0REAS",
"name": "Hugo",
"email": "hugo@acoh.com.br",
"username": "hugo",
"is_active": true,
"is_staff": true,
"last_login": "2025-04-29T20:23:39.909901-03:00",
"date_joined": "2025-02-15T23:16:34.529502-03:00"
}
}

POST create account

https://api.acoh.com.br/accounts

request

curl
curl -X POST https://api.acoh.com.br/accounts \
  -H "Authorization: Bearer TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "nome": "Hugo",
    "email": "hugo@acoh.com.br",
    "username": "hugo"
  }'

response

json
{
"user": {
"id": "01JM68P43G7QPHF07X67P0REAS",
"name": "Hugo",
"email": "hugo@acoh.com.br",
"username": "hugo",
"is_active": true,
"is_staff": true,
"last_login": "2025-04-29T20:23:39.909901-03:00",
"date_joined": "2025-02-15T23:16:34.529502-03:00"
}
}