Skip to main content

Requests

  • JSON in, JSON out. Send request bodies as JSON with Content-Type: application/json.
  • Flat resources. Every resource is a top-level path, such as /employees. The employer is a parameter, not part of the path.
  • POST creates and updates. POST /employees creates one and POST /employees/{id} updates it. An update changes the fields you send and leaves the rest alone.
  • snake_case for every path, parameter, field and enum value.

Objects

Every object has these fields: A field with no value is returned as null, not left out.

ID prefixes

Treat IDs as opaque strings of up to 64 characters.

External IDs

Employers, pay schedules, employees and payrolls take an external_id: your own identifier for the same thing. Hammock enforces uniqueness (across your employers for an employer, and within one employer for the rest) and lets you look objects up by it. A duplicate returns external_id_taken.

Data formats

Pay dates, lock dates and other calendar dates are plain dates. Business-day arithmetic uses US bank holidays.

Metadata

Employers, employees and payrolls accept metadata: up to 50 key-value pairs for your own use. Keys are up to 40 characters and values up to 500, and both are strings. Hammock stores metadata and returns it, and never acts on it. Don’t put sensitive data in it. To remove a key, send it with an empty string.

Request IDs

Every response has a Request-Id header, and every error repeats it as request_id. Log it, and include it when you contact Hammock about a request.

Rate limits

Each API key can make 25 requests per second. Beyond that, requests return 429 with the code rate_limit and a Retry-After header giving the seconds to wait. Retry with exponential backoff. The sandbox has the same limit.