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

# Acumatica Cloud ERP REST API

> Client-mode REST API connector for Acumatica contract-based REST (Production Orders, Stock Items, Adjustments)

Technical Preview

## Overview

Client-mode REST API connector for Acumatica contract-based REST (Production Orders, Stock Items, Adjustments). `BASE_ADDRESS` defaults to `https://YOUR_ACUMATICA_HOST`. Auth: **Session cookie (POST /entity/auth/login) or OAuth 2.0 Bearer**. Pass secrets only at runtime via MQTT JSON placeholders or Hub `GET SECRET` — never commit real credentials.

## Auth

Session cookie (POST /entity/auth/login) or OAuth 2.0 Bearer. Prefer Hub secrets / `GET SECRET`. Never hard-code tokens into the `.lot`.

## Basic Syntax

```lot wrap theme={"theme":"css-variables","languages":{"custom":["/languages/lot.json"]}}

DEFINE ROUTE AcumaticaCloudErpRestApi WITH TYPE REST_API
    ADD REST_API_CONFIG
        WITH BASE_ADDRESS "https://YOUR_ACUMATICA_HOST"
        WITH ENABLE_CLIENT "true"
        WITH USE_SSL "true"
        WITH REQUEST_TIMEOUT '30'
        WITH DEFAULT_CONTENT_TYPE "application/json"
        # Auth: Authorization Bearer {value.json.access_token} — prefer Hub secrets / GET SECRET.
        # Optional Basic: WITH USERNAME "YOUR_USER" / WITH PASSWORD GET SECRET "APP_PASSWORD"
    ADD EVENT Login
        WITH SOURCE_TOPIC "integrations/acumatica-cloud-erp/request/Login"
        WITH DESTINATION_TOPIC "integrations/acumatica-cloud-erp/response/Login"
        WITH METHOD "POST"
        WITH ENDPOINT "/entity/auth/login"
        WITH HEADERS
            ADD "Content-Type" "application/json"
            ADD "Authorization" "Bearer {value.json.access_token}"
        WITH BODY "{payload}"
    ADD EVENT Logout
        WITH SOURCE_TOPIC "integrations/acumatica-cloud-erp/request/Logout"
        WITH DESTINATION_TOPIC "integrations/acumatica-cloud-erp/response/Logout"
        WITH METHOD "POST"
        WITH ENDPOINT "/entity/auth/logout"
        WITH HEADERS
            ADD "Content-Type" "application/json"
            ADD "Authorization" "Bearer {value.json.access_token}"
        WITH BODY "{payload}"
    ADD EVENT Listproductionorders
        WITH SOURCE_TOPIC "integrations/acumatica-cloud-erp/request/Listproductionorders"
        WITH DESTINATION_TOPIC "integrations/acumatica-cloud-erp/response/Listproductionorders"
        WITH METHOD "GET"
        WITH ENDPOINT "/entity/Default/24.200.001/ProductionOrder"
        WITH HEADERS
            ADD "Accept" "application/json"
    # ... additional EVENTs in package .lot ...
```

## MQTT topics

Request topics under `integrations/acumatica-cloud-erp/request/...`; responses on `integrations/acumatica-cloud-erp/response/...`.

## Template reference

Generated from the shipped broker template `acumatica-cloud-erp` (`-routeCode ACUMATICA_CLOUD_ERP`). It lists every event the template defines.

### Auth

Session cookie (POST /entity/auth/login) or OAuth 2.0 Bearer

Auth headers used by the template: `Authorization: Bearer {value.json.access_token}`.

### Template parameters

| Placeholder | Type | Description | Required |
| - | - | - | - |
| `RouteName` | string | Name of the Acumatica Cloud ERP connector | no |
| `BaseUrl` | string | Acumatica Cloud ERP base URL without trailing slash (e.g. https\://YOUR\_ACUMATICA\_HOST) | yes |

`BASE_ADDRESS` default: `https://YOUR_ACUMATICA_HOST`.

### Events

| Event | Method | Endpoint | Request topic | Response topic | Payload fields |
| - | - | - | - | - | - |
| `Login` | POST | `/entity/auth/login` | `integrations/acumatica-cloud-erp/request/Login` | `integrations/acumatica-cloud-erp/response/Login` | `access_token`, `body` |
| `Logout` | POST | `/entity/auth/logout` | `integrations/acumatica-cloud-erp/request/Logout` | `integrations/acumatica-cloud-erp/response/Logout` | `access_token`, `body` |
| `Listproductionorders` | GET | `/entity/MANUFACTURING/24.200.001/ProductionOrder` | `integrations/acumatica-cloud-erp/request/Listproductionorders` | `integrations/acumatica-cloud-erp/response/Listproductionorders` | `access_token` |
| `Getproductionorder` | GET | `/entity/MANUFACTURING/24.200.001/ProductionOrder/{value.json.id}` | `integrations/acumatica-cloud-erp/request/Getproductionorder` | `integrations/acumatica-cloud-erp/response/Getproductionorder` | `access_token`, `id` |
| `Putmoveentry` | PUT | `/entity/MANUFACTURING/24.200.001/MoveEntry` | `integrations/acumatica-cloud-erp/request/Putmoveentry` | `integrations/acumatica-cloud-erp/response/Putmoveentry` | `access_token`, `body` |
| `Liststockitems` | GET | `/entity/Default/24.200.001/StockItem` | `integrations/acumatica-cloud-erp/request/Liststockitems` | `integrations/acumatica-cloud-erp/response/Liststockitems` | `access_token` |
| `Getstockitem` | GET | `/entity/Default/24.200.001/StockItem/{value.json.id}` | `integrations/acumatica-cloud-erp/request/Getstockitem` | `integrations/acumatica-cloud-erp/response/Getstockitem` | `access_token`, `id` |
| `Putinventoryadjustment` | PUT | `/entity/Default/24.200.001/InventoryAdjustment` | `integrations/acumatica-cloud-erp/request/Putinventoryadjustment` | `integrations/acumatica-cloud-erp/response/Putinventoryadjustment` | `access_token`, `body` |

### Deploy

Get the template card (JSON with `template` and `metadata`) from the broker, then deploy the connector:

```bash theme={"theme":"css-variables","languages":{"custom":["/languages/lot.json"]}}
mosquitto_pub -t '$SYS/Coreflux/Command' -m "-routeCode ACUMATICA_CLOUD_ERP"
```

The deployable connector from the REST API app, with `BASE_ADDRESS` already filled in:

```lot theme={"theme":"css-variables","languages":{"custom":["/languages/lot.json"]}}
DEFINE ROUTE AcumaticaCloudErpRestApi WITH TYPE REST_API
    ADD REST_API_CONFIG
        WITH BASE_ADDRESS "https://YOUR_ACUMATICA_HOST"
        WITH ENABLE_CLIENT "true"
        WITH USE_SSL "true"
        WITH REQUEST_TIMEOUT '30'
        WITH DEFAULT_CONTENT_TYPE "application/json"
    ADD EVENT Login
        WITH SOURCE_TOPIC "integrations/acumatica-cloud-erp/request/Login"
        WITH DESTINATION_TOPIC "integrations/acumatica-cloud-erp/response/Login"
        WITH METHOD "POST"
        WITH ENDPOINT "/entity/auth/login"
        WITH HEADERS
            ADD "Content-Type" "application/json"
            ADD "Authorization" "Bearer {value.json.access_token}"
        WITH BODY "{value.json.body}"
    ADD EVENT Logout
        WITH SOURCE_TOPIC "integrations/acumatica-cloud-erp/request/Logout"
        WITH DESTINATION_TOPIC "integrations/acumatica-cloud-erp/response/Logout"
        WITH METHOD "POST"
        WITH ENDPOINT "/entity/auth/logout"
        WITH HEADERS
            ADD "Content-Type" "application/json"
            ADD "Authorization" "Bearer {value.json.access_token}"
        WITH BODY "{value.json.body}"
    ADD EVENT Listproductionorders
        WITH SOURCE_TOPIC "integrations/acumatica-cloud-erp/request/Listproductionorders"
        WITH DESTINATION_TOPIC "integrations/acumatica-cloud-erp/response/Listproductionorders"
        WITH METHOD "GET"
        WITH ENDPOINT "/entity/MANUFACTURING/24.200.001/ProductionOrder"
        WITH HEADERS
            ADD "Accept" "application/json"
            ADD "Authorization" "Bearer {value.json.access_token}"
    ADD EVENT Getproductionorder
        WITH SOURCE_TOPIC "integrations/acumatica-cloud-erp/request/Getproductionorder"
        WITH DESTINATION_TOPIC "integrations/acumatica-cloud-erp/response/Getproductionorder"
        WITH METHOD "GET"
        WITH ENDPOINT "/entity/MANUFACTURING/24.200.001/ProductionOrder/{value.json.id}"
        WITH HEADERS
            ADD "Accept" "application/json"
            ADD "Authorization" "Bearer {value.json.access_token}"
    ADD EVENT Putmoveentry
        WITH SOURCE_TOPIC "integrations/acumatica-cloud-erp/request/Putmoveentry"
        WITH DESTINATION_TOPIC "integrations/acumatica-cloud-erp/response/Putmoveentry"
        WITH METHOD "PUT"
        WITH ENDPOINT "/entity/MANUFACTURING/24.200.001/MoveEntry"
        WITH HEADERS
            ADD "Content-Type" "application/json"
            ADD "Authorization" "Bearer {value.json.access_token}"
        WITH BODY "{value.json.body}"
    ADD EVENT Liststockitems
        WITH SOURCE_TOPIC "integrations/acumatica-cloud-erp/request/Liststockitems"
        WITH DESTINATION_TOPIC "integrations/acumatica-cloud-erp/response/Liststockitems"
        WITH METHOD "GET"
        WITH ENDPOINT "/entity/Default/24.200.001/StockItem"
        WITH HEADERS
            ADD "Accept" "application/json"
            ADD "Authorization" "Bearer {value.json.access_token}"
    ADD EVENT Getstockitem
        WITH SOURCE_TOPIC "integrations/acumatica-cloud-erp/request/Getstockitem"
        WITH DESTINATION_TOPIC "integrations/acumatica-cloud-erp/response/Getstockitem"
        WITH METHOD "GET"
        WITH ENDPOINT "/entity/Default/24.200.001/StockItem/{value.json.id}"
        WITH HEADERS
            ADD "Accept" "application/json"
            ADD "Authorization" "Bearer {value.json.access_token}"
    ADD EVENT Putinventoryadjustment
        WITH SOURCE_TOPIC "integrations/acumatica-cloud-erp/request/Putinventoryadjustment"
        WITH DESTINATION_TOPIC "integrations/acumatica-cloud-erp/response/Putinventoryadjustment"
        WITH METHOD "PUT"
        WITH ENDPOINT "/entity/Default/24.200.001/InventoryAdjustment"
        WITH HEADERS
            ADD "Content-Type" "application/json"
            ADD "Authorization" "Bearer {value.json.access_token}"
        WITH BODY "{value.json.body}"
```

Deploy it with `-addRoute` (do not include `ADD METADATA`).

### Usage example

Call `Login` by publishing a JSON payload to its request topic, and read the reply on the response topic:

```bash theme={"theme":"css-variables","languages":{"custom":["/languages/lot.json"]}}
mosquitto_sub -t 'integrations/acumatica-cloud-erp/response/Login' &
mosquitto_pub -t 'integrations/acumatica-cloud-erp/request/Login' -m '{"access_token": "<access_token>", "body": {}}'
```

## Related

* [REST API Connectors](/latest/lot-language/routes/rest-api-routes)
* [REST API apps index](/latest/lot-language/routes/rest-api-apps)


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