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

# Accurate

> Sync Accurate Online and the app in both directions: Sales Orders become tasks, and finished tasks create Delivery Orders.

The **Accurate** integration connects your organization to **Accurate Online** (Accurate.id), the Indonesian cloud accounting platform by CPSSoft. Once connected, data moves in **two directions**:

* **Pull into the platform**: a Sales Order created in Accurate becomes a task automatically.
* **Send to Accurate**: finishing that task creates a Delivery Order in Accurate.

Each direction is set up with its own **rules**, and you can use one direction or both. The full round trip:

1. A **Sales Order** is created in Accurate.
2. It is **pulled** into the app as a task.
3. The task is **done and delivered** in the field app.
4. A **Delivery Order** is **sent** back to Accurate, linked to the Sales Order.

> [!NOTE]
>
> Every role can connect Accurate and manage its rules. No integration permission is needed.

## Before you begin

1. **An Accurate Online account**: the cloud version, which provides the Open API this integration uses.
2. **At least one business (data usaha)** set up in your Accurate Online account.
3. **One Accurate account per organization**: an Accurate account holds a single active connection at a time, so connecting it to a second organization ends the first connection. Use a separate Accurate account for each organization you want to sync.

## Step 1: Connect your Accurate account

1. Open **Settings › Integration**.
2. On the **Accurate** card, click **Connect**.
3. You're taken to Accurate's authorization page. Sign in with your Accurate credentials and click **Grant Access**.
4. Accurate sends you back to **Settings › Integration**. The card now shows **Connected**.

![The Accurate card once connected](https://mintcdn.com/mile-app/WPibWyW63U4l5gcF/images/v4/settings/integration-accurate.png?fit=max\&auto=format\&n=WPibWyW63U4l5gcF\&q=85\&s=34600d9e1b0b55fa7dd69f1b52706070)

1. **Manage rules**: opens **Accurate rules**, where you add, edit, turn on or off, repair and delete the sync rules.
2. **Disconnect**: ends the connection. See [Disconnect](#disconnect).

The businesses in your Accurate account come with the connection. Each rule targets **one business**, because values such as Customer, Item and Branch are records that live inside a single company. To sync a second company, add a second rule for it.

## Step 2: Open the rules

Click **Manage rules** on the card.

**Accurate rules** has two tabs and opens on **Pull into the platform**.

![Accurate rules, Pull into the platform tab](https://mintcdn.com/mile-app/WPibWyW63U4l5gcF/images/v4/settings/integration-accurate-rules.png?fit=max\&auto=format\&n=WPibWyW63U4l5gcF\&q=85\&s=6528c185ed1907793c436f0d85a8a044)

*The Pull into the platform tab*

1. **Pull into the platform**: rules that turn an Accurate document into a task. Each rule reads **Flow ← Accurate document**, for example *Delivery ← Sales Order*, with badges for the number of field mappings, **Line items** and **Creates a remainder task** when that option is on.
2. **Company**: rules are grouped under the Accurate business (company) they belong to. A company no longer in your Accurate account shows **Removed**, and its rules can't run until you delete them or reconnect. **Unverified** means Accurate couldn't be reached to check; reopen the window to check again.
3. **On / off switch**: turns a rule on or off without deleting it. The toast *Auto-sync turned on* or *Auto-sync turned off* confirms it.
4. **Webhook log**: what Accurate sent for this pull rule. See [Check the webhook log](#check-the-webhook-log).
5. **Edit**: opens the rule with every saved value filled in. See [Edit a rule](#edit-a-rule).
6. **Add Mapping**: adds a rule in the open tab.

![Accurate rules, Send to Accurate tab](https://mintcdn.com/mile-app/WPibWyW63U4l5gcF/images/v4/settings/integration-accurate-rules-push.png?fit=max\&auto=format\&n=WPibWyW63U4l5gcF\&q=85\&s=ce12309a9f929f9787883da8e90f615e)

*The Send to Accurate tab*

1. **Send to Accurate**: rules that create a record in Accurate when something happens to a task. Each rule reads **Flow → Accurate document**, for example *Delivery Return → Delivery Order*, with badges for its trigger, field mappings and **Line items**.
2. **On / off switch**: shown only while the rule's automation is working. When it isn't, the rule says *Auto-sync isn't active for this rule yet* and shows **Fix**, which rebuilds the automation.
3. **Automation log**: the runs of the automation behind the rule. See [Syncing happens automatically](#syncing-happens-automatically).
4. **Edit**: opens the rule with every saved value filled in.

The bin icon on a rule deletes it: see [Delete a rule](#delete-a-rule).

## Step 3: Add a rule that pulls Sales Orders in

On the **Pull into the platform** tab, click **Add Mapping**. The fields appear one after another as you fill them in.

![A pull rule: Sales Order into the Delivery flow](https://mintcdn.com/mile-app/WPibWyW63U4l5gcF/images/v4/settings/integration-accurate-import.png?fit=max\&auto=format\&n=WPibWyW63U4l5gcF\&q=85\&s=f333853ca7edcda20be7632098af70ca)

*A pull rule, shown here open for editing*

1. **Accurate Module**: **Sales Order**. Next to it, **Accurate business** is the company the Sales Orders come from.
2. **Flow**: the flow new tasks are created in. A flow with a rule that creates Sales Orders in Accurate can't be picked.
3. **Lands in hub**: the hub the new tasks belong to.
4. **Auto-create a follow-up task for the remaining quantity**: a Sales Order that is only partly delivered raises a new task for what's still owed. See [Partial delivery and the remainder task](#partial-delivery-and-the-remainder-task).
5. **Field mappings**: for each flow field, choose the Accurate field that fills it, such as **Customer Name**, **Shipping Address**, **Sales Order Number** or **Transaction Date**. Required flow fields are listed first and locked, so they can't be removed. Click **Add field** for more rows.
6. **Source (Bill component)**: the **Bill** that receives the order's item rows. **Item Name**, **Quantity**, **Unit Price** and **Line Total** are filled from the Accurate item columns automatically. Leave it empty to import only the header fields. See [Bill](https://docsy3.mile.app/pages/workflow/flow/components/bill/introduction.md).

Click **Save** and confirm *Save mapping?*. The toast *Sync rule saved.* confirms it.

If the flow has a required field on its first page that Accurate can't fill, such as a photo, the form says so and **Save** stays off, because every imported task would be rejected. Pick another flow, or move that field off the first page.

> [!NOTE]
>
> The same Accurate document and business can feed **several flows**. One Sales Order then creates one task in **each** of them.

## Step 4: Add a rule that sends Delivery Orders back

On the **Send to Accurate** tab, click **Add Mapping**.

![A send rule: Delivery Order from the Delivery Return flow](https://mintcdn.com/mile-app/WPibWyW63U4l5gcF/images/v4/settings/integration-accurate-push.png?fit=max\&auto=format\&n=WPibWyW63U4l5gcF\&q=85\&s=1cf3ee4498f33a8504f18b3e5d587827)

*A send rule, shown here open for editing*

1. **Action**: **Create a new record** or **Update an existing record**. Update writes back to the record the task was imported from, so it only works for tasks that came from Accurate, and always runs when the task is finished.
2. **Trigger**: when the record is sent: **Task created**, **Task assigned** or **Task finished**. Use **Task finished** so the record carries what the driver actually delivered.
3. **Header mappings**: each Accurate field takes its value from a flow field, a task field (such as **Task ID** or **Created time**) or a fixed value. Fields Accurate requires are listed first and can't be removed. A field that points at a record in Accurate, such as **Customer Code**, **Branch Name** or **Currency Code**, is picked from Accurate's own list, or taken from a flow field. Customer, branch and currency can also follow the Sales Order: turn on **Auto-resolve from Sales Order** and the row reads **From Sales Order**.
4. **Source (Bill component)**: the **Bill** whose rows become the Delivery Order's items, required for a new record. **Item Name**, **Quantity** and **Unit Price** come from each row.

Also on the form: **Accurate document** is **Delivery Order**, **Accurate business** is the company the record goes to, and **Flow** is the flow whose tasks are sent. A flow that already pulls Delivery Orders in from Accurate can't be picked for a new record.

Click **Save**. *Create sync rule?* explains that saving creates the automation that sends matching tasks; click **Save and create**. The toast *Sync rule saved.* confirms it. If your plan's automation quota is full, the rule is saved with auto-sync off, and a message says so.

> [!NOTE]
>
> A Delivery Order sent for a task that was **pulled in from a Sales Order** links back to that Sales Order and advances its fulfilment. With **Auto-resolve from Sales Order** on, its **customer** and **branch** come from the Sales Order itself. If the task's Bill contains a row that wasn't on the original Sales Order, that row is added to the Sales Order first, which can increase the order's total.

> [!NOTE]
>
> **Branch Name** is required when your Accurate business has more than one branch, so the form adds it as a locked row. For a single-branch company it isn't needed.

## Which fields can be mapped

Accurate stores five kinds of value: text, whole number, money, true/false and date. Map a field only if it holds **one** such value. The rules are the same in both directions.

**Input components**, by their type:

| Type | Can be mapped | Fills which Accurate fields |
| - | - | - |
| Text | Yes | Text fields |
| Address | Yes | Text fields, e.g. Shipping Address |
| Phone Number | Yes | Text fields |
| URL | Yes | Text fields |
| Number | Yes | Number and money fields |
| Currency | Yes | Money fields |
| Date | Yes | Date fields |
| Date Time | Yes | Date fields. Accurate stores a date only, so the time is dropped |
| Time | Text only | Text fields only. It has no date, so it can never fill a date field |
| Coordinate | Text only | Text fields only, as the raw coordinate text |

**Other components:**

| Component | Can be mapped |
| - | - |
| Select | Yes, into text fields. If several options are chosen, they arrive as one comma-separated line |
| Bill | Line items only, never a single field. Each Bill row becomes one order item |
| Photo, Capture, Video, Voice Note, Signature, View, Subpage, Subflow, Timer, OTP | No |

Components that hold a file or a picture, group other components, or only display something have no value for Accurate to record. See [Components](https://docsy3.mile.app/pages/workflow/flow/components/introduction.md).

## Syncing happens automatically

**Send to Accurate.** Saving a send rule creates an automation in the background, named *\[Accurate] Flow → Document*, for example *\[Accurate] Delivery → Delivery Order*. You can see it on the Automation page, but you don't need to manage it. To check its runs, click the **Automation log** icon on the send rule in **Accurate rules**; the rule's [automation log](https://docsy3.mile.app/pages/workflow/automation/log.md) opens in a new tab. From then on, every task of that flow that reaches the trigger is sent to Accurate. Any Bill item that doesn't exist in Accurate yet is created there when the task is sent, so you don't need to create every product in Accurate first.

**Pull into the platform.** Once a pull rule exists, Accurate tells the app whenever a Sales Order in that business changes:

* **Created**: a task is created in each mapped flow, in the hub you chose.
* **Edited**: the linked task is updated. No duplicate is created, however many times the order changes.
* **Deleted**: the linked task is deleted.

A task that is already **Done** is never changed or deleted by a later edit in Accurate, so completed field work is protected.

### Partial delivery and the remainder task

A driver can deliver less than the order asked for: on the Bill, the quantity starts at the ordered amount and can be lowered. The Delivery Order records what was actually handed over, and the Sales Order keeps the difference outstanding.

With **Auto-create a follow-up task for the remaining quantity** on (the rule then shows **Creates a remainder task**), the app raises a new task for that outstanding quantity as soon as the first task finishes. It carries the same customer, address and mappings, with a Bill holding only what's still owed. Deliver it partly again and the cycle repeats, each time leaving a smaller remainder, until the Sales Order is fully delivered and shows **Processed** in Accurate.

With it off, a partial delivery simply closes the task. The Sales Order still shows the outstanding quantity in Accurate, and you decide what happens next.

### Serial numbers

Some Accurate items are **serial-managed**: each unit has its own serial or batch number, and Accurate rejects a Delivery Order that doesn't carry one serial per delivered unit. A send rule has two ways to supply them, under **Line items**:

* **Source (List component)**: a **List** in the flow where the driver records the serials. Serial matching is forgiving of surplus and strict on shortfalls: extra or unrecognized serials are ignored, and only delivering **fewer** valid serials than the line's quantity fails the send, with a message naming the item.
* **Auto-pick serial numbers**: Accurate assigns serials from stock. These may not be the exact units delivered, so the switch asks you to confirm before it turns on.

Leave both off when none of the items are serial-managed.

## Example: a complete round trip

This walkthrough follows one order the whole way.

1. **Two rules.** In **Manage rules**, a flow named **Delivery** has a pull rule (Sales Order) and a send rule (Delivery Order, trigger **Task finished**).
2. **A Sales Order in Accurate.** Your sales team creates a Sales Order as usual: a customer, the items and the quantities. It appears in Accurate's Sales Order list as **Waiting on Process**.
3. **The task appears.** Within about half a minute a task is in your task list, created from the API, with the customer details already filled in. Its **Bill** shows every order line with item, quantity and price.
4. **The field work.** The task is assigned and done in the field app like any other. On the Bill page the driver confirms the quantity actually delivered, lowering it when the delivery is partial.
5. **The task finishes.** Finishing the task is what triggers the send.
6. **The Delivery Order arrives in Accurate.** It's created automatically with the delivered items and quantities, for the same customer and branch as the Sales Order.
7. **The Sales Order closes itself.** Once everything is delivered, the Sales Order shows **Processed** in Accurate.

What this gives you:

* An order raised by your sales team reaches the driver without anyone re-typing it.
* The quantity the driver confirms is the quantity your books record.
* The Sales Order closes itself once delivery is complete, so your accounting stays current on its own.

## Managing the integration

### Edit a rule

Click the pencil icon on any rule. **Edit sync rule** opens with every saved value filled in. Change what you need and click **Save**: *Update mapping?* (pull) or *Update sync rule?* (send) asks you to confirm, and the toast *Sync rule saved.* confirms it. Anything you didn't change stays exactly as it was.

On a send rule, **Action** and **Trigger** are fixed once the rule exists, because its automation is built for that event. To use a different action or trigger, add a new rule and delete the old one. Required rows stay locked while editing, as they are on a new rule.

### Turn a rule on or off

Use the switch on a pull or send rule. A rule that is off keeps its mappings and starts syncing again when you turn it back on. A send rule's switch is hidden while its automation isn't working; click **Fix** to rebuild the automation first.

### Check the webhook log

Every time a Sales Order changes, Accurate sends the app a webhook. Click the clock icon on a pull rule to see them.

![Webhook log for a pull rule](https://mintcdn.com/mile-app/WPibWyW63U4l5gcF/images/v4/settings/integration-accurate-webhook-log.png?fit=max\&auto=format\&n=WPibWyW63U4l5gcF\&q=85\&s=639a5c3848b08377002a8341c6b517a1)

*The webhook log, with one delivery opened*

1. **Date**: the day to show, today by default. Accurate keeps the last month and returns one day at a time.
2. **Refresh**: loads the day again.
3. **A delivery**: when it arrived, its **Type**, **Status**, whether it was **Skipped**, and the **Reference** (the document number in Accurate). Click it to see everything Accurate sent.

*No webhook deliveries in this time range.* means Accurate sent nothing that day.

### Delete a rule

Click the bin icon on the rule. *Delete this rule?* warns that the app stops syncing this flow with Accurate. Click **Delete**. Documents already in Accurate and tasks already created stay where they are.

### Reconnect

The card shows **Reconnect** when the connection still exists but needs to be authorized again, for example when a new capability needs a permission your connection predates. Click it, sign in to Accurate and grant access again. Reconnecting refreshes the permissions and **keeps every rule**.

If Accurate ended the connection, for example because the same Accurate account was connected to another organization, the card shows **Not connected** and **Connect**. Connect again to resume syncing, and see [Before you begin](#before-you-begin) on keeping one Accurate account per organization.

### Disconnect

Click **Disconnect** on the card and confirm. Your **rules are kept**. Disconnecting removes the stored credentials and pauses syncing in both directions; connecting again resumes it. Use **Reconnect** instead if you only need to refresh permissions.

To also remove the app's access on the Accurate side, open your Accurate account, go to **Aplikasi Terhubung** (Connected Applications), and remove it there.

## Good to know

* **A flow can carry both directions.** The same flow can hold a Sales Order pull rule and a Delivery Order send rule, which is exactly the round trip above. What it can't do is pull and send the **same** Accurate document: the form disables a flow that already has a rule for that document in the other direction.
* **Keep rules in step with your flows.** If a flow is edited after a rule is saved and a mapped field is gone, edit the rule and point it at the new field.
* **Syncing is go-forward.** A rule starts working on the next order or task, so create the rule before the work you want synced.


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