> ## Documentation Index
> Fetch the complete documentation index at: https://docs.duvo.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Maersk

> Pull ocean invoice headers and per-container demurrage and detention charges from your Maersk account.

<Note>
  **Beta** — This connection is in beta and may change. It is enabled per team: if Maersk does not appear on your Connections page, ask Duvo to turn it on.
</Note>

Maersk is a global ocean carrier and logistics provider. Connecting Maersk to Duvo lets your agents pull invoice headers and per-container demurrage and detention charges straight from your Maersk account, so freight spend checks and charge disputes run against live data instead of manual portal exports.

<Note>
  This connection returns invoice **headers** — invoice number, bill of lading, dates, amounts, currency, and status. Maersk's API does not expose charge line items or the invoice PDF. See [What this connection cannot do](#what-this-connection-cannot-do).
</Note>

## Setup

<Steps>
  <Step title="Confirm prerequisites" icon="circle-check">
    <Check>A Maersk account with a customer code. Your code starts with a two-letter country code, for example `DK00007951`.</Check>
    <Check>An account on the [Maersk Developer Portal](https://developer.maersk.com/). Registration is self-service — you do not need a sales representative to create the account.</Check>
    <Check>An app registered on the portal, which gives you a Consumer Key and Consumer Secret.</Check>

    <Tip>
      Register the app before you need the connection. Access to each API product is approved manually by Maersk and bound to your customer code, and Maersk does not publish a turnaround time — starting early avoids a wait later.
    </Tip>
  </Step>

  <Step title="Request access to the API products" icon="key">
    On the Developer Portal, request access for your app to both products this connection uses:

    * **Ocean Invoices** — invoice headers by customer code.
    * **Import Demurrage & Detention** — per-container free time and accrued charges.

    Each request is reviewed by Maersk and granted against a specific customer code. Requesting one does not grant the other.

    <Warning>
      Until a product is approved, calls to it return `403` even though your credentials are valid. Duvo reports that as a distinct message so you can tell it apart from a bad Client ID or Secret.
    </Warning>
  </Step>

  <Step title="Add the connection in Duvo" icon="plug">
    On the [Connections page](https://app.duvo.ai/integrations), open Maersk and fill in these fields:

    <ParamField body="Client ID" type="string" required>
      The Consumer Key of your app on the Developer Portal. Maersk also requires it as the `Consumer-Key` header on every call, which Duvo handles for you.
    </ParamField>

    <ParamField body="Client Secret" type="string" required>
      The Consumer Secret of the same app.
    </ParamField>

    <ParamField body="Customer Code" type="string" required>
      Your Maersk customer code, starting with a two-letter country code — for example `DK00007951`. Used as the default for both tools; individual requests can override it.
    </ParamField>

    <ParamField body="Environment" type="string">
      Leave empty for production. Enter `pre-production` to target `api-stage.maersk.com` instead. Access to each environment is granted separately.
    </ParamField>

    <ParamField body="Credit transfers permitted" type="string">
      Enter `true` if your country permits credit transfers for cancelled invoices. Leave empty for `false`. Affects how Maersk reports credits, and an agent can override it on an individual request if credits come back wrong.
    </ParamField>
  </Step>
</Steps>

<AccordionGroup>
  <Accordion title="Two different customer codes" icon="triangle-alert">
    Maersk identifies a customer differently across the two APIs, and for some accounts the two values differ:

    * **Ocean Invoices** uses the country-prefixed form, such as `DK00007951`.
    * **Import Demurrage & Detention** uses a carrier customer code that is often all digits, such as `33100971688`.

    Enter the country-prefixed form as your Customer Code. If demurrage and detention lookups report an invalid customer code, pass the numeric form on the request instead — the charges tool accepts an override.
  </Accordion>

  <Accordion title="Rate limits" icon="gauge">
    Maersk allows **1,000 calls per hour and 60 calls per minute** per Consumer Key, shared across every API product. Duvo caches the access token between calls so a scheduled run over many bills of lading does not spend the quota re-authenticating, and reports a `429` with the quota named so it is clear what was hit.
  </Accordion>

  <Accordion title="Third-party documentation" icon="book">
    * [Maersk Developer Portal](https://developer.maersk.com/) — registration, app creation, and API product access requests.
    * [Maersk API Solutions](https://www.maersk.com/digital-services/data-integrations/api) — overview of the API programme and available products.
    * [MyFinance invoice help](https://www.maersk.com/support/faqs/view-invoices) — viewing, downloading, and disputing invoices, including the invoice PDFs this connection cannot retrieve.
  </Accordion>
</AccordionGroup>

## Capabilities

* **List ocean invoices** — retrieve invoice headers for a customer code by category (open, paid, overdue, or credits), with invoice number, bill of lading, invoice and due dates, invoiced and open amounts, currency, and status.
* **Filter by document or date** — narrow to specific bills of lading, invoice numbers, or payment receipt numbers, or to a date range. A date range is required when listing paid invoices without specific documents.
* **Check demurrage and detention** — for a bill of lading, get per-container free days, free-time start and last free date, chargeable days, the accrued amount with its per-day rate tiers, and whether the charge is final or still an estimate.
* **Work across Maersk brands** — Maersk A/S, Safmarine, Sealand Americas, Sealand Europe, Sealand Asia, and Maersk Line Limited, selected per request by carrier code.

## What this connection cannot do

Being explicit here saves a wasted agent run:

* **No charge line items.** Maersk's Ocean Invoices API returns header-level data only. To see what makes up an invoice total, open the invoice PDF in MyFinance on maersk.com, or use the demurrage and detention tool — that is where the per-container charge detail lives.
* **No invoice PDF download.** The API has no document endpoint. Results flag whether a PDF exists on maersk.com, but retrieving it is a portal action.
* **No pagination.** Maersk returns every matching invoice in one response. Duvo caps what it hands back and tells the agent how many were omitted, so broad queries should be narrowed with a date range or specific document numbers.
* **Import shipments only, within a window.** Demurrage and detention are available from 10 days before vessel arrival to 250 days after. Outside that window Maersk returns nothing.

## Key Benefits

* **Freight spend checks on live data** — agents read current invoice status instead of a stale portal export.
* **Charge detail where disputes happen** — demurrage and detention are the most commonly disputed ocean charges, and the per-container breakdown is available directly.
* **Clear failure messages** — an unapproved API product, a rejected credential, and a rate limit each report differently, so setup problems are quick to place.
* **Scales across bills of lading** — token caching and result caps mean a scheduled run over many shipments stays inside Maersk's quota.

## Works Well With

<CardGroup cols={3}>
  <Card title="Google Sheets" icon="https://mintcdn.com/duvo-d8027998/O3tlM6eCuFk2uJpN/images/connections/google-sheets.svg?fit=max&auto=format&n=O3tlM6eCuFk2uJpN&q=85&s=0ef8d55e05c34e7a4a618933bdf0ceb3" href="/user-guide/connections/available-connections/google-sheets" width="24" height="24" data-path="images/connections/google-sheets.svg">
    Build freight spend summaries or demurrage exposure trackers from invoice and charge data.
  </Card>

  <Card title="Microsoft Excel" icon="https://mintcdn.com/duvo-d8027998/O3tlM6eCuFk2uJpN/images/connections/excel.svg?fit=max&auto=format&n=O3tlM6eCuFk2uJpN&q=85&s=986599d60d09acee47293fda2b62df99" href="/user-guide/connections/available-connections/microsoft-excel" width="2290" height="2130" data-path="images/connections/excel.svg">
    Reconcile Maersk invoice headers against internal accruals in a spreadsheet.
  </Card>

  <Card title="Intelligent Document Reader" icon="https://mintcdn.com/duvo-d8027998/O3tlM6eCuFk2uJpN/images/connections/document-processor.svg?fit=max&auto=format&n=O3tlM6eCuFk2uJpN&q=85&s=235064e3740592527b7cd527852674ee" href="/user-guide/connections/available-connections/intelligent-document-reader" width="24" height="24" data-path="images/connections/document-processor.svg">
    Extract charge line items from invoice PDFs the API does not return.
  </Card>

  <Card title="Gmail" icon="https://mintcdn.com/duvo-d8027998/O3tlM6eCuFk2uJpN/images/connections/gmail.svg?fit=max&auto=format&n=O3tlM6eCuFk2uJpN&q=85&s=ad4e229283f3fe2f26c0f96a49f28e13" href="/user-guide/connections/available-connections/gmail" width="88" height="66" data-path="images/connections/gmail.svg">
    Pull invoice PDFs that arrive by email, or send overdue and dispute follow-ups.
  </Card>

  <Card title="Slack" icon="https://mintcdn.com/duvo-d8027998/O3tlM6eCuFk2uJpN/images/connections/slack.svg?fit=max&auto=format&n=O3tlM6eCuFk2uJpN&q=85&s=8a64bdd1af39e903923e4a273b4a4618" href="/user-guide/connections/available-connections/slack" width="512" height="512" data-path="images/connections/slack.svg">
    Alert the team when demurrage starts accruing or an invoice goes overdue.
  </Card>

  <Card title="Enterprise Browser" icon="https://mintcdn.com/duvo-d8027998/O3tlM6eCuFk2uJpN/images/connections/browser-agent.svg?fit=max&auto=format&n=O3tlM6eCuFk2uJpN&q=85&s=49168ae85c39df2529060d2f33df88b2" href="/user-guide/connections/available-connections/browser" width="24" height="24" data-path="images/connections/browser-agent.svg">
    Retrieve invoice PDFs and line-item detail from MyFinance when the API is not enough.
  </Card>
</CardGroup>
