Skip to main content

Save ShipMyOrders Invoice Nominal Code Mapping Rules

POST 

/api/shipmyorders/invoices/mapping-rules

Replaces the full set of ShipMyOrders invoice nominal-code mapping rules in one call. Rules with an id are updated, rules without one are created, and every existing rule not in the payload is deleted — send an empty array to remove all rules.

Not yet available to API tokens

This endpoint currently requires session authentication; Personal Access Token scope support is in progress.

Body: rules (array, required). Per rule:

  • id (integer, optional) — existing rule to update
  • nominal_code_id (integer, required)
  • conditions (array, required) — each {column, operator, value}; column and operator are required strings, value is a string or null
  • sort_order (integer, optional) — defaults to the rule's position in the array

Rules are evaluated in sort_order order when an invoice is processed; the first rule whose conditions all match a line sets that line's nominal code. Each condition has column, operator and value:

  • description or quantity with =, !=, >, >=, <, <, contains, not contains (case-insensitive), in, not in (value is a comma-separated list)
  • salesorder with exists / not exists — whether the line matched a SKU.io fulfillment (value is ignored, send null) A condition on any other column never matches.

Saving does not re-code lines already processed; unprocess and process an invoice to apply new rules to it.

Returns the saved rules in evaluation order.

Requires the integrations.update permission.

Authentication: Bearer token (Personal Access Token).

Request​

Responses​

OK

Response Headers
    Content-Type