Portals

Supplier Portal Broker Portal Carrier Portal Customer Portal Mobile app

Integrations

All integrations API docs

Industries

Fuel Propane Lubricants Chemicals Agriculture All industries

Resources

Guides Blog Glossary FAQ Security Features Pricing About Us Login Request a Demo

API Reference

Energy Connect Public API v1 — RESTful JSON over HTTPS

Download the current OpenAPI contract · Explorer · Integration guide

Last updated

Quickstart

Base URL: https://api.energyconnecter.ai/v1/public

The API covers 158 endpoints across 18 resource groups: Orders (53), Pricing (14), Connections & Freight Rates (12), Invoices (12), Capacity Exchange (11), Companies (9), Webhooks (8), Locations (7), Supplier Terminals (5), Tax Rates (5), API Keys (4), Allocations (3), Load Board (3), Payments (2), and one each for Customers, Suppliers, Product Taxonomy and Reference Data. Every operation is listed below; the same inventory is also available as plain text, one line per operation, at /llms-full.txt.

Authentication

Pass your API key either as an X-API-Key header or as an Authorization: Bearer token — both are accepted. Keys start with ec_live_ (production) or ec_test_ (sandbox: isolated test company). A test key never reads or changes live data, sends no email or SMS, is not billed and has its own monthly cap; once authenticated, its responses carry X-EC-Sandbox: true.

curl -H "X-API-Key: ec_live_your_key_here" \
  https://api.energyconnecter.ai/v1/public/orders

# equivalently, as a Bearer token:
curl -H "Authorization: Bearer ec_live_your_key_here" \
  https://api.energyconnecter.ai/v1/public/orders

Idempotency

Every write (POST, PUT, PATCH, DELETE) requires an Idempotency-Key header — 16–200 characters of A-Za-z0-9_-. A UUID works. Omit it and the call returns 400 IDEMPOTENCY_KEY_REQUIRED. The only exception is POST /pricing/freight-calculate, which computes and writes nothing.

Use a fresh key for every distinct request. Retrying with the same key and the same body replays the original response — marked Idempotency-Replayed: true — without re-running side effects such as dispatch SMS or email. Records are kept for 24 hours. Reusing a key with a different body returns 409 IDEMPOTENCY_KEY_CONFLICT; a key whose original request is still in flight returns 409 IDEMPOTENCY_IN_FLIGHT with Retry-After. A key whose request ended in a 5xx returns 409 IDEMPOTENCY_OUTCOME_UNKNOWN: the write may have completed, so check the resource rather than resubmitting. After a 504 REQUEST_TIMEOUT the key is held for the full 24 hours; after any other 5xx, for 60 seconds (Retry-After gives the time left), and then a retry runs. After a 4xx the key is free at once, so you can fix the request and retry it.

curl -X POST https://api.energyconnecter.ai/v1/public/delivery-tickets \
  -H "X-API-Key: ec_live_your_key_here" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"bolNumbers":["1234567"]}'

Rate Limits

600 requests/min burst
50,000 billable requests/month
RateLimit-* headers on every response; Retry-After on 429

Response Format

Success: { success: true, data: ... }
List: { success: true, data: [...], meta: { total, page, pageSize, totalPages, hasMore } }
Error: { success: false, error: { code, message } }

Pagination

Use ?page=1&pageSize=20 query params.
Max pageSize is 100 (500 for connections).
To sync only what changed, GET /orders, /invoices and /delivery-tickets take ?updatedSince=: walk with meta.nextCursor passed back as cursor until hasMore is false.

Errors

400 VALIDATION_ERROR • 401 INVALID_API_KEY
403 INSUFFICIENT_SCOPE • 404 NOT_FOUND
429 RATE_LIMIT_EXCEEDED (error.kind: burst = retry soon, quota = monthly cap, wait for resetAt)

Versioning & deprecation

Within /v1 the contract only grows. An integration built against it keeps working, unchanged, for the life of /v1.

What v1 guarantees

  • No endpoint, field or enum value is ever removed or renamed in place. A renamed concept keeps its old key as a permanent alias (gallons/unit beside quantity/unitCode).
  • We may add endpoints, optional request fields, response fields and enum values. Ignore fields you don't recognise and tolerate unknown enum values.
  • Also treated as breaking, so they do not happen in v1: changing a field's type or meaning, tightening validation of existing input, changing a default (sort, page size, filter), changing the status code for an existing situation, making an always-present field nullable, and adding a required request field.

When a breaking change is needed

It ships as /v2/public, running beside v1. v1 stays up at least 12 months after v2 is generally available, and at least 6 months after the last active v1 caller migrates. Retirement is announced, then dual-run, then scheduled and announced brownouts (short 410 windows), then 410 Gone pointing to the migration guide. Nothing is removed silently.

Notice periods

ChangeNotice
Additive changeChangelog entry
Rate limits, quotas, IP policy30 days
Deprecation of v112 months before sunset
Brownout windowsListed in the deprecation notice; reminders 30 and 7 days before each
Emergency security fixDirect contact, before or at rollout

Notices go to the creator of each affected active key and to the company's primary contact, name a person to reply to, and are recorded in the changelog below. A fix for behavior that contradicted this documentation can ship within v1 and is listed there too.

Changelog

  • — POST /v1/public/orders and PUT /v1/public/orders/:id refuse a fuel line in a unit that is not a volume (pounds, tons, each and the like, whether sent in lines[].unitCode or inherited from your catalog default or a tank) with 400 FUEL_LINE_NEEDS_VOLUME_UNIT; it was accepted before. A fuel line in liters or another volume unit is still accepted, and its per-gallon fees are priced on its quantity converted to gallons. Usage measured 2026-11-30 (every raw api_usage row kept, back to 2026-09-01): one API key called POST /v1/public/orders 36 times and PUT /v1/public/orders/:id 13 times, every call succeeded, and all 190 lines on that company’s orders from 2026-10-28 to 2026-11-13 use gal, so no integration depended on the old answer and no notice is owed under §4.
  • — POST /v1/public/capacity-listings/:id/bids: a second bid from a company that already has a PENDING bid on the listing answers 409 with code BID_ALREADY_PENDING (“You already have a pending bid on this listing. Edit it instead.”); it returned 201 and created a second bid before. Edit the pending bid with PATCH /v1/public/capacity-bids/:id. Usage measured 2026-11-30 (every raw api_usage row kept, back to 2026-09-01): no public capacity route was called, so no integration depended on the old answer and no notice is owed under §4.
  • — Order documents: a carrier key holding haul_execution:write can attach and delete its own BOL and POD on hauls assigned to it, and request the haul_bol, haul_pod, order_bol and order_pod uploads. A key with only haul_execution:write that is not a party to the order gets 404, not 403, on attach, delete and upload. Keys with orders:write are unchanged.
  • — Added: POST /v1/public/invoice-amendments/:id/decline (payer) and .../withdraw (issuer); POST /v1/public/invoices/:id/dispute, .../dispute-response and .../dispute-resolve. GET /v1/public/invoices/:id now returns disputeReason, disputeResponse, disputeRespondedAt, disputeResolution and disputeResolvedAt (each null until it happens). Nothing existing changed.
  • — Connections: an agent whose request got an info request can see it, answer it and hear about it. GET /v1/public/connections and /:id return infoRequest (while the status is INFO_REQUESTED or RESUBMITTED) and declineReason. New POST /v1/public/connections/:id/resubmit (requester only, no body). connection.updated also fires with INFO_REQUESTED and RESUBMITTED; a consumer that switches on status should handle both. The spec also lists DISCONNECTED (already returned) and drops message (never returned). Additive.
  • — Docs: error codes corrected on my-bids, the owner’s bid list, bid submit, accept, decline and reconfirm; each lists the codes it returns, and the withdraw, re-counter and decline notes say when each returns 409. No behaviour change.
  • — A public path id that is not a UUID, on an endpoint that answered 503 for it, now answers 400 VALIDATION_ERROR. The company profile, retired supplier-ordering and terminal price routes are unchanged. A malformed second id (bidId, docId, fileId) now answers 400 even when the parent is not yours (it was 404), and the 400 body is the details.errors.params form.
  • — PUT /v1/public/orders/:id/bids/:bidId/withdraw: an owner withdrawing a bid it placed itself (a self-bid on an internal bid) now gets 200 while the bid is PENDING or PENDING_CONNECTION, and 400 once it is closed, like the carrier. Both were 409 since 2026-11-25. The owner’s withdraw on another company’s bid is unchanged.
  • — Bids: withdrawing a bid on a load you neither posted nor bid on returns 404, like an unknown bid, not 403. A key without order_bids:write still gets 403.
  • — POST /v1/public/orders/:id/assignee-cancel answers 409 while a reported failed delivery attempt is open on a CONFIRMED or IN_TRANSIT load; it returned 200 and cancelled the load before. The poster reschedules or converts the load to a dry run, and cancel works again after that. A contract decline from ASSIGNED is not affected. Usage measured 2026-11-28 (every raw api_usage row kept, back to 2026-08-30): POST /v1/public/orders/:id/assignee-cancel was never called, so no integration depended on the old answer and no notice is owed under §4.
  • — POST /pricing/imports/terminal-aliases: a 404 for a supplierTerminalId that is not yours now says “Terminal not found or not yours” (it said “SupplierTerminal not found”). The status and error.code (NOT_FOUND) are unchanged; match on the code, not the message.
  • — Docs: error codes corrected on counter, re-counter, withdraw and my-bid: 404 and 409 are listed where returned, and my-bid no longer lists 400. Since 2026-11-25 the owner’s withdraw on a bid that is not COUNTERED returns 409. No behaviour change.
  • — Docs: the price-sheet import preview example shows dataCount, and the batch read lists errorMessage. No behaviour change.
  • — Price-sheet imports: each previewRows item now has isMalformedRow, and GET /pricing/imports/{id} returns fileSha256. The commit body is optional when every data row fits in the preview.
  • — Delivery tickets: a company that is not the ticket's issuer, supplier or receiver gets 404, like an unknown id, not 403, on read, PDF, update and sign. Attaching or removing an order document on an order you are not on also gets 404. A party acting outside its role still gets 403.
  • — Docs: since 2026-11-21, a 7th decimal on rate (bid) and counterRate (counter) is rounded half-up to 6, not a 400; a new re-counter rate with a 7th decimal is still a 400. Corrects 2026-11-11.
  • — Connections: GET /connections and GET /connections/{id} now return shipToCodes, your own active ship-to ERP codes on the connection (the values POST /orders takes as shipToErpId). Never the other company’s. Empty when none. Additive.
  • — Price-sheet imports: the preview now returns fileSha256, and committing a batch with more data rows than the 50 previewed requires fileSha256 and acknowledgeUnseenRows: true in the body. Without them the commit returns 400 and writes nothing. Dale, DTN and Venture sheets with no effective date now preview as malformed instead of being dated now.
  • — Docs: the supplier-terminal update body is partial, and location create lists its contacts, schedules and assets. No behaviour change.
  • — Docs: order create and update list terminalErpId, creditHoldAcknowledged and fees; customerReference is not accepted; loadingNumber takes 50 characters; any catalog unit code is valid. No behaviour change.
  • — Docs: the order bid body is required and must carry a price, and poNumber is required on the PO update. No behaviour change.
  • — Docs: the webhook update body lists the accepted event names, and the uploads context names the CSV import scope. No behaviour change.
  • — Docs: bulk rack prices note at most 6 decimal places, and the freight calculator lists destinationCity and destinationState. No behaviour change.
  • — Docs: connection freight rates: the update body applies no defaults and lists its accepted fields, fee basis is documented, connectionId comes from the path on create, and effectiveAt defaults to now. No behaviour change.
  • — Bids: rate on POST /orders/{id}/bids and PUT /orders/{id}/bids/{bidId}/re-counter, and counterRate on PUT /orders/{id}/bids/{bidId}/counter, allow at most 6 decimal places; more is a 400. A re-counter at exactly the countered rate is always accepted.
  • — Deliveries: phase adds the value loaded for a confirmed load that has been loaded and not yet departed. Such a load read scheduled before.
  • — Orders you create or update with shipToErpId now return that value as shipToErpId on your own reads, on the order and on each stop. It was null before.
  • — Order lines add supplierErpId and terminalErpId: your own back-office ids for the line's supplier and terminal, the same ids you can send on POST /orders. Null when you hold no id for it, or more than one.
  • — Orders: productErpId on order lines also matches your own product's exact name (case-insensitive) when no id or code matched. A name shared by two of your products returns 409 ERP_ID_AMBIGUOUS.
  • — Orders: create and update by your own customerErpId / shipToErpId. An unsupported <name>ErpId field (e.g. productErpId) is now a 400, not silently ignored.
  • — Invoice amendments: changing the lines now recomputes the tax. Omit total, or include the new tax in it.
  • — Freight: a connection freight rate with no base price (none at all, or only a fuel surcharge, which is a percent of a zero base) no longer quotes $0 freight. POST /pricing/freight-calculate and freight ranking skip it and fall through to the next rate or the default calculation. No request or response shape changes.
  • — Orders: supplier ordering is withdrawn. Suppliers are assigned on order lines and never receive orders. POST /orders/{id}/send-to-supplier, /supplier-accept and /supplier-decline now return 410 Gone; role=supplier lists nothing; pendingPriceRequest and supplierCompanyId are null.
  • — Orders: suppliers take orders from customers. role=supplier lists the orders a customer sent you; new POST /orders/{id}/send-to-supplier, /supplier-accept and /supplier-decline; orders carry supplierCompanyId (null on carrier and broker reads).
  • — Orders: pendingPriceRequest shows a price change (new rate, higher quantity, added or dropped line) you filed on an order a supplier accepted, until the supplier answers or the load goes in transit; null otherwise and on carrier and broker reads.
  • — Order lines add productCode (product master id, e.g. DSL-ULSD-2) and terminalCode (IRS terminal control number, as on GET /master-terminals). Exact matches only: null when uncertain, so fall back to the name.
  • — Allocations: rows add brand ("" = unbranded) and supplierId (granting supplier; null on your own row), so rows sharing terminal, product and period differ.
  • — Idempotency: a write that ends in a 5xx no longer releases its Idempotency-Key. A retry with the same key gets the new 409 IDEMPOTENCY_OUTCOME_UNKNOWN: for 24 hours after a 504 REQUEST_TIMEOUT, which can still complete, and for 60 seconds after any other 5xx, then the retry runs. A retry used to run a timed-out write a second time. A 4xx still frees the key at once.
  • — Invoices, invoice amendments and payments: a company that is neither the issuer nor the payer gets 404, the same as an unknown id, instead of 403. A payer reading an unissued draft by id also gets 404. A party acting outside its role still gets 403.
  • — Price imports: committing a batch creates new supplier terminals for unmapped terminal codes only when the key also holds supplier_terminals:write. With pricing:write alone, those rows are skipped and their codes are listed in the new unresolvedTerminalCodes response field. Map them with /pricing/imports/terminal-aliases and import again.
  • — Locations: a schedule day marked open must carry both openTime and closeTime. A closed day needs neither.
  • — Locations: an empty contacts, schedules or compartments array returns 400 instead of deleting every row. Omit the field to leave it unchanged; set isActive: false to stand a site down.
  • — PUT on orders, locations, companies and supplier terminals is genuinely partial: fields you don't send are left unchanged. Schema defaults used to overwrite them.
  • — Order lines accept any unit in the units-of-measure catalog and fractional quantities. gallons/unit remain permanent aliases.
Browse endpoints

Orders

Capacity Exchange

Invoices

Payments

Pricing

Tax Rates

Reference Data

Connections & Freight Rates

Delivery Tickets

Deliveries

Locations

Allocations

Supplier Terminals

Customers

Suppliers

Companies

Webhooks

Usage

API Keys