Skip to main content

Acumatica

Plugin for Gesso ERP Provider

note

The following describes general usage, if you setup your project following getting-started/install then these next steps have already been handled for you.

Requirements

  • Acumatica middleware is setup

  • You have a working Acumatica instance

    info

    If you don't already have a working Acumatica instance follow the steps provided by Acumatica here.

  • Acumatica username

  • Acumatica password

  • Acumatica url

    note

    This is the base url of your instance ie. http://acumatica.acro.website/AcumaticaSite

  • Acumatica client id

  • Acumatica client secret

    info

    To find or create these follow the path in your Acumatica dashboard More Items > Integration > Show All > Connected Applications. From here you can follow the section To Register a Client Application on page 35 in the Acumatica ERP Intergration Development Guide.

Installation

Install the Gesso ERP provider

  • pnpm install @acromedia/gesso-erp

Install the Gesso Acumatica plugin

  • pnpm install @acromedia/gesso-acumatica

Install the Gesso Acumatica middleware

  • pnpm install @acromedia/gesso-acumatica-middleware

Configure the package

In your projects .env file set the corresponding variables with the credentials from requirements.

  • GESSO_ACUMATICA_USERNAME
  • GESSO_ACUMATICA_PASSWORD
  • GESSO_ACUMATICA_CLIENT_ID
  • GESSO_ACUMATICA_CLIENT_SECRET
  • GESSO_ACUMATICA_URL

If you didn't pass Acumatica options to @acromedia/create-gesso and you're adding this module for the first time and want to setup the provider, run

  • pnpm gesso construct erp acumatica

After running the construct script you will now see a erp.ts file in the root directory of your project. This file takes care of telling gesso-erp what plugin system is being used and ensures the correct hooks are exposed by gesso-erp.

Register the plugin with the provider

  • Under your source files directory (commonly src) there will be a newly added erp.ts file.
// erp.ts
// Import the ERP provider
import { erp as gessoErp } from "@acromedia/gesso-erp";
// Import the provider plugins
import plugin from "@acromedia/gesso-acumatica";
// Import the Gesso config.
import config from "../gesso.config.json";

// Register the plugins and config with erp provider.
const erp = gessoErp(plugin, config);

export default erp;

Usage

// import the ERP provider from the erp.ts file.
import erp from ./erp

// Import your required functionality.
const { useInvoices } = erp;

const InvoicePage = ({ id }) => {
// Example implementation of the useInvoice hook provided via Gesso ERP
const { invoices } = useInvoices({ id });

return <InvoiceDetails invoice={invoices[0]}
};