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

# External systems

> Connect Mercora to your CTRM, such as Agiblocks. Choose which pushes are on (invoices, B/Ls, contracts, captured deals, hedges), let the Copilot read Agiblocks reporting data, and see every push's outcome.

A **CTRM** (commodity trading and risk management system) is the system of record many trading firms book their contracts, deliveries, invoices and hedges in. If your firm runs one, Mercora can push the work you have reviewed into it.

Today the connected system is **Agiblocks**. Some buttons and messages call it by its vendor's name, Agiboo: for example **Sync to Agiboo** or **Skip Agiboo**.

Every push happens after an operator's action in Mercora, such as approving a document or creating a captured contract. Mercora never pushes on its own, and it shows you how each push ended. For example, with **Invoice sync** on, approving Kanchana Siam Sugar's invoice KSS-INV-26-0288 in the Inbox creates it in Agiblocks as a draft incoming invoice, so nobody keys it in again.

## How the connection is set up

The Agiblocks connection is set up for your workspace by the Mercora team. There is no key to paste.

Workspace admins can see it under **Settings → Integrations → Agiblocks**:

* **Connection** shows the **Account** Mercora signs in to, that it was **Set up by** Mercora, and its **Status**, checked when the page opens: **Connected**, **Not working**, **Not set up** or **Off**.
* **What automations can do with it** lists the actions automations and the Copilot may take in Agiblocks, such as **Find a contract**, **Create a contract** and **Push a supplier invoice**. Every action starts off; anything that writes to Agiblocks always asks first. See [Integrations](https://docs.mercora.io/integrations/overview.md).

![The Agiblocks What automations can do with it table, with every action switched off](https://mintcdn.com/placeholder-f4ffdeec/22McaegbdDRSI41b/images/integrations/automation-actions-table.png?fit=max\&auto=format\&n=22McaegbdDRSI41b\&q=85\&s=1231a9cfbc589f8f2e0241d7a57e343c)

The Agiblocks actions table. Reads run on its own once allowed; creating a contract or pushing a supplier invoice leaves Mercora and always asks first.

## Choose which pushes are on

Pushes are controlled by modules. **External systems sync** is the main switch; each kind of push then has its own switch under it, so you can, for example, push invoices without pushing hedges.

> [!NOTE]
>
> Available when the **External systems sync** module, and the switch for each push below, are turned on for your workspace. Ask your workspace admin. With **External systems sync** off, no push runs, whatever the switches beneath it say.

| Switch | What it pushes | When it runs |
| - | - | - |
| **Invoice sync** | A supplier invoice, as a draft incoming invoice in Agiblocks. | When an operator approves the invoice in the Inbox. |
| **B/L sync** | A bill of lading's number, date and vessel, onto the matching delivery in Agiblocks. | When an operator approves the B/L in the Inbox. |
| **Contract sync** | A contract captured from an uploaded document. | When an operator approves the contract document. |
| **Deal Capture sync** | A recap or contract captured from email, WhatsApp, Teams or the Copilot. | When an operator clicks **Create contract** on the Deal Capture item. See [Deal capture](https://docs.mercora.io/workflows/deal-capture.md). |
| **Hedging sync** | Hedge fills, booked as futures and allocated to a position. | After a fill is recorded on an approved hedge. See [Hedging](https://docs.mercora.io/workflows/hedging.md). |

Each push also needs the matching permission on the operator's role: **Invoice sync**, **B/L sync** and **Contract sync** under Documents, and **External sync** under Deal Capture and under Hedging. See [Roles and permissions](https://docs.mercora.io/concepts/roles-and-permissions.md).

Turning a switch off stops new pushes of that kind. A push that already reached Agiblocks can still be finished and recovered.

## What you see on a push

Before you click, the card says what the push will do, for example "Approving creates a draft incoming invoice in Agiboo". If Agiblocks will need something Mercora doesn't have yet, the card shows **Blocked by:** with the missing fields, and offers no push until you fix them.

After you click, the push runs in the background. You can move on:

| State | Where the item is | What it shows |
| - | - | - |
| Running | **Waiting** | **Syncing to Agiboo**, read-only, with the time it started |
| Landed | **Done** | **Synced to Agiboo**, with the Agiblocks reference |
| Agiblocks needs something | **Needs you** | **Agiboo needs you** and the reason. Fix it and approve again. |
| Failed | **Needs you** | **Sync failed** and the error. Approve again to retry. |
| Interrupted, with no result | **Needs you** | **Check Agiboo** |

Mercora never retries a push on its own. When a push was interrupted, check in Agiblocks first, because it may have landed:

* For an invoice or B/L, look in Agiblocks, then use **Reopen for retry** if it isn't there.
* For a contract, if the create was submitted but couldn't be confirmed, link the existing contract instead of creating it again. See [Deal capture](https://docs.mercora.io/workflows/deal-capture.md#push-the-deal-to-your-ctrm).
* For a hedge, use **Retry booking** or **Retry allocation**, which check Agiblocks for Mercora's own reference first, or **Mark as handled** if someone booked it by hand. See [Hedging](https://docs.mercora.io/workflows/hedging.md#hedges-in-agiblocks).

When you don't want a push at all, cards offer a way to finish in Mercora only, such as **Skip Agiboo**.

## Agiblocks reporting for the Copilot

The Copilot can also read your Agiblocks reporting data to answer questions and build exports: contracts, deliveries and B/Ls, supplier and sales invoices, cost sheets, positions, hedges and futures, FX deals, the general ledger and counterparty records. For example: "Which purchase contracts did we trade this month?" or "Show freight budget against actual per delivery."

This is read-only. Nothing the Copilot does through reporting can change Agiblocks data.

> [!NOTE]
>
> Available when the **Agiblocks reporting** module, under **Copilot**, is turned on for your workspace. Ask your workspace admin. Members also need **Reports** access.

An admin also switches on **Read the reporting schema** and **Query reporting data** on the Agiblocks integration page.

## Next steps

> **[Deal capture](https://docs.mercora.io/workflows/deal-capture.md#push-the-deal-to-your-ctrm)**
>
> Create a captured contract in Mercora and Agiblocks with one click.

> **[The Inbox](https://docs.mercora.io/documents/inbox.md)**
>
> Approve the invoices and B/Ls that push to Agiblocks.

> **[Hedging](https://docs.mercora.io/workflows/hedging.md#hedges-in-agiblocks)**
>
> Book hedge fills as futures in Agiblocks.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.