Apprise ERP

Read inventory, exact ERP order details, and exact Customer PO matches for fixed customer tmdirect over native HTTP using saved credentials. PO results are bounded to the first page; snapshot consistency is unverified. No match is not proof of rejected import.

Order Creation from the CLI

Order creation is available through the source-checkout CLI and server client. It is not registered as a workflow operation. The workflow operations below remain read-only.

Set APPRISE_USERNAME, APPRISE_PASSWORD, and APPRISE_SYSTEM_ID for the CLI. To approve and commit orders, also set a separate APPRISE_APPROVAL_SECRET of at least 32 characters and APPRISE_APPROVAL_NONCE_DIR to an absolute path on persistent storage. Every process or host using that approval secret must share the same nonce directory on a filesystem that supports atomic exclusive file creation. Do not use separate local directories across hosts or ephemeral container storage. The server adapter uses PostgreSQL for shared nonce storage; its approvals use a separate server key and cannot reuse CLI tokens.

Run validation first, review the returned fields, UOM, totals, and errors, then mint an approval for the exact customer, PO, product, quantity, and expected UOM:

bun run packages/integrations/src/providers/apprise/cli-test.ts validate-order-create CUST01 PO-123 PROD01 2 Each
bun run packages/integrations/src/providers/apprise/cli-test.ts mint-order-approval reviewer CUST01 PO-123 PROD01 2 Each

The mint command prints a signed token with a five-minute lifetime. Treat it as a secret. Supply it as the first argument to commit-order-create, followed by the same order values. The client consumes the token before the duplicate check and never releases it, including after a failed attempt. A replay, missing nonce store, or storage failure blocks the save. Retain nonce records until their recorded expiry has passed; deleting a live record permits replay.

The CLI uses the Sales order class for validation, approval, and commit, and treats an omitted or empty expected UOM the same way in each command. Duplicate detection is scoped to the same customer and customer PO. A matching PO for another customer does not block the order.

Approvals also bind the optional orderDate, order class, addresses, shipping settings, EDI trade ID, freight settings, and charges supported by the server client. Adding, removing, or changing that date requires a new approval. Tokens issued before this format change must be minted again. requiredDate, legacy total overrides (freightCharges, taxAmount, additionalCharges), explicit zero-price overrides, and notes are unsupported and rejected. Use the structured charges input for additional charges.

Duplicate lines with the same SKU and exact requested UOM are consolidated before entry; approval still covers the original lines. When you provide an expected UOM, the client can enter a different unit but must observe that exact value before saving. Missing or different UOM data blocks the commit. A duplicate lookup failure also blocks it. After the main save request, missing confirmation or any unexpected dialog returns SAVE_UNCONFIRMED and closes the local session without sending further requests. Check Apprise for the customer PO before retrying; an uncertain response does not prove that the order was not saved.

Server adapters

The internal server adapters add BOL, invoice, paginated lookup, and guarded order creation handlers. They do not add canvas operations or an approval UI. Invoice filters accept ref_num, cust_code, and ref_type; these are translated to the ERP column names. Lookup results at a row/navigation cap are incomplete and cannot establish that an order does not exist.

Order creation commits require an authenticated caller, accessible saved credential, and a signed five-minute approval. The server key is derived from BETTER_AUTH_SECRET. Approval is bound to the authenticated user and a scope of JSON.stringify([workspaceId, credentialId]), and its nonce is consumed atomically in PostgreSQL. Passing requireApproval: false cannot bypass approval. The supporting void client likewise requires a valid approval covering the order number and reason, plus shared durable nonce storage.

Inventory calls sharing an Apprise session run serially. Bulk snapshots reject invalid chunk sizes and concurrency limits, malformed quantities, and failed SKU reads. Zone filtering and inventory unit conversion are unavailable; these inputs are rejected instead of relabeling location totals. A missing unit or an unverified save remains a blocking result; check Apprise before retrying an uncertain mutation.

Shipment tracking

The internal tracking clients read packages for the NJ1 location through Order Relationship Inquiry. Shipped-since polling reads invoice dates from Customer Transaction History, resolves each invoice to its orders, and collects packages from every invoice before grouping by customer PO. The group's invoice and invoiceDate identify its latest invoice; invoices and orderNumbers retain the full set. Tracking remains a server client capability rather than a canvas operation.

Inspect complete before advancing a poll. Invoice or pick-demand failures remain in the result, set complete: false, and retain the input fromDate as the watermark. Retry that range and pass previously delivered tracking numbers in reportedTrackingNumbers to avoid duplicate delivery. Successful polls advance to toDate. The date overlap defaults to one day and is bounded to zero through two days. Invalid calendar dates and reversed ranges are rejected.

Tools

Get order details by exact ERP order number over native HTTP. Customer PO search is unsupported; completeness and pagination are unverified. The durable order_search ID now requires credentialId/orderNumber.

Input

ParameterTypeRequiredDescription
credentialIdstringYesSaved Apprise credential identifier
orderNumberstringYesExact ERP order number, not Customer PO; preserved without normalization

Output

ParameterTypeDescription
credentialIdstringcredentialId output from the tool
requestedOrderNumberstringrequestedOrderNumber output from the tool
systemIDstringsystemID output from the tool
companystringcompany output from the tool
observedAtstringobservedAt output from the tool
headerobjectheader output from the tool
rowCountnumberrowCount output from the tool
linesarraylines output from the tool
scopeobjectscope output from the tool

apprise_inventory_query

Read inventory by SKU over native HTTP using a saved Apprise credential. Completeness and pagination remain unverified.

Input

ParameterTypeRequiredDescription
credentialIdstringYesSaved Apprise credential identifier
skustringYesNo description
locationstringNoOnly blank (observed default) is supported; omit or leave empty
zonestringNoOnly blank (observed default) is supported; ALL is unsupported
uomstringNoOnly Each is supported (default); EA is unsupported
limitnumberYesNo description

Output

ParameterTypeDescription
credentialIdstringcredentialId output from the tool
skustringRequested SKU; identity is request-correlated, not provider-echo-verified
productNamestringFresh provider product name from the inventory response
systemIDstringsystemID output from the tool
companystringcompany output from the tool
observedAtstringobservedAt output from the tool
rowCountnumberrowCount output from the tool
locationsarraylocations output from the tool
scopeobjectIdentity is request-correlated; completeness and pagination are unverified

Read exact Customer PO matches for fixed customer tmdirect over native HTTP. Bounded first page only (fewer than 50 rows); snapshot consistency unverified. No match is not proof of rejected import. No order selection or browser fallback.

Input

ParameterTypeRequiredDescription
credentialIdstringYesSaved Apprise credential identifier
customerPostringYesExact Customer PO, including leading zeros; preserved without normalization. Customer is fixed to tmdirect.

Output

ParameterTypeDescription
credentialIdstringcredentialId output from the tool
customerPostringcustomerPo output from the tool
systemIDstringsystemID output from the tool
companystringcompany output from the tool
observedAtstringobservedAt output from the tool
rowCountnumberrowCount output from the tool
matchesarraymatches output from the tool
scopeobjectscope output from the tool

On this page