Skip to content

Developers

API reference

Every endpoint, scope and webhook event, generated from the OpenAPI file the API is tested against, so it always matches.

Base URL
https://demurly.com
Endpoints
42
API version
v1
On this page

Demurly records demurrage for fuel carriers and fuel buyers: the driver's wait at the terminal or the drop, with GPS, timestamps and photos, sent as a charge the buyer reviews, approves and pays. This API lets your own systems read and write those records.

What the API covers

Endpoints under /api/v1 for your organization's records, drivers (carriers only), terminals, connections and saved reports (a feed for Power BI, Excel and Tableau). Carriers can report finished waits from their own systems and send records; fuel buyers can approve and dispute them; both can comment. Outbound webhooks push record events to your systems as they happen.

Authentication

Send an API key as Authorization: Bearer dmrl_.... Organization admins create keys under Settings > API keys and choose their scopes (records:read, records:write, drivers:read, terminals:read, connections:read, reports:read, analytics:read, webhooks:read, webhooks:write). Creating a key, or giving one more access, needs two-step sign-in (2FA) on the admin's account; carriers need the Pro plan, fuel buyers are free. A key acts as the admin who created it: writes are recorded as that person, marked as coming from the API, and stop working if they're no longer an admin.

Keys are live (dmrl_..., your real data) or test (dmrl_test_..., your test-mode sandbox; see Test mode). A company can have up to 25 active keys of each kind; past that, creating one is refused until you revoke one. To replace a key without downtime, rotate it (Settings > API keys > Rotate): you get a new key with the same name, scopes and mode, shown once, and the old key keeps working for the overlap you choose (1 hour, 24 hours or 7 days), then stops. Both are listed with the old one's expiry. A key that expires (after a rotation, or at an expiry it was given) is announced to the company's admins, in the app and by email, 7 days and 1 day before.

The API is server-to-server only. It sends no CORS headers, so a browser refuses a call made from a web page; that's on purpose, because a key is a secret. Keep keys on your server (an environment variable or a secrets store), never in front-end or mobile app code.

Pro plan

Carriers need Pro ($199 a month) to set this up; upgrade on Settings > Plan & billing. Fuel buyers get it free. See pricing.
ScopeAllows
records:readList and read demurrage records and their history
records:writeCreate records (carriers), send, approve, dispute, comment and attach photos
drivers:readList your drivers (carriers only)
terminals:readList your configured terminals
connections:readList your carrier/customer connections
reports:readList your saved reports and read their rows (Power BI, Excel, Tableau)
analytics:readWaits by terminal, demurrage by week or month, and aging
webhooks:readList your webhook endpoints and their delivery logs
webhooks:writeAdd, change and delete webhook endpoints, roll their signing secrets, send test events and resend deliveries
Example request
curl "https://demurly.com/api/v1/records" \
  -H "Authorization: Bearer $DEMURLY_API_KEY"

New to the API? The quickstart goes from a key to your first record in five minutes.

Idempotency

Send an Idempotency-Key header with a write: a unique string of 1 to 255 letters, digits, underscores, periods, colons or hyphens (a UUID is ideal; anything else is 400). A retry with the same key and body returns the first response, with Idempotent-Replayed: true, instead of acting twice. The body must be byte-identical: the same key with a different body (even different spacing or key order) gets 422 IDEMPOTENCY_KEY_REUSED; use a new key when you change the request. A retry while the first request is still running gets 409 IDEMPOTENCY_IN_PROGRESS with Retry-After. Keys last 24 hours. Creating a record requires one.

Only final answers are kept under a key and replayed: 2xx, and 4xx that the same request would get again (400 validation errors, 404, 409 INVALID_STATUS / CONFLICT / OVERLAPPING_WAIT, 413, 415). Answers a retry could change are not kept, and a retry with the same key runs again: 5xx, 401, 403 (for example the key's creator was made an admin again), 429, and the retryable 409s (RECORD_CHANGED, RECORD_LOCKED). So after a 400, fix the request and send it with a new key: the old key answers 422 for the changed body.

Times and time zones

Every time field (start_time, approved_at, occurred_at...) is an ISO 8601 instant in UTC, written with milliseconds and Z (2026-11-07T04:07:00.000Z). Parse them as instants rather than comparing strings. Each record also says where the wait happened: time_zone (an IANA name such as America/Phoenix, from the terminal), start_time_local / end_time_local (the same instants with that zone's offset, e.g. 2026-11-07T21:07:00.000-07:00) and local_start_date (the wait's day at the terminal). The terminal object, and GET /api/v1/terminals, carry the terminal's time_zone.

Money and units

Amounts (amount, amount_approved, hourly_rate, proposed_amount) are US dollars as JSON numbers with up to two decimals (125.5 is $125.50), not cents; the one exception is a payment-rules problem, whose *_cents fields say so in their names. hourly_rate is dollars per hour. Minutes (total_minutes, free_time_minutes, billable_minutes) are whole minutes; billable time is charged in 15-minute steps, rounded up, and billed_minutes is that rounded figure (billable_minutes 62 bills 75).

Rate limiting

Each API key has its own per-minute limit (default 60, configurable from 1 to 1000). A company's keys together are also capped at 3,000 requests a minute; when that ceiling is the tighter one, X-RateLimit-Limit reports it. Responses include X-RateLimit-Limit, X-RateLimit-Remaining and X-RateLimit-Reset (the Unix time, in seconds, when the window resets). Over the limit, the API returns 429 RATE_LIMITED with a Retry-After header (seconds); wait that long. Requests with a missing or invalid key are limited too: 60 a minute from one IP address.

Requests and responses

Send JSON bodies with Content-Type: application/json (or a +json type); a non-empty body of any other type gets 415. A write with no body (approve, or send with no options) needs no Content-Type. Unknown query parameters are ignored; a known one with a bad value (limit, cursor, status, include, format) is 400 VALIDATION_ERROR naming it, never silently clamped. Text such as load and BOL numbers and notes is stored exactly as sent. An unknown path under /api/v1 is a JSON 404 NOT_FOUND; a method a path doesn't take is a JSON 405 METHOD_NOT_ALLOWED with an Allow header (and details.allow). A 401 carries WWW-Authenticate: Bearer realm="demurly".

Every response carries X-Request-Id, and every error body repeats it as error.request_id. Log it, and quote it when you write to support: it finds your request in our logs. You can send your own (8 to 64 letters, digits, periods, underscores, colons or hyphens) to tie our logs to yours; otherwise Demurly makes one.

Pagination

The records list is newest first. It returns { "data": [...], "has_more": true, "next_cursor": "..." }: pass limit (1 to 100, default 50) and send next_cursor back as cursor for the next page; on the last page has_more is false and next_cursor is null. Use updated_since to poll for changes: an ISO 8601 date-time with an offset or Z (e.g. 2026-11-01T00:00:00Z; URL-encode a + offset as %2B), from 2000 up to a day from now; anything else is 400. A cursor must be one this API returned; anything else is 400. Treat cursors as opaque: each is a keyset position (a time and an id) within your own company's data, not signed and not tied to one list. Sent to another list it only picks a starting point there, still within your data, so it's harmless but meaningless; always send a list's own next_cursor back to that list. An empty cursor= is the first page.

A charge a fuel buyer was sent never disappears from its view. If the carrier cancels it, sends it to another buyer, or takes it back for review, the buyer's list (and updated_since polls) and GET /api/v1/records/{id} return a tombstone instead (RecordTombstone): its id, record_number, carrier, status: "withdrawn", withdrawn_reason (cancelled, reassigned or recalled) and withdrawn_at, and nothing about what happened to it afterwards. Its updated_at is when it was withdrawn, so a poll sees it once. Close the payable on your side when you see one. A cancellation in your round also sends the record.cancelled webhook; a charge sent to another buyer or taken back has no webhook, so poll or GET it. If the carrier sends it to you again it comes back as an ordinary record. Filter with status=withdrawn to list only tombstones. Writes to a withdrawn charge get 409 INVALID_STATUS. Drivers, terminals and connections page the same way (limit 1 to 1,000, default 1,000; has_more, next_cursor): drivers and terminals oldest first, connections newest first. A saved report's data returns up to 50,000 rows with truncated saying whether more matched.

Versioning

The API's version is in the path (/api/v1). Within v1, changes are additive and can come at any time: new endpoints, new optional request fields, new response fields, new values in a field with a fixed set of values (such as status, source or a webhook's type) and new webhook event types. Write your client to ignore fields and values it doesn't know. A breaking change (removing or renaming a field, changing a type or a meaning, a new required field) only comes in a new version, announced at least 6 months ahead in the changelog and by email to every company with an active key; the old version keeps working for at least 12 months after the new one ships. A deprecated field or endpoint is marked in this file and the changelog first, and keeps working until its version ends.

Test mode

Build and test your integration without touching real charges. Create a test key under Settings > API keys > Test: test mode is free for every company (carriers don't need Pro for it), and creating a test key needs 2FA like any key. A test key works with every endpoint, on your company's sandbox, made on its first call: your test company (<your name> (test mode), of your kind) connected to a test counterparty (a test fuel buyer for a carrier, a test carrier for a fuel buyer), with sample drivers (T-101 to T-103) and terminals. Live and test data never mix: a test key can't see your real records, and a live key can't see the sandbox. Every JSON body an API key gets carries livemode (true for live keys, false for test keys), errors included. An error answered before the key is checked (a missing or invalid key, a body over the size limit, an unknown path) takes livemode from the key's prefix (dmrl_test_ is test), or null when no key was sent.

The sandbox sends no email or text to anyone, takes no payment, records no platform fee, syncs nothing to accounting systems and sends no EDI. Webhooks do fire: test-mode events go only to endpoints you add as test endpoints (Settings > Webhooks), with livemode: false in the body; a live endpoint never gets a test event, and a test endpoint never gets a live one.

To see the other side's moves, test keys can call the simulation endpoints under /api/v1/test (tag Test mode): the sandbox's fuel buyer approves, disputes, pays in Demurly or marks a charge paid outside Demurly; its carrier creates a sample charge (how a fuel buyer's test key receives one) and confirms an outside payment. Each step sends the same webhooks a real one would. POST /api/v1/test/sandbox/reset (or Reset sandbox in Settings > API keys > Test) deletes the sandbox's records; its drivers, terminals and connection stay. Live keys get 403 from /api/v1/test.

What isn't in the API

EDI setup and message history (/api/edi/configurations, /api/edi/messages) are session only: they're managed in the app under Settings > Connected systems > EDI, by a signed-in admin, and an API key gets 401 there. There are no /api/v1 EDI endpoints. Your trading partners send their signed X12 messages to /api/edi/webhook.

Errors

Errors use { "error": { "code", "message", "request_id", "details"?, "hint"?, "field"? } }. Branch on code, which is stable; message is safe to show to people and its wording can change; details comes with some errors only (the field errors of a VALIDATION_ERROR, for example). hint says what to do when there's something specific to do (a missing scope, a record number sent as an id, an expired key, how long to wait), and a VALIDATION_ERROR names its first field in field. Every 429 carries Retry-After. Every code, with its cause, how to fix it and whether to retry, is in the error table.

Every "not allowed in the record's current state" answer is a 409. Its code says whether retrying can help:

  • Retry: RECORD_CHANGED (another action changed the record first), RECORD_LOCKED (a payment is processing, or another wait for the same driver is being created) and IDEMPOTENCY_IN_PROGRESS come with Retry-After (seconds). Wait, then send the same request again (the same Idempotency-Key is fine).
  • Don't retry: INVALID_STATUS (the record's status doesn't allow this; details.status is the status it's in), OVERLAPPING_WAIT (the driver already has a wait at those times; details.record_id and details.record_number name it) and CONFLICT (another state of the record rules it out, such as nothing billable or a buyer's payment terms). Re-read the record and decide.

A 503 SERVICE_UNAVAILABLE with Retry-After means the same change is still being written by an earlier request; retry after that many seconds. A 500 is safe to retry as well.

StatusCodeWhen
400VALIDATION_ERRORA field, parameter or header is missing or invalid: a bad date, an unknown status, a limit out of range, a cursor this API didn't return, a malformed Idempotency-Key, disputed_minutes longer than the wait, or an offer at or above the charge. details.fields names each one.
400BAD_REQUESTThe request can't be done as sent: the body isn't valid JSON, nothing is billable (the wait was within free time), a record has no photo yet (driver-app records; every record created from 2026-12-15, and in test mode now), or the file doesn't match its type.
401UNAUTHORIZEDNo API key, a malformed Authorization header, or a key that is wrong, revoked, turned off or expired.
403FORBIDDENThe key lacks the scope, its creator is no longer an admin (writes), the company is inactive, or only the other side can do this (only carriers report, send and attach photos; only fuel buyers approve and dispute; only carriers list drivers).
403PLAN_LIMITThe carrier's company isn't on the Pro plan, which the API needs (fuel buyers are free).
404NOT_FOUNDNo such record, report or path, or one your company can't see (another carrier's record, a draft not yet sent to you).
405METHOD_NOT_ALLOWEDThe path exists but not with this method (for example DELETE /api/v1/records).
409INVALID_STATUSFinal: the record's status doesn't allow this (it's paid, closed, cancelled, already approved, or withdrawn from you); details.status says which. Re-read it; don't retry.
409OVERLAPPING_WAITFinal: the driver already has a wait at these times (or this exact one); details.record_id and details.record_number name it.
409CONFLICTFinal: another state of the record rules it out (nothing billable, the buyer's payment terms, a changed amount or offer). Re-read it and decide.
409RECORD_CHANGEDRetry: another action changed the record first. Wait Retry-After seconds and send the same request again.
409RECORD_LOCKEDRetry: a payment is processing for this record. Wait Retry-After seconds and try again.
409IDEMPOTENCY_IN_PROGRESSRetry: a request with this Idempotency-Key is still running. Wait Retry-After seconds and send it again.
409DELIVERY_IN_PROGRESSRetry: the webhook delivery you asked to resend is being sent right now. Wait Retry-After seconds, then check the delivery log before resending.
413PAYLOAD_TOO_LARGEThe body is too big (a photo over 5 MB, a JSON body over its limit), or a saved report's CSV would have more than 50,000 rows.
415UNSUPPORTED_MEDIA_TYPEThe Content-Type isn't one this endpoint takes: a JSON endpoint got a body that isn't application/json (or +json), or a photo isn't image/jpeg or image/png.
422UNPROCESSABLEThe photo check refused the file: a copy or near copy of a photo on another record, no camera data (from 2026-12-15; test mode now), or taken more than 24 hours before the wait started. details.reasons lists the codes.
429RATE_LIMITEDToo many requests this minute: over the key's own limit (60 by default), over the company's 3,000 a minute across all its keys, or over 60 a minute with a missing or invalid key from one IP address.
500INTERNAL_ERRORSomething went wrong on Demurly's side.
503SERVICE_UNAVAILABLEThe same change is still being written by an earlier request, or Demurly is briefly unavailable.
Error body
{
  "error": {
    "code": "NOT_FOUND",
    "message": "No such record, report or path, or one your company can't see (another carrier's record, a draft not yet sent to you).",
    "request_id": "6f1c2d3e-4b5a-4c6d-8e7f-9a0b1c2d3e4f",
    "hint": "Use the record's id (a UUID), or list with q=DMR-00000432 to find it.",
    "field": "start_time"
  }
}

Each code's cause, fix and whether to retry are in the error catalogue.

Endpoints

42 endpoints

Records

List records

GET/api/v1/records

API keyScope records:read

Records your organization can see, newest first. Carriers see their records in every status, including recording, draft and pending_review (narrow with status, e.g. status=draft,pending_review); customers see records sent to them, and a tombstone (RecordTombstone, status withdrawn) for each charge they were sent that the carrier has since cancelled, sent to another buyer or taken back. A company that is both lists both. A test key (dmrl_test_...) lists its test-mode sandbox's records only, never your real ones. Requires the records:read scope.

Parameters

  • statusstringqueryOptional

    Comma-separated statuses (e.g. sent_to_customer,disputed); withdrawn selects buyers' tombstones

  • updated_sincestring (date-time)queryOptional

    Only records updated at or after this time: ISO 8601 with an offset or Z, between 2000-01-01 and a day from now (URL-encode + as %2B)

  • qstringqueryOptional

    Record number, load, BOL or container number containing this (case-insensitive, up to 100 characters) (up to 100 characters)

  • terminal_idstring (uuid)queryOptional

    Only records at this terminal

  • partner_idstring (uuid)queryOptional

    Only records with this other company: the fuel buyer on a carrier's records, the carrier on a buyer's

  • started_fromstringqueryOptional

    The wait started at or after this (a date is UTC midnight, or an ISO 8601 date-time with an offset)

  • started_tostringqueryOptional

    The wait started before this

  • amount_minnumberqueryOptional

    Amount at least this (dollars) (at least 0)

  • amount_maxnumberqueryOptional

    Amount at most this (dollars) (at least 0)

  • disputedbooleanqueryOptional

    true: only records that were ever disputed; false: only ones that never were

  • limitintegerqueryOptional

    Page size, a whole number from 1 to 100 (default 50); anything else is 400 VALIDATION_ERROR naming limit (1 to 100) Default 50.

  • cursorstringqueryOptional

    next_cursor from the previous page

Example request

curl "https://demurly.com/api/v1/records" \
  -H "Authorization: Bearer $DEMURLY_API_KEY"

Response 200

A page of records

Returns the record object or the record tombstone object (every field explained).

Example
{
  "data": [
    {
      "id": "3f6c1d2e-8a4b-4c1e-9f0a-1b2c3d4e5f60",
      "record_number": "DMR-00001042",
      "status": "sent_to_customer",
      "carrier": {
        "id": "a1b2c3d4-0000-4000-8000-000000000001",
        "name": "Acme Trucking"
      },
      "customer": {
        "id": "a1b2c3d4-0000-4000-8000-000000000002",
        "name": "Gulf Fuel Supply"
      },
      "terminal": {
        "id": "a1b2c3d4-0000-4000-8000-000000000003",
        "name": "Houston Terminal",
        "time_zone": "America/Chicago"
      },
      "load_number": "L-55821",
      "bol_number": "BOL-99812",
      "container_number": null,
      "start_time": "2026-01-15T14:30:00.000Z",
      "end_time": "2026-01-15T17:45:00.000Z",
      "time_zone": "America/Chicago",
      "time_zone_source": "terminal",
      "start_time_local": "2026-01-15T08:30:00.000-06:00",
      "end_time_local": "2026-01-15T11:45:00.000-06:00",
      "local_start_date": "2026-01-15",
      "adjusted_start_time": null,
      "adjusted_end_time": null,
      "time_adjustment_reason": null,
      "total_minutes": 195,
      "free_time_minutes": 120,
      "billable_minutes": 75,
      "billed_minutes": 75,
      "hourly_rate": 100,
      "amount": 125,
      "amount_approved": null,
      "currency": "usd",
      "stop_reason": "manual",
      "started_offline": false,
      "start_received_at": null,
      "start_clock_drift_seconds": null,
      "gps_evidence": {
        "status": "complete",
        "source": "phone",
        "point_count": 42,
        "issues": []
      },
      "source": "phone",
      "source_label": "Recorded by the driver's phone.",
      "vehicle": null,
      "evidence_hash": null,
      "sent_to_customer_at": "2026-01-15T18:10:00.000Z",
      "approved_at": null,
      "paid_at": null,
      "created_at": "2026-01-15T14:30:02.000Z",
      "updated_at": "2026-01-15T18:10:00.000Z"
    }
  ],
  "has_more": true,
  "next_cursor": "eyJjIjoiMjAyNi0wMS0xNVQxNDozMDowMi4wMDBaIiwiaSI6IjNmNmMxZDJlIn0",
  "livemode": true
}

Errors

  • 400 BAD_REQUESTInvalid parameter (code BAD_REQUEST or VALIDATION_ERROR). Query parameters are checked, never silently changed: a limit out of range, an unknown status, include or format value, or a cursor this API didn't return is 400 VALIDATION_ERROR with details.fields naming the parameter. Unknown query parameters are ignored.
  • 401 UNAUTHORIZEDMissing, malformed, invalid, revoked or expired API key
  • 403 FORBIDDENThe key lacks the scope, its creator is no longer an admin, the organization is inactive, or only the other side can do this (only carriers send and attach photos, only fuel buyers approve and dispute, only carriers list drivers)
  • 405 METHOD_NOT_ALLOWEDThis path doesn't take that method (code METHOD_NOT_ALLOWED). Allow and details.allow list the ones it does.
  • 429 RATE_LIMITEDOver a rate limit: the API key's own per-minute limit (1 to 1,000, default 60), your company's 3,000 requests a minute across all its keys, or 60 requests a minute with a missing or invalid key from one IP address. Wait Retry-After seconds.
  • 500 INTERNAL_ERRORSomething went wrong on Demurly's side; it's safe to retry

Report a record

POST/api/v1/records

API keyScope records:write

Carriers only. Report a finished wait from your own system (TMS, ELD, gate log). It's calculated with your rates and free time like any driver record and lands in pending_review, or goes straight to the customer with send: true. Requires records:write and an Idempotency-Key. Times are recorded as reported by your system and the record's events are marked source: api. A wait that overlaps another wait of the same driver (not cancelled or rejected), or repeats one exactly, is refused with 409 OVERLAPPING_WAIT naming the other record. Creates for one driver run one at a time, so of two overlapping reports sent at once one is created and the other refused, with nothing left behind.

Parameters

  • Idempotency-KeystringheaderRequired

    Any unique string (1-255 letters, digits, underscores, periods, colons or hyphens). A retry with the same key and body returns the first response instead of creating a duplicate. (up to 255 characters)

Request body

Send exactly one of driver_id or driver_number.

  • driver_idstring (uuid)Optional

    An active driver's id from GET /api/v1/drivers

  • driver_numberstringOptional

    An active driver's driver_number, instead of driver_id

  • start_timestring (date-time)Required

    When the wait started (at most 90 days ago)

  • end_timestring (date-time)Required

    When it ended (after start_time, not in the future, at most 72 hours later)

  • terminal_idstring (uuid)Optional

    A terminal's id from GET /api/v1/terminals (can be null)

  • customer_idstring (uuid)Optional

    The fuel buyer to bill: partner.id of an active connection from GET /api/v1/connections (can be null)

  • load_numberstringOptional

    Your load or order number (up to 100 characters; can be null)

  • bol_numberstringOptional

    The bill of lading number (up to 100 characters; can be null)

  • notesstringOptional

    A note on the record, for your team (up to 2000 characters; can be null)

  • time_zonestringOptional

    The IANA time zone where the wait happened. Used only when there is no terminal_id (a terminal's own zone wins); without either, Demurly uses your company's time zone setting. Times are still sent and returned as UTC instants. (up to 64 characters; can be null)

  • sendbooleanOptional

    Send it to customer_id right away (else it waits in pending_review). If it can't be sent, it's still created and send_error says why.

Example request

curl -X POST "https://demurly.com/api/v1/records" \
  -H "Authorization: Bearer $DEMURLY_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
  "driver_number": "1001",
  "start_time": "2026-01-15T14:30:00Z",
  "end_time": "2026-01-15T17:45:00Z",
  "terminal_id": "a1b2c3d4-0000-4000-8000-000000000003",
  "customer_id": "a1b2c3d4-0000-4000-8000-000000000002",
  "load_number": "L-55821",
  "send": true
}'

Response 201

The new record. If send was asked for but the record couldn't be sent (for example the wait was within free time, so nothing is billable), it's still created, in pending_review, and send_error says why.

Returns the record object (every field explained).

Example
{
  "data": {
    "id": "7b2e4c19-5d3a-4f8e-9a61-2c0d8e7f1a34",
    "record_number": "DMR-00001043",
    "status": "sent_to_customer",
    "carrier": {
      "id": "a1b2c3d4-0000-4000-8000-000000000001",
      "name": "Acme Trucking"
    },
    "customer": {
      "id": "a1b2c3d4-0000-4000-8000-000000000002",
      "name": "Gulf Fuel Supply"
    },
    "terminal": {
      "id": "a1b2c3d4-0000-4000-8000-000000000003",
      "name": "Houston Terminal",
      "time_zone": "America/Chicago"
    },
    "load_number": "L-55821",
    "bol_number": "BOL-99812",
    "container_number": null,
    "start_time": "2026-01-15T14:30:00.000Z",
    "end_time": "2026-01-15T17:45:00.000Z",
    "time_zone": "America/Chicago",
    "time_zone_source": "terminal",
    "start_time_local": "2026-01-15T08:30:00.000-06:00",
    "end_time_local": "2026-01-15T11:45:00.000-06:00",
    "local_start_date": "2026-01-15",
    "adjusted_start_time": null,
    "adjusted_end_time": null,
    "time_adjustment_reason": null,
    "total_minutes": 195,
    "free_time_minutes": 120,
    "billable_minutes": 75,
    "billed_minutes": 75,
    "hourly_rate": 100,
    "amount": 125,
    "amount_approved": null,
    "currency": "usd",
    "stop_reason": "manual",
    "started_offline": false,
    "start_received_at": null,
    "start_clock_drift_seconds": null,
    "gps_evidence": {
      "status": "not_tracked",
      "source": "phone",
      "point_count": 0,
      "issues": []
    },
    "source": "api",
    "source_label": "Reported by Acme Trucking's own system.",
    "vehicle": null,
    "evidence_hash": null,
    "sent_to_customer_at": "2026-01-15T18:02:12.000Z",
    "approved_at": null,
    "paid_at": null,
    "created_at": "2026-01-15T18:02:11.000Z",
    "updated_at": "2026-01-15T18:02:12.000Z"
  },
  "send_error": null,
  "livemode": true
}

Errors

  • 400 BAD_REQUESTInvalid parameter (code BAD_REQUEST or VALIDATION_ERROR). Query parameters are checked, never silently changed: a limit out of range, an unknown status, include or format value, or a cursor this API didn't return is 400 VALIDATION_ERROR with details.fields naming the parameter. Unknown query parameters are ignored.
  • 401 UNAUTHORIZEDMissing, malformed, invalid, revoked or expired API key
  • 403 FORBIDDENThe key lacks the scope, its creator is no longer an admin, the organization is inactive, or only the other side can do this (only carriers send and attach photos, only fuel buyers approve and dispute, only carriers list drivers)
  • 405 METHOD_NOT_ALLOWEDThis path doesn't take that method (code METHOD_NOT_ALLOWED). Allow and details.allow list the ones it does.
  • 409 CONFLICTThe record's state doesn't allow this. The code says whether a retry can help; retryable ones come with Retry-After.
  • 415 UNSUPPORTED_MEDIA_TYPEThe body isn't a type this endpoint takes. JSON endpoints need Content-Type: application/json (any charset) whenever there's a body; photos must be JPEG or PNG.
  • 422 UNPROCESSABLEThis Idempotency-Key was already used for a different request (code IDEMPOTENCY_KEY_REUSED). The body must be byte-identical to the first; use a new key for a changed request.
  • 429 RATE_LIMITEDOver a rate limit: the API key's own per-minute limit (1 to 1,000, default 60), your company's 3,000 requests a minute across all its keys, or 60 requests a minute with a missing or invalid key from one IP address. Wait Retry-After seconds.
  • 500 INTERNAL_ERRORSomething went wrong on Demurly's side; it's safe to retry
  • 503 SERVICE_UNAVAILABLEThe same change is still being written by an earlier request; retry after Retry-After seconds

Get a record

GET/api/v1/records/{id}

API keyScope records:read

One record your organization can see, by its id (a UUID). A record number (DMR-00000432) is 404 with a message saying to use the id or list with q=DMR-00000432; a test key asking for one of your real records is 404 saying test keys see only the sandbox. include=events adds its history (GPS points omitted). A fuel buyer gets a tombstone (RecordTombstone, no events) for a charge it was sent that has since been withdrawn. Requires records:read.

Parameters

  • idstring (uuid)pathRequired
  • includestringqueryOptional

    Set to events to include the record's event history; any other value is 400 VALIDATION_ERROR naming include (one of: events)

Example request

curl "https://demurly.com/api/v1/records/3f6c1d2e-8a4b-4c1e-9f0a-1b2c3d4e5f60" \
  -H "Authorization: Bearer $DEMURLY_API_KEY"

Response 200

The record, or a fuel buyer's tombstone of a withdrawn charge

Returns the record object or the record tombstone object (every field explained).

Example
{
  "data": {
    "id": "3f6c1d2e-8a4b-4c1e-9f0a-1b2c3d4e5f60",
    "record_number": "DMR-00001042",
    "status": "sent_to_customer",
    "carrier": {
      "id": "a1b2c3d4-0000-4000-8000-000000000001",
      "name": "Acme Trucking"
    },
    "customer": {
      "id": "a1b2c3d4-0000-4000-8000-000000000002",
      "name": "Gulf Fuel Supply"
    },
    "terminal": {
      "id": "a1b2c3d4-0000-4000-8000-000000000003",
      "name": "Houston Terminal",
      "time_zone": "America/Chicago"
    },
    "load_number": "L-55821",
    "bol_number": "BOL-99812",
    "container_number": null,
    "start_time": "2026-01-15T14:30:00.000Z",
    "end_time": "2026-01-15T17:45:00.000Z",
    "time_zone": "America/Chicago",
    "time_zone_source": "terminal",
    "start_time_local": "2026-01-15T08:30:00.000-06:00",
    "end_time_local": "2026-01-15T11:45:00.000-06:00",
    "local_start_date": "2026-01-15",
    "adjusted_start_time": null,
    "adjusted_end_time": null,
    "time_adjustment_reason": null,
    "total_minutes": 195,
    "free_time_minutes": 120,
    "billable_minutes": 75,
    "billed_minutes": 75,
    "hourly_rate": 100,
    "amount": 125,
    "amount_approved": null,
    "currency": "usd",
    "stop_reason": "manual",
    "started_offline": false,
    "start_received_at": null,
    "start_clock_drift_seconds": null,
    "gps_evidence": {
      "status": "complete",
      "source": "phone",
      "point_count": 42,
      "issues": []
    },
    "source": "phone",
    "source_label": "Recorded by the driver's phone.",
    "vehicle": null,
    "evidence_hash": null,
    "sent_to_customer_at": "2026-01-15T18:10:00.000Z",
    "approved_at": null,
    "paid_at": null,
    "created_at": "2026-01-15T14:30:02.000Z",
    "updated_at": "2026-01-15T18:10:00.000Z",
    "events": [
      {
        "id": "e1a2b3c4-0000-4000-8000-0000000000a1",
        "type": "record_created",
        "sequence": 1,
        "actor_type": "driver",
        "occurred_at": "2026-01-15T14:30:00.000Z",
        "recorded_at": "2026-01-15T14:30:02.000Z",
        "data": {}
      },
      {
        "id": "e1a2b3c4-0000-4000-8000-0000000000a2",
        "type": "gps_tracking_stopped",
        "sequence": 44,
        "actor_type": "driver",
        "occurred_at": "2026-01-15T17:45:00.000Z",
        "recorded_at": "2026-01-15T17:45:01.000Z",
        "data": {}
      },
      {
        "id": "e1a2b3c4-0000-4000-8000-0000000000a3",
        "type": "calculation_performed",
        "sequence": 45,
        "actor_type": "system",
        "occurred_at": "2026-01-15T17:45:01.000Z",
        "recorded_at": "2026-01-15T17:45:01.000Z",
        "data": {
          "amount": 125,
          "total_minutes": 195,
          "billable_minutes": 75,
          "billed_minutes": 75,
          "hourly_rate": 100
        }
      },
      {
        "id": "e1a2b3c4-0000-4000-8000-0000000000a4",
        "type": "record_submitted",
        "sequence": 46,
        "actor_type": "driver",
        "occurred_at": "2026-01-15T17:46:00.000Z",
        "recorded_at": "2026-01-15T17:46:00.000Z",
        "data": {}
      },
      {
        "id": "e1a2b3c4-0000-4000-8000-0000000000a5",
        "type": "record_sent_to_customer",
        "sequence": 47,
        "actor_type": "carrier_admin",
        "occurred_at": "2026-01-15T18:10:00.000Z",
        "recorded_at": "2026-01-15T18:10:00.000Z",
        "data": {}
      }
    ]
  },
  "livemode": true
}

Errors

  • 401 UNAUTHORIZEDMissing, malformed, invalid, revoked or expired API key
  • 403 FORBIDDENThe key lacks the scope, its creator is no longer an admin, the organization is inactive, or only the other side can do this (only carriers send and attach photos, only fuel buyers approve and dispute, only carriers list drivers)
  • 404 NOT_FOUNDNot found, or not visible to this organization. An unknown /api/v1 path is 404 NOT_FOUND in the same JSON shape.
  • 405 METHOD_NOT_ALLOWEDThis path doesn't take that method (code METHOD_NOT_ALLOWED). Allow and details.allow list the ones it does.
  • 429 RATE_LIMITEDOver a rate limit: the API key's own per-minute limit (1 to 1,000, default 60), your company's 3,000 requests a minute across all its keys, or 60 requests a minute with a missing or invalid key from one IP address. Wait Retry-After seconds.
  • 500 INTERNAL_ERRORSomething went wrong on Demurly's side; it's safe to retry

Send a record

POST/api/v1/records/{id}/send

API keyScope records:write

Carriers only. Send a record in pending_review (or disputed, after a correction) to the customer for approval. The amount is recalculated first. Resubmitting a disputed record to the buyer who disputed it requires a message, your response to the buyer's dispute (stored with the send, event record_sent_to_customer, with resubmission true and the changes since the dispute); sending it to a different customer instead is a fresh send to them (resubmission false, no message kept). A record the driver recorded in the driver app needs at least one photo first (400); records from an ELD, EDI 214, this API or an import don't. A charge that doesn't meet the buyer's payment rules is refused with 409 (details.reason payment_rules) unless confirm_nonconforming is true. A record its driver flagged as started by mistake (event driver_flagged_mistake) is refused with 409 (details.reason driver_flagged_mistake) until the carrier cancels it or keeps it in the app (event mistake_flag_dismissed). Requires records:write.

Parameters

  • idstring (uuid)pathRequired
  • Idempotency-KeystringheaderOptional

    Any unique string (1-255 letters, digits, underscores, periods, colons or hyphens). A retry with the same key and body returns the first response. (up to 255 characters)

Request body

  • customer_idstring (uuid)Optional

    Send to this connected customer instead of the record's current one (can be null)

  • messagestringOptional

    A note to the buyer. Required when resubmitting a disputed record (your response to the dispute). (up to 2000 characters; can be null)

  • confirm_nonconformingbooleanOptional

    Send even though the charge doesn't meet the buyer's payment rules (minimum free time, maximum rate). Without it such a send is refused with 409 CONFLICT, details.reason payment_rules and details.problems naming each rule. (can be null)

Example request

curl -X POST "https://demurly.com/api/v1/records/3f6c1d2e-8a4b-4c1e-9f0a-1b2c3d4e5f60/send" \
  -H "Authorization: Bearer $DEMURLY_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
  "customer_id": "a1b2c3d4-0000-4000-8000-000000000002"
}'

Response 200

The record after the change

Returns the record object (every field explained).

Example
{
  "data": {
    "id": "3f6c1d2e-8a4b-4c1e-9f0a-1b2c3d4e5f60",
    "record_number": "DMR-00001042",
    "status": "sent_to_customer",
    "carrier": {
      "id": "a1b2c3d4-0000-4000-8000-000000000001",
      "name": "Acme Trucking"
    },
    "customer": {
      "id": "a1b2c3d4-0000-4000-8000-000000000002",
      "name": "Gulf Fuel Supply"
    },
    "terminal": {
      "id": "a1b2c3d4-0000-4000-8000-000000000003",
      "name": "Houston Terminal",
      "time_zone": "America/Chicago"
    },
    "load_number": "L-55821",
    "bol_number": "BOL-99812",
    "container_number": null,
    "start_time": "2026-01-15T14:30:00.000Z",
    "end_time": "2026-01-15T17:45:00.000Z",
    "time_zone": "America/Chicago",
    "time_zone_source": "terminal",
    "start_time_local": "2026-01-15T08:30:00.000-06:00",
    "end_time_local": "2026-01-15T11:45:00.000-06:00",
    "local_start_date": "2026-01-15",
    "adjusted_start_time": null,
    "adjusted_end_time": null,
    "time_adjustment_reason": null,
    "total_minutes": 195,
    "free_time_minutes": 120,
    "billable_minutes": 75,
    "billed_minutes": 75,
    "hourly_rate": 100,
    "amount": 125,
    "amount_approved": null,
    "currency": "usd",
    "stop_reason": "manual",
    "started_offline": false,
    "start_received_at": null,
    "start_clock_drift_seconds": null,
    "gps_evidence": {
      "status": "complete",
      "source": "phone",
      "point_count": 42,
      "issues": []
    },
    "source": "phone",
    "source_label": "Recorded by the driver's phone.",
    "vehicle": null,
    "evidence_hash": null,
    "sent_to_customer_at": "2026-01-15T18:10:00.000Z",
    "approved_at": null,
    "paid_at": null,
    "created_at": "2026-01-15T14:30:02.000Z",
    "updated_at": "2026-01-15T18:10:00.000Z"
  },
  "livemode": true
}

Errors

  • 400 BAD_REQUESTInvalid parameter (code BAD_REQUEST or VALIDATION_ERROR). Query parameters are checked, never silently changed: a limit out of range, an unknown status, include or format value, or a cursor this API didn't return is 400 VALIDATION_ERROR with details.fields naming the parameter. Unknown query parameters are ignored.
  • 401 UNAUTHORIZEDMissing, malformed, invalid, revoked or expired API key
  • 403 FORBIDDENThe key lacks the scope, its creator is no longer an admin, the organization is inactive, or only the other side can do this (only carriers send and attach photos, only fuel buyers approve and dispute, only carriers list drivers)
  • 404 NOT_FOUNDNot found, or not visible to this organization. An unknown /api/v1 path is 404 NOT_FOUND in the same JSON shape.
  • 405 METHOD_NOT_ALLOWEDThis path doesn't take that method (code METHOD_NOT_ALLOWED). Allow and details.allow list the ones it does.
  • 409 CONFLICTThe record's state doesn't allow this. The code says whether a retry can help; retryable ones come with Retry-After.
  • 415 UNSUPPORTED_MEDIA_TYPEThe body isn't a type this endpoint takes. JSON endpoints need Content-Type: application/json (any charset) whenever there's a body; photos must be JPEG or PNG.
  • 422 UNPROCESSABLEThis Idempotency-Key was already used for a different request (code IDEMPOTENCY_KEY_REUSED). The body must be byte-identical to the first; use a new key for a changed request.
  • 429 RATE_LIMITEDOver a rate limit: the API key's own per-minute limit (1 to 1,000, default 60), your company's 3,000 requests a minute across all its keys, or 60 requests a minute with a missing or invalid key from one IP address. Wait Retry-After seconds.
  • 500 INTERNAL_ERRORSomething went wrong on Demurly's side; it's safe to retry
  • 503 SERVICE_UNAVAILABLEThe same change is still being written by an earlier request; retry after Retry-After seconds

Approve a record

POST/api/v1/records/{id}/approve

API keyScope records:write

Fuel buyers only. Approve a record sent to you (or escalated after a dispute). Send the amount you read as expected_amount: if the carrier changed the charge since, the approval is refused with 409 and nothing changes. The body is optional. Requires records:write.

Parameters

  • idstring (uuid)pathRequired
  • Idempotency-KeystringheaderOptional

    Any unique string (1-255 letters, digits, underscores, periods, colons or hyphens). A retry with the same key and body returns the first response. (up to 255 characters)

Request body

  • expected_amountnumberOptional

    The amount you read and mean to approve, in USD. If the charge has changed since, the approval is refused (409). (0 to 1000000; can be null)

Example request

curl -X POST "https://demurly.com/api/v1/records/3f6c1d2e-8a4b-4c1e-9f0a-1b2c3d4e5f60/approve" \
  -H "Authorization: Bearer $DEMURLY_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
  "expected_amount": 125
}'

Response 200

The record after the change

Returns the record object (every field explained).

Example
{
  "data": {
    "id": "3f6c1d2e-8a4b-4c1e-9f0a-1b2c3d4e5f60",
    "record_number": "DMR-00001042",
    "status": "customer_approved",
    "carrier": {
      "id": "a1b2c3d4-0000-4000-8000-000000000001",
      "name": "Acme Trucking"
    },
    "customer": {
      "id": "a1b2c3d4-0000-4000-8000-000000000002",
      "name": "Gulf Fuel Supply"
    },
    "terminal": {
      "id": "a1b2c3d4-0000-4000-8000-000000000003",
      "name": "Houston Terminal",
      "time_zone": "America/Chicago"
    },
    "load_number": "L-55821",
    "bol_number": "BOL-99812",
    "container_number": null,
    "start_time": "2026-01-15T14:30:00.000Z",
    "end_time": "2026-01-15T17:45:00.000Z",
    "time_zone": "America/Chicago",
    "time_zone_source": "terminal",
    "start_time_local": "2026-01-15T08:30:00.000-06:00",
    "end_time_local": "2026-01-15T11:45:00.000-06:00",
    "local_start_date": "2026-01-15",
    "adjusted_start_time": null,
    "adjusted_end_time": null,
    "time_adjustment_reason": null,
    "total_minutes": 195,
    "free_time_minutes": 120,
    "billable_minutes": 75,
    "billed_minutes": 75,
    "hourly_rate": 100,
    "amount": 125,
    "amount_approved": 125,
    "currency": "usd",
    "stop_reason": "manual",
    "started_offline": false,
    "start_received_at": null,
    "start_clock_drift_seconds": null,
    "gps_evidence": {
      "status": "complete",
      "source": "phone",
      "point_count": 42,
      "issues": []
    },
    "source": "phone",
    "source_label": "Recorded by the driver's phone.",
    "vehicle": null,
    "evidence_hash": null,
    "sent_to_customer_at": "2026-01-15T18:10:00.000Z",
    "approved_at": "2026-01-16T15:20:00.000Z",
    "paid_at": null,
    "created_at": "2026-01-15T14:30:02.000Z",
    "updated_at": "2026-01-16T15:20:00.000Z"
  },
  "livemode": true
}

Errors

  • 400 BAD_REQUESTInvalid parameter (code BAD_REQUEST or VALIDATION_ERROR). Query parameters are checked, never silently changed: a limit out of range, an unknown status, include or format value, or a cursor this API didn't return is 400 VALIDATION_ERROR with details.fields naming the parameter. Unknown query parameters are ignored.
  • 401 UNAUTHORIZEDMissing, malformed, invalid, revoked or expired API key
  • 403 FORBIDDENThe key lacks the scope, its creator is no longer an admin, the organization is inactive, or only the other side can do this (only carriers send and attach photos, only fuel buyers approve and dispute, only carriers list drivers)
  • 404 NOT_FOUNDNot found, or not visible to this organization. An unknown /api/v1 path is 404 NOT_FOUND in the same JSON shape.
  • 405 METHOD_NOT_ALLOWEDThis path doesn't take that method (code METHOD_NOT_ALLOWED). Allow and details.allow list the ones it does.
  • 409 CONFLICTThe record's state doesn't allow this. The code says whether a retry can help; retryable ones come with Retry-After.
  • 415 UNSUPPORTED_MEDIA_TYPEThe body isn't a type this endpoint takes. JSON endpoints need Content-Type: application/json (any charset) whenever there's a body; photos must be JPEG or PNG.
  • 422 UNPROCESSABLEThis Idempotency-Key was already used for a different request (code IDEMPOTENCY_KEY_REUSED). The body must be byte-identical to the first; use a new key for a changed request.
  • 429 RATE_LIMITEDOver a rate limit: the API key's own per-minute limit (1 to 1,000, default 60), your company's 3,000 requests a minute across all its keys, or 60 requests a minute with a missing or invalid key from one IP address. Wait Retry-After seconds.
  • 500 INTERNAL_ERRORSomething went wrong on Demurly's side; it's safe to retry
  • 503 SERVICE_UNAVAILABLEThe same change is still being written by an earlier request; retry after Retry-After seconds

Dispute a record

POST/api/v1/records/{id}/dispute

API keyScope records:write

Fuel buyers only. Dispute a record sent to you, with a written reason; it goes back to the carrier. Requires records:write.

Parameters

  • idstring (uuid)pathRequired
  • Idempotency-KeystringheaderOptional

    Any unique string (1-255 letters, digits, underscores, periods, colons or hyphens). A retry with the same key and body returns the first response. (up to 255 characters)

Request body

  • reasonstringRequired

    Why you dispute it, in words the carrier will read (up to 2000 characters)

  • dispute_typestringOptional

    What's wrong with the charge (one of: time, rate, both, full_rejection, evidence; can be null)

  • disputed_minutesintegerOptional

    Minutes you say shouldn't be billed (at least 0; can be null)

  • proposed_amountnumberOptional

    What you'd pay instead (a counter-amount), in USD (0 to 1000000; can be null)

Example request

curl -X POST "https://demurly.com/api/v1/records/3f6c1d2e-8a4b-4c1e-9f0a-1b2c3d4e5f60/dispute" \
  -H "Authorization: Bearer $DEMURLY_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
  "reason": "Gate log shows a 90-minute wait",
  "dispute_type": "time",
  "disputed_minutes": 60
}'

Response 200

The record after the change

Returns the record object (every field explained).

Example
{
  "data": {
    "id": "3f6c1d2e-8a4b-4c1e-9f0a-1b2c3d4e5f60",
    "record_number": "DMR-00001042",
    "status": "disputed",
    "carrier": {
      "id": "a1b2c3d4-0000-4000-8000-000000000001",
      "name": "Acme Trucking"
    },
    "customer": {
      "id": "a1b2c3d4-0000-4000-8000-000000000002",
      "name": "Gulf Fuel Supply"
    },
    "terminal": {
      "id": "a1b2c3d4-0000-4000-8000-000000000003",
      "name": "Houston Terminal",
      "time_zone": "America/Chicago"
    },
    "load_number": "L-55821",
    "bol_number": "BOL-99812",
    "container_number": null,
    "start_time": "2026-01-15T14:30:00.000Z",
    "end_time": "2026-01-15T17:45:00.000Z",
    "time_zone": "America/Chicago",
    "time_zone_source": "terminal",
    "start_time_local": "2026-01-15T08:30:00.000-06:00",
    "end_time_local": "2026-01-15T11:45:00.000-06:00",
    "local_start_date": "2026-01-15",
    "adjusted_start_time": null,
    "adjusted_end_time": null,
    "time_adjustment_reason": null,
    "total_minutes": 195,
    "free_time_minutes": 120,
    "billable_minutes": 75,
    "billed_minutes": 75,
    "hourly_rate": 100,
    "amount": 125,
    "amount_approved": null,
    "currency": "usd",
    "stop_reason": "manual",
    "started_offline": false,
    "start_received_at": null,
    "start_clock_drift_seconds": null,
    "gps_evidence": {
      "status": "complete",
      "source": "phone",
      "point_count": 42,
      "issues": []
    },
    "source": "phone",
    "source_label": "Recorded by the driver's phone.",
    "vehicle": null,
    "evidence_hash": null,
    "sent_to_customer_at": "2026-01-15T18:10:00.000Z",
    "approved_at": null,
    "paid_at": null,
    "created_at": "2026-01-15T14:30:02.000Z",
    "updated_at": "2026-01-16T15:20:00.000Z"
  },
  "livemode": true
}

Errors

  • 400 BAD_REQUESTInvalid parameter (code BAD_REQUEST or VALIDATION_ERROR). Query parameters are checked, never silently changed: a limit out of range, an unknown status, include or format value, or a cursor this API didn't return is 400 VALIDATION_ERROR with details.fields naming the parameter. Unknown query parameters are ignored.
  • 401 UNAUTHORIZEDMissing, malformed, invalid, revoked or expired API key
  • 403 FORBIDDENThe key lacks the scope, its creator is no longer an admin, the organization is inactive, or only the other side can do this (only carriers send and attach photos, only fuel buyers approve and dispute, only carriers list drivers)
  • 404 NOT_FOUNDNot found, or not visible to this organization. An unknown /api/v1 path is 404 NOT_FOUND in the same JSON shape.
  • 405 METHOD_NOT_ALLOWEDThis path doesn't take that method (code METHOD_NOT_ALLOWED). Allow and details.allow list the ones it does.
  • 409 CONFLICTThe record's state doesn't allow this. The code says whether a retry can help; retryable ones come with Retry-After.
  • 415 UNSUPPORTED_MEDIA_TYPEThe body isn't a type this endpoint takes. JSON endpoints need Content-Type: application/json (any charset) whenever there's a body; photos must be JPEG or PNG.
  • 422 UNPROCESSABLEThis Idempotency-Key was already used for a different request (code IDEMPOTENCY_KEY_REUSED). The body must be byte-identical to the first; use a new key for a changed request.
  • 429 RATE_LIMITEDOver a rate limit: the API key's own per-minute limit (1 to 1,000, default 60), your company's 3,000 requests a minute across all its keys, or 60 requests a minute with a missing or invalid key from one IP address. Wait Retry-After seconds.
  • 500 INTERNAL_ERRORSomething went wrong on Demurly's side; it's safe to retry
  • 503 SERVICE_UNAVAILABLEThe same change is still being written by an earlier request; retry after Retry-After seconds

Comment on a record

POST/api/v1/records/{id}/comments

API keyScope records:write

Either company on the record adds a comment both can see. Requires records:write.

Parameters

  • idstring (uuid)pathRequired
  • Idempotency-KeystringheaderOptional

    Any unique string (1-255 letters, digits, underscores, periods, colons or hyphens). A retry with the same key and body returns the first response. (up to 255 characters)

Request body

  • commentstringRequired

    Shown to both companies on the record (up to 2000 characters)

Example request

curl -X POST "https://demurly.com/api/v1/records/3f6c1d2e-8a4b-4c1e-9f0a-1b2c3d4e5f60/comments" \
  -H "Authorization: Bearer $DEMURLY_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
  "comment": "Matched to invoice 4471 in our ERP"
}'

Response 200

The record after the change

Returns the record object (every field explained).

Example
{
  "data": {
    "id": "3f6c1d2e-8a4b-4c1e-9f0a-1b2c3d4e5f60",
    "record_number": "DMR-00001042",
    "status": "sent_to_customer",
    "carrier": {
      "id": "a1b2c3d4-0000-4000-8000-000000000001",
      "name": "Acme Trucking"
    },
    "customer": {
      "id": "a1b2c3d4-0000-4000-8000-000000000002",
      "name": "Gulf Fuel Supply"
    },
    "terminal": {
      "id": "a1b2c3d4-0000-4000-8000-000000000003",
      "name": "Houston Terminal",
      "time_zone": "America/Chicago"
    },
    "load_number": "L-55821",
    "bol_number": "BOL-99812",
    "container_number": null,
    "start_time": "2026-01-15T14:30:00.000Z",
    "end_time": "2026-01-15T17:45:00.000Z",
    "time_zone": "America/Chicago",
    "time_zone_source": "terminal",
    "start_time_local": "2026-01-15T08:30:00.000-06:00",
    "end_time_local": "2026-01-15T11:45:00.000-06:00",
    "local_start_date": "2026-01-15",
    "adjusted_start_time": null,
    "adjusted_end_time": null,
    "time_adjustment_reason": null,
    "total_minutes": 195,
    "free_time_minutes": 120,
    "billable_minutes": 75,
    "billed_minutes": 75,
    "hourly_rate": 100,
    "amount": 125,
    "amount_approved": null,
    "currency": "usd",
    "stop_reason": "manual",
    "started_offline": false,
    "start_received_at": null,
    "start_clock_drift_seconds": null,
    "gps_evidence": {
      "status": "complete",
      "source": "phone",
      "point_count": 42,
      "issues": []
    },
    "source": "phone",
    "source_label": "Recorded by the driver's phone.",
    "vehicle": null,
    "evidence_hash": null,
    "sent_to_customer_at": "2026-01-15T18:10:00.000Z",
    "approved_at": null,
    "paid_at": null,
    "created_at": "2026-01-15T14:30:02.000Z",
    "updated_at": "2026-01-16T09:05:00.000Z"
  },
  "livemode": true
}

Errors

  • 400 BAD_REQUESTInvalid parameter (code BAD_REQUEST or VALIDATION_ERROR). Query parameters are checked, never silently changed: a limit out of range, an unknown status, include or format value, or a cursor this API didn't return is 400 VALIDATION_ERROR with details.fields naming the parameter. Unknown query parameters are ignored.
  • 401 UNAUTHORIZEDMissing, malformed, invalid, revoked or expired API key
  • 403 FORBIDDENThe key lacks the scope, its creator is no longer an admin, the organization is inactive, or only the other side can do this (only carriers send and attach photos, only fuel buyers approve and dispute, only carriers list drivers)
  • 404 NOT_FOUNDNot found, or not visible to this organization. An unknown /api/v1 path is 404 NOT_FOUND in the same JSON shape.
  • 405 METHOD_NOT_ALLOWEDThis path doesn't take that method (code METHOD_NOT_ALLOWED). Allow and details.allow list the ones it does.
  • 409 CONFLICTThe record's state doesn't allow this. The code says whether a retry can help; retryable ones come with Retry-After.
  • 415 UNSUPPORTED_MEDIA_TYPEThe body isn't a type this endpoint takes. JSON endpoints need Content-Type: application/json (any charset) whenever there's a body; photos must be JPEG or PNG.
  • 422 UNPROCESSABLEThis Idempotency-Key was already used for a different request (code IDEMPOTENCY_KEY_REUSED). The body must be byte-identical to the first; use a new key for a changed request.
  • 429 RATE_LIMITEDOver a rate limit: the API key's own per-minute limit (1 to 1,000, default 60), your company's 3,000 requests a minute across all its keys, or 60 requests a minute with a missing or invalid key from one IP address. Wait Retry-After seconds.
  • 500 INTERNAL_ERRORSomething went wrong on Demurly's side; it's safe to retry
  • 503 SERVICE_UNAVAILABLEThe same change is still being written by an earlier request; retry after Retry-After seconds

List a record's photos

GET/api/v1/records/{id}/photos

API keyScope records:read

The photos and documents on a record (BOL, gate ticket, the driver's photos at the terminal, dashcam images), oldest first, for either side. Each has a download_url that works for 10 minutes; ask again for a fresh one. A fuel buyer sees the carrier side's evidence and anything it attached itself, never what another buyer attached. A charge withdrawn from a buyer shows none (409 INVALID_STATUS, details.status withdrawn). Removed or replaced photos aren't listed. Requests that make download URLs are limited to 60 a minute per API key (429 RATE_LIMITED with Retry-After). Requires records:read.

Parameters

  • idstring (uuid)pathRequired
  • limitintegerqueryOptional

    Page size, a whole number from 1 to 50 (default 50); anything else is 400 VALIDATION_ERROR naming limit (1 to 50) Default 50.

  • cursorstringqueryOptional

    The next_cursor of the previous page (opaque); anything else is 400 VALIDATION_ERROR naming cursor

Example request

curl "https://demurly.com/api/v1/records/3f6c1d2e-8a4b-4c1e-9f0a-1b2c3d4e5f60/photos" \
  -H "Authorization: Bearer $DEMURLY_API_KEY"

Response 200

A page of the record's photos, oldest first (limit, cursor)

Returns the record photo object (every field explained).

Example
{
  "data": [
    {
      "id": "9c4f2a1b-6e3d-4b7a-8f20-5d1e9c3b7a44",
      "record_id": "3f6c1d2e-8a4b-4c1e-9f0a-1b2c3d4e5f60",
      "kind": "photo",
      "source": "driver_camera",
      "camera": null,
      "content_type": "image/jpeg",
      "size_bytes": 482113,
      "sha256": "4f3c9a0e7b1d2c6f8e5a3b9d0c7e1f2a6b8d4c0e9f3a7b1c5d2e8f6a0b4c9d3e",
      "width": 3024,
      "height": 4032,
      "taken_at": "2026-01-15T14:41:12.000Z",
      "time_zone": "America/Chicago",
      "taken_at_local": "2026-01-15T08:41:12.000-06:00",
      "uploaded_at": "2026-01-15T14:41:15.204Z",
      "download_url": "https://storage.demurly.com/storage/v1/object/sign/record-photos/3f6c1d2e-8a4b-4c1e-9f0a-1b2c3d4e5f60/1768488072000_a1b2c3d4.jpg?token=eyJhbGciOiJIUzI1NiJ9.sig",
      "download_url_expires_at": "2026-11-09T18:30:00.000Z"
    }
  ],
  "has_more": false,
  "next_cursor": null,
  "livemode": true
}

Errors

  • 400 BAD_REQUESTInvalid parameter (code BAD_REQUEST or VALIDATION_ERROR). Query parameters are checked, never silently changed: a limit out of range, an unknown status, include or format value, or a cursor this API didn't return is 400 VALIDATION_ERROR with details.fields naming the parameter. Unknown query parameters are ignored.
  • 401 UNAUTHORIZEDMissing, malformed, invalid, revoked or expired API key
  • 403 FORBIDDENThe key lacks the scope, its creator is no longer an admin, the organization is inactive, or only the other side can do this (only carriers send and attach photos, only fuel buyers approve and dispute, only carriers list drivers)
  • 404 NOT_FOUNDNot found, or not visible to this organization. An unknown /api/v1 path is 404 NOT_FOUND in the same JSON shape.
  • 405 METHOD_NOT_ALLOWEDThis path doesn't take that method (code METHOD_NOT_ALLOWED). Allow and details.allow list the ones it does.
  • 409 CONFLICTThe record's state doesn't allow this. The code says whether a retry can help; retryable ones come with Retry-After.
  • 429 RATE_LIMITEDOver a rate limit: the API key's own per-minute limit (1 to 1,000, default 60), your company's 3,000 requests a minute across all its keys, or 60 requests a minute with a missing or invalid key from one IP address. Wait Retry-After seconds.
  • 500 INTERNAL_ERRORSomething went wrong on Demurly's side; it's safe to retry

Attach a photo

POST/api/v1/records/{id}/photos

API keyScope records:write

Carriers only. Attach a JPEG or PNG (5 MB at most), such as a BOL or gate ticket, sent as the raw request body. Not allowed once the record is paid, closed or cancelled. Requires records:write. Every photo is checked when it arrives (photo_check in the response), from the file's own camera data (EXIF: when and where it was taken, the camera, the editing program) and against photos on other records. Send the camera's original file, not a copy with its metadata stripped. Refused (422 UNPROCESSABLE, details.reasons, nothing stored): a copy or near copy of a photo on another record; a file with no camera data; one taken more than 24 hours before the wait started. Stored but marked review: taken more than 30 minutes outside the wait, more than 1 km from the terminal, saved by an editing program, or a screenshot. **Change on 2026-12-15:** a file with no camera data is refused (until then it's stored as review), and records created from that day need at least one photo before they can be sent, whatever made them (today only driver-app records do). Test mode has both rules now.

Parameters

  • idstring (uuid)pathRequired
  • Idempotency-KeystringheaderOptional

    Any unique string (1-255 letters, digits, underscores, periods, colons or hyphens). A retry with the same key and body returns the first response. (up to 255 characters)

Request body

The raw file as the body, sent as image/jpeg or image/png.

Example request

curl -X POST "https://demurly.com/api/v1/records/3f6c1d2e-8a4b-4c1e-9f0a-1b2c3d4e5f60/photos" \
  -H "Authorization: Bearer $DEMURLY_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: image/jpeg" \
  --data-binary @file.jpeg

Response 201

The attached photo

Returns the photo attachment object (every field explained).

Example
{
  "data": {
    "id": "9c4f2a1b-6e3d-4b7a-8f20-5d1e9c3b7a44",
    "record_id": "3f6c1d2e-8a4b-4c1e-9f0a-1b2c3d4e5f60",
    "content_type": "image/jpeg",
    "size_bytes": 482113,
    "sha256": "4f3c9a0e7b1d2c6f8e5a3b9d0c7e1f2a6b8d4c0e9f3a7b1c5d2e8f6a0b4c9d3e",
    "photo_check": {
      "result": "original",
      "reasons": []
    }
  },
  "livemode": true
}

Errors

  • 400 BAD_REQUESTInvalid parameter (code BAD_REQUEST or VALIDATION_ERROR). Query parameters are checked, never silently changed: a limit out of range, an unknown status, include or format value, or a cursor this API didn't return is 400 VALIDATION_ERROR with details.fields naming the parameter. Unknown query parameters are ignored.
  • 401 UNAUTHORIZEDMissing, malformed, invalid, revoked or expired API key
  • 403 FORBIDDENThe key lacks the scope, its creator is no longer an admin, the organization is inactive, or only the other side can do this (only carriers send and attach photos, only fuel buyers approve and dispute, only carriers list drivers)
  • 404 NOT_FOUNDNot found, or not visible to this organization. An unknown /api/v1 path is 404 NOT_FOUND in the same JSON shape.
  • 405 METHOD_NOT_ALLOWEDThis path doesn't take that method (code METHOD_NOT_ALLOWED). Allow and details.allow list the ones it does.
  • 409 CONFLICTThe record's state doesn't allow this. The code says whether a retry can help; retryable ones come with Retry-After.
  • 413 PAYLOAD_TOO_LARGEThe body is larger than allowed (photos up to 5 MB), or a report's CSV would have more than 50,000 rows
  • 415 UNSUPPORTED_MEDIA_TYPEThe body isn't a type this endpoint takes. JSON endpoints need Content-Type: application/json (any charset) whenever there's a body; photos must be JPEG or PNG.
  • 422 UNPROCESSABLEThe photo was refused by the photo check (code UNPROCESSABLE, details.reasons lists each reason's code), and nothing was stored. Also 422 IDEMPOTENCY_KEY_REUSED when this Idempotency-Key was used for a different request.
  • 429 RATE_LIMITEDOver a rate limit: the API key's own per-minute limit (1 to 1,000, default 60), your company's 3,000 requests a minute across all its keys, or 60 requests a minute with a missing or invalid key from one IP address. Wait Retry-After seconds.
  • 500 INTERNAL_ERRORSomething went wrong on Demurly's side; it's safe to retry
  • 503 SERVICE_UNAVAILABLEThe same change is still being written by an earlier request; retry after Retry-After seconds

Get a photo

GET/api/v1/records/{id}/photos/{photo_id}

API keyScope records:read

One photo or document of a record, with a fresh download URL that works for 10 minutes. The same rules as listing a record's photos. Requires records:read.

Parameters

  • idstring (uuid)pathRequired
  • photo_idstring (uuid)pathRequired

    The photo's id (from the list, a photo upload, or a document_attached event's attachment_id)

Example request

curl "https://demurly.com/api/v1/records/3f6c1d2e-8a4b-4c1e-9f0a-1b2c3d4e5f60/photos/3f6c1d2e-8a4b-4c1e-9f0a-1b2c3d4e5f60" \
  -H "Authorization: Bearer $DEMURLY_API_KEY"

Response 200

The photo, with a download URL

Returns the record photo object (every field explained).

Example
{
  "data": {
    "id": "9c4f2a1b-6e3d-4b7a-8f20-5d1e9c3b7a44",
    "record_id": "3f6c1d2e-8a4b-4c1e-9f0a-1b2c3d4e5f60",
    "kind": "photo",
    "source": "driver_camera",
    "camera": null,
    "content_type": "image/jpeg",
    "size_bytes": 482113,
    "sha256": "4f3c9a0e7b1d2c6f8e5a3b9d0c7e1f2a6b8d4c0e9f3a7b1c5d2e8f6a0b4c9d3e",
    "width": 3024,
    "height": 4032,
    "taken_at": "2026-01-15T14:41:12.000Z",
    "time_zone": "America/Chicago",
    "taken_at_local": "2026-01-15T08:41:12.000-06:00",
    "uploaded_at": "2026-01-15T14:41:15.204Z",
    "download_url": "https://storage.demurly.com/storage/v1/object/sign/record-photos/3f6c1d2e-8a4b-4c1e-9f0a-1b2c3d4e5f60/1768488072000_a1b2c3d4.jpg?token=eyJhbGciOiJIUzI1NiJ9.sig",
    "download_url_expires_at": "2026-11-09T18:30:00.000Z"
  },
  "livemode": true
}

Errors

  • 401 UNAUTHORIZEDMissing, malformed, invalid, revoked or expired API key
  • 403 FORBIDDENThe key lacks the scope, its creator is no longer an admin, the organization is inactive, or only the other side can do this (only carriers send and attach photos, only fuel buyers approve and dispute, only carriers list drivers)
  • 404 NOT_FOUNDNot found, or not visible to this organization. An unknown /api/v1 path is 404 NOT_FOUND in the same JSON shape.
  • 405 METHOD_NOT_ALLOWEDThis path doesn't take that method (code METHOD_NOT_ALLOWED). Allow and details.allow list the ones it does.
  • 409 CONFLICTThe record's state doesn't allow this. The code says whether a retry can help; retryable ones come with Retry-After.
  • 429 RATE_LIMITEDOver a rate limit: the API key's own per-minute limit (1 to 1,000, default 60), your company's 3,000 requests a minute across all its keys, or 60 requests a minute with a missing or invalid key from one IP address. Wait Retry-After seconds.
  • 500 INTERNAL_ERRORSomething went wrong on Demurly's side; it's safe to retry

Drivers

List drivers

GET/api/v1/drivers

API keyScope drivers:read

Your drivers (carriers only). Requires drivers:read.

Parameters

  • limitintegerqueryOptional

    Page size, a whole number from 1 to 1,000 (default 1,000); anything else is 400 VALIDATION_ERROR naming limit (1 to 1000) Default 1000.

  • cursorstringqueryOptional

    The next_cursor of the previous page (opaque); anything else is 400 VALIDATION_ERROR naming cursor

Example request

curl "https://demurly.com/api/v1/drivers" \
  -H "Authorization: Bearer $DEMURLY_API_KEY"

Response 200

A page of your drivers, oldest first (limit, cursor)

Returns the driver object (every field explained).

Example
{
  "data": [
    {
      "id": "d1a2b3c4-0000-4000-8000-000000000011",
      "driver_number": "1001",
      "first_name": "John",
      "last_name": "Smith",
      "is_active": true,
      "created_at": "2025-11-02T15:00:00.000Z"
    }
  ],
  "has_more": false,
  "next_cursor": null,
  "livemode": true
}

Errors

  • 400 BAD_REQUESTInvalid parameter (code BAD_REQUEST or VALIDATION_ERROR). Query parameters are checked, never silently changed: a limit out of range, an unknown status, include or format value, or a cursor this API didn't return is 400 VALIDATION_ERROR with details.fields naming the parameter. Unknown query parameters are ignored.
  • 401 UNAUTHORIZEDMissing, malformed, invalid, revoked or expired API key
  • 403 FORBIDDENCustomer organization, missing drivers:read scope, or inactive organization
  • 405 METHOD_NOT_ALLOWEDThis path doesn't take that method (code METHOD_NOT_ALLOWED). Allow and details.allow list the ones it does.
  • 429 RATE_LIMITEDOver a rate limit: the API key's own per-minute limit (1 to 1,000, default 60), your company's 3,000 requests a minute across all its keys, or 60 requests a minute with a missing or invalid key from one IP address. Wait Retry-After seconds.
  • 500 INTERNAL_ERRORSomething went wrong on Demurly's side; it's safe to retry

Terminals

List terminals

GET/api/v1/terminals

API keyScope terminals:read

Terminals configured for your organization. Requires terminals:read.

Parameters

  • limitintegerqueryOptional

    Page size, a whole number from 1 to 1,000 (default 1,000); anything else is 400 VALIDATION_ERROR naming limit (1 to 1000) Default 1000.

  • cursorstringqueryOptional

    The next_cursor of the previous page (opaque); anything else is 400 VALIDATION_ERROR naming cursor

Example request

curl "https://demurly.com/api/v1/terminals" \
  -H "Authorization: Bearer $DEMURLY_API_KEY"

Response 200

A page of the terminals configured for your organization, oldest first (limit, cursor)

Returns the terminal object (every field explained).

Example
{
  "data": [
    {
      "id": "a1b2c3d4-0000-4000-8000-000000000003",
      "name": "Houston Terminal",
      "address": "1200 Port Rd",
      "city": "Houston",
      "state": "TX",
      "zip": "77029",
      "latitude": 29.7604,
      "longitude": -95.3698,
      "time_zone": "America/Chicago"
    }
  ],
  "has_more": false,
  "next_cursor": null,
  "livemode": true
}

Errors

  • 400 BAD_REQUESTInvalid parameter (code BAD_REQUEST or VALIDATION_ERROR). Query parameters are checked, never silently changed: a limit out of range, an unknown status, include or format value, or a cursor this API didn't return is 400 VALIDATION_ERROR with details.fields naming the parameter. Unknown query parameters are ignored.
  • 401 UNAUTHORIZEDMissing, malformed, invalid, revoked or expired API key
  • 403 FORBIDDENThe key lacks the scope, its creator is no longer an admin, the organization is inactive, or only the other side can do this (only carriers send and attach photos, only fuel buyers approve and dispute, only carriers list drivers)
  • 405 METHOD_NOT_ALLOWEDThis path doesn't take that method (code METHOD_NOT_ALLOWED). Allow and details.allow list the ones it does.
  • 429 RATE_LIMITEDOver a rate limit: the API key's own per-minute limit (1 to 1,000, default 60), your company's 3,000 requests a minute across all its keys, or 60 requests a minute with a missing or invalid key from one IP address. Wait Retry-After seconds.
  • 500 INTERNAL_ERRORSomething went wrong on Demurly's side; it's safe to retry

Connections

List connections

GET/api/v1/connections

API keyScope connections:read

Your carrier/customer connections. Each side sees only its own rate setting. Requires connections:read.

Parameters

  • limitintegerqueryOptional

    Page size, a whole number from 1 to 1,000 (default 1,000); anything else is 400 VALIDATION_ERROR naming limit (1 to 1000) Default 1000.

  • cursorstringqueryOptional

    The next_cursor of the previous page (opaque); anything else is 400 VALIDATION_ERROR naming cursor

Example request

curl "https://demurly.com/api/v1/connections" \
  -H "Authorization: Bearer $DEMURLY_API_KEY"

Response 200

A page of your connections, newest first (limit, cursor)

Returns the connection object (every field explained).

Example
{
  "data": [
    {
      "id": "c1a2b3c4-0000-4000-8000-000000000021",
      "status": "active",
      "role": "carrier",
      "partner": {
        "id": "a1b2c3d4-0000-4000-8000-000000000002",
        "name": "Gulf Fuel Supply",
        "type": "customer"
      },
      "hourly_rate": 100,
      "maximum_rate": null,
      "created_at": "2025-10-20T18:00:00.000Z"
    }
  ],
  "has_more": false,
  "next_cursor": null,
  "livemode": true
}

Errors

  • 400 BAD_REQUESTInvalid parameter (code BAD_REQUEST or VALIDATION_ERROR). Query parameters are checked, never silently changed: a limit out of range, an unknown status, include or format value, or a cursor this API didn't return is 400 VALIDATION_ERROR with details.fields naming the parameter. Unknown query parameters are ignored.
  • 401 UNAUTHORIZEDMissing, malformed, invalid, revoked or expired API key
  • 403 FORBIDDENThe key lacks the scope, its creator is no longer an admin, the organization is inactive, or only the other side can do this (only carriers send and attach photos, only fuel buyers approve and dispute, only carriers list drivers)
  • 405 METHOD_NOT_ALLOWEDThis path doesn't take that method (code METHOD_NOT_ALLOWED). Allow and details.allow list the ones it does.
  • 429 RATE_LIMITEDOver a rate limit: the API key's own per-minute limit (1 to 1,000, default 60), your company's 3,000 requests a minute across all its keys, or 60 requests a minute with a missing or invalid key from one IP address. Wait Retry-After seconds.
  • 500 INTERNAL_ERRORSomething went wrong on Demurly's side; it's safe to retry

Reports

List saved reports

GET/api/v1/reports

API keyScope reports:read

Reports your team saved in the report builder (Reports > Report builder > Save report), newest first. Use an id with the report data endpoint to read its rows. Requires reports:read. Part of Pro for carriers; free for fuel buyers.

Example request

curl "https://demurly.com/api/v1/reports" \
  -H "Authorization: Bearer $DEMURLY_API_KEY"

Response 200

All of your saved reports (up to 200, not paginated)

Returns the saved report object (every field explained).

Example
{
  "data": [
    {
      "id": "5a1b2c3d-0000-4000-8000-000000000031",
      "name": "Approved charges by customer",
      "columns": [
        "record_number",
        "status",
        "amount",
        "customer_name",
        "created_at"
      ],
      "date_range": {
        "type": "preset",
        "preset": "30d"
      },
      "statuses": [
        "customer_approved"
      ],
      "amount_min": null,
      "amount_max": null,
      "created_at": "2026-11-01T15:00:00.000Z",
      "updated_at": "2026-11-02T09:30:00.000Z"
    }
  ],
  "livemode": true
}

Errors

  • 401 UNAUTHORIZEDMissing, malformed, invalid, revoked or expired API key
  • 403 FORBIDDENThe key lacks the scope, its creator is no longer an admin, the organization is inactive, or only the other side can do this (only carriers send and attach photos, only fuel buyers approve and dispute, only carriers list drivers)
  • 405 METHOD_NOT_ALLOWEDThis path doesn't take that method (code METHOD_NOT_ALLOWED). Allow and details.allow list the ones it does.
  • 429 RATE_LIMITEDOver a rate limit: the API key's own per-minute limit (1 to 1,000, default 60), your company's 3,000 requests a minute across all its keys, or 60 requests a minute with a missing or invalid key from one IP address. Wait Retry-After seconds.
  • 500 INTERNAL_ERRORSomething went wrong on Demurly's side; it's safe to retry

Get a saved report's rows

GET/api/v1/reports/{id}/data

API keyScope reports:read

Runs a saved report now and returns its rows, for Power BI, Excel (Power Query) and Tableau to refresh on a schedule. Rows are flat, keyed by stable snake_case column names; numbers are numbers, times are ISO 8601 in UTC, and empty values are null (empty cells in CSV). Every row ends with time_zone: the IANA zone of the record's terminal (for example America/Phoenix), so you can show each time as the terminal's clock showed it; the times themselves stay UTC. A rolling date range such as the last 30 days ends at the time of the request and applies to when each wait started; a custom range and year to date are days on your company's calendar, and a record is in them by the day its wait started at its terminal (its local day). Requires reports:read. Part of Pro for carriers; free for fuel buyers. At most 50,000 rows come back (fewer with limit). JSON says truncated: true when more matched; every answer carries X-Demurly-Truncated: true or false. A CSV that would be cut at 50,000 rows without a limit is refused with 413 instead of looking complete.

Parameters

  • idstring (uuid)pathRequired

    The saved report's id (from the list of saved reports)

  • formatstringqueryOptional

    json (default) or csv (any case); anything else is 400 VALIDATION_ERROR naming format (one of: json, csv) Default json.

  • limitintegerqueryOptional

    The most rows to return, a whole number from 1 to 50,000 (default 50,000); anything else is 400 VALIDATION_ERROR naming limit (1 to 50000) Default 50000.

Example request

curl "https://demurly.com/api/v1/reports/3f6c1d2e-8a4b-4c1e-9f0a-1b2c3d4e5f60/data" \
  -H "Authorization: Bearer $DEMURLY_API_KEY"

Response 200

The report's rows, newest record first

Returns the report data object (every field explained).

Example
{
  "report": {
    "id": "5a1b2c3d-0000-4000-8000-000000000031",
    "name": "Approved charges by customer",
    "updated_at": "2026-11-02T09:30:00.000Z"
  },
  "generated_at": "2026-11-06T12:00:00.000Z",
  "columns": [
    {
      "name": "record_number",
      "label": "Record Number",
      "type": "string"
    },
    {
      "name": "amount",
      "label": "Amount",
      "type": "number"
    },
    {
      "name": "start_time",
      "label": "Start (UTC)",
      "type": "datetime"
    },
    {
      "name": "time_zone",
      "label": "Time zone ID",
      "type": "string"
    }
  ],
  "data": [
    {
      "record_number": "DMR-00001042",
      "amount": 125,
      "start_time": "2026-11-05T15:30:00.000Z",
      "time_zone": "America/Phoenix"
    }
  ],
  "row_count": 1,
  "truncated": false,
  "livemode": true
}

Errors

  • 400 BAD_REQUESTformat or limit is invalid
  • 401 UNAUTHORIZEDMissing, malformed, invalid, revoked or expired API key
  • 403 FORBIDDENThe key lacks the scope, its creator is no longer an admin, the organization is inactive, or only the other side can do this (only carriers send and attach photos, only fuel buyers approve and dispute, only carriers list drivers)
  • 404 NOT_FOUNDNot found, or not visible to this organization. An unknown /api/v1 path is 404 NOT_FOUND in the same JSON shape.
  • 405 METHOD_NOT_ALLOWEDThis path doesn't take that method (code METHOD_NOT_ALLOWED). Allow and details.allow list the ones it does.
  • 409 CONFLICTThe saved report can no longer be read; open it in the report builder and save it again
  • 413 PAYLOAD_TOO_LARGEA CSV would have more than 50,000 rows; narrow the report, pass limit, or use JSON
  • 429 RATE_LIMITEDOver a rate limit: the API key's own per-minute limit (1 to 1,000, default 60), your company's 3,000 requests a minute across all its keys, or 60 requests a minute with a missing or invalid key from one IP address. Wait Retry-After seconds.
  • 500 INTERNAL_ERRORSomething went wrong on Demurly's side; it's safe to retry

Disputes

List disputes

GET/api/v1/disputes

API keyScope records:read

Records the buyer disputed, newest first, each with a dispute summary. A dispute isn't its own object: it's the record, so id is the record's id. state=open (the default) lists records disputed or escalated now; resolved those disputed that have moved on (approved, paid, closed...); all both. A fuel buyer sees its own dispute rounds only. Accepts the same search as List records. Requires records:read.

Parameters

  • statestringqueryOptional

    (one of: open, resolved, all) Default open.

  • qstringqueryOptional

    Record number, load, BOL or container number containing this (case-insensitive, up to 100 characters) (up to 100 characters)

  • terminal_idstring (uuid)queryOptional

    Only records at this terminal

  • partner_idstring (uuid)queryOptional

    Only records with this other company: the fuel buyer on a carrier's records, the carrier on a buyer's

  • started_fromstringqueryOptional

    The wait started at or after this (a date is UTC midnight, or an ISO 8601 date-time with an offset)

  • started_tostringqueryOptional

    The wait started before this

  • amount_minnumberqueryOptional

    Amount at least this (dollars) (at least 0)

  • amount_maxnumberqueryOptional

    Amount at most this (dollars) (at least 0)

  • limitintegerqueryOptional

    Page size, a whole number from 1 to 100 (default 50) (1 to 100) Default 50.

  • cursorstringqueryOptional

    next_cursor from the previous page

Example request

curl "https://demurly.com/api/v1/disputes" \
  -H "Authorization: Bearer $DEMURLY_API_KEY"

Response 200

A page of disputed records

Returns the disputed record object (every field explained).

Example (from the schema)
{
  "data": [
    {
      "id": "7b2e4c19-5d3a-4f8e-9a61-2c0d8e7f1a34",
      "record_number": "DMR-00001043",
      "status": "sent_to_customer",
      "carrier": {
        "id": "a1b2c3d4-0000-4000-8000-000000000001",
        "name": "Acme Trucking"
      },
      "customer": {
        "id": "a1b2c3d4-0000-4000-8000-000000000002",
        "name": "Gulf Fuel Supply"
      },
      "terminal": {
        "id": "a1b2c3d4-0000-4000-8000-000000000003",
        "name": "Houston Terminal",
        "time_zone": "America/Chicago"
      },
      "load_number": "L-55821",
      "bol_number": "BOL-99812",
      "container_number": null,
      "start_time": "2026-01-15T14:30:00.000Z",
      "end_time": "2026-01-15T17:45:00.000Z",
      "time_zone": "America/Chicago",
      "time_zone_source": "terminal",
      "start_time_local": "2026-01-15T08:30:00.000-06:00",
      "end_time_local": "2026-01-15T11:45:00.000-06:00",
      "local_start_date": "2026-01-15",
      "adjusted_start_time": null,
      "adjusted_end_time": null,
      "time_adjustment_reason": null,
      "total_minutes": 195,
      "free_time_minutes": 120,
      "billable_minutes": 75,
      "billed_minutes": 75,
      "hourly_rate": 100,
      "amount": 125,
      "amount_approved": null,
      "currency": "usd",
      "stop_reason": "manual",
      "started_offline": false,
      "start_received_at": null,
      "start_clock_drift_seconds": null,
      "gps_evidence": {
        "status": "not_tracked",
        "source": "phone",
        "point_count": 0,
        "issues": []
      },
      "source": "api",
      "source_label": "Reported by Acme Trucking's own system.",
      "vehicle": null,
      "evidence_hash": null,
      "sent_to_customer_at": "2026-01-15T18:02:12.000Z",
      "approved_at": null,
      "paid_at": null,
      "created_at": "2026-01-15T18:02:11.000Z",
      "updated_at": "2026-01-15T18:02:12.000Z",
      "dispute": {
        "state": "open",
        "opened_at": "2026-01-15T08:30:00Z",
        "reason": "string",
        "dispute_type": "string",
        "proposed_amount": 0,
        "escalated_at": "2026-01-15T08:30:00Z",
        "rounds": 0
      }
    }
  ],
  "has_more": true,
  "next_cursor": "string",
  "livemode": true
}

Errors

  • 400 BAD_REQUESTInvalid parameter (code BAD_REQUEST or VALIDATION_ERROR). Query parameters are checked, never silently changed: a limit out of range, an unknown status, include or format value, or a cursor this API didn't return is 400 VALIDATION_ERROR with details.fields naming the parameter. Unknown query parameters are ignored.
  • 401 UNAUTHORIZEDMissing, malformed, invalid, revoked or expired API key
  • 403 FORBIDDENThe key lacks the scope, its creator is no longer an admin, the organization is inactive, or only the other side can do this (only carriers send and attach photos, only fuel buyers approve and dispute, only carriers list drivers)
  • 405 METHOD_NOT_ALLOWEDThis path doesn't take that method (code METHOD_NOT_ALLOWED). Allow and details.allow list the ones it does.
  • 429 RATE_LIMITEDOver a rate limit: the API key's own per-minute limit (1 to 1,000, default 60), your company's 3,000 requests a minute across all its keys, or 60 requests a minute with a missing or invalid key from one IP address. Wait Retry-After seconds.
  • 500 INTERNAL_ERRORSomething went wrong on Demurly's side; it's safe to retry

Get a dispute

GET/api/v1/disputes/{id}

API keyScope records:read

One record's dispute: the record, its dispute summary, and the dispute's events (disputes, the carrier's adjusted times and resends, escalations, accepted offers, approvals and comments), oldest first. {id} is the record's id; 404 when it was never disputed. Requires records:read.

Parameters

  • idstring (uuid)pathRequired

Example request

curl "https://demurly.com/api/v1/disputes/3f6c1d2e-8a4b-4c1e-9f0a-1b2c3d4e5f60" \
  -H "Authorization: Bearer $DEMURLY_API_KEY"

Response 200

The dispute

Example (from the schema)
{
  "data": {
    "id": "7b2e4c19-5d3a-4f8e-9a61-2c0d8e7f1a34",
    "record_number": "DMR-00001043",
    "status": "sent_to_customer",
    "carrier": {
      "id": "a1b2c3d4-0000-4000-8000-000000000001",
      "name": "Acme Trucking"
    },
    "customer": {
      "id": "a1b2c3d4-0000-4000-8000-000000000002",
      "name": "Gulf Fuel Supply"
    },
    "terminal": {
      "id": "a1b2c3d4-0000-4000-8000-000000000003",
      "name": "Houston Terminal",
      "time_zone": "America/Chicago"
    },
    "load_number": "L-55821",
    "bol_number": "BOL-99812",
    "container_number": null,
    "start_time": "2026-01-15T14:30:00.000Z",
    "end_time": "2026-01-15T17:45:00.000Z",
    "time_zone": "America/Chicago",
    "time_zone_source": "terminal",
    "start_time_local": "2026-01-15T08:30:00.000-06:00",
    "end_time_local": "2026-01-15T11:45:00.000-06:00",
    "local_start_date": "2026-01-15",
    "adjusted_start_time": null,
    "adjusted_end_time": null,
    "time_adjustment_reason": null,
    "total_minutes": 195,
    "free_time_minutes": 120,
    "billable_minutes": 75,
    "billed_minutes": 75,
    "hourly_rate": 100,
    "amount": 125,
    "amount_approved": null,
    "currency": "usd",
    "stop_reason": "manual",
    "started_offline": false,
    "start_received_at": null,
    "start_clock_drift_seconds": null,
    "gps_evidence": {
      "status": "not_tracked",
      "source": "phone",
      "point_count": 0,
      "issues": []
    },
    "source": "api",
    "source_label": "Reported by Acme Trucking's own system.",
    "vehicle": null,
    "evidence_hash": null,
    "sent_to_customer_at": "2026-01-15T18:02:12.000Z",
    "approved_at": null,
    "paid_at": null,
    "created_at": "2026-01-15T18:02:11.000Z",
    "updated_at": "2026-01-15T18:02:12.000Z",
    "dispute": {
      "state": "open",
      "opened_at": "2026-01-15T08:30:00Z",
      "reason": "string",
      "dispute_type": "string",
      "proposed_amount": 0,
      "escalated_at": "2026-01-15T08:30:00Z",
      "rounds": 0
    },
    "events": [
      {
        "id": "3f6c1d2e-8a4b-4c1e-9f0a-1b2c3d4e5f60",
        "type": "string",
        "sequence": 0,
        "actor_type": "string",
        "occurred_at": "2026-01-15T08:30:00Z",
        "recorded_at": "2026-01-15T08:30:00Z",
        "data": {}
      }
    ]
  },
  "livemode": true
}

Errors

  • 401 UNAUTHORIZEDMissing, malformed, invalid, revoked or expired API key
  • 403 FORBIDDENThe key lacks the scope, its creator is no longer an admin, the organization is inactive, or only the other side can do this (only carriers send and attach photos, only fuel buyers approve and dispute, only carriers list drivers)
  • 404 NOT_FOUNDNot found, or not visible to this organization. An unknown /api/v1 path is 404 NOT_FOUND in the same JSON shape.
  • 405 METHOD_NOT_ALLOWEDThis path doesn't take that method (code METHOD_NOT_ALLOWED). Allow and details.allow list the ones it does.
  • 429 RATE_LIMITEDOver a rate limit: the API key's own per-minute limit (1 to 1,000, default 60), your company's 3,000 requests a minute across all its keys, or 60 requests a minute with a missing or invalid key from one IP address. Wait Retry-After seconds.
  • 500 INTERNAL_ERRORSomething went wrong on Demurly's side; it's safe to retry

Invoices

List invoices

GET/api/v1/invoices

API keyScope records:read

Approved charges as invoices, newest first. In Demurly each approved charge is its invoice: the invoice number is the record number, id is the record's id, and the amount is what was approved. Accepts the same search as List records. Requires records:read.

Parameters

  • statusstringqueryOptional

    unpaid (approved, not paid), payment_pending (a bank debit clearing or a check the carrier hasn't confirmed), paid, closed (closed without payment); default all (one of: unpaid, payment_pending, paid, closed)

  • qstringqueryOptional

    Record number, load, BOL or container number containing this (case-insensitive, up to 100 characters) (up to 100 characters)

  • terminal_idstring (uuid)queryOptional

    Only records at this terminal

  • partner_idstring (uuid)queryOptional

    Only records with this other company: the fuel buyer on a carrier's records, the carrier on a buyer's

  • started_fromstringqueryOptional

    The wait started at or after this (a date is UTC midnight, or an ISO 8601 date-time with an offset)

  • started_tostringqueryOptional

    The wait started before this

  • amount_minnumberqueryOptional

    Amount at least this (dollars) (at least 0)

  • amount_maxnumberqueryOptional

    Amount at most this (dollars) (at least 0)

  • disputedbooleanqueryOptional

    true: only records that were ever disputed; false: only ones that never were

  • limitintegerqueryOptional

    Page size, a whole number from 1 to 100 (default 50) (1 to 100) Default 50.

  • cursorstringqueryOptional

    next_cursor from the previous page

Example request

curl "https://demurly.com/api/v1/invoices" \
  -H "Authorization: Bearer $DEMURLY_API_KEY"

Response 200

A page of invoices

Returns the invoice object (every field explained).

Example (from the schema)
{
  "data": [
    {
      "id": "3f6c1d2e-8a4b-4c1e-9f0a-1b2c3d4e5f60",
      "invoice_number": "DMR-00001042",
      "record_id": "3f6c1d2e-8a4b-4c1e-9f0a-1b2c3d4e5f60",
      "status": "unpaid",
      "carrier": {
        "id": "string",
        "name": "string"
      },
      "customer": {
        "id": "string",
        "name": "string"
      },
      "amount": 0,
      "currency": "usd",
      "load_number": "string",
      "bol_number": "string",
      "approved_at": "2026-01-15T08:30:00Z",
      "paid_at": "2026-01-15T08:30:00Z",
      "pdf_url": "string"
    }
  ],
  "has_more": true,
  "next_cursor": "string",
  "livemode": true
}

Errors

  • 400 BAD_REQUESTInvalid parameter (code BAD_REQUEST or VALIDATION_ERROR). Query parameters are checked, never silently changed: a limit out of range, an unknown status, include or format value, or a cursor this API didn't return is 400 VALIDATION_ERROR with details.fields naming the parameter. Unknown query parameters are ignored.
  • 401 UNAUTHORIZEDMissing, malformed, invalid, revoked or expired API key
  • 403 FORBIDDENThe key lacks the scope, its creator is no longer an admin, the organization is inactive, or only the other side can do this (only carriers send and attach photos, only fuel buyers approve and dispute, only carriers list drivers)
  • 405 METHOD_NOT_ALLOWEDThis path doesn't take that method (code METHOD_NOT_ALLOWED). Allow and details.allow list the ones it does.
  • 429 RATE_LIMITEDOver a rate limit: the API key's own per-minute limit (1 to 1,000, default 60), your company's 3,000 requests a minute across all its keys, or 60 requests a minute with a missing or invalid key from one IP address. Wait Retry-After seconds.
  • 500 INTERNAL_ERRORSomething went wrong on Demurly's side; it's safe to retry

Get an invoice

GET/api/v1/invoices/{id}

API keyScope records:read

One invoice; {id} is the record's id. 404 until the charge is approved. Requires records:read.

Parameters

  • idstring (uuid)pathRequired

Example request

curl "https://demurly.com/api/v1/invoices/3f6c1d2e-8a4b-4c1e-9f0a-1b2c3d4e5f60" \
  -H "Authorization: Bearer $DEMURLY_API_KEY"

Response 200

The invoice

Returns the invoice object (every field explained).

Example (from the schema)
{
  "data": {
    "id": "3f6c1d2e-8a4b-4c1e-9f0a-1b2c3d4e5f60",
    "invoice_number": "DMR-00001042",
    "record_id": "3f6c1d2e-8a4b-4c1e-9f0a-1b2c3d4e5f60",
    "status": "unpaid",
    "carrier": {
      "id": "string",
      "name": "string"
    },
    "customer": {
      "id": "string",
      "name": "string"
    },
    "amount": 0,
    "currency": "usd",
    "load_number": "string",
    "bol_number": "string",
    "approved_at": "2026-01-15T08:30:00Z",
    "paid_at": "2026-01-15T08:30:00Z",
    "pdf_url": "string"
  },
  "livemode": true
}

Errors

  • 401 UNAUTHORIZEDMissing, malformed, invalid, revoked or expired API key
  • 403 FORBIDDENThe key lacks the scope, its creator is no longer an admin, the organization is inactive, or only the other side can do this (only carriers send and attach photos, only fuel buyers approve and dispute, only carriers list drivers)
  • 404 NOT_FOUNDNot found, or not visible to this organization. An unknown /api/v1 path is 404 NOT_FOUND in the same JSON shape.
  • 405 METHOD_NOT_ALLOWEDThis path doesn't take that method (code METHOD_NOT_ALLOWED). Allow and details.allow list the ones it does.
  • 429 RATE_LIMITEDOver a rate limit: the API key's own per-minute limit (1 to 1,000, default 60), your company's 3,000 requests a minute across all its keys, or 60 requests a minute with a missing or invalid key from one IP address. Wait Retry-After seconds.
  • 500 INTERNAL_ERRORSomething went wrong on Demurly's side; it's safe to retry

Download an invoice PDF

GET/api/v1/invoices/{id}/pdf

API keyScope records:read

The invoice as a PDF, the same file the app downloads. Requires records:read.

Parameters

  • idstring (uuid)pathRequired

Example request

curl "https://demurly.com/api/v1/invoices/3f6c1d2e-8a4b-4c1e-9f0a-1b2c3d4e5f60/pdf" \
  -H "Authorization: Bearer $DEMURLY_API_KEY"

Response 200

The PDF

No response body.

Errors

  • 401 UNAUTHORIZEDMissing, malformed, invalid, revoked or expired API key
  • 403 FORBIDDENThe key lacks the scope, its creator is no longer an admin, the organization is inactive, or only the other side can do this (only carriers send and attach photos, only fuel buyers approve and dispute, only carriers list drivers)
  • 404 NOT_FOUNDNot found, or not visible to this organization. An unknown /api/v1 path is 404 NOT_FOUND in the same JSON shape.
  • 405 METHOD_NOT_ALLOWEDThis path doesn't take that method (code METHOD_NOT_ALLOWED). Allow and details.allow list the ones it does.
  • 429 RATE_LIMITEDOver a rate limit: the API key's own per-minute limit (1 to 1,000, default 60), your company's 3,000 requests a minute across all its keys, or 60 requests a minute with a missing or invalid key from one IP address. Wait Retry-After seconds.
  • 500 INTERNAL_ERRORSomething went wrong on Demurly's side; it's safe to retry

Stats

Waits by terminal

GET/api/v1/stats/terminals

API keyScope analytics:read

For records whose wait started in the range: how many, total and average wait, billable minutes, billed and approved amounts, by terminal, biggest billed amount first. Never counts waits still recording, cancelled or rejected. Requires analytics:read.

Parameters

  • fromstringqueryOptional

    Records whose wait started at or after this (a date is UTC midnight). Default 30 days before to; the range can be at most two years

  • tostringqueryOptional

    ...and before this. Default now

Example request

curl "https://demurly.com/api/v1/stats/terminals" \
  -H "Authorization: Bearer $DEMURLY_API_KEY"

Response 200

Waits by terminal

Returns the terminal stats object (every field explained).

Example
{
  "from": "2026-10-11T00:00:00.000Z",
  "to": "2026-11-10T00:00:00.000Z",
  "data": [
    {
      "terminal": {
        "id": "a1b2c3d4-0000-4000-8000-000000000003",
        "name": "Houston Terminal"
      },
      "records": 14,
      "wait_minutes": 2730,
      "average_wait_minutes": 195,
      "billable_minutes": 1050,
      "billed_amount": 1750,
      "approved_amount": 1500
    }
  ],
  "livemode": true
}

Errors

  • 400 BAD_REQUESTInvalid parameter (code BAD_REQUEST or VALIDATION_ERROR). Query parameters are checked, never silently changed: a limit out of range, an unknown status, include or format value, or a cursor this API didn't return is 400 VALIDATION_ERROR with details.fields naming the parameter. Unknown query parameters are ignored.
  • 401 UNAUTHORIZEDMissing, malformed, invalid, revoked or expired API key
  • 403 FORBIDDENThe key lacks the scope, its creator is no longer an admin, the organization is inactive, or only the other side can do this (only carriers send and attach photos, only fuel buyers approve and dispute, only carriers list drivers)
  • 405 METHOD_NOT_ALLOWEDThis path doesn't take that method (code METHOD_NOT_ALLOWED). Allow and details.allow list the ones it does.
  • 429 RATE_LIMITEDOver a rate limit: the API key's own per-minute limit (1 to 1,000, default 60), your company's 3,000 requests a minute across all its keys, or 60 requests a minute with a missing or invalid key from one IP address. Wait Retry-After seconds.
  • 500 INTERNAL_ERRORSomething went wrong on Demurly's side; it's safe to retry

Waits by carrier or buyer

GET/api/v1/stats/partners

API keyScope analytics:read

For records whose wait started in the range: how many, how many were disputed, total and average wait, billed and approved amounts, by the other company on the record (a carrier's fuel buyers, a fuel buyer's carriers), most disputed first. A fuel buyer counts only its own disputes. Never counts waits still recording, cancelled or rejected. Requires analytics:read.

Parameters

  • fromstringqueryOptional

    Records whose wait started at or after this (a date is UTC midnight). Default 30 days before to; the range can be at most two years

  • tostringqueryOptional

    ...and before this. Default now

Example request

curl "https://demurly.com/api/v1/stats/partners" \
  -H "Authorization: Bearer $DEMURLY_API_KEY"

Response 200

Waits by carrier or buyer

Returns the partner stats object (every field explained).

Example
{
  "from": "2026-10-11T00:00:00.000Z",
  "to": "2026-11-10T00:00:00.000Z",
  "data": [
    {
      "partner": {
        "id": "a1b2c3d4-0000-4000-8000-000000000004",
        "type": "carrier",
        "name": "Acme Trucking"
      },
      "records": 22,
      "disputed_records": 4,
      "wait_minutes": 4180,
      "average_wait_minutes": 190,
      "billed_amount": 2950,
      "approved_amount": 2400
    }
  ],
  "livemode": true
}

Errors

  • 400 BAD_REQUESTInvalid parameter (code BAD_REQUEST or VALIDATION_ERROR). Query parameters are checked, never silently changed: a limit out of range, an unknown status, include or format value, or a cursor this API didn't return is 400 VALIDATION_ERROR with details.fields naming the parameter. Unknown query parameters are ignored.
  • 401 UNAUTHORIZEDMissing, malformed, invalid, revoked or expired API key
  • 403 FORBIDDENThe key lacks the scope, its creator is no longer an admin, the organization is inactive, or only the other side can do this (only carriers send and attach photos, only fuel buyers approve and dispute, only carriers list drivers)
  • 405 METHOD_NOT_ALLOWEDThis path doesn't take that method (code METHOD_NOT_ALLOWED). Allow and details.allow list the ones it does.
  • 429 RATE_LIMITEDOver a rate limit: the API key's own per-minute limit (1 to 1,000, default 60), your company's 3,000 requests a minute across all its keys, or 60 requests a minute with a missing or invalid key from one IP address. Wait Retry-After seconds.
  • 500 INTERNAL_ERRORSomething went wrong on Demurly's side; it's safe to retry

Demurrage by week or month

GET/api/v1/stats/demurrage

API keyScope analytics:read

For records whose wait started in the range, by week (starting Monday) or month on your company's calendar: how many, total wait, billed, approved and paid amounts. Periods with no records are left out. Requires analytics:read.

Parameters

  • fromstringqueryOptional

    Records whose wait started at or after this (a date is UTC midnight). Default 30 days before to; the range can be at most two years

  • tostringqueryOptional

    ...and before this. Default now

  • intervalstringqueryOptional

    (one of: week, month) Default month.

Example request

curl "https://demurly.com/api/v1/stats/demurrage" \
  -H "Authorization: Bearer $DEMURLY_API_KEY"

Response 200

Demurrage by period

Returns the period stats object (every field explained).

Example (from the schema)
{
  "from": "2026-01-15T08:30:00Z",
  "to": "2026-01-15T08:30:00Z",
  "interval": "week",
  "time_zone": "America/Chicago",
  "data": [
    {
      "period_start": "2026-01-15",
      "records": 0,
      "wait_minutes": 0,
      "billed_amount": 0,
      "approved_amount": 0,
      "paid_amount": 0
    }
  ],
  "livemode": true
}

Errors

  • 400 BAD_REQUESTInvalid parameter (code BAD_REQUEST or VALIDATION_ERROR). Query parameters are checked, never silently changed: a limit out of range, an unknown status, include or format value, or a cursor this API didn't return is 400 VALIDATION_ERROR with details.fields naming the parameter. Unknown query parameters are ignored.
  • 401 UNAUTHORIZEDMissing, malformed, invalid, revoked or expired API key
  • 403 FORBIDDENThe key lacks the scope, its creator is no longer an admin, the organization is inactive, or only the other side can do this (only carriers send and attach photos, only fuel buyers approve and dispute, only carriers list drivers)
  • 405 METHOD_NOT_ALLOWEDThis path doesn't take that method (code METHOD_NOT_ALLOWED). Allow and details.allow list the ones it does.
  • 429 RATE_LIMITEDOver a rate limit: the API key's own per-minute limit (1 to 1,000, default 60), your company's 3,000 requests a minute across all its keys, or 60 requests a minute with a missing or invalid key from one IP address. Wait Retry-After seconds.
  • 500 INTERNAL_ERRORSomething went wrong on Demurly's side; it's safe to retry

Aging

GET/api/v1/stats/aging

API keyScope analytics:read

What's outstanding now, by age: charges awaiting review (sent, disputed or escalated; days since sent) and approved but unpaid (days since approved), in 0-30, 31-60, 61-90 and 90+ day buckets. Requires analytics:read.

Example request

curl "https://demurly.com/api/v1/stats/aging" \
  -H "Authorization: Bearer $DEMURLY_API_KEY"

Response 200

Aging buckets

Returns the aging stats object (every field explained).

Example (from the schema)
{
  "as_of": "2026-01-15T08:30:00Z",
  "awaiting_review": [
    {
      "days": "0-30",
      "records": 0,
      "amount": 0
    }
  ],
  "approved_unpaid": [
    {
      "days": "0-30",
      "records": 0,
      "amount": 0
    }
  ],
  "livemode": true
}

Errors

  • 401 UNAUTHORIZEDMissing, malformed, invalid, revoked or expired API key
  • 403 FORBIDDENThe key lacks the scope, its creator is no longer an admin, the organization is inactive, or only the other side can do this (only carriers send and attach photos, only fuel buyers approve and dispute, only carriers list drivers)
  • 405 METHOD_NOT_ALLOWEDThis path doesn't take that method (code METHOD_NOT_ALLOWED). Allow and details.allow list the ones it does.
  • 429 RATE_LIMITEDOver a rate limit: the API key's own per-minute limit (1 to 1,000, default 60), your company's 3,000 requests a minute across all its keys, or 60 requests a minute with a missing or invalid key from one IP address. Wait Retry-After seconds.
  • 500 INTERNAL_ERRORSomething went wrong on Demurly's side; it's safe to retry

Webhook endpoints

List webhook endpoints

GET/api/v1/webhook_endpoints

API keyScope webhooks:read

Your company's webhook endpoints (at most 10, so one page), oldest first, with whether each is on, why it was turned off, events missed while it was off, and the latest delivery. A live key lists the live endpoints, a test key the test ones. Signing secrets are never shown here, only their last four characters. Requires webhooks:read.

Example request

curl "https://demurly.com/api/v1/webhook_endpoints" \
  -H "Authorization: Bearer $DEMURLY_API_KEY"

Response 200

Your webhook endpoints

Returns the webhook endpoint object (every field explained).

Example
{
  "data": [
    {
      "id": "7b1e2c3d-4a5b-4c6d-8e7f-901234567890",
      "livemode": true,
      "url": "https://erp.example.com/demurly/webhooks",
      "description": "ERP sync",
      "events": [
        "record.approved",
        "record.paid"
      ],
      "active": true,
      "disabled_reason": null,
      "disabled_at": null,
      "failing_since": null,
      "missed_events": null,
      "secret_hint": "whsec_…9QzA",
      "secret_rolled_at": "2026-11-09T18:00:00.000Z",
      "previous_secret_expires_at": "2026-11-10T18:00:00.000Z",
      "last_delivery": {
        "status": "succeeded",
        "attempted_at": "2026-11-09T18:20:01.512Z",
        "status_code": 200
      },
      "created_at": "2026-10-01T15:00:00.000Z",
      "updated_at": "2026-11-09T18:00:00.000Z"
    }
  ],
  "has_more": false,
  "next_cursor": null,
  "livemode": true
}

Errors

  • 401 UNAUTHORIZEDMissing, malformed, invalid, revoked or expired API key
  • 403 FORBIDDENThe key lacks the scope, its creator is no longer an admin, the organization is inactive, or only the other side can do this (only carriers send and attach photos, only fuel buyers approve and dispute, only carriers list drivers)
  • 405 METHOD_NOT_ALLOWEDThis path doesn't take that method (code METHOD_NOT_ALLOWED). Allow and details.allow list the ones it does.
  • 429 RATE_LIMITEDOver a rate limit: the API key's own per-minute limit (1 to 1,000, default 60), your company's 3,000 requests a minute across all its keys, or 60 requests a minute with a missing or invalid key from one IP address. Wait Retry-After seconds.
  • 500 INTERNAL_ERRORSomething went wrong on Demurly's side; it's safe to retry

Add a webhook endpoint

POST/api/v1/webhook_endpoints

API keyScope webhooks:write

Add an endpoint that receives signed record events. The same rules as Settings > Webhooks apply. The URL must use https and point to a public address, and the events must be ones your side of a record gets (leave events out or empty for every event, including ones added later). You can have up to 10 endpoints, and carriers need the Pro plan (fuel buyers are free). The answer carries the signing secret (secret) this once; store it to verify deliveries. A retry with the same Idempotency-Key answers with secret null (it is never stored); roll the secret if you lost it. Requires webhooks:write and an Idempotency-Key.

Parameters

  • Idempotency-KeystringheaderRequired

    Any unique string (1-255 letters, digits, underscores, periods, colons or hyphens). A retry with the same key and body returns the first response instead of creating a duplicate. (up to 255 characters)

Request body

  • urlstringRequired

    https, at a public address (up to 2000 characters)

  • descriptionstringOptional

    (up to 200 characters; can be null)

  • eventsarray of stringOptional

    Event types to send; empty or left out for every event

Example request

curl -X POST "https://demurly.com/api/v1/webhook_endpoints" \
  -H "Authorization: Bearer $DEMURLY_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
  "url": "https://erp.example.com/demurly/webhooks",
  "description": "ERP sync",
  "events": [
    "record.approved",
    "record.paid"
  ]
}'

Response 201

The new endpoint, with its signing secret (shown only now)

Returns the webhook endpoint object (every field explained).

Example
{
  "data": {
    "id": "7b1e2c3d-4a5b-4c6d-8e7f-901234567890",
    "livemode": true,
    "url": "https://erp.example.com/demurly/webhooks",
    "description": "ERP sync",
    "events": [
      "record.approved",
      "record.paid"
    ],
    "active": true,
    "disabled_reason": null,
    "disabled_at": null,
    "failing_since": null,
    "missed_events": null,
    "secret_hint": "whsec_…9QzA",
    "secret_rolled_at": null,
    "previous_secret_expires_at": null,
    "last_delivery": null,
    "created_at": "2026-11-09T18:00:00.000Z",
    "updated_at": "2026-11-09T18:00:00.000Z",
    "secret": "whsec_Hk3vR8nQe2LxT0aWmZ5bYc7dUf9gJp1s"
  },
  "livemode": true
}

Errors

  • 400 BAD_REQUESTInvalid parameter (code BAD_REQUEST or VALIDATION_ERROR). Query parameters are checked, never silently changed: a limit out of range, an unknown status, include or format value, or a cursor this API didn't return is 400 VALIDATION_ERROR with details.fields naming the parameter. Unknown query parameters are ignored.
  • 401 UNAUTHORIZEDMissing, malformed, invalid, revoked or expired API key
  • 403 FORBIDDENThe key lacks the scope, its creator is no longer an admin, the organization is inactive, or only the other side can do this (only carriers send and attach photos, only fuel buyers approve and dispute, only carriers list drivers)
  • 405 METHOD_NOT_ALLOWEDThis path doesn't take that method (code METHOD_NOT_ALLOWED). Allow and details.allow list the ones it does.
  • 415 UNSUPPORTED_MEDIA_TYPEThe body isn't a type this endpoint takes. JSON endpoints need Content-Type: application/json (any charset) whenever there's a body; photos must be JPEG or PNG.
  • 422 UNPROCESSABLEThis Idempotency-Key was already used for a different request (code IDEMPOTENCY_KEY_REUSED). The body must be byte-identical to the first; use a new key for a changed request.
  • 429 RATE_LIMITEDOver a rate limit: the API key's own per-minute limit (1 to 1,000, default 60), your company's 3,000 requests a minute across all its keys, or 60 requests a minute with a missing or invalid key from one IP address. Wait Retry-After seconds.
  • 500 INTERNAL_ERRORSomething went wrong on Demurly's side; it's safe to retry
  • 503 SERVICE_UNAVAILABLEThe same change is still being written by an earlier request; retry after Retry-After seconds

Get a webhook endpoint

GET/api/v1/webhook_endpoints/{id}

API keyScope webhooks:read

One of your webhook endpoints (of the key's mode). Requires webhooks:read.

Parameters

  • idstring (uuid)pathRequired

    The endpoint's id

Example request

curl "https://demurly.com/api/v1/webhook_endpoints/3f6c1d2e-8a4b-4c1e-9f0a-1b2c3d4e5f60" \
  -H "Authorization: Bearer $DEMURLY_API_KEY"

Response 200

The endpoint

Returns the webhook endpoint object (every field explained).

Example
{
  "data": {
    "id": "7b1e2c3d-4a5b-4c6d-8e7f-901234567890",
    "livemode": true,
    "url": "https://erp.example.com/demurly/webhooks",
    "description": "ERP sync",
    "events": [
      "record.approved",
      "record.paid"
    ],
    "active": true,
    "disabled_reason": null,
    "disabled_at": null,
    "failing_since": null,
    "missed_events": null,
    "secret_hint": "whsec_…9QzA",
    "secret_rolled_at": "2026-11-09T18:00:00.000Z",
    "previous_secret_expires_at": "2026-11-10T18:00:00.000Z",
    "last_delivery": {
      "status": "succeeded",
      "attempted_at": "2026-11-09T18:20:01.512Z",
      "status_code": 200
    },
    "created_at": "2026-10-01T15:00:00.000Z",
    "updated_at": "2026-11-09T18:00:00.000Z"
  },
  "livemode": true
}

Errors

  • 401 UNAUTHORIZEDMissing, malformed, invalid, revoked or expired API key
  • 403 FORBIDDENThe key lacks the scope, its creator is no longer an admin, the organization is inactive, or only the other side can do this (only carriers send and attach photos, only fuel buyers approve and dispute, only carriers list drivers)
  • 404 NOT_FOUNDNot found, or not visible to this organization. An unknown /api/v1 path is 404 NOT_FOUND in the same JSON shape.
  • 405 METHOD_NOT_ALLOWEDThis path doesn't take that method (code METHOD_NOT_ALLOWED). Allow and details.allow list the ones it does.
  • 429 RATE_LIMITEDOver a rate limit: the API key's own per-minute limit (1 to 1,000, default 60), your company's 3,000 requests a minute across all its keys, or 60 requests a minute with a missing or invalid key from one IP address. Wait Retry-After seconds.
  • 500 INTERNAL_ERRORSomething went wrong on Demurly's side; it's safe to retry

Change a webhook endpoint

PATCH/api/v1/webhook_endpoints/{id}

API keyScope webhooks:write

Change the URL, description or events, or turn the endpoint off and on with active. While it's off, events are kept for it (paused), not lost. Turning it back on clears the failures that turned it off and leaves the missed events waiting: missed_events says how many, and the missed events endpoint sends or skips them. Turning it on needs the Pro plan for carriers. Requires webhooks:write.

Parameters

  • idstring (uuid)pathRequired

    The endpoint's id

  • Idempotency-KeystringheaderOptional

    Any unique string (1-255 letters, digits, underscores, periods, colons or hyphens). A retry with the same key and body returns the first response. (up to 255 characters)

Request body

At least one field

  • urlstringOptional

    (up to 2000 characters)

  • descriptionstringOptional

    (up to 200 characters; can be null)

  • eventsarray of stringOptional
  • activebooleanOptional

    false turns it off (events are kept as paused); true turns it back on

Example request

curl -X PATCH "https://demurly.com/api/v1/webhook_endpoints/3f6c1d2e-8a4b-4c1e-9f0a-1b2c3d4e5f60" \
  -H "Authorization: Bearer $DEMURLY_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
  "events": [
    "record.approved",
    "record.paid",
    "record.disputed"
  ],
  "active": true
}'

Response 200

The endpoint after the change

Returns the webhook endpoint object (every field explained).

Example
{
  "data": {
    "id": "7b1e2c3d-4a5b-4c6d-8e7f-901234567890",
    "livemode": true,
    "url": "https://erp.example.com/demurly/webhooks",
    "description": "ERP sync",
    "events": [
      "record.approved",
      "record.paid",
      "record.disputed"
    ],
    "active": true,
    "disabled_reason": null,
    "disabled_at": null,
    "failing_since": null,
    "missed_events": null,
    "secret_hint": "whsec_…9QzA",
    "secret_rolled_at": "2026-11-09T18:00:00.000Z",
    "previous_secret_expires_at": "2026-11-10T18:00:00.000Z",
    "last_delivery": {
      "status": "succeeded",
      "attempted_at": "2026-11-09T18:20:01.512Z",
      "status_code": 200
    },
    "created_at": "2026-10-01T15:00:00.000Z",
    "updated_at": "2026-11-09T19:00:00.000Z"
  },
  "livemode": true
}

Errors

  • 400 BAD_REQUESTInvalid parameter (code BAD_REQUEST or VALIDATION_ERROR). Query parameters are checked, never silently changed: a limit out of range, an unknown status, include or format value, or a cursor this API didn't return is 400 VALIDATION_ERROR with details.fields naming the parameter. Unknown query parameters are ignored.
  • 401 UNAUTHORIZEDMissing, malformed, invalid, revoked or expired API key
  • 403 FORBIDDENThe key lacks the scope, its creator is no longer an admin, the organization is inactive, or only the other side can do this (only carriers send and attach photos, only fuel buyers approve and dispute, only carriers list drivers)
  • 404 NOT_FOUNDNot found, or not visible to this organization. An unknown /api/v1 path is 404 NOT_FOUND in the same JSON shape.
  • 405 METHOD_NOT_ALLOWEDThis path doesn't take that method (code METHOD_NOT_ALLOWED). Allow and details.allow list the ones it does.
  • 415 UNSUPPORTED_MEDIA_TYPEThe body isn't a type this endpoint takes. JSON endpoints need Content-Type: application/json (any charset) whenever there's a body; photos must be JPEG or PNG.
  • 422 UNPROCESSABLEThis Idempotency-Key was already used for a different request (code IDEMPOTENCY_KEY_REUSED). The body must be byte-identical to the first; use a new key for a changed request.
  • 429 RATE_LIMITEDOver a rate limit: the API key's own per-minute limit (1 to 1,000, default 60), your company's 3,000 requests a minute across all its keys, or 60 requests a minute with a missing or invalid key from one IP address. Wait Retry-After seconds.
  • 500 INTERNAL_ERRORSomething went wrong on Demurly's side; it's safe to retry
  • 503 SERVICE_UNAVAILABLEThe same change is still being written by an earlier request; retry after Retry-After seconds

Delete a webhook endpoint

DELETE/api/v1/webhook_endpoints/{id}

API keyScope webhooks:write

Remove an endpoint. Nothing is sent to it again (deliveries waiting for it end as failed); its delivery log is kept for your records. Requires webhooks:write.

Parameters

  • idstring (uuid)pathRequired

    The endpoint's id

  • Idempotency-KeystringheaderOptional

    Any unique string (1-255 letters, digits, underscores, periods, colons or hyphens). A retry with the same key and body returns the first response. (up to 255 characters)

Example request

curl -X DELETE "https://demurly.com/api/v1/webhook_endpoints/3f6c1d2e-8a4b-4c1e-9f0a-1b2c3d4e5f60" \
  -H "Authorization: Bearer $DEMURLY_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)"

Response 204

Deleted (no body)

No response body.

Errors

  • 401 UNAUTHORIZEDMissing, malformed, invalid, revoked or expired API key
  • 403 FORBIDDENThe key lacks the scope, its creator is no longer an admin, the organization is inactive, or only the other side can do this (only carriers send and attach photos, only fuel buyers approve and dispute, only carriers list drivers)
  • 404 NOT_FOUNDNot found, or not visible to this organization. An unknown /api/v1 path is 404 NOT_FOUND in the same JSON shape.
  • 405 METHOD_NOT_ALLOWEDThis path doesn't take that method (code METHOD_NOT_ALLOWED). Allow and details.allow list the ones it does.
  • 422 UNPROCESSABLEThis Idempotency-Key was already used for a different request (code IDEMPOTENCY_KEY_REUSED). The body must be byte-identical to the first; use a new key for a changed request.
  • 429 RATE_LIMITEDOver a rate limit: the API key's own per-minute limit (1 to 1,000, default 60), your company's 3,000 requests a minute across all its keys, or 60 requests a minute with a missing or invalid key from one IP address. Wait Retry-After seconds.
  • 500 INTERNAL_ERRORSomething went wrong on Demurly's side; it's safe to retry
  • 503 SERVICE_UNAVAILABLEThe same change is still being written by an earlier request; retry after Retry-After seconds

Roll a signing secret

POST/api/v1/webhook_endpoints/{id}/roll_secret

API keyScope webhooks:write

Make a new signing secret, returned once as secret. Choose how long the old one keeps working with overlap_hours: 0 (it stops at once), 1, 24 (the default) or 168 (7 days). Until then every delivery carries two signatures, X-Demurly-Signature: t=<t>,v1=<new>,v1=<old>, so your receiver verifies with either secret: deploy the new one, then let the old one expire. previous_secret_expires_at says when it does. Rolling again during an overlap ends the older secret at once. Send an Idempotency-Key so a retry doesn't roll twice: it answers with secret null, because the secret is never stored (roll again with a new key if you lost it). Requires webhooks:write.

Parameters

  • idstring (uuid)pathRequired

    The endpoint's id

  • Idempotency-KeystringheaderOptional

    Any unique string (1-255 letters, digits, underscores, periods, colons or hyphens). A retry with the same key and body returns the first response. (up to 255 characters)

Request body

  • overlap_hoursintegerOptional

    How long the old secret keeps working: 0 (stops at once), 1, 24 or 168 hours (one of: 0, 1, 24, 168)

Example request

curl -X POST "https://demurly.com/api/v1/webhook_endpoints/3f6c1d2e-8a4b-4c1e-9f0a-1b2c3d4e5f60/roll_secret" \
  -H "Authorization: Bearer $DEMURLY_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
  "overlap_hours": 24
}'

Response 200

The endpoint, with its new signing secret (shown only now)

Returns the webhook endpoint object (every field explained).

Example
{
  "data": {
    "id": "7b1e2c3d-4a5b-4c6d-8e7f-901234567890",
    "livemode": true,
    "url": "https://erp.example.com/demurly/webhooks",
    "description": "ERP sync",
    "events": [
      "record.approved",
      "record.paid"
    ],
    "active": true,
    "disabled_reason": null,
    "disabled_at": null,
    "failing_since": null,
    "missed_events": null,
    "secret_hint": "whsec_…9QzA",
    "secret_rolled_at": "2026-11-09T18:00:00.000Z",
    "previous_secret_expires_at": "2026-11-10T18:00:00.000Z",
    "last_delivery": {
      "status": "succeeded",
      "attempted_at": "2026-11-09T18:20:01.512Z",
      "status_code": 200
    },
    "created_at": "2026-10-01T15:00:00.000Z",
    "updated_at": "2026-11-09T18:00:00.000Z",
    "secret": "whsec_Nw4sD6kVq1PzE8tGx3hLb0mRy5cAj7oU"
  },
  "livemode": true
}

Errors

  • 400 BAD_REQUESTInvalid parameter (code BAD_REQUEST or VALIDATION_ERROR). Query parameters are checked, never silently changed: a limit out of range, an unknown status, include or format value, or a cursor this API didn't return is 400 VALIDATION_ERROR with details.fields naming the parameter. Unknown query parameters are ignored.
  • 401 UNAUTHORIZEDMissing, malformed, invalid, revoked or expired API key
  • 403 FORBIDDENThe key lacks the scope, its creator is no longer an admin, the organization is inactive, or only the other side can do this (only carriers send and attach photos, only fuel buyers approve and dispute, only carriers list drivers)
  • 404 NOT_FOUNDNot found, or not visible to this organization. An unknown /api/v1 path is 404 NOT_FOUND in the same JSON shape.
  • 405 METHOD_NOT_ALLOWEDThis path doesn't take that method (code METHOD_NOT_ALLOWED). Allow and details.allow list the ones it does.
  • 415 UNSUPPORTED_MEDIA_TYPEThe body isn't a type this endpoint takes. JSON endpoints need Content-Type: application/json (any charset) whenever there's a body; photos must be JPEG or PNG.
  • 422 UNPROCESSABLEThis Idempotency-Key was already used for a different request (code IDEMPOTENCY_KEY_REUSED). The body must be byte-identical to the first; use a new key for a changed request.
  • 429 RATE_LIMITEDOver a rate limit: the API key's own per-minute limit (1 to 1,000, default 60), your company's 3,000 requests a minute across all its keys, or 60 requests a minute with a missing or invalid key from one IP address. Wait Retry-After seconds.
  • 500 INTERNAL_ERRORSomething went wrong on Demurly's side; it's safe to retry
  • 503 SERVICE_UNAVAILABLEThe same change is still being written by an earlier request; retry after Retry-After seconds

Send a test event

POST/api/v1/webhook_endpoints/{id}/test

API keyScope webhooks:write

Send a webhook.test event to the endpoint now, once and without retries, and get the delivery back with what your endpoint answered. The endpoint must be on (409 CONFLICT otherwise). At most 20 an hour per API key. Requires webhooks:write.

Parameters

  • idstring (uuid)pathRequired

    The endpoint's id

  • Idempotency-KeystringheaderOptional

    Any unique string (1-255 letters, digits, underscores, periods, colons or hyphens). A retry with the same key and body returns the first response. (up to 255 characters)

Example request

curl -X POST "https://demurly.com/api/v1/webhook_endpoints/3f6c1d2e-8a4b-4c1e-9f0a-1b2c3d4e5f60/test" \
  -H "Authorization: Bearer $DEMURLY_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)"

Response 200

The test delivery and its attempt

Returns the webhook delivery object (every field explained).

Example
{
  "data": {
    "id": "c3d4e5f6-0000-4000-8000-0000000000d2",
    "endpoint_id": "7b1e2c3d-4a5b-4c6d-8e7f-901234567890",
    "event_type": "webhook.test",
    "record_id": null,
    "status": "succeeded",
    "attempt_count": 1,
    "last_status_code": 200,
    "last_error": null,
    "next_attempt_at": null,
    "last_attempt_at": "2026-11-09T18:30:00.311Z",
    "created_at": "2026-11-09T18:30:00.120Z",
    "body": "{\"id\":\"c3d4e5f6-0000-4000-8000-0000000000d2\",\"type\":\"webhook.test\",\"created_at\":\"2026-11-09T18:30:00.120Z\",\"record_id\":null,\"sequence\":null,\"occurred_at\":\"2026-11-09T18:30:00.120Z\",\"data\":{\"message\":\"Test event from the Demurly API\"}}",
    "attempts": [
      {
        "attempt_number": 1,
        "attempted_at": "2026-11-09T18:30:00.129Z",
        "duration_ms": 176,
        "request": {
          "headers": {
            "Content-Type": "application/json",
            "User-Agent": "Demurly-Webhooks/1.0",
            "X-Demurly-Signature": "t=1794248401,v1=5f0e3c9a1b7d2e4f6a8c0b1d3e5f7a9c2b4d6e8f0a1c3e5b7d9f1a3c5e7b9d0f2,v1=9a8b7c6d5e4f3a2b1c0d9e8f7a6b5c4d3e2f1a0b9c8d7e6f5a4b3c2d1e0f9a8b",
            "X-Demurly-Event": "webhook.test",
            "X-Demurly-Delivery": "c3d4e5f6-0000-4000-8000-0000000000d2"
          }
        },
        "response": {
          "status": 200,
          "headers": {
            "content-type": "application/json",
            "date": "Mon, 09 Nov 2026 18:21:01 GMT"
          },
          "body": "{\"received\":true}",
          "body_truncated": false
        },
        "error": null
      }
    ]
  },
  "livemode": true
}

Errors

  • 401 UNAUTHORIZEDMissing, malformed, invalid, revoked or expired API key
  • 403 FORBIDDENThe key lacks the scope, its creator is no longer an admin, the organization is inactive, or only the other side can do this (only carriers send and attach photos, only fuel buyers approve and dispute, only carriers list drivers)
  • 404 NOT_FOUNDNot found, or not visible to this organization. An unknown /api/v1 path is 404 NOT_FOUND in the same JSON shape.
  • 405 METHOD_NOT_ALLOWEDThis path doesn't take that method (code METHOD_NOT_ALLOWED). Allow and details.allow list the ones it does.
  • 409 CONFLICTThe record's state doesn't allow this. The code says whether a retry can help; retryable ones come with Retry-After.
  • 422 UNPROCESSABLEThis Idempotency-Key was already used for a different request (code IDEMPOTENCY_KEY_REUSED). The body must be byte-identical to the first; use a new key for a changed request.
  • 429 RATE_LIMITEDOver a rate limit: the API key's own per-minute limit (1 to 1,000, default 60), your company's 3,000 requests a minute across all its keys, or 60 requests a minute with a missing or invalid key from one IP address. Wait Retry-After seconds.
  • 500 INTERNAL_ERRORSomething went wrong on Demurly's side; it's safe to retry
  • 503 SERVICE_UNAVAILABLEThe same change is still being written by an earlier request; retry after Retry-After seconds

Send or skip missed events

POST/api/v1/webhook_endpoints/{id}/missed_events

API keyScope webhooks:write

The events kept for the endpoint while it was off. send queues them now, oldest first, with their original id and sequence and a fresh set of retries; the endpoint must be on (409 CONFLICT otherwise). skip leaves them unsent; they stay in the delivery log as skipped and each can still be resent. Requires webhooks:write.

Parameters

  • idstring (uuid)pathRequired

    The endpoint's id

  • Idempotency-KeystringheaderOptional

    Any unique string (1-255 letters, digits, underscores, periods, colons or hyphens). A retry with the same key and body returns the first response. (up to 255 characters)

Request body

  • actionstringRequired

    (one of: send, skip)

Example request

curl -X POST "https://demurly.com/api/v1/webhook_endpoints/3f6c1d2e-8a4b-4c1e-9f0a-1b2c3d4e5f60/missed_events" \
  -H "Authorization: Bearer $DEMURLY_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
  "action": "send"
}'

Response 200

How many events were sent or skipped, and since when they were kept

Example
{
  "data": {
    "action": "send",
    "count": 12,
    "since": "2026-11-06T02:14:09.000Z"
  },
  "livemode": true
}

Errors

  • 400 BAD_REQUESTInvalid parameter (code BAD_REQUEST or VALIDATION_ERROR). Query parameters are checked, never silently changed: a limit out of range, an unknown status, include or format value, or a cursor this API didn't return is 400 VALIDATION_ERROR with details.fields naming the parameter. Unknown query parameters are ignored.
  • 401 UNAUTHORIZEDMissing, malformed, invalid, revoked or expired API key
  • 403 FORBIDDENThe key lacks the scope, its creator is no longer an admin, the organization is inactive, or only the other side can do this (only carriers send and attach photos, only fuel buyers approve and dispute, only carriers list drivers)
  • 404 NOT_FOUNDNot found, or not visible to this organization. An unknown /api/v1 path is 404 NOT_FOUND in the same JSON shape.
  • 405 METHOD_NOT_ALLOWEDThis path doesn't take that method (code METHOD_NOT_ALLOWED). Allow and details.allow list the ones it does.
  • 409 CONFLICTThe record's state doesn't allow this. The code says whether a retry can help; retryable ones come with Retry-After.
  • 415 UNSUPPORTED_MEDIA_TYPEThe body isn't a type this endpoint takes. JSON endpoints need Content-Type: application/json (any charset) whenever there's a body; photos must be JPEG or PNG.
  • 422 UNPROCESSABLEThis Idempotency-Key was already used for a different request (code IDEMPOTENCY_KEY_REUSED). The body must be byte-identical to the first; use a new key for a changed request.
  • 429 RATE_LIMITEDOver a rate limit: the API key's own per-minute limit (1 to 1,000, default 60), your company's 3,000 requests a minute across all its keys, or 60 requests a minute with a missing or invalid key from one IP address. Wait Retry-After seconds.
  • 500 INTERNAL_ERRORSomething went wrong on Demurly's side; it's safe to retry
  • 503 SERVICE_UNAVAILABLEThe same change is still being written by an earlier request; retry after Retry-After seconds

List deliveries

GET/api/v1/webhook_endpoints/{id}/deliveries

API keyScope webhooks:read

The endpoint's delivery log, newest first. Each delivery has the body sent and every attempt, with the request headers (the signature included), how long it took, and the response status, headers and first 2 KB of the body (null when nothing came back). Filter with status and event_type. Requires webhooks:read.

Parameters

  • idstring (uuid)pathRequired

    The endpoint's id

  • limitintegerqueryOptional

    Page size, a whole number from 1 to 100 (default 20); anything else is 400 VALIDATION_ERROR naming limit (1 to 100) Default 20.

  • cursorstringqueryOptional

    The next_cursor of the previous page (opaque); anything else is 400 VALIDATION_ERROR naming cursor

  • statusstringqueryOptional

    Only deliveries in this state; anything else is 400 VALIDATION_ERROR naming status (one of: pending, succeeded, failed, paused, skipped)

  • event_typestringqueryOptional

    Only this event type (e.g. record.approved, or webhook.test); an unknown one is 400 VALIDATION_ERROR naming event_type

Example request

curl "https://demurly.com/api/v1/webhook_endpoints/3f6c1d2e-8a4b-4c1e-9f0a-1b2c3d4e5f60/deliveries" \
  -H "Authorization: Bearer $DEMURLY_API_KEY"

Response 200

A page of deliveries, newest first (limit, cursor)

Returns the webhook delivery object (every field explained).

Example
{
  "data": [
    {
      "id": "c3d4e5f6-0000-4000-8000-0000000000d1",
      "endpoint_id": "7b1e2c3d-4a5b-4c6d-8e7f-901234567890",
      "event_type": "record.approved",
      "record_id": "3f6c1d2e-8a4b-4c1e-9f0a-1b2c3d4e5f60",
      "status": "succeeded",
      "attempt_count": 2,
      "last_status_code": 200,
      "last_error": null,
      "next_attempt_at": null,
      "last_attempt_at": "2026-11-09T18:21:01.402Z",
      "created_at": "2026-11-09T18:20:00.950Z",
      "body": "{\"id\":\"8d2f6c1e-1a2b-4c3d-9e0f-112233445566\",\"type\":\"record.approved\",\"created_at\":\"2026-11-09T18:20:00.950Z\",\"record_id\":\"3f6c1d2e-8a4b-4c1e-9f0a-1b2c3d4e5f60\",\"sequence\":7,\"occurred_at\":\"2026-11-09T18:20:00.912Z\",\"data\":{\"record\":{\"id\":\"3f6c1d2e-8a4b-4c1e-9f0a-1b2c3d4e5f60\",\"status\":\"customer_approved\"},\"event\":{\"type\":\"record_approved\",\"sequence\":7}}}",
      "attempts": [
        {
          "attempt_number": 1,
          "attempted_at": "2026-11-09T18:20:00.981Z",
          "duration_ms": null,
          "request": {
            "headers": {
              "Content-Type": "application/json",
              "User-Agent": "Demurly-Webhooks/1.0",
              "X-Demurly-Signature": "t=1794248401,v1=5f0e3c9a1b7d2e4f6a8c0b1d3e5f7a9c2b4d6e8f0a1c3e5b7d9f1a3c5e7b9d0f2,v1=9a8b7c6d5e4f3a2b1c0d9e8f7a6b5c4d3e2f1a0b9c8d7e6f5a4b3c2d1e0f9a8b",
              "X-Demurly-Event": "record.approved",
              "X-Demurly-Delivery": "c3d4e5f6-0000-4000-8000-0000000000d1"
            }
          },
          "response": null,
          "error": "Could not connect, or no response within 10 seconds"
        },
        {
          "attempt_number": 2,
          "attempted_at": "2026-11-09T18:21:01.402Z",
          "duration_ms": 182,
          "request": {
            "headers": {
              "Content-Type": "application/json",
              "User-Agent": "Demurly-Webhooks/1.0",
              "X-Demurly-Signature": "t=1794248401,v1=5f0e3c9a1b7d2e4f6a8c0b1d3e5f7a9c2b4d6e8f0a1c3e5b7d9f1a3c5e7b9d0f2,v1=9a8b7c6d5e4f3a2b1c0d9e8f7a6b5c4d3e2f1a0b9c8d7e6f5a4b3c2d1e0f9a8b",
              "X-Demurly-Event": "record.approved",
              "X-Demurly-Delivery": "c3d4e5f6-0000-4000-8000-0000000000d1"
            }
          },
          "response": {
            "status": 200,
            "headers": {
              "content-type": "application/json",
              "date": "Mon, 09 Nov 2026 18:21:01 GMT"
            },
            "body": "{\"received\":true}",
            "body_truncated": false
          },
          "error": null
        }
      ]
    }
  ],
  "has_more": false,
  "next_cursor": null,
  "livemode": true
}

Errors

  • 400 BAD_REQUESTInvalid parameter (code BAD_REQUEST or VALIDATION_ERROR). Query parameters are checked, never silently changed: a limit out of range, an unknown status, include or format value, or a cursor this API didn't return is 400 VALIDATION_ERROR with details.fields naming the parameter. Unknown query parameters are ignored.
  • 401 UNAUTHORIZEDMissing, malformed, invalid, revoked or expired API key
  • 403 FORBIDDENThe key lacks the scope, its creator is no longer an admin, the organization is inactive, or only the other side can do this (only carriers send and attach photos, only fuel buyers approve and dispute, only carriers list drivers)
  • 404 NOT_FOUNDNot found, or not visible to this organization. An unknown /api/v1 path is 404 NOT_FOUND in the same JSON shape.
  • 405 METHOD_NOT_ALLOWEDThis path doesn't take that method (code METHOD_NOT_ALLOWED). Allow and details.allow list the ones it does.
  • 429 RATE_LIMITEDOver a rate limit: the API key's own per-minute limit (1 to 1,000, default 60), your company's 3,000 requests a minute across all its keys, or 60 requests a minute with a missing or invalid key from one IP address. Wait Retry-After seconds.
  • 500 INTERNAL_ERRORSomething went wrong on Demurly's side; it's safe to retry

Get a delivery

GET/api/v1/webhook_endpoints/{id}/deliveries/{delivery_id}

API keyScope webhooks:read

One delivery of the endpoint, with the body sent and every attempt. Requires webhooks:read.

Parameters

  • idstring (uuid)pathRequired

    The endpoint's id

  • delivery_idstring (uuid)pathRequired

    The delivery's id (from the delivery log)

Example request

curl "https://demurly.com/api/v1/webhook_endpoints/3f6c1d2e-8a4b-4c1e-9f0a-1b2c3d4e5f60/deliveries/3f6c1d2e-8a4b-4c1e-9f0a-1b2c3d4e5f60" \
  -H "Authorization: Bearer $DEMURLY_API_KEY"

Response 200

The delivery

Returns the webhook delivery object (every field explained).

Example
{
  "data": {
    "id": "c3d4e5f6-0000-4000-8000-0000000000d1",
    "endpoint_id": "7b1e2c3d-4a5b-4c6d-8e7f-901234567890",
    "event_type": "record.approved",
    "record_id": "3f6c1d2e-8a4b-4c1e-9f0a-1b2c3d4e5f60",
    "status": "succeeded",
    "attempt_count": 2,
    "last_status_code": 200,
    "last_error": null,
    "next_attempt_at": null,
    "last_attempt_at": "2026-11-09T18:21:01.402Z",
    "created_at": "2026-11-09T18:20:00.950Z",
    "body": "{\"id\":\"8d2f6c1e-1a2b-4c3d-9e0f-112233445566\",\"type\":\"record.approved\",\"created_at\":\"2026-11-09T18:20:00.950Z\",\"record_id\":\"3f6c1d2e-8a4b-4c1e-9f0a-1b2c3d4e5f60\",\"sequence\":7,\"occurred_at\":\"2026-11-09T18:20:00.912Z\",\"data\":{\"record\":{\"id\":\"3f6c1d2e-8a4b-4c1e-9f0a-1b2c3d4e5f60\",\"status\":\"customer_approved\"},\"event\":{\"type\":\"record_approved\",\"sequence\":7}}}",
    "attempts": [
      {
        "attempt_number": 1,
        "attempted_at": "2026-11-09T18:20:00.981Z",
        "duration_ms": null,
        "request": {
          "headers": {
            "Content-Type": "application/json",
            "User-Agent": "Demurly-Webhooks/1.0",
            "X-Demurly-Signature": "t=1794248401,v1=5f0e3c9a1b7d2e4f6a8c0b1d3e5f7a9c2b4d6e8f0a1c3e5b7d9f1a3c5e7b9d0f2,v1=9a8b7c6d5e4f3a2b1c0d9e8f7a6b5c4d3e2f1a0b9c8d7e6f5a4b3c2d1e0f9a8b",
            "X-Demurly-Event": "record.approved",
            "X-Demurly-Delivery": "c3d4e5f6-0000-4000-8000-0000000000d1"
          }
        },
        "response": null,
        "error": "Could not connect, or no response within 10 seconds"
      },
      {
        "attempt_number": 2,
        "attempted_at": "2026-11-09T18:21:01.402Z",
        "duration_ms": 182,
        "request": {
          "headers": {
            "Content-Type": "application/json",
            "User-Agent": "Demurly-Webhooks/1.0",
            "X-Demurly-Signature": "t=1794248401,v1=5f0e3c9a1b7d2e4f6a8c0b1d3e5f7a9c2b4d6e8f0a1c3e5b7d9f1a3c5e7b9d0f2,v1=9a8b7c6d5e4f3a2b1c0d9e8f7a6b5c4d3e2f1a0b9c8d7e6f5a4b3c2d1e0f9a8b",
            "X-Demurly-Event": "record.approved",
            "X-Demurly-Delivery": "c3d4e5f6-0000-4000-8000-0000000000d1"
          }
        },
        "response": {
          "status": 200,
          "headers": {
            "content-type": "application/json",
            "date": "Mon, 09 Nov 2026 18:21:01 GMT"
          },
          "body": "{\"received\":true}",
          "body_truncated": false
        },
        "error": null
      }
    ]
  },
  "livemode": true
}

Errors

  • 401 UNAUTHORIZEDMissing, malformed, invalid, revoked or expired API key
  • 403 FORBIDDENThe key lacks the scope, its creator is no longer an admin, the organization is inactive, or only the other side can do this (only carriers send and attach photos, only fuel buyers approve and dispute, only carriers list drivers)
  • 404 NOT_FOUNDNot found, or not visible to this organization. An unknown /api/v1 path is 404 NOT_FOUND in the same JSON shape.
  • 405 METHOD_NOT_ALLOWEDThis path doesn't take that method (code METHOD_NOT_ALLOWED). Allow and details.allow list the ones it does.
  • 429 RATE_LIMITEDOver a rate limit: the API key's own per-minute limit (1 to 1,000, default 60), your company's 3,000 requests a minute across all its keys, or 60 requests a minute with a missing or invalid key from one IP address. Wait Retry-After seconds.
  • 500 INTERNAL_ERRORSomething went wrong on Demurly's side; it's safe to retry

Resend a delivery

POST/api/v1/webhook_endpoints/{id}/deliveries/{delivery_id}/resend

API keyScope webhooks:write

Queue a delivery again now, with a fresh set of retries, and start sending it. The body is the same bytes, with the same event id (drop it if you've handled it), signed afresh. 409 DELIVERY_IN_PROGRESS with Retry-After when it's being sent right now; 409 CONFLICT when the endpoint is off; 400 for a test event (send a new one). Requires webhooks:write.

Parameters

  • idstring (uuid)pathRequired

    The endpoint's id

  • delivery_idstring (uuid)pathRequired

    The delivery's id (from the delivery log)

  • Idempotency-KeystringheaderOptional

    Any unique string (1-255 letters, digits, underscores, periods, colons or hyphens). A retry with the same key and body returns the first response. (up to 255 characters)

Example request

curl -X POST "https://demurly.com/api/v1/webhook_endpoints/3f6c1d2e-8a4b-4c1e-9f0a-1b2c3d4e5f60/deliveries/3f6c1d2e-8a4b-4c1e-9f0a-1b2c3d4e5f60/resend" \
  -H "Authorization: Bearer $DEMURLY_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)"

Response 202

Queued: the delivery as it now stands (pending)

Returns the webhook delivery object (every field explained).

Example
{
  "data": {
    "id": "c3d4e5f6-0000-4000-8000-0000000000d1",
    "endpoint_id": "7b1e2c3d-4a5b-4c6d-8e7f-901234567890",
    "event_type": "record.approved",
    "record_id": "3f6c1d2e-8a4b-4c1e-9f0a-1b2c3d4e5f60",
    "status": "pending",
    "attempt_count": 0,
    "last_status_code": 200,
    "last_error": null,
    "next_attempt_at": "2026-11-09T19:02:00.000Z",
    "last_attempt_at": "2026-11-09T18:21:01.402Z",
    "created_at": "2026-11-09T18:20:00.950Z",
    "body": "{\"id\":\"8d2f6c1e-1a2b-4c3d-9e0f-112233445566\",\"type\":\"record.approved\",\"created_at\":\"2026-11-09T18:20:00.950Z\",\"record_id\":\"3f6c1d2e-8a4b-4c1e-9f0a-1b2c3d4e5f60\",\"sequence\":7,\"occurred_at\":\"2026-11-09T18:20:00.912Z\",\"data\":{\"record\":{\"id\":\"3f6c1d2e-8a4b-4c1e-9f0a-1b2c3d4e5f60\",\"status\":\"customer_approved\"},\"event\":{\"type\":\"record_approved\",\"sequence\":7}}}",
    "attempts": [
      {
        "attempt_number": 1,
        "attempted_at": "2026-11-09T18:20:00.981Z",
        "duration_ms": null,
        "request": {
          "headers": {
            "Content-Type": "application/json",
            "User-Agent": "Demurly-Webhooks/1.0",
            "X-Demurly-Signature": "t=1794248401,v1=5f0e3c9a1b7d2e4f6a8c0b1d3e5f7a9c2b4d6e8f0a1c3e5b7d9f1a3c5e7b9d0f2,v1=9a8b7c6d5e4f3a2b1c0d9e8f7a6b5c4d3e2f1a0b9c8d7e6f5a4b3c2d1e0f9a8b",
            "X-Demurly-Event": "record.approved",
            "X-Demurly-Delivery": "c3d4e5f6-0000-4000-8000-0000000000d1"
          }
        },
        "response": null,
        "error": "Could not connect, or no response within 10 seconds"
      },
      {
        "attempt_number": 2,
        "attempted_at": "2026-11-09T18:21:01.402Z",
        "duration_ms": 182,
        "request": {
          "headers": {
            "Content-Type": "application/json",
            "User-Agent": "Demurly-Webhooks/1.0",
            "X-Demurly-Signature": "t=1794248401,v1=5f0e3c9a1b7d2e4f6a8c0b1d3e5f7a9c2b4d6e8f0a1c3e5b7d9f1a3c5e7b9d0f2,v1=9a8b7c6d5e4f3a2b1c0d9e8f7a6b5c4d3e2f1a0b9c8d7e6f5a4b3c2d1e0f9a8b",
            "X-Demurly-Event": "record.approved",
            "X-Demurly-Delivery": "c3d4e5f6-0000-4000-8000-0000000000d1"
          }
        },
        "response": {
          "status": 200,
          "headers": {
            "content-type": "application/json",
            "date": "Mon, 09 Nov 2026 18:21:01 GMT"
          },
          "body": "{\"received\":true}",
          "body_truncated": false
        },
        "error": null
      }
    ]
  },
  "livemode": true
}

Errors

  • 400 BAD_REQUESTInvalid parameter (code BAD_REQUEST or VALIDATION_ERROR). Query parameters are checked, never silently changed: a limit out of range, an unknown status, include or format value, or a cursor this API didn't return is 400 VALIDATION_ERROR with details.fields naming the parameter. Unknown query parameters are ignored.
  • 401 UNAUTHORIZEDMissing, malformed, invalid, revoked or expired API key
  • 403 FORBIDDENThe key lacks the scope, its creator is no longer an admin, the organization is inactive, or only the other side can do this (only carriers send and attach photos, only fuel buyers approve and dispute, only carriers list drivers)
  • 404 NOT_FOUNDNot found, or not visible to this organization. An unknown /api/v1 path is 404 NOT_FOUND in the same JSON shape.
  • 405 METHOD_NOT_ALLOWEDThis path doesn't take that method (code METHOD_NOT_ALLOWED). Allow and details.allow list the ones it does.
  • 409 CONFLICTThe record's state doesn't allow this. The code says whether a retry can help; retryable ones come with Retry-After.
  • 422 UNPROCESSABLEThis Idempotency-Key was already used for a different request (code IDEMPOTENCY_KEY_REUSED). The body must be byte-identical to the first; use a new key for a changed request.
  • 429 RATE_LIMITEDOver a rate limit: the API key's own per-minute limit (1 to 1,000, default 60), your company's 3,000 requests a minute across all its keys, or 60 requests a minute with a missing or invalid key from one IP address. Wait Retry-After seconds.
  • 500 INTERNAL_ERRORSomething went wrong on Demurly's side; it's safe to retry
  • 503 SERVICE_UNAVAILABLEThe same change is still being written by an earlier request; retry after Retry-After seconds

Test

Create a sample charge

POST/api/v1/test/records

API keyScope records:write

A finished sample charge from your sandbox's carrier (a sample driver and terminal, a wait that ends now; when every sample driver is busy then, the wait is placed just before the one in its way), sent to your sandbox's fuel buyer unless send is false. A fuel buyer's test key uses it to receive charges to approve or dispute; a carrier's can use it as a shortcut instead of POST /api/v1/records. Test keys only (dmrl_test_...); a live key gets 403. Requires records:write.

Parameters

  • Idempotency-KeystringheaderOptional

    Any unique string (1-255 letters, digits, underscores, periods, colons or hyphens). A retry with the same key and body returns the first response. (up to 255 characters)

Request body

  • wait_minutesintegerOptional

    The wait in minutes, ending now (default 180: with the 120 free minutes, 60 billable) (1 to 4320)

  • load_numberstringOptional

    Load number (default TEST-<unix time>) (up to 100 characters; can be null)

  • sendbooleanOptional

    Send it to the sandbox's fuel buyer (default true)

Example request

curl -X POST "https://demurly.com/api/v1/test/records" \
  -H "Authorization: Bearer $DEMURLY_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
  "wait_minutes": 180,
  "load_number": "TEST-1001"
}'

Response 201

The new sample record (sent unless send was false; send_error says why a send didn't happen)

Returns the record object (every field explained).

Example
{
  "data": {
    "id": "3f6c1d2e-8a4b-4c1e-9f0a-1b2c3d4e5f60",
    "record_number": "DMR-00000007",
    "status": "sent_to_customer",
    "carrier": {
      "id": "a1b2c3d4-0000-4000-8000-0000000000c1",
      "name": "Acme Trucking (test mode)"
    },
    "customer": {
      "id": "a1b2c3d4-0000-4000-8000-0000000000c2",
      "name": "Test Fuel Buyer (test mode)"
    },
    "terminal": {
      "id": "a1b2c3d4-0000-4000-8000-0000000000c3",
      "name": "Test Terminal Houston",
      "time_zone": "America/Chicago"
    },
    "load_number": "TEST-1763000000",
    "bol_number": null,
    "container_number": null,
    "start_time": "2026-01-15T14:30:00.000Z",
    "end_time": "2026-01-15T17:30:00.000Z",
    "time_zone": "America/Chicago",
    "time_zone_source": "terminal",
    "start_time_local": "2026-01-15T08:30:00.000-06:00",
    "end_time_local": "2026-01-15T11:30:00.000-06:00",
    "local_start_date": "2026-01-15",
    "adjusted_start_time": null,
    "adjusted_end_time": null,
    "time_adjustment_reason": null,
    "total_minutes": 180,
    "free_time_minutes": 120,
    "billable_minutes": 60,
    "hourly_rate": 100,
    "amount": 100,
    "amount_approved": null,
    "currency": "usd",
    "stop_reason": "manual",
    "started_offline": false,
    "start_received_at": null,
    "start_clock_drift_seconds": null,
    "gps_evidence": {
      "status": "not_tracked",
      "source": "phone",
      "point_count": 0,
      "issues": []
    },
    "source": "api",
    "source_label": "Reported by Acme Trucking (test mode)'s own system.",
    "vehicle": null,
    "evidence_hash": null,
    "sent_to_customer_at": "2026-01-15T17:31:00.000Z",
    "approved_at": null,
    "paid_at": null,
    "created_at": "2026-01-15T17:31:00.000Z",
    "updated_at": "2026-01-15T17:35:00.000Z"
  },
  "send_error": null,
  "livemode": false
}

Errors

  • 400 BAD_REQUESTInvalid parameter (code BAD_REQUEST or VALIDATION_ERROR). Query parameters are checked, never silently changed: a limit out of range, an unknown status, include or format value, or a cursor this API didn't return is 400 VALIDATION_ERROR with details.fields naming the parameter. Unknown query parameters are ignored.
  • 401 UNAUTHORIZEDMissing, malformed, invalid, revoked or expired API key
  • 403 FORBIDDENThe key lacks the scope, its creator is no longer an admin, the organization is inactive, or only the other side can do this (only carriers send and attach photos, only fuel buyers approve and dispute, only carriers list drivers)
  • 404 NOT_FOUNDNot found, or not visible to this organization. An unknown /api/v1 path is 404 NOT_FOUND in the same JSON shape.
  • 405 METHOD_NOT_ALLOWEDThis path doesn't take that method (code METHOD_NOT_ALLOWED). Allow and details.allow list the ones it does.
  • 409 CONFLICTThe record's state doesn't allow this. The code says whether a retry can help; retryable ones come with Retry-After.
  • 415 UNSUPPORTED_MEDIA_TYPEThe body isn't a type this endpoint takes. JSON endpoints need Content-Type: application/json (any charset) whenever there's a body; photos must be JPEG or PNG.
  • 422 UNPROCESSABLEThis Idempotency-Key was already used for a different request (code IDEMPOTENCY_KEY_REUSED). The body must be byte-identical to the first; use a new key for a changed request.
  • 429 RATE_LIMITEDOver a rate limit: the API key's own per-minute limit (1 to 1,000, default 60), your company's 3,000 requests a minute across all its keys, or 60 requests a minute with a missing or invalid key from one IP address. Wait Retry-After seconds.
  • 500 INTERNAL_ERRORSomething went wrong on Demurly's side; it's safe to retry
  • 503 SERVICE_UNAVAILABLEThe same change is still being written by an earlier request; retry after Retry-After seconds

Simulate: the buyer approves

POST/api/v1/test/records/{id}/approve

API keyScope records:write

Your sandbox's fuel buyer approves the charge (sent, disputed or escalated): customer_approved, and record.approved to your test endpoints. No body. Test keys only (dmrl_test_...); a live key gets 403. Requires records:write.

Parameters

  • idstring (uuid)pathRequired
  • Idempotency-KeystringheaderOptional

    Any unique string (1-255 letters, digits, underscores, periods, colons or hyphens). A retry with the same key and body returns the first response. (up to 255 characters)

Example request

curl -X POST "https://demurly.com/api/v1/test/records/3f6c1d2e-8a4b-4c1e-9f0a-1b2c3d4e5f60/approve" \
  -H "Authorization: Bearer $DEMURLY_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)"

Response 200

The record after the step

Returns the record object (every field explained).

Example
{
  "data": {
    "id": "3f6c1d2e-8a4b-4c1e-9f0a-1b2c3d4e5f60",
    "record_number": "DMR-00000007",
    "status": "customer_approved",
    "carrier": {
      "id": "a1b2c3d4-0000-4000-8000-0000000000c1",
      "name": "Acme Trucking (test mode)"
    },
    "customer": {
      "id": "a1b2c3d4-0000-4000-8000-0000000000c2",
      "name": "Test Fuel Buyer (test mode)"
    },
    "terminal": {
      "id": "a1b2c3d4-0000-4000-8000-0000000000c3",
      "name": "Test Terminal Houston",
      "time_zone": "America/Chicago"
    },
    "load_number": "TEST-1763000000",
    "bol_number": null,
    "container_number": null,
    "start_time": "2026-01-15T14:30:00.000Z",
    "end_time": "2026-01-15T17:30:00.000Z",
    "time_zone": "America/Chicago",
    "time_zone_source": "terminal",
    "start_time_local": "2026-01-15T08:30:00.000-06:00",
    "end_time_local": "2026-01-15T11:30:00.000-06:00",
    "local_start_date": "2026-01-15",
    "adjusted_start_time": null,
    "adjusted_end_time": null,
    "time_adjustment_reason": null,
    "total_minutes": 180,
    "free_time_minutes": 120,
    "billable_minutes": 60,
    "hourly_rate": 100,
    "amount": 100,
    "amount_approved": 100,
    "currency": "usd",
    "stop_reason": "manual",
    "started_offline": false,
    "start_received_at": null,
    "start_clock_drift_seconds": null,
    "gps_evidence": {
      "status": "not_tracked",
      "source": "phone",
      "point_count": 0,
      "issues": []
    },
    "source": "api",
    "source_label": "Reported by Acme Trucking (test mode)'s own system.",
    "vehicle": null,
    "evidence_hash": null,
    "sent_to_customer_at": "2026-01-15T17:31:00.000Z",
    "approved_at": "2026-01-15T17:33:00.000Z",
    "paid_at": null,
    "created_at": "2026-01-15T17:31:00.000Z",
    "updated_at": "2026-01-15T17:35:00.000Z"
  },
  "livemode": false
}

Errors

  • 400 BAD_REQUESTInvalid parameter (code BAD_REQUEST or VALIDATION_ERROR). Query parameters are checked, never silently changed: a limit out of range, an unknown status, include or format value, or a cursor this API didn't return is 400 VALIDATION_ERROR with details.fields naming the parameter. Unknown query parameters are ignored.
  • 401 UNAUTHORIZEDMissing, malformed, invalid, revoked or expired API key
  • 403 FORBIDDENThe key lacks the scope, its creator is no longer an admin, the organization is inactive, or only the other side can do this (only carriers send and attach photos, only fuel buyers approve and dispute, only carriers list drivers)
  • 404 NOT_FOUNDNot found, or not visible to this organization. An unknown /api/v1 path is 404 NOT_FOUND in the same JSON shape.
  • 405 METHOD_NOT_ALLOWEDThis path doesn't take that method (code METHOD_NOT_ALLOWED). Allow and details.allow list the ones it does.
  • 409 CONFLICTThe record's state doesn't allow this. The code says whether a retry can help; retryable ones come with Retry-After.
  • 415 UNSUPPORTED_MEDIA_TYPEThe body isn't a type this endpoint takes. JSON endpoints need Content-Type: application/json (any charset) whenever there's a body; photos must be JPEG or PNG.
  • 422 UNPROCESSABLEThis Idempotency-Key was already used for a different request (code IDEMPOTENCY_KEY_REUSED). The body must be byte-identical to the first; use a new key for a changed request.
  • 429 RATE_LIMITEDOver a rate limit: the API key's own per-minute limit (1 to 1,000, default 60), your company's 3,000 requests a minute across all its keys, or 60 requests a minute with a missing or invalid key from one IP address. Wait Retry-After seconds.
  • 500 INTERNAL_ERRORSomething went wrong on Demurly's side; it's safe to retry
  • 503 SERVICE_UNAVAILABLEThe same change is still being written by an earlier request; retry after Retry-After seconds

Simulate: the buyer disputes

POST/api/v1/test/records/{id}/dispute

API keyScope records:write

Your sandbox's fuel buyer disputes the charge; it comes back to you as disputed, with record.disputed. Every field is optional (a sample reason is used). Test keys only (dmrl_test_...); a live key gets 403. Requires records:write.

Parameters

  • idstring (uuid)pathRequired
  • Idempotency-KeystringheaderOptional

    Any unique string (1-255 letters, digits, underscores, periods, colons or hyphens). A retry with the same key and body returns the first response. (up to 255 characters)

Request body

  • reasonstringOptional

    Why (default: a sample reason) (up to 2000 characters)

  • dispute_typestringOptional

    (one of: time, rate, both, full_rejection, evidence; can be null)

  • disputed_minutesintegerOptional

    (0 to 4320; can be null)

  • proposed_amountnumberOptional

    An offer below the charge, in dollars (at least 0; can be null)

Example request

curl -X POST "https://demurly.com/api/v1/test/records/3f6c1d2e-8a4b-4c1e-9f0a-1b2c3d4e5f60/dispute" \
  -H "Authorization: Bearer $DEMURLY_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
  "reason": "Our gate log shows 2 hours",
  "dispute_type": "time",
  "disputed_minutes": 60
}'

Response 200

The record after the step

Returns the record object (every field explained).

Example
{
  "data": {
    "id": "3f6c1d2e-8a4b-4c1e-9f0a-1b2c3d4e5f60",
    "record_number": "DMR-00000007",
    "status": "disputed",
    "carrier": {
      "id": "a1b2c3d4-0000-4000-8000-0000000000c1",
      "name": "Acme Trucking (test mode)"
    },
    "customer": {
      "id": "a1b2c3d4-0000-4000-8000-0000000000c2",
      "name": "Test Fuel Buyer (test mode)"
    },
    "terminal": {
      "id": "a1b2c3d4-0000-4000-8000-0000000000c3",
      "name": "Test Terminal Houston",
      "time_zone": "America/Chicago"
    },
    "load_number": "TEST-1763000000",
    "bol_number": null,
    "container_number": null,
    "start_time": "2026-01-15T14:30:00.000Z",
    "end_time": "2026-01-15T17:30:00.000Z",
    "time_zone": "America/Chicago",
    "time_zone_source": "terminal",
    "start_time_local": "2026-01-15T08:30:00.000-06:00",
    "end_time_local": "2026-01-15T11:30:00.000-06:00",
    "local_start_date": "2026-01-15",
    "adjusted_start_time": null,
    "adjusted_end_time": null,
    "time_adjustment_reason": null,
    "total_minutes": 180,
    "free_time_minutes": 120,
    "billable_minutes": 60,
    "hourly_rate": 100,
    "amount": 100,
    "amount_approved": null,
    "currency": "usd",
    "stop_reason": "manual",
    "started_offline": false,
    "start_received_at": null,
    "start_clock_drift_seconds": null,
    "gps_evidence": {
      "status": "not_tracked",
      "source": "phone",
      "point_count": 0,
      "issues": []
    },
    "source": "api",
    "source_label": "Reported by Acme Trucking (test mode)'s own system.",
    "vehicle": null,
    "evidence_hash": null,
    "sent_to_customer_at": "2026-01-15T17:31:00.000Z",
    "approved_at": null,
    "paid_at": null,
    "created_at": "2026-01-15T17:31:00.000Z",
    "updated_at": "2026-01-15T17:35:00.000Z"
  },
  "livemode": false
}

Errors

  • 400 BAD_REQUESTInvalid parameter (code BAD_REQUEST or VALIDATION_ERROR). Query parameters are checked, never silently changed: a limit out of range, an unknown status, include or format value, or a cursor this API didn't return is 400 VALIDATION_ERROR with details.fields naming the parameter. Unknown query parameters are ignored.
  • 401 UNAUTHORIZEDMissing, malformed, invalid, revoked or expired API key
  • 403 FORBIDDENThe key lacks the scope, its creator is no longer an admin, the organization is inactive, or only the other side can do this (only carriers send and attach photos, only fuel buyers approve and dispute, only carriers list drivers)
  • 404 NOT_FOUNDNot found, or not visible to this organization. An unknown /api/v1 path is 404 NOT_FOUND in the same JSON shape.
  • 405 METHOD_NOT_ALLOWEDThis path doesn't take that method (code METHOD_NOT_ALLOWED). Allow and details.allow list the ones it does.
  • 409 CONFLICTThe record's state doesn't allow this. The code says whether a retry can help; retryable ones come with Retry-After.
  • 415 UNSUPPORTED_MEDIA_TYPEThe body isn't a type this endpoint takes. JSON endpoints need Content-Type: application/json (any charset) whenever there's a body; photos must be JPEG or PNG.
  • 422 UNPROCESSABLEThis Idempotency-Key was already used for a different request (code IDEMPOTENCY_KEY_REUSED). The body must be byte-identical to the first; use a new key for a changed request.
  • 429 RATE_LIMITEDOver a rate limit: the API key's own per-minute limit (1 to 1,000, default 60), your company's 3,000 requests a minute across all its keys, or 60 requests a minute with a missing or invalid key from one IP address. Wait Retry-After seconds.
  • 500 INTERNAL_ERRORSomething went wrong on Demurly's side; it's safe to retry
  • 503 SERVICE_UNAVAILABLEThe same change is still being written by an earlier request; retry after Retry-After seconds

Simulate: the buyer pays in Demurly

POST/api/v1/test/records/{id}/pay

API keyScope records:write

Your sandbox's fuel buyer pays the approved charge in Demurly, as a card payment would: paid_stripe, with record.paid. No money moves and no fee or payout is made. No body. A charge that isn't approved gets 409 INVALID_STATUS. Test keys only (dmrl_test_...); a live key gets 403. Requires records:write.

Parameters

  • idstring (uuid)pathRequired
  • Idempotency-KeystringheaderOptional

    Any unique string (1-255 letters, digits, underscores, periods, colons or hyphens). A retry with the same key and body returns the first response. (up to 255 characters)

Example request

curl -X POST "https://demurly.com/api/v1/test/records/3f6c1d2e-8a4b-4c1e-9f0a-1b2c3d4e5f60/pay" \
  -H "Authorization: Bearer $DEMURLY_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)"

Response 200

The record after the step

Returns the record object (every field explained).

Example
{
  "data": {
    "id": "3f6c1d2e-8a4b-4c1e-9f0a-1b2c3d4e5f60",
    "record_number": "DMR-00000007",
    "status": "paid_stripe",
    "carrier": {
      "id": "a1b2c3d4-0000-4000-8000-0000000000c1",
      "name": "Acme Trucking (test mode)"
    },
    "customer": {
      "id": "a1b2c3d4-0000-4000-8000-0000000000c2",
      "name": "Test Fuel Buyer (test mode)"
    },
    "terminal": {
      "id": "a1b2c3d4-0000-4000-8000-0000000000c3",
      "name": "Test Terminal Houston",
      "time_zone": "America/Chicago"
    },
    "load_number": "TEST-1763000000",
    "bol_number": null,
    "container_number": null,
    "start_time": "2026-01-15T14:30:00.000Z",
    "end_time": "2026-01-15T17:30:00.000Z",
    "time_zone": "America/Chicago",
    "time_zone_source": "terminal",
    "start_time_local": "2026-01-15T08:30:00.000-06:00",
    "end_time_local": "2026-01-15T11:30:00.000-06:00",
    "local_start_date": "2026-01-15",
    "adjusted_start_time": null,
    "adjusted_end_time": null,
    "time_adjustment_reason": null,
    "total_minutes": 180,
    "free_time_minutes": 120,
    "billable_minutes": 60,
    "hourly_rate": 100,
    "amount": 100,
    "amount_approved": 100,
    "currency": "usd",
    "stop_reason": "manual",
    "started_offline": false,
    "start_received_at": null,
    "start_clock_drift_seconds": null,
    "gps_evidence": {
      "status": "not_tracked",
      "source": "phone",
      "point_count": 0,
      "issues": []
    },
    "source": "api",
    "source_label": "Reported by Acme Trucking (test mode)'s own system.",
    "vehicle": null,
    "evidence_hash": null,
    "sent_to_customer_at": "2026-01-15T17:31:00.000Z",
    "approved_at": "2026-01-15T17:33:00.000Z",
    "paid_at": "2026-01-15T17:35:00.000Z",
    "created_at": "2026-01-15T17:31:00.000Z",
    "updated_at": "2026-01-15T17:35:00.000Z"
  },
  "livemode": false
}

Errors

  • 400 BAD_REQUESTInvalid parameter (code BAD_REQUEST or VALIDATION_ERROR). Query parameters are checked, never silently changed: a limit out of range, an unknown status, include or format value, or a cursor this API didn't return is 400 VALIDATION_ERROR with details.fields naming the parameter. Unknown query parameters are ignored.
  • 401 UNAUTHORIZEDMissing, malformed, invalid, revoked or expired API key
  • 403 FORBIDDENThe key lacks the scope, its creator is no longer an admin, the organization is inactive, or only the other side can do this (only carriers send and attach photos, only fuel buyers approve and dispute, only carriers list drivers)
  • 404 NOT_FOUNDNot found, or not visible to this organization. An unknown /api/v1 path is 404 NOT_FOUND in the same JSON shape.
  • 405 METHOD_NOT_ALLOWEDThis path doesn't take that method (code METHOD_NOT_ALLOWED). Allow and details.allow list the ones it does.
  • 409 CONFLICTThe record's state doesn't allow this. The code says whether a retry can help; retryable ones come with Retry-After.
  • 415 UNSUPPORTED_MEDIA_TYPEThe body isn't a type this endpoint takes. JSON endpoints need Content-Type: application/json (any charset) whenever there's a body; photos must be JPEG or PNG.
  • 422 UNPROCESSABLEThis Idempotency-Key was already used for a different request (code IDEMPOTENCY_KEY_REUSED). The body must be byte-identical to the first; use a new key for a changed request.
  • 429 RATE_LIMITEDOver a rate limit: the API key's own per-minute limit (1 to 1,000, default 60), your company's 3,000 requests a minute across all its keys, or 60 requests a minute with a missing or invalid key from one IP address. Wait Retry-After seconds.
  • 500 INTERNAL_ERRORSomething went wrong on Demurly's side; it's safe to retry
  • 503 SERVICE_UNAVAILABLEThe same change is still being written by an earlier request; retry after Retry-After seconds

Simulate: the buyer marks it paid outside Demurly

POST/api/v1/test/records/{id}/mark_paid_external

API keyScope records:write

Your sandbox's fuel buyer says it paid the approved charge by check, ACH or wire: payment_pending, with record.payment_pending, until the carrier confirms (confirm_payment). Test keys only (dmrl_test_...); a live key gets 403. Requires records:write.

Parameters

  • idstring (uuid)pathRequired
  • Idempotency-KeystringheaderOptional

    Any unique string (1-255 letters, digits, underscores, periods, colons or hyphens). A retry with the same key and body returns the first response. (up to 255 characters)

Request body

  • methodstringOptional

    How it was paid (default check) (one of: check, ach, wire, other)

  • referencestringOptional

    Check number or transfer reference (default TEST-<record>) (up to 200 characters; can be null)

Example request

curl -X POST "https://demurly.com/api/v1/test/records/3f6c1d2e-8a4b-4c1e-9f0a-1b2c3d4e5f60/mark_paid_external" \
  -H "Authorization: Bearer $DEMURLY_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
  "method": "check",
  "reference": "CHK-20431"
}'

Response 200

The record after the step

Returns the record object (every field explained).

Example
{
  "data": {
    "id": "3f6c1d2e-8a4b-4c1e-9f0a-1b2c3d4e5f60",
    "record_number": "DMR-00000007",
    "status": "payment_pending",
    "carrier": {
      "id": "a1b2c3d4-0000-4000-8000-0000000000c1",
      "name": "Acme Trucking (test mode)"
    },
    "customer": {
      "id": "a1b2c3d4-0000-4000-8000-0000000000c2",
      "name": "Test Fuel Buyer (test mode)"
    },
    "terminal": {
      "id": "a1b2c3d4-0000-4000-8000-0000000000c3",
      "name": "Test Terminal Houston",
      "time_zone": "America/Chicago"
    },
    "load_number": "TEST-1763000000",
    "bol_number": null,
    "container_number": null,
    "start_time": "2026-01-15T14:30:00.000Z",
    "end_time": "2026-01-15T17:30:00.000Z",
    "time_zone": "America/Chicago",
    "time_zone_source": "terminal",
    "start_time_local": "2026-01-15T08:30:00.000-06:00",
    "end_time_local": "2026-01-15T11:30:00.000-06:00",
    "local_start_date": "2026-01-15",
    "adjusted_start_time": null,
    "adjusted_end_time": null,
    "time_adjustment_reason": null,
    "total_minutes": 180,
    "free_time_minutes": 120,
    "billable_minutes": 60,
    "hourly_rate": 100,
    "amount": 100,
    "amount_approved": 100,
    "currency": "usd",
    "stop_reason": "manual",
    "started_offline": false,
    "start_received_at": null,
    "start_clock_drift_seconds": null,
    "gps_evidence": {
      "status": "not_tracked",
      "source": "phone",
      "point_count": 0,
      "issues": []
    },
    "source": "api",
    "source_label": "Reported by Acme Trucking (test mode)'s own system.",
    "vehicle": null,
    "evidence_hash": null,
    "sent_to_customer_at": "2026-01-15T17:31:00.000Z",
    "approved_at": "2026-01-15T17:33:00.000Z",
    "paid_at": null,
    "created_at": "2026-01-15T17:31:00.000Z",
    "updated_at": "2026-01-15T17:35:00.000Z"
  },
  "livemode": false
}

Errors

  • 400 BAD_REQUESTInvalid parameter (code BAD_REQUEST or VALIDATION_ERROR). Query parameters are checked, never silently changed: a limit out of range, an unknown status, include or format value, or a cursor this API didn't return is 400 VALIDATION_ERROR with details.fields naming the parameter. Unknown query parameters are ignored.
  • 401 UNAUTHORIZEDMissing, malformed, invalid, revoked or expired API key
  • 403 FORBIDDENThe key lacks the scope, its creator is no longer an admin, the organization is inactive, or only the other side can do this (only carriers send and attach photos, only fuel buyers approve and dispute, only carriers list drivers)
  • 404 NOT_FOUNDNot found, or not visible to this organization. An unknown /api/v1 path is 404 NOT_FOUND in the same JSON shape.
  • 405 METHOD_NOT_ALLOWEDThis path doesn't take that method (code METHOD_NOT_ALLOWED). Allow and details.allow list the ones it does.
  • 409 CONFLICTThe record's state doesn't allow this. The code says whether a retry can help; retryable ones come with Retry-After.
  • 415 UNSUPPORTED_MEDIA_TYPEThe body isn't a type this endpoint takes. JSON endpoints need Content-Type: application/json (any charset) whenever there's a body; photos must be JPEG or PNG.
  • 422 UNPROCESSABLEThis Idempotency-Key was already used for a different request (code IDEMPOTENCY_KEY_REUSED). The body must be byte-identical to the first; use a new key for a changed request.
  • 429 RATE_LIMITEDOver a rate limit: the API key's own per-minute limit (1 to 1,000, default 60), your company's 3,000 requests a minute across all its keys, or 60 requests a minute with a missing or invalid key from one IP address. Wait Retry-After seconds.
  • 500 INTERNAL_ERRORSomething went wrong on Demurly's side; it's safe to retry
  • 503 SERVICE_UNAVAILABLEThe same change is still being written by an earlier request; retry after Retry-After seconds

Simulate: the carrier confirms an outside payment

POST/api/v1/test/records/{id}/confirm_payment

API keyScope records:write

Your sandbox's carrier confirms it received the payment the buyer reported making outside Demurly (or an approved charge paid outside): paid_external, with record.paid. No body. Test keys only (dmrl_test_...); a live key gets 403. Requires records:write.

Parameters

  • idstring (uuid)pathRequired
  • Idempotency-KeystringheaderOptional

    Any unique string (1-255 letters, digits, underscores, periods, colons or hyphens). A retry with the same key and body returns the first response. (up to 255 characters)

Example request

curl -X POST "https://demurly.com/api/v1/test/records/3f6c1d2e-8a4b-4c1e-9f0a-1b2c3d4e5f60/confirm_payment" \
  -H "Authorization: Bearer $DEMURLY_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)"

Response 200

The record after the step

Returns the record object (every field explained).

Example
{
  "data": {
    "id": "3f6c1d2e-8a4b-4c1e-9f0a-1b2c3d4e5f60",
    "record_number": "DMR-00000007",
    "status": "paid_external",
    "carrier": {
      "id": "a1b2c3d4-0000-4000-8000-0000000000c1",
      "name": "Acme Trucking (test mode)"
    },
    "customer": {
      "id": "a1b2c3d4-0000-4000-8000-0000000000c2",
      "name": "Test Fuel Buyer (test mode)"
    },
    "terminal": {
      "id": "a1b2c3d4-0000-4000-8000-0000000000c3",
      "name": "Test Terminal Houston",
      "time_zone": "America/Chicago"
    },
    "load_number": "TEST-1763000000",
    "bol_number": null,
    "container_number": null,
    "start_time": "2026-01-15T14:30:00.000Z",
    "end_time": "2026-01-15T17:30:00.000Z",
    "time_zone": "America/Chicago",
    "time_zone_source": "terminal",
    "start_time_local": "2026-01-15T08:30:00.000-06:00",
    "end_time_local": "2026-01-15T11:30:00.000-06:00",
    "local_start_date": "2026-01-15",
    "adjusted_start_time": null,
    "adjusted_end_time": null,
    "time_adjustment_reason": null,
    "total_minutes": 180,
    "free_time_minutes": 120,
    "billable_minutes": 60,
    "hourly_rate": 100,
    "amount": 100,
    "amount_approved": 100,
    "currency": "usd",
    "stop_reason": "manual",
    "started_offline": false,
    "start_received_at": null,
    "start_clock_drift_seconds": null,
    "gps_evidence": {
      "status": "not_tracked",
      "source": "phone",
      "point_count": 0,
      "issues": []
    },
    "source": "api",
    "source_label": "Reported by Acme Trucking (test mode)'s own system.",
    "vehicle": null,
    "evidence_hash": null,
    "sent_to_customer_at": "2026-01-15T17:31:00.000Z",
    "approved_at": "2026-01-15T17:33:00.000Z",
    "paid_at": "2026-01-15T17:35:00.000Z",
    "created_at": "2026-01-15T17:31:00.000Z",
    "updated_at": "2026-01-15T17:35:00.000Z"
  },
  "livemode": false
}

Errors

  • 400 BAD_REQUESTInvalid parameter (code BAD_REQUEST or VALIDATION_ERROR). Query parameters are checked, never silently changed: a limit out of range, an unknown status, include or format value, or a cursor this API didn't return is 400 VALIDATION_ERROR with details.fields naming the parameter. Unknown query parameters are ignored.
  • 401 UNAUTHORIZEDMissing, malformed, invalid, revoked or expired API key
  • 403 FORBIDDENThe key lacks the scope, its creator is no longer an admin, the organization is inactive, or only the other side can do this (only carriers send and attach photos, only fuel buyers approve and dispute, only carriers list drivers)
  • 404 NOT_FOUNDNot found, or not visible to this organization. An unknown /api/v1 path is 404 NOT_FOUND in the same JSON shape.
  • 405 METHOD_NOT_ALLOWEDThis path doesn't take that method (code METHOD_NOT_ALLOWED). Allow and details.allow list the ones it does.
  • 409 CONFLICTThe record's state doesn't allow this. The code says whether a retry can help; retryable ones come with Retry-After.
  • 415 UNSUPPORTED_MEDIA_TYPEThe body isn't a type this endpoint takes. JSON endpoints need Content-Type: application/json (any charset) whenever there's a body; photos must be JPEG or PNG.
  • 422 UNPROCESSABLEThis Idempotency-Key was already used for a different request (code IDEMPOTENCY_KEY_REUSED). The body must be byte-identical to the first; use a new key for a changed request.
  • 429 RATE_LIMITEDOver a rate limit: the API key's own per-minute limit (1 to 1,000, default 60), your company's 3,000 requests a minute across all its keys, or 60 requests a minute with a missing or invalid key from one IP address. Wait Retry-After seconds.
  • 500 INTERNAL_ERRORSomething went wrong on Demurly's side; it's safe to retry
  • 503 SERVICE_UNAVAILABLEThe same change is still being written by an earlier request; retry after Retry-After seconds

Reset the sandbox

POST/api/v1/test/sandbox/reset

API keyScope records:write

Deletes every record in your test-mode sandbox, with its events, photos, comments and webhook deliveries. The sample drivers, terminals and the connection stay. Admins can do the same under Settings > API keys > Test. No body. Test keys only (dmrl_test_...); a live key gets 403. Requires records:write.

Parameters

  • Idempotency-KeystringheaderOptional

    Any unique string (1-255 letters, digits, underscores, periods, colons or hyphens). A retry with the same key and body returns the first response. (up to 255 characters)

Example request

curl -X POST "https://demurly.com/api/v1/test/sandbox/reset" \
  -H "Authorization: Bearer $DEMURLY_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)"

Response 200

How many records were deleted

Example
{
  "data": {
    "records_deleted": 12
  },
  "livemode": false
}

Errors

  • 400 BAD_REQUESTInvalid parameter (code BAD_REQUEST or VALIDATION_ERROR). Query parameters are checked, never silently changed: a limit out of range, an unknown status, include or format value, or a cursor this API didn't return is 400 VALIDATION_ERROR with details.fields naming the parameter. Unknown query parameters are ignored.
  • 401 UNAUTHORIZEDMissing, malformed, invalid, revoked or expired API key
  • 403 FORBIDDENThe key lacks the scope, its creator is no longer an admin, the organization is inactive, or only the other side can do this (only carriers send and attach photos, only fuel buyers approve and dispute, only carriers list drivers)
  • 404 NOT_FOUNDNot found, or not visible to this organization. An unknown /api/v1 path is 404 NOT_FOUND in the same JSON shape.
  • 405 METHOD_NOT_ALLOWEDThis path doesn't take that method (code METHOD_NOT_ALLOWED). Allow and details.allow list the ones it does.
  • 409 CONFLICTThe record's state doesn't allow this. The code says whether a retry can help; retryable ones come with Retry-After.
  • 415 UNSUPPORTED_MEDIA_TYPEThe body isn't a type this endpoint takes. JSON endpoints need Content-Type: application/json (any charset) whenever there's a body; photos must be JPEG or PNG.
  • 422 UNPROCESSABLEThis Idempotency-Key was already used for a different request (code IDEMPOTENCY_KEY_REUSED). The body must be byte-identical to the first; use a new key for a changed request.
  • 429 RATE_LIMITEDOver a rate limit: the API key's own per-minute limit (1 to 1,000, default 60), your company's 3,000 requests a minute across all its keys, or 60 requests a minute with a missing or invalid key from one IP address. Wait Retry-After seconds.
  • 500 INTERNAL_ERRORSomething went wrong on Demurly's side; it's safe to retry
  • 503 SERVICE_UNAVAILABLEThe same change is still being written by an earlier request; retry after Retry-After seconds

Objects

What the endpoints and webhooks return, field by field. Fields can be added at any time; ignore ones you don't know.

The record object

A demurrage record - one wait at a terminal or drop, billed as a charge to a fuel buyer.

Fields

  • idstring (uuid)

    The record's id, used in every /records/{id} path

  • record_numberstring

    The number people see and quote (DMR- and 8 digits)

  • statusstring

    Where the record is in its lifecycle (see the record lifecycle guide). New statuses may be added; treat one you don't know as in progress.

    recording
    The driver's clock is running: the wait is in progress (carriers only).
    draft
    The clock stopped; the driver hasn't submitted the record yet (carriers only).
    pending_review
    Waiting for the carrier's review before it goes to the fuel buyer (carriers only).
    rejected_by_employer
    The carrier's review rejected its driver's record. It's never billed; the carrier can reopen it (carriers only).
    sent_to_customer
    With the fuel buyer, to approve or dispute.
    disputed
    The buyer disputed it. The carrier corrects and resends it, accepts the buyer's offer, escalates, or closes it.
    escalated
    The carrier escalated the dispute. The buyer approves or closes it.
    customer_approved
    The buyer approved it: it's owed (amount_approved). Unpaid until a payment completes.
    payment_pending
    A payment is on its way: a bank payment is processing, or the buyer marked it paid outside Demurly and the carrier hasn't confirmed it.
    paid_stripe
    Paid through Demurly (card or bank). Final, unless the payment is refunded or lost to a chargeback, which puts it back to customer_approved.
    paid_external
    Paid outside Demurly, confirmed by the carrier or its accounting system. Final.
    cancelled
    The carrier cancelled it before the buyer answered. Final; never billed.
    closed
    A dispute ended without payment. Final.
  • carrierobject

    The carrier that billed the wait

  • carrier.idstring (uuid)
  • carrier.namestringcan be null
  • customerobjectcan be null

    The fuel buyer it's billed to (null until one is chosen). Its id is a connection's partner.id.

  • customer.idstring (uuid)
  • customer.namestringcan be null
  • terminalobjectcan be null

    Where the wait happened (null for a reported wait without a terminal)

  • terminal.idstring (uuid)
  • terminal.namestring

    Your custom name for the terminal, else its name

  • terminal.time_zonestringcan be null

    The terminal's IANA time zone (null while it isn't known)

  • load_numberstringcan be null

    The carrier's load or order number

  • bol_numberstringcan be null

    The bill of lading number for the load

  • container_numberstringcan be null

    The container or trailer number, when recorded

  • start_timestring (date-time)can be null

    When the wait started (UTC; null only while a record has no start)

  • end_timestring (date-time)can be null

    When it ended (UTC; null while recording)

  • time_zonestringcan be null

    The IANA time zone where the wait happened: the terminal's, stamped when the record was created (see time_zone_source). start_time, end_time and every other time field stay UTC instants; use this zone, or start_time_local / end_time_local, to show the terminal's clock.

  • time_zone_sourcestringcan be null

    Where time_zone came from: terminal (the record's terminal), start_gps (the location where the wait started), reported (the time_zone your system sent when creating it without a terminal), device (the driver's phone), company (your company's time zone setting), default (America/Chicago). backfill_* are records made before zones were stamped (November 2026), given their best zone the same way.

    terminal
    The record's terminal
    start_gps
    The location where the wait started
    reported
    The time_zone your system sent when creating it without a terminal
    device
    The driver's phone
    company
    Your company's time zone setting
    default
    America/Chicago, when nothing else was known
    backfill_terminal
    Stamped later (records from before November 2026) from the terminal
    backfill_gps
    Stamped later from the start location
    backfill_device
    Stamped later from the driver's phone
    backfill_company
    Stamped later from the company setting
    backfill_default
    Stamped later with the default
  • start_time_localstringcan be null

    start_time on the terminal's clock: ISO 8601 with time_zone's offset at that moment (null when start_time is). The same instant as start_time.

  • end_time_localstringcan be null

    end_time on the terminal's clock, like start_time_local. Across a daylight-saving change the two can carry different offsets (-05:00 then -06:00).

  • local_start_datestring (date)can be null

    The day the wait started on the terminal's calendar (YYYY-MM-DD; null without a start). Saved reports count days by it.

  • adjusted_start_timestring (date-time)can be null

    Set when the carrier adjusted the times while answering a dispute (event time_adjusted, with time_adjustment_reason). start_time and end_time stay the recorded times; the adjusted ones are what's billed.

  • adjusted_end_timestring (date-time)can be null

    See adjusted_start_time

  • time_adjustment_reasonstringcan be null

    The carrier's reason for the adjusted times

  • total_minutesintegercan be null

    The whole wait in minutes, from the adjusted times when set, else the recorded ones

  • free_time_minutesintegercan be null

    Minutes the buyer doesn't pay for (free time), stamped from the carrier's setting when the record was made

  • billable_minutesintegercan be null

    Wait past free time, in whole minutes (total_minutes minus free time and any adjustment), not rounded

  • billed_minutesintegercan be null

    Minutes the amount bills: billable_minutes rounded up to the next 15-minute step (62 -> 75)

  • hourly_ratenumbercan be null

    Per hour, in currency: the carrier's rate for this buyer, else its default rate

  • amountnumbercan be null

    Billed amount in currency (billable hours times hourly_rate, or an accepted offer); null until calculated

  • amount_approvednumbercan be null

    What the buyer approved, in currency (null until approved)

  • currencystring

    The currency of hourly_rate and the amounts: the carrier's when the record was made. Amounts are never converted

    usd
    cad
  • stop_reasonstringcan be null

    Why the clock stopped: manual (the driver, or reported times), or an automatic stop such as speed or distance

  • started_offlineboolean

    The driver started the wait with no signal (offline check-in): the start waited on the phone and reached Demurly later (start_received_at). start_time is then the phone's start time, corrected for the phone's clock.

  • start_received_atstring (date-time)can be null

    When an offline start reached Demurly (null when the start was sent at once)

  • start_clock_drift_secondsintegercan be null

    For an offline start: Demurly's clock minus the phone's clock when the start was sent, in seconds (positive: the phone was behind). Over 5 minutes is flagged in gps_evidence (start_clock_drift).

  • sourcestring

    Where the times came from: eld (the truck's ELD gateway, Samsara or Motive; in development for Pro carriers, not yet available), phone (the Demurly driver app), api (the carrier's own system through this API), edi (the carrier's EDI 214 shipment status messages), import (the carrier's spreadsheet of past records).

    eld
    The truck's ELD gateway (Samsara or Motive); in development, not yet available
    phone
    The Demurly driver app
    api
    The carrier's own system, through this API
    edi
    The carrier's EDI 214 shipment status messages
    import
    The carrier's spreadsheet of past records
    other
    Entered in Demurly
  • source_labelstring

    The same, in the sentence the fuel buyer sees, e.g. "Arrival and departure from the truck's Samsara gateway (Unit 214), inside the fence for Spokane Terminal."

  • vehicleobjectcan be null

    The truck, for records opened by its ELD gateway (and phone records linked to one)

  • vehicle.idstringcan be null
  • vehicle.unit_numberstringcan be null

    The carrier's unit number

  • evidence_hashstringcan be null

    For ELD records: the SHA-256 (hex) of the evidence snapshot sealed when the record closed (trail inside the site fence, engine intervals, fence and rule versions). Null for other records and until the record closes.

  • gps_evidenceobjectcan be null

    The GPS evidence, checked when the record is stopped (null before that): the driver's phone trail, or for ELD records the truck gateway's trail (source eld). Missing evidence doesn't block a record; it's flagged so reviewers can check the times. status is incomplete when any issue is a warning; not_tracked for records whose times were reported (API, EDI, import) rather than tracked by the driver app.

  • gps_evidence.statusstring
    complete
    The trail backs the times
    incomplete
    At least one issue is a warning
    not_tracked
    The times were reported (API, EDI, import), not tracked by the driver app
  • gps_evidence.sourcestring

    Whose trail was checked: the driver's phone or the truck's ELD gateway

    phone
    eld
  • gps_evidence.point_countinteger

    GPS points stored for the record (for eld, the gateway's positions during the wait)

  • gps_evidence.issuesarray of object
  • gps_evidence.issues[].codestring

    short_tracking_gap (info): no GPS point for 10 to 30 minutes, with the times (over 30 minutes is tracking_gaps, a warning). gps_jump: two GPS points too far apart for the time between them (over 100 mph), so one is likely wrong. auto_stopped (info): the wait stopped itself (the truck drove off or moved over half a mile) rather than the driver tapping Stop. started_offline (info): the wait started without signal, with the phone's GPS trail until signal returned. start_clock_drift: the phone's clock was over 5 minutes off. offline_start_gap: no GPS point soon after an offline start. offline_points_outside_geofence: points recorded without signal were outside the terminal's geofence. For ELD records (source eld): eld_no_trail: no gateway positions during the wait. eld_no_arrival_point / eld_no_departure_point: no gateway position within 10 minutes of that edge. eld_gateway_gap: no position for over 10 minutes with the engine on or unknown, or the truck moved. eld_engine_off_gap (info): no position while the engine was off and the truck stayed put (a parked gateway sleeps). eld_outside_fence: gateway positions during the wait outside the site fence (warning when none were inside). eld_provider_geofence (info): the times came from the ELD provider's own geofence (Motive).

    zero_length
    no_gps
    manual_location_only
    no_start_location
    no_departure_point
    too_few_points
    poor_accuracy
    tracking_gaps
    short_tracking_gap
    gps_jump
    auto_stopped
    driver_said_still_here
    recording_interrupted
    gps_errors
    mock_location
    start_outside_geofence
    end_outside_geofence
    started_offline
    start_clock_drift
    offline_start_gap
    offline_points_outside_geofence
    eld_no_trail
    eld_no_arrival_point
    eld_no_departure_point
    eld_gateway_gap
    eld_engine_off_gap
    eld_outside_fence
    eld_provider_geofence
  • gps_evidence.issues[].severitystring
    warning
    Evidence is missing or weak
    info
    Worth knowing (for example outside the terminal geofence), not a gap
  • gps_evidence.issues[].messagestring

    What's missing, in words to show a person

  • sent_to_customer_atstring (date-time)can be null

    When it was last sent to the buyer

  • approved_atstring (date-time)can be null

    When the buyer approved it

  • paid_atstring (date-time)can be null

    When it was paid

  • created_atstring (date-time)

    When the record was made

  • updated_atstring (date-time)

    When anything about it last changed, including a comment or photo: what updated_since compares

  • eventsarray of object

    Its history, oldest first (only with include=events; GPS points left out). A fuel buyer sees only its own rounds.

  • events[].idstring (uuid)
  • events[].typestring

    The stored event type, such as record_created, calculation_performed, record_sent_to_customer, record_disputed or comment_added (listed in the record lifecycle guide). New types may be added.

  • events[].sequenceinteger

    Its place in the record's history: increases by event

  • events[].actor_typestring

    Who acted: driver, carrier_admin, customer_admin, guest (an emailed review link) or system

  • events[].occurred_atstring (date-time)

    When it happened

  • events[].recorded_atstring (date-time)

    When Demurly stored the event

  • events[].dataobject

    Details by type, e.g. amount, total_minutes, billable_minutes and hourly_rate for calculation_performed, reason and disputeType for a dispute, comment for a comment (keys as stored; ignore ones you don't know)

Example

Record (JSON)
{
  "id": "7b2e4c19-5d3a-4f8e-9a61-2c0d8e7f1a34",
  "record_number": "DMR-00001043",
  "status": "sent_to_customer",
  "carrier": {
    "id": "a1b2c3d4-0000-4000-8000-000000000001",
    "name": "Acme Trucking"
  },
  "customer": {
    "id": "a1b2c3d4-0000-4000-8000-000000000002",
    "name": "Gulf Fuel Supply"
  },
  "terminal": {
    "id": "a1b2c3d4-0000-4000-8000-000000000003",
    "name": "Houston Terminal",
    "time_zone": "America/Chicago"
  },
  "load_number": "L-55821",
  "bol_number": "BOL-99812",
  "container_number": null,
  "start_time": "2026-01-15T14:30:00.000Z",
  "end_time": "2026-01-15T17:45:00.000Z",
  "time_zone": "America/Chicago",
  "time_zone_source": "terminal",
  "start_time_local": "2026-01-15T08:30:00.000-06:00",
  "end_time_local": "2026-01-15T11:45:00.000-06:00",
  "local_start_date": "2026-01-15",
  "adjusted_start_time": null,
  "adjusted_end_time": null,
  "time_adjustment_reason": null,
  "total_minutes": 195,
  "free_time_minutes": 120,
  "billable_minutes": 75,
  "billed_minutes": 75,
  "hourly_rate": 100,
  "amount": 125,
  "amount_approved": null,
  "currency": "usd",
  "stop_reason": "manual",
  "started_offline": false,
  "start_received_at": null,
  "start_clock_drift_seconds": null,
  "gps_evidence": {
    "status": "not_tracked",
    "source": "phone",
    "point_count": 0,
    "issues": []
  },
  "source": "api",
  "source_label": "Reported by Acme Trucking's own system.",
  "vehicle": null,
  "evidence_hash": null,
  "sent_to_customer_at": "2026-01-15T18:02:12.000Z",
  "approved_at": null,
  "paid_at": null,
  "created_at": "2026-01-15T18:02:11.000Z",
  "updated_at": "2026-01-15T18:02:12.000Z"
}

The record tombstone object

What a fuel buyer still sees of a charge it was sent after the carrier withdrew it from that buyer. Nothing from what happened to the charge afterwards is shown.

Fields

  • idstring (uuid)Always present
  • record_numberstringAlways present
  • statusstringAlways present
    withdrawn
  • withdrawn_reasonstringAlways present

    cancelled: the carrier cancelled (withdrew) it. reassigned: the carrier sent it to another fuel buyer. recalled: the carrier took it back for review; it may be sent to you again, and then it's an ordinary record again.

    cancelled
    reassigned
    recalled
  • withdrawn_atstring (date-time)Always present

    When it was withdrawn from you

  • carrierobjectAlways present
  • carrier.idstring
  • carrier.namestringcan be null
  • created_atstring (date-time)Always present
  • updated_atstring (date-time)Always present

    When it was withdrawn (or its reason last changed): what updated_since compares

Example

Record tombstone (JSON)
{
  "id": "3f6c1d2e-8a4b-4c1e-9f0a-1b2c3d4e5f60",
  "record_number": "DMR-00000042",
  "status": "withdrawn",
  "withdrawn_reason": "cancelled",
  "withdrawn_at": "2026-01-15T08:30:00Z",
  "carrier": {
    "id": "string",
    "name": "string"
  },
  "created_at": "2026-01-15T08:30:00Z",
  "updated_at": "2026-01-15T08:30:00Z"
}

The driver object

One of your drivers

Fields

  • idstring (uuid)

    Send as driver_id when reporting a wait

  • driver_numberstringcan be null

    Your number for the driver; send as driver_number instead of driver_id

  • first_namestringcan be null
  • last_namestringcan be null
  • is_activeboolean

    Only active drivers can be named on a new record

  • created_atstring (date-time)

Example

Driver (JSON)
{
  "id": "d1a2b3c4-0000-4000-8000-000000000011",
  "driver_number": "1001",
  "first_name": "John",
  "last_name": "Smith",
  "is_active": true,
  "created_at": "2025-11-02T15:00:00.000Z"
}

The terminal object

A terminal (a fuel rack or other site where drivers wait) configured for your company

Fields

  • idstring (uuid)

    Send as terminal_id when reporting a wait

  • namestringcan be null

    Your custom name for the terminal, else its name

  • addressstringcan be null
  • citystringcan be null
  • statestringcan be null
  • zipstringcan be null
  • latitudenumbercan be null
  • longitudenumbercan be null
  • time_zonestringcan be null

    The terminal's IANA time zone (null while it isn't known). Records at the terminal are stamped with it.

Example

Terminal (JSON)
{
  "id": "a1b2c3d4-0000-4000-8000-000000000003",
  "name": "Houston Terminal",
  "address": "1200 Port Rd",
  "city": "Houston",
  "state": "TX",
  "zip": "77029",
  "latitude": 29.7604,
  "longitude": -95.3698,
  "time_zone": "America/Chicago"
}

The connection object

A carrier and a fuel buyer that bill each other through Demurly

Fields

  • idstring (uuid)

    The connection's own id (not the partner's)

  • statusstring
    pending
    Invited; not accepted yet
    active
    Connected: records can be sent
    inactive
    Ended; no new records
  • rolestring

    Your organization's side of the connection

    carrier
    customer
  • partnerobject

    The other company

  • partner.idstring (uuid)

    The other company's id: for a carrier, the customer_id to send records to

  • partner.namestringcan be null
  • partner.typestring
    carrier
    customer
  • hourly_ratenumbercan be null

    The carrier's rate for this customer (carrier keys only; null for customers)

  • maximum_ratenumbercan be null

    The customer's maximum rate for this carrier (customer keys only; null for carriers)

  • created_atstring (date-time)

Example

Connection (JSON)
{
  "id": "c1a2b3c4-0000-4000-8000-000000000021",
  "status": "active",
  "role": "carrier",
  "partner": {
    "id": "a1b2c3d4-0000-4000-8000-000000000002",
    "name": "Gulf Fuel Supply",
    "type": "customer"
  },
  "hourly_rate": 100,
  "maximum_rate": null,
  "created_at": "2025-10-20T18:00:00.000Z"
}

The saved report object

A report saved in the report builder

Fields

  • idstring (uuid)
  • namestring
  • columnsarray of string

    The report's column names, in order

  • date_rangeobjectcan be null

    { "type": "preset", "preset": "7d" | "30d" | "90d" | "ytd" | "12m" } (rolling), { "type": "fixed", "start": "YYYY-MM-DD", "end": "YYYY-MM-DD" } (days on your company's calendar; each record by its wait's local day at its terminal) or { "type": "all" }

  • date_range.typestring
    preset
    fixed
    all
  • date_range.presetstring
    7d
    30d
    90d
    ytd
    12m
  • date_range.startstring (date)
  • date_range.endstring (date)
  • statusesarray of string

    Record statuses included (empty means all)

  • amount_minnumbercan be null
  • amount_maxnumbercan be null
  • created_atstring (date-time)
  • updated_atstring (date-time)

Example

Saved report (JSON)
{
  "id": "5a1b2c3d-0000-4000-8000-000000000031",
  "name": "Approved charges by customer",
  "columns": [
    "record_number",
    "status",
    "amount",
    "customer_name",
    "created_at"
  ],
  "date_range": {
    "type": "preset",
    "preset": "30d"
  },
  "statuses": [
    "customer_approved"
  ],
  "amount_min": null,
  "amount_max": null,
  "created_at": "2026-11-01T15:00:00.000Z",
  "updated_at": "2026-11-02T09:30:00.000Z"
}

The report data object

A saved report's rows, run now

Fields

  • livemodeboolean

    true for a live key's answer (your real data); false for a test key's (your test-mode sandbox). Every JSON body an API key gets carries it, errors included, and so does every webhook body.

  • reportobject
  • report.idstring (uuid)
  • report.namestring
  • report.updated_atstring (date-time)
  • generated_atstring (date-time)
  • columnsarray of object
  • columns[].namestring

    Stable column name (the key in each row)

  • columns[].labelstring

    The heading the report builder shows

  • columns[].typestring
    string
    number
    datetime
  • dataarray of object
  • row_countinteger
  • truncatedboolean

    More rows matched than were returned (see limit)

Example

Report data (JSON)
{
  "report": {
    "id": "5a1b2c3d-0000-4000-8000-000000000031",
    "name": "Approved charges by customer",
    "updated_at": "2026-11-02T09:30:00.000Z"
  },
  "generated_at": "2026-11-06T12:00:00.000Z",
  "columns": [
    {
      "name": "record_number",
      "label": "Record Number",
      "type": "string"
    },
    {
      "name": "amount",
      "label": "Amount",
      "type": "number"
    },
    {
      "name": "start_time",
      "label": "Start (UTC)",
      "type": "datetime"
    },
    {
      "name": "time_zone",
      "label": "Time zone ID",
      "type": "string"
    }
  ],
  "data": [
    {
      "record_number": "DMR-00001042",
      "amount": 125,
      "start_time": "2026-11-05T15:30:00.000Z",
      "time_zone": "America/Phoenix"
    }
  ],
  "row_count": 1,
  "truncated": false,
  "livemode": true
}

The photo attachment object

A photo attached to a record (a BOL, gate ticket or terminal sign)

Fields

  • idstring (uuid)
  • record_idstring (uuid)
  • content_typestring
    image/jpeg
    image/png
  • size_bytesinteger

    The file's size in bytes

  • sha256string

    SHA-256 of the file, hex

  • photo_checkobject

    The photo check: whether a photo is an original taken at this wait. Checked from the file's camera data (or, for the driver app's camera, the app's own time and GPS fix) and against photos on other records.

Example

Photo attachment (JSON)
{
  "id": "9c4f2a1b-6e3d-4b7a-8f20-5d1e9c3b7a44",
  "record_id": "3f6c1d2e-8a4b-4c1e-9f0a-1b2c3d4e5f60",
  "content_type": "image/jpeg",
  "size_bytes": 482113,
  "sha256": "4f3c9a0e7b1d2c6f8e5a3b9d0c7e1f2a6b8d4c0e9f3a7b1c5d2e8f6a0b4c9d3e",
  "photo_check": {
    "result": "original",
    "reasons": []
  }
}

The webhook event object

The body of every webhook POST. For webhook.test (Send test in settings) record_id, sequence and data.event are null and data is { message }.

Fields

  • idstring

    The event's id; the same on every retry, so you can drop duplicates

  • typestring
    record.created
    record.stopped
    record.submitted
    record.rejected_internal
    record.reopened
    record.sent
    record.approved
    record.disputed
    record.escalated
    record.closed
    record.offer_accepted
    record.withdrawn
    record.cancelled
    record.updated
    record.comment_added
    record.payment_pending
    record.payment_failed
    record.paid
    record.payment_reversed
    webhook.test
  • created_atstring (date-time)

    When the delivery was queued

  • record_idstring (uuid)can be null

    The record the event is about (null for webhook.test)

  • sequenceintegercan be null

    The event's place in its record's history: increases with each event of a record. Keep the highest applied per record_id and ignore lower ones (delivery is unordered). Null for webhook.test

  • occurred_atstring (date-time)can be null

    When the event happened

  • livemodeboolean

    false for a test-mode event (sent only to test endpoints), true otherwise; a live endpoint never gets a test event, nor a test endpoint a live one

  • dataobject
  • data.messagestring

    webhook.test only: a line saying it's a test

  • data.recordRecord or Record tombstone

    The record when this body was first built (its first attempt), not necessarily at the event; compare sequence, or GET the record. For record.withdrawn: the tombstone (status withdrawn), built when it was withdrawn

    One of: Record, Record tombstone

  • data.eventobjectcan be null

    The event that triggered this webhook (null for webhook.test)

  • data.event.typestring

    The stored event type, e.g. time_adjusted or field_updated for record.updated, external_payment_marked or payment_processing for record.payment_pending; record_withdrawn for record.withdrawn (data: withdrawn_reason)

  • data.event.sequenceinteger

    Same as the top-level sequence

  • data.event.actor_typestring

    e.g. carrier_admin, customer_admin, guest, system

  • data.event.sourcestring

    e.g. web, api, mobile_web, android_app, guest_link, webhook, system

  • data.event.occurred_atstring (date-time)
  • data.event.dataobject

    Details by type, e.g. a dispute's reason; on approvals from an emailed link, isGuestApproval and guestEmail (who approved; not a signed-in user); field and value for a field change; adjusted_start_time, adjusted_end_time (null: back to the recorded times), reason and previous_amount for adjusted times; comment for a comment; method, reference and paid_on for a payment marked outside Demurly; note, or method, failureCode and failureMessage, for a failed payment

Example

Webhook event (JSON)
{
  "id": "string",
  "type": "record.created",
  "created_at": "2026-01-15T08:30:00Z",
  "record_id": "3f6c1d2e-8a4b-4c1e-9f0a-1b2c3d4e5f60",
  "sequence": 0,
  "occurred_at": "2026-01-15T08:30:00Z",
  "livemode": true,
  "data": {
    "message": "string",
    "record": {
      "id": "7b2e4c19-5d3a-4f8e-9a61-2c0d8e7f1a34",
      "record_number": "DMR-00001043",
      "status": "sent_to_customer",
      "carrier": {
        "id": "a1b2c3d4-0000-4000-8000-000000000001",
        "name": "Acme Trucking"
      },
      "customer": {
        "id": "a1b2c3d4-0000-4000-8000-000000000002",
        "name": "Gulf Fuel Supply"
      },
      "terminal": {
        "id": "a1b2c3d4-0000-4000-8000-000000000003",
        "name": "Houston Terminal",
        "time_zone": "America/Chicago"
      },
      "load_number": "L-55821",
      "bol_number": "BOL-99812",
      "container_number": null,
      "start_time": "2026-01-15T14:30:00.000Z",
      "end_time": "2026-01-15T17:45:00.000Z",
      "time_zone": "America/Chicago",
      "time_zone_source": "terminal",
      "start_time_local": "2026-01-15T08:30:00.000-06:00",
      "end_time_local": "2026-01-15T11:45:00.000-06:00",
      "local_start_date": "2026-01-15",
      "adjusted_start_time": null,
      "adjusted_end_time": null,
      "time_adjustment_reason": null,
      "total_minutes": 195,
      "free_time_minutes": 120,
      "billable_minutes": 75,
      "billed_minutes": 75,
      "hourly_rate": 100,
      "amount": 125,
      "amount_approved": null,
      "currency": "usd",
      "stop_reason": "manual",
      "started_offline": false,
      "start_received_at": null,
      "start_clock_drift_seconds": null,
      "gps_evidence": {
        "status": "not_tracked",
        "source": "phone",
        "point_count": 0,
        "issues": []
      },
      "source": "api",
      "source_label": "Reported by Acme Trucking's own system.",
      "vehicle": null,
      "evidence_hash": null,
      "sent_to_customer_at": "2026-01-15T18:02:12.000Z",
      "approved_at": null,
      "paid_at": null,
      "created_at": "2026-01-15T18:02:11.000Z",
      "updated_at": "2026-01-15T18:02:12.000Z"
    },
    "event": {
      "type": "string",
      "sequence": 0,
      "actor_type": "string",
      "source": "string",
      "occurred_at": "2026-01-15T08:30:00Z",
      "data": {}
    }
  }
}

The error object

Fields

  • livemodeboolean

    true for a live key's answer (your real data); false for a test key's (your test-mode sandbox). Every JSON body an API key gets carries it, errors included, and so does every webhook body.

  • errorobjectAlways present
  • error.codestringAlways present

    Stable machine-readable code: branch on this, not on message. Every code, with its cause, fix and whether to retry, is in the error catalogue (the x-codes of each response). New codes may be added; treat one you don't know by its HTTP status.

  • error.messagestringAlways present

    What went wrong, safe to show to people. Wording can change.

  • error.request_idstring

    The request's X-Request-Id (every /api/v1 error); quote it to support to find the call

  • error.hintstring

    What to do about it, when there's something specific: a record number sent where the id goes, a test key asking for live data, a missing scope (named), a missing, revoked or expired key, a field to fix, how long to wait. Wording can change.

  • error.fieldstring

    VALIDATION_ERROR only: the first field or query parameter at fault (every one is in details.fields)

  • error.detailsValidation error details or Invalid status details or Overlapping wait details or Payment rules details

    More about some errors only, by code: VALIDATION_ERROR (fields), INVALID_STATUS (status), OVERLAPPING_WAIT (the other wait), CONFLICT for payment rules (reason payment_rules, problems)

    One of: Validation error details, Invalid status details, Overlapping wait details, Payment rules details

Example

Error (JSON)
{
  "livemode": true,
  "error": {
    "code": "NOT_FOUND",
    "message": "Record not found",
    "request_id": "6f1c2d3e-4b5a-4c6d-8e7f-9a0b1c2d3e4f",
    "hint": "Use the record's id (a UUID), or list with q=DMR-00000432 to find it.",
    "field": "start_time",
    "details": {
      "fields": {
        "start_time": [
          "Required"
        ],
        "end_time": [
          "end_time can't be in the future"
        ]
      }
    }
  }
}

The payment rules details object

CONFLICT from send: the charge doesn't meet the buyer's payment rules. Send again with confirm_nonconforming: true to send it anyway.

Fields

  • reasonstring
    payment_rules
  • problemsarray of object
  • problems[].rulestring
    min_free_time
    The buyer pays only after more free time than this charge gives
    max_rate
    The charge's hourly rate is above the buyer's maximum
  • problems[].scopestring
    carrier
    The buyer set the rule for your company
    company
    The buyer's rule for every carrier
  • problems[].messagestring

    The problem in words

  • problems[].required_minutesinteger

    min_free_time: the free time the buyer expects

  • problems[].actual_minutesinteger

    min_free_time: the free time this charge gives

  • problems[].max_rate_centsinteger

    max_rate: the buyer's maximum hourly rate, in cents

  • problems[].actual_rate_centsinteger

    max_rate: this charge's hourly rate, in cents

  • confirm_withstring

    The request field that sends it anyway

    confirm_nonconforming

Example

Payment rules details (JSON)
{
  "reason": "payment_rules",
  "problems": [
    {
      "rule": "max_rate",
      "scope": "carrier",
      "message": "The buyer's maximum rate is $50.00 an hour; this charge is $100.00.",
      "max_rate_cents": 5000,
      "actual_rate_cents": 10000
    }
  ],
  "confirm_with": "confirm_nonconforming"
}

The overlapping wait details object

OVERLAPPING_WAIT: the driver's other wait

Fields

  • reasonstring
    overlapping_wait
  • record_idstring (uuid)
  • record_numberstring
  • start_timestring (date-time)
  • end_timestring (date-time)can be null
  • statusstring

Example

Overlapping wait details (JSON)
{
  "reason": "overlapping_wait",
  "record_id": "3f6c1d2e-8a4b-4c1e-9f0a-1b2c3d4e5f60",
  "record_number": "DMR-00001042",
  "start_time": "2026-01-15T14:30:00.000Z",
  "end_time": "2026-01-15T17:45:00.000Z",
  "status": "sent_to_customer"
}

The invalid status details object

INVALID_STATUS: the status the record is in

Fields

  • statusstring

    A record status, or withdrawn for a charge withdrawn from you

Example

Invalid status details (JSON)
{
  "status": "customer_approved"
}

The validation error details object

VALIDATION_ERROR: what's wrong with each field

Fields

  • fieldsobject

    Field name (dotted for nested fields; "_" for the body as a whole) to its messages

Example

Validation error details (JSON)
{
  "fields": {
    "start_time": [
      "Required"
    ],
    "end_time": [
      "end_time can't be in the future"
    ]
  }
}

The livemode object

true for a live key's answer (your real data); false for a test key's (your test-mode sandbox). Every JSON body an API key gets carries it, errors included, and so does every webhook body.

Example

Livemode (JSON)
true

The webhook delivery object

One event sent (or to be sent) to an endpoint, with every attempt.

Fields

  • idstring (uuid)

    The delivery's id (the X-Demurly-Delivery header)

  • endpoint_idstring (uuid)
  • event_typestring

    e.g. record.approved, or webhook.test

  • record_idstring (uuid)can be null
  • statusstring
    pending
    Waiting for its next attempt
    succeeded
    Your endpoint answered 2xx
    failed
    Every retry failed (resend it)
    paused
    Kept while the endpoint was off
    skipped
    A missed event you chose not to send
  • attempt_countinteger

    Attempts since it was queued (or last resent)

  • last_status_codeintegercan be null
  • last_errorstringcan be null
  • next_attempt_atstring (date-time)can be null

    When it's tried next (pending only)

  • last_attempt_atstring (date-time)can be null
  • created_atstring (date-time)
  • bodystringcan be null

    The exact JSON body sent (a WebhookEvent), as a string; null until the first attempt

  • attemptsarray of Webhook delivery attempt

    Every attempt, oldest first

Example

Webhook delivery (JSON)
{
  "id": "c3d4e5f6-0000-4000-8000-0000000000d1",
  "endpoint_id": "7b1e2c3d-4a5b-4c6d-8e7f-901234567890",
  "event_type": "record.approved",
  "record_id": "3f6c1d2e-8a4b-4c1e-9f0a-1b2c3d4e5f60",
  "status": "succeeded",
  "attempt_count": 2,
  "last_status_code": 200,
  "last_error": null,
  "next_attempt_at": null,
  "last_attempt_at": "2026-11-09T18:21:01.402Z",
  "created_at": "2026-11-09T18:20:00.950Z",
  "body": "{\"id\":\"8d2f6c1e-1a2b-4c3d-9e0f-112233445566\",\"type\":\"record.approved\",\"created_at\":\"2026-11-09T18:20:00.950Z\",\"record_id\":\"3f6c1d2e-8a4b-4c1e-9f0a-1b2c3d4e5f60\",\"sequence\":7,\"occurred_at\":\"2026-11-09T18:20:00.912Z\",\"data\":{\"record\":{\"id\":\"3f6c1d2e-8a4b-4c1e-9f0a-1b2c3d4e5f60\",\"status\":\"customer_approved\"},\"event\":{\"type\":\"record_approved\",\"sequence\":7}}}",
  "attempts": [
    {
      "attempt_number": 1,
      "attempted_at": "2026-11-09T18:20:00.981Z",
      "duration_ms": null,
      "request": {
        "headers": {
          "Content-Type": "application/json",
          "User-Agent": "Demurly-Webhooks/1.0",
          "X-Demurly-Signature": "t=1794248401,v1=5f0e3c9a1b7d2e4f6a8c0b1d3e5f7a9c2b4d6e8f0a1c3e5b7d9f1a3c5e7b9d0f2,v1=9a8b7c6d5e4f3a2b1c0d9e8f7a6b5c4d3e2f1a0b9c8d7e6f5a4b3c2d1e0f9a8b",
          "X-Demurly-Event": "record.approved",
          "X-Demurly-Delivery": "c3d4e5f6-0000-4000-8000-0000000000d1"
        }
      },
      "response": null,
      "error": "Could not connect, or no response within 10 seconds"
    },
    {
      "attempt_number": 2,
      "attempted_at": "2026-11-09T18:21:01.402Z",
      "duration_ms": 182,
      "request": {
        "headers": {
          "Content-Type": "application/json",
          "User-Agent": "Demurly-Webhooks/1.0",
          "X-Demurly-Signature": "t=1794248401,v1=5f0e3c9a1b7d2e4f6a8c0b1d3e5f7a9c2b4d6e8f0a1c3e5b7d9f1a3c5e7b9d0f2,v1=9a8b7c6d5e4f3a2b1c0d9e8f7a6b5c4d3e2f1a0b9c8d7e6f5a4b3c2d1e0f9a8b",
          "X-Demurly-Event": "record.approved",
          "X-Demurly-Delivery": "c3d4e5f6-0000-4000-8000-0000000000d1"
        }
      },
      "response": {
        "status": 200,
        "headers": {
          "content-type": "application/json",
          "date": "Mon, 09 Nov 2026 18:21:01 GMT"
        },
        "body": "{\"received\":true}",
        "body_truncated": false
      },
      "error": null
    }
  ]
}

The webhook delivery attempt object

One try at a delivery, as sent and as answered.

Fields

  • attempt_numberinteger

    1 for the first try; numbering starts again after a resend

  • attempted_atstring (date-time)
  • duration_msintegercan be null

    How long until your endpoint answered; null when it couldn't be reached (a refused connection and a timeout are reported the same way)

  • requestobject
  • request.headersobject

    The headers sent, X-Demurly-Signature included

  • responseobjectcan be null

    What your endpoint answered (null when nothing came back)

  • response.statusinteger
  • response.headersobject

    Its headers (cookies left out)

  • response.bodystringcan be null

    The first 2 KB of its body

  • response.body_truncatedboolean

    The body was longer than what's kept

  • errorstringcan be null

    Why it failed: an HTTP status, no response within 10 seconds, could not connect

Example

Webhook delivery attempt (JSON)
{
  "attempt_number": 2,
  "attempted_at": "2026-11-09T18:21:01.402Z",
  "duration_ms": 182,
  "request": {
    "headers": {
      "Content-Type": "application/json",
      "User-Agent": "Demurly-Webhooks/1.0",
      "X-Demurly-Signature": "t=1794248401,v1=5f0e3c9a1b7d2e4f6a8c0b1d3e5f7a9c2b4d6e8f0a1c3e5b7d9f1a3c5e7b9d0f2,v1=9a8b7c6d5e4f3a2b1c0d9e8f7a6b5c4d3e2f1a0b9c8d7e6f5a4b3c2d1e0f9a8b",
      "X-Demurly-Event": "record.approved",
      "X-Demurly-Delivery": "c3d4e5f6-0000-4000-8000-0000000000d1"
    }
  },
  "response": {
    "status": 200,
    "headers": {
      "content-type": "application/json",
      "date": "Mon, 09 Nov 2026 18:21:01 GMT"
    },
    "body": "{\"received\":true}",
    "body_truncated": false
  },
  "error": null
}

The webhook endpoint object

A URL that receives your record events (Settings > Webhooks, or this API).

Fields

  • idstring (uuid)
  • livemodeboolean

    true for a live endpoint (live keys manage them); false for a test endpoint, which gets test-mode events only

  • urlstring

    An https URL at a public address

  • descriptionstringcan be null
  • eventsarray of string

    The event types it gets; empty means every event, including ones added later

  • activeboolean

    Whether it's on. Off (by you, or by Demurly after 3 days of failing every retry), events are kept for it as paused

  • disabled_reasonstringcan be null

    Why it's off

  • disabled_atstring (date-time)can be null

    When it was turned off (null while on)

  • failing_sincestring (date-time)can be null

    The first failed attempt since the last delivered one (null while delivering)

  • missed_eventsobjectcan be null

    Events kept while it was off, waiting to be sent or skipped (missed events endpoint)

  • missed_events.countinteger
  • missed_events.sincestring (date-time)
  • secret_hintstring

    The signing secret's last four characters (whsec_…9QzA)

  • secret_rolled_atstring (date-time)can be null

    When the secret was last rolled

  • previous_secret_expires_atstring (date-time)can be null

    Until when deliveries also carry a signature made with the previous secret (a second v1); null when there's none

  • last_deliveryobjectcan be null
  • last_delivery.statusstring
    pending
    succeeded
    failed
    paused
    skipped
  • last_delivery.attempted_atstring (date-time)
  • last_delivery.status_codeintegercan be null
  • created_atstring (date-time)
  • updated_atstring (date-time)
  • secretstring

    The signing secret (whsec_...). Only in the answers to adding an endpoint and rolling its secret: store it then

Example

Webhook endpoint (JSON)
{
  "id": "7b1e2c3d-4a5b-4c6d-8e7f-901234567890",
  "livemode": true,
  "url": "https://erp.example.com/demurly/webhooks",
  "description": "ERP sync",
  "events": [
    "record.approved",
    "record.paid"
  ],
  "active": true,
  "disabled_reason": null,
  "disabled_at": null,
  "failing_since": null,
  "missed_events": null,
  "secret_hint": "whsec_…9QzA",
  "secret_rolled_at": null,
  "previous_secret_expires_at": null,
  "last_delivery": null,
  "created_at": "2026-11-09T18:00:00.000Z",
  "updated_at": "2026-11-09T18:00:00.000Z",
  "secret": "whsec_Hk3vR8nQe2LxT0aWmZ5bYc7dUf9gJp1s"
}

The aging stats object

Fields

  • as_ofstring (date-time)
  • awaiting_reviewarray of Aging bucket
  • approved_unpaidarray of Aging bucket
  • livemodeboolean

    true for a live key's answer (your real data); false for a test key's (your test-mode sandbox). Every JSON body an API key gets carries it, errors included, and so does every webhook body.

Example

Aging stats (JSON)
{
  "as_of": "2026-01-15T08:30:00Z",
  "awaiting_review": [
    {
      "days": "0-30",
      "records": 0,
      "amount": 0
    }
  ],
  "approved_unpaid": [
    {
      "days": "0-30",
      "records": 0,
      "amount": 0
    }
  ],
  "livemode": true
}

The aging bucket object

Fields

  • daysstring
    0-30
    31-60
    61-90
    90+
  • recordsinteger
  • amountnumber

Example

Aging bucket (JSON)
{
  "days": "0-30",
  "records": 0,
  "amount": 0
}

The period stats object

Fields

  • fromstring (date-time)
  • tostring (date-time)
  • intervalstring
    week
    month
  • time_zonestring

    Your company's time zone (the calendar periods follow)

  • dataarray of object
  • data[].period_startstring (date)

    The week's Monday or the month's first day

  • data[].recordsinteger
  • data[].wait_minutesinteger
  • data[].billed_amountnumber
  • data[].approved_amountnumber
  • data[].paid_amountnumber
  • livemodeboolean

    true for a live key's answer (your real data); false for a test key's (your test-mode sandbox). Every JSON body an API key gets carries it, errors included, and so does every webhook body.

Example

Period stats (JSON)
{
  "from": "2026-01-15T08:30:00Z",
  "to": "2026-01-15T08:30:00Z",
  "interval": "week",
  "time_zone": "America/Chicago",
  "data": [
    {
      "period_start": "2026-01-15",
      "records": 0,
      "wait_minutes": 0,
      "billed_amount": 0,
      "approved_amount": 0,
      "paid_amount": 0
    }
  ],
  "livemode": true
}

The partner stats object

Fields

  • fromstring (date-time)
  • tostring (date-time)
  • dataarray of object
  • data[].partnerobject
  • data[].partner.idstring
  • data[].partner.typestring

    customer: a fuel buyer (on a carrier's records)

    carrier
    customer
  • data[].partner.namestringcan be null
  • data[].recordsinteger
  • data[].disputed_recordsinteger

    Records with a dispute your company can see

  • data[].wait_minutesinteger
  • data[].average_wait_minutesinteger
  • data[].billed_amountnumber
  • data[].approved_amountnumber
  • livemodeboolean

    true for a live key's answer (your real data); false for a test key's (your test-mode sandbox). Every JSON body an API key gets carries it, errors included, and so does every webhook body.

Example

Partner stats (JSON)
{
  "from": "2026-10-11T00:00:00.000Z",
  "to": "2026-11-10T00:00:00.000Z",
  "data": [
    {
      "partner": {
        "id": "a1b2c3d4-0000-4000-8000-000000000004",
        "type": "carrier",
        "name": "Acme Trucking"
      },
      "records": 22,
      "disputed_records": 4,
      "wait_minutes": 4180,
      "average_wait_minutes": 190,
      "billed_amount": 2950,
      "approved_amount": 2400
    }
  ],
  "livemode": true
}

The terminal stats object

Fields

  • fromstring (date-time)
  • tostring (date-time)
  • dataarray of object
  • data[].terminalobjectcan be null

    null for records with no terminal

  • data[].terminal.idstring
  • data[].terminal.namestring
  • data[].recordsinteger
  • data[].wait_minutesinteger
  • data[].average_wait_minutesinteger
  • data[].billable_minutesinteger
  • data[].billed_amountnumber
  • data[].approved_amountnumber
  • livemodeboolean

    true for a live key's answer (your real data); false for a test key's (your test-mode sandbox). Every JSON body an API key gets carries it, errors included, and so does every webhook body.

Example

Terminal stats (JSON)
{
  "from": "2026-10-11T00:00:00.000Z",
  "to": "2026-11-10T00:00:00.000Z",
  "data": [
    {
      "terminal": {
        "id": "a1b2c3d4-0000-4000-8000-000000000003",
        "name": "Houston Terminal"
      },
      "records": 14,
      "wait_minutes": 2730,
      "average_wait_minutes": 195,
      "billable_minutes": 1050,
      "billed_amount": 1750,
      "approved_amount": 1500
    }
  ],
  "livemode": true
}

The invoice object

An approved charge as an invoice (each approved charge is its invoice)

Fields

  • idstring (uuid)Always present

    The record's id

  • invoice_numberstringAlways present

    The record number

  • record_idstring (uuid)Always present
  • statusstringAlways present
    unpaid
    payment_pending
    paid
    closed
  • carrierobjectAlways present
  • carrier.idstring
  • carrier.namestringcan be null
  • customerobjectcan be nullAlways present
  • customer.idstring
  • customer.namestringcan be null
  • amountnumbercan be nullAlways present

    What was approved (dollars)

  • currencystringAlways present
    usd
  • load_numberstringcan be null
  • bol_numberstringcan be null
  • approved_atstring (date-time)can be nullAlways present
  • paid_atstring (date-time)can be nullAlways present
  • pdf_urlstringAlways present

    The PDF: GET it with the same API key

Example

Invoice (JSON)
{
  "id": "3f6c1d2e-8a4b-4c1e-9f0a-1b2c3d4e5f60",
  "invoice_number": "DMR-00001042",
  "record_id": "3f6c1d2e-8a4b-4c1e-9f0a-1b2c3d4e5f60",
  "status": "unpaid",
  "carrier": {
    "id": "string",
    "name": "string"
  },
  "customer": {
    "id": "string",
    "name": "string"
  },
  "amount": 0,
  "currency": "usd",
  "load_number": "string",
  "bol_number": "string",
  "approved_at": "2026-01-15T08:30:00Z",
  "paid_at": "2026-01-15T08:30:00Z",
  "pdf_url": "string"
}

The record event object

One event in a record's history

Fields

  • idstring (uuid)
  • typestring

    The stored event type, such as record_created, calculation_performed, record_sent_to_customer, record_disputed or comment_added (listed in the record lifecycle guide). New types may be added.

  • sequenceinteger

    Its place in the record's history: increases by event

  • actor_typestring

    Who acted: driver, carrier_admin, customer_admin, guest (an emailed review link) or system

  • occurred_atstring (date-time)

    When it happened

  • recorded_atstring (date-time)

    When Demurly stored the event

  • dataobject

    Details by type, e.g. amount, total_minutes, billable_minutes and hourly_rate for calculation_performed, reason and disputeType for a dispute, comment for a comment (keys as stored; ignore ones you don't know)

Example

Record event (JSON)
{
  "id": "3f6c1d2e-8a4b-4c1e-9f0a-1b2c3d4e5f60",
  "type": "string",
  "sequence": 0,
  "actor_type": "string",
  "occurred_at": "2026-01-15T08:30:00Z",
  "recorded_at": "2026-01-15T08:30:00Z",
  "data": {}
}

The disputed record object

A record with its dispute summary (id is the record's id)

Example

Disputed record (JSON)
{
  "id": "7b2e4c19-5d3a-4f8e-9a61-2c0d8e7f1a34",
  "record_number": "DMR-00001043",
  "status": "sent_to_customer",
  "carrier": {
    "id": "a1b2c3d4-0000-4000-8000-000000000001",
    "name": "Acme Trucking"
  },
  "customer": {
    "id": "a1b2c3d4-0000-4000-8000-000000000002",
    "name": "Gulf Fuel Supply"
  },
  "terminal": {
    "id": "a1b2c3d4-0000-4000-8000-000000000003",
    "name": "Houston Terminal",
    "time_zone": "America/Chicago"
  },
  "load_number": "L-55821",
  "bol_number": "BOL-99812",
  "container_number": null,
  "start_time": "2026-01-15T14:30:00.000Z",
  "end_time": "2026-01-15T17:45:00.000Z",
  "time_zone": "America/Chicago",
  "time_zone_source": "terminal",
  "start_time_local": "2026-01-15T08:30:00.000-06:00",
  "end_time_local": "2026-01-15T11:45:00.000-06:00",
  "local_start_date": "2026-01-15",
  "adjusted_start_time": null,
  "adjusted_end_time": null,
  "time_adjustment_reason": null,
  "total_minutes": 195,
  "free_time_minutes": 120,
  "billable_minutes": 75,
  "billed_minutes": 75,
  "hourly_rate": 100,
  "amount": 125,
  "amount_approved": null,
  "currency": "usd",
  "stop_reason": "manual",
  "started_offline": false,
  "start_received_at": null,
  "start_clock_drift_seconds": null,
  "gps_evidence": {
    "status": "not_tracked",
    "source": "phone",
    "point_count": 0,
    "issues": []
  },
  "source": "api",
  "source_label": "Reported by Acme Trucking's own system.",
  "vehicle": null,
  "evidence_hash": null,
  "sent_to_customer_at": "2026-01-15T18:02:12.000Z",
  "approved_at": null,
  "paid_at": null,
  "created_at": "2026-01-15T18:02:11.000Z",
  "updated_at": "2026-01-15T18:02:12.000Z",
  "dispute": {
    "state": "open",
    "opened_at": "2026-01-15T08:30:00Z",
    "reason": "string",
    "dispute_type": "string",
    "proposed_amount": 0,
    "escalated_at": "2026-01-15T08:30:00Z",
    "rounds": 0
  }
}

The dispute summary object

The latest dispute on a record

Fields

  • statestringAlways present

    open: the record is disputed or escalated now

    open
    resolved
  • opened_atstring (date-time)can be nullAlways present

    When the latest dispute was made

  • reasonstringcan be nullAlways present
  • dispute_typestringcan be nullAlways present
  • proposed_amountnumbercan be nullAlways present

    The buyer's proposed amount, when it made one

  • escalated_atstring (date-time)can be nullAlways present
  • roundsintegerAlways present

    How many times it was disputed

Example

Dispute summary (JSON)
{
  "state": "open",
  "opened_at": "2026-01-15T08:30:00Z",
  "reason": "string",
  "dispute_type": "string",
  "proposed_amount": 0,
  "escalated_at": "2026-01-15T08:30:00Z",
  "rounds": 0
}

The record photo object

A photo or document on a record, with a short-lived download URL. width and height are known for photos uploaded from 2026-11 on.

Fields

  • idstring (uuid)
  • record_idstring (uuid)
  • kindstring
    photo
    document
  • sourcestring
    driver_camera
    Taken with the driver's phone in the app
    file_upload
    Chosen from files in the app
    api
    Attached through this API
    email
    Attached from an email
    dashcam
    Fetched from the truck's dashcam (ELD)
  • camerastringcan be null

    Dashcam images only

    road_facing
    driver_facing
  • content_typestring

    e.g. image/jpeg, image/png, image/webp

  • size_bytesinteger

    The file's size in bytes

  • sha256string

    SHA-256 of the file, hex; check a download against it

  • widthintegercan be null

    Pixels, when known

  • heightintegercan be null

    Pixels, when known

  • taken_atstring (date-time)can be null

    When it was taken (the phone's or dashcam's time), when known

  • time_zonestringcan be null

    The record's IANA time zone (its terminal's)

  • taken_at_localstringcan be null

    taken_at with time_zone's offset

  • uploaded_atstring (date-time)

    When Demurly received it

  • download_urlstringcan be null

    A signed URL to GET the file, valid until download_url_expires_at (10 minutes); no API key needed. Don't store it: ask for the photo again for a fresh one

  • download_url_expires_atstring (date-time)can be null
  • photo_checkobject

    The photo check: whether a photo is an original taken at this wait. Checked from the file's camera data (or, for the driver app's camera, the app's own time and GPS fix) and against photos on other records.

Example

Record photo (JSON)
{
  "id": "9c4f2a1b-6e3d-4b7a-8f20-5d1e9c3b7a44",
  "record_id": "3f6c1d2e-8a4b-4c1e-9f0a-1b2c3d4e5f60",
  "kind": "photo",
  "source": "driver_camera",
  "camera": null,
  "content_type": "image/jpeg",
  "size_bytes": 482113,
  "sha256": "4f3c9a0e7b1d2c6f8e5a3b9d0c7e1f2a6b8d4c0e9f3a7b1c5d2e8f6a0b4c9d3e",
  "width": 3024,
  "height": 4032,
  "taken_at": "2026-01-15T14:41:12.000Z",
  "time_zone": "America/Chicago",
  "taken_at_local": "2026-01-15T08:41:12.000-06:00",
  "uploaded_at": "2026-01-15T14:41:15.204Z",
  "download_url": "https://storage.demurly.com/storage/v1/object/sign/record-photos/3f6c1d2e-8a4b-4c1e-9f0a-1b2c3d4e5f60/1768488072000_a1b2c3d4.jpg?token=eyJhbGciOiJIUzI1NiJ9.sig",
  "download_url_expires_at": "2026-11-09T18:30:00.000Z",
  "photo_check": {
    "result": "original",
    "reasons": []
  }
}

The photo check object

The photo check: whether a photo is an original taken at this wait. Checked from the file's camera data (or, for the driver app's camera, the app's own time and GPS fix) and against photos on other records.

Fields

  • resultstring
    original
    Nothing to note
    review
    Stored and shown, with the reasons to look at it
    not_checked
    Added before photos were checked (November 2026)
  • reasonsarray of object
  • reasons[].codestring
    duplicate
    no_camera_data
    too_old
    outside_wait
    no_time
    far_from_terminal
    edited
    screenshot
  • reasons[].messagestring

    The reason in words

Example

Photo check (JSON)
{
  "result": "review",
  "reasons": [
    {
      "code": "far_from_terminal",
      "message": "It was taken more than 1 km from the terminal."
    }
  ]
}

Webhooks

Add endpoints under Settings > Webhooks, or with the webhook endpoints API (webhooks:read and webhooks:write scopes): the same rules apply, the signing secret is returned once when you add an endpoint or roll its secret, and each change is in your audit log under the key's name. Each event is a POST with { id, type, created_at, record_id, sequence, occurred_at, data: { record, event } }, signed in X-Demurly-Signature: t=<unix seconds>,v1=<hex HMAC-SHA256 of "<t>.<raw body>"> with the endpoint's secret. Accept the delivery if any v1 matches: after a secret is rolled, deliveries carry one v1 per valid secret (t=...,v1=<new>,v1=<old>) until the old one expires (at once, or after 1 hour, 24 hours or 7 days, as chosen). Answer 2xx within 10 seconds; anything else is retried after 1 m, 5 m, 30 m, 2 h, 6 h, 12 h and 24 h. The event types are listed below (x-webhooks in the spec); new types can be added, so ignore types and fields you don't know.

Delivery is at-least-once and unordered. id is the same on every retry and on a resend: drop an id you've already handled. Each delivery retries on its own schedule, so an older event can arrive after a newer one for the same record. sequence is the event's place in its record's history (it only increases, per record) and occurred_at is when it happened: keep the highest sequence you've applied for each record_id and ignore an event with a lower one (or fetch GET /api/v1/records/{id} for the current state). Sequence numbers have gaps: they count every event in the record's history, and only some of those are webhook events (GPS points, photos and calculations aren't), so 1, 2, 4, 5 is normal. Even the first events can arrive out of order (record.stopped before record.created for a wait reported in one call).

Timing: the first attempt is sent as the event happens. Retries are sent by a job that runs once a minute, so a retry can land up to a minute after its scheduled time. Every failed attempt counts toward the retries, however quickly it failed (a refused connection included).

data.record is the same object the records endpoints return, as it was when the body was first built (the first attempt; retries send the same bytes), not necessarily at the event.

When an endpoint is turned off: Demurly turns an endpoint off only when it has accepted nothing for 3 days and at least 5 events in a row failed every retry (each event is retried for about 45 hours), so an outage of hours never does. The company's admins get an email and an in-app notice. Nothing is lost: deliveries waiting for it pause, and events while it's off are kept for it (paused in the delivery log, also when an admin turned it off). Turn it back on in Settings > Webhooks and send the missed events (or skip them); they arrive with their original id and sequence.

A charge withdrawn from a fuel buyer (sent to another buyer, or taken back for review) sends that buyer record.withdrawn once, with the same tombstone the records endpoints show it (status: withdrawn, withdrawn_reason, withdrawn_at) and nothing from the new round. A cancellation sends record.cancelled instead. If the charge is sent to the buyer again, record.sent starts a new round.

Event types

EventSent when
record.createdA record was started: a driver started the clock, or a wait was reported through the API, EDI or an import (carriers only)
record.stoppedThe driver stopped the clock; the record is a draft until submitted (carriers only)
record.submittedA record stopped and is waiting for the carrier's review (carriers only)
record.rejected_internalThe carrier's review rejected its driver's record; the buyer never sees it (carriers only)
record.reopenedThe carrier took a review rejection back; the record is under review again (carriers only)
record.sentThe carrier sent a record to the buyer for approval
record.approvedThe buyer approved a record
record.disputedThe buyer disputed a record, with a reason
record.escalatedThe carrier escalated a dispute
record.closedA disputed record was closed without payment
record.offer_acceptedThe carrier accepted the buyer's counter-offer from a dispute; the charge is back with the buyer at that amount, to approve
record.withdrawnA charge you were sent was sent to another buyer or taken back for review by the carrier; data.record is the tombstone the API shows you (buyers only)
record.cancelledThe carrier cancelled a record (buyers hear only of records sent to them, and get this, not record.withdrawn)
record.updatedA record's details or billed times changed (a field edit, or times adjusted, which changes the amount); data.event.type says which
record.comment_addedSomeone on the carrier or the buyer side commented on a record
record.payment_pendingA payment is on its way: a bank payment started in Demurly, or the buyer marked it paid outside Demurly (method and reference in data.event.data)
record.payment_failedA pending payment didn't arrive: a bank payment failed, or the carrier said an outside payment was never received; the record is approved and unpaid again
record.paidA record was paid by card or confirmed paid outside Demurly
record.payment_reversedA card payment was fully refunded or lost to a chargeback; the record is approved and unpaid again
Event body (record.created)
{
  "id": "e1a2b3c4-0000-4000-8000-000000000047",
  "type": "record.created",
  "created_at": "2026-01-16T15:20:00.412Z",
  "record_id": "3f6c1d2e-8a4b-4c1e-9f0a-1b2c3d4e5f60",
  "sequence": 47,
  "occurred_at": "2026-01-16T15:20:00.000Z",
  "livemode": true,
  "data": {
    "record": {
      "id": "3f6c1d2e-8a4b-4c1e-9f0a-1b2c3d4e5f60",
      "record_number": "DMR-00001042",
      "status": "recording",
      "carrier": {
        "id": "a1b2c3d4-0000-4000-8000-000000000001",
        "name": "Acme Trucking"
      },
      "customer": {
        "id": "a1b2c3d4-0000-4000-8000-000000000002",
        "name": "Gulf Fuel Supply"
      },
      "terminal": {
        "id": "a1b2c3d4-0000-4000-8000-000000000003",
        "name": "Houston Terminal",
        "time_zone": "America/Chicago"
      },
      "load_number": "L-55821",
      "bol_number": "BOL-99812",
      "container_number": null,
      "start_time": "2026-01-15T14:30:00.000Z",
      "end_time": null,
      "time_zone": "America/Chicago",
      "time_zone_source": "terminal",
      "start_time_local": "2026-01-15T08:30:00.000-06:00",
      "end_time_local": null,
      "local_start_date": "2026-01-15",
      "adjusted_start_time": null,
      "adjusted_end_time": null,
      "time_adjustment_reason": null,
      "total_minutes": null,
      "free_time_minutes": 120,
      "billable_minutes": null,
      "billed_minutes": null,
      "hourly_rate": 100,
      "amount": null,
      "amount_approved": null,
      "currency": "usd",
      "stop_reason": null,
      "started_offline": false,
      "start_received_at": null,
      "start_clock_drift_seconds": null,
      "gps_evidence": null,
      "source": "phone",
      "source_label": "Recorded by the driver's phone.",
      "vehicle": null,
      "evidence_hash": null,
      "sent_to_customer_at": null,
      "approved_at": null,
      "paid_at": null,
      "created_at": "2026-01-15T14:30:02.000Z",
      "updated_at": "2026-01-16T15:20:00.000Z"
    },
    "event": {
      "type": "record_created",
      "sequence": 47,
      "actor_type": "driver",
      "source": "android_app",
      "occurred_at": "2026-01-16T15:20:00.000Z",
      "data": {}
    }
  }
}

An example body for every event, signature checks in Node.js, Python, C# and Go, and the delivery rules are in the webhooks guide.

Building an integration?

API changes are posted in the changelog. We answer integration questions by email.