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.
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 updatenominal_code_id(integer, required)conditions(array, required) — each{column, operator, value};columnandoperatorare required strings,valueis a string or nullsort_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:
descriptionorquantitywith=,!=,>,>=,<,<,contains,not contains(case-insensitive),in,not in(valueis a comma-separated list)salesorderwithexists/not exists— whether the line matched a SKU.io fulfillment (valueis 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
- 200
- 401
- 403
- 422
- 429
OK
Response Headers
Unauthenticated — the bearer token is missing, revoked, expired, or malformed. Never retry automatically; fix the credential. See the Errors guide.
Forbidden — the token lacks a required scope, the endpoint is not available to API tokens, or the user behind the token lacks the permission. A human must adjust the token scopes or user permissions; do not retry.
Validation failed — the body is a field → messages map (Laravel shape) or the platform envelope with a stable machine-readable code. Fix the payload and resubmit.
Rate limited — platform limit is 1,000 requests/min; individual tokens may carry lower limits. Honor the Retry-After header before retrying. See the Rate Limits guide.