Skip to content

Surfaces

Interactive API Explorer: Explorer

The authoritative surface is the OpenAPI spec:

  • /scm/openapi.yaml

Additional surfaces are available: MCP (/scm/mcp.html) and CLI (g3n scm ...; see cli/README.md).

Surface Types (explicit)

API Gateway

  • Status: Available.
  • Base: https://api.g3nretailstack.com/scm
  • Notes: Primary tenant surface for sales cycle workflows.

Direct Lambda

  • Status: Not offered.
  • Notes: No direct Lambda surface is documented for SCM.

CLI

  • Status: Available.
  • Command: g3n scm ... (API Gateway).
  • Notes: See cli/README.md.

MCP

  • Status: Available.
  • Canonical protocol: https://mcp.g3nretailstack.com/scm/PROTOCOL.md
  • Mirror: https://doc.g3nretailstack.com/scm/PROTOCOL.md

Auth + tenancy

  • Required headers: x-orgcode and x-session-guid (user session) or x-api-key (org-bound service account).
  • Header auth is canonical; body auth is accepted where documented. See /common/headers-identity.html.
  • Optional cost attribution: x-cccode (or request field cccode) where supported; see OpenAPI.
  • Non-associated callers receive 404 not-found (anti-enumeration).
  • Facility context: x-logical-guid (required for operational actions; see OpenAPI per-path). x-channel-code (required where documented; see OpenAPI per-path).

Identifier policy

  • Direct get/update/status calls require GUID/ID fields (*_id or legacy *_guid where that is the canonical field name). Code-based lookups are resolve/search only.
  • Responses never include both *_id and *_guid for the same record (no dual-field output).
  • Exceptions (email-based UAS, PVM resolve, MRS container+record_id) are listed in /common/ids-codes.html.

Request builder (API Gateway)

Headers (canonical)

bash
-H "x-orgcode: $ORGCODE"
-H "x-session-guid: $SESSION_GUID" # or: -H "x-api-key: $API_KEY"
-H "content-type: application/json"

Template

bash
curl -sS -X POST "https://api.g3nretailstack.com/scm/<endpoint>" \
  -H "content-type: application/json" \
  -H "x-orgcode: $ORGCODE" \
  -H "x-session-guid: $SESSION_GUID" \
  -d '{"...": "..."}'

Notes

  • Replace <endpoint> with a route from the OpenAPI inventory.
  • Header auth is canonical; body session_guid / api_key is accepted where documented.

OMS/DOM expansion surfaces

  • POST /scm/order/promise/quote (ATP/CTP promise quotes with confidence + routing plan preview)
  • POST /scm/order/promise/reserve
  • POST /scm/order/promise/allocate
  • POST /scm/order/promise/commit
  • POST /scm/order/promise/release
  • POST /scm/routing/policy/get|list|set (routing policy CRUD by channel/logical)
  • POST /scm/routing/plan/create|get|list (routing plans for split fulfillment)
  • POST /scm/fulfillment/shipment/exception (custom exception codes + notes)
  • POST /scm/fulfillment/shipment/exception/short-pick
  • POST /scm/fulfillment/shipment/exception/damaged
  • POST /scm/fulfillment/shipment/exception/carrier-failure
  • POST /scm/fulfillment/shipment/exception/partial
  • POST /scm/fulfillment/shipment/exception/resolve
  • POST /scm/fulfillment/shipment/pickup/no_show

EDI adapter surfaces

  • POST /scm/edi/record
  • POST /scm/edi/status/set
  • POST /scm/edi/get
  • POST /scm/edi/list

Tax/compliance surfaces

  • POST /scm/tax/policy/set|get|list
  • POST /scm/tax/quote
  • POST /scm/tax/finalize

Endpoint inventory (OpenAPI parity)

Request/response schema names reference OpenAPI component schemas.

MethodPathRequest schemaResponse schema
POST/backorder/approveBackorderApproveRequestBackorderEnvelope
POST/backorder/cancelBackorderCancelRequestBackorderEnvelope
POST/backorder/createBackorderCreateRequestBackorderEnvelope
POST/backorder/expireBackorderExpireRequestBackorderEnvelope
POST/backorder/fulfillBackorderFulfillRequestBackorderEnvelope
POST/backorder/getBackorderGetRequestBackorderEnvelope
POST/backorder/listBackorderListRequestBackorderListEnvelope
POST/backorder/partial-fulfillBackorderPartialFulfillRequestBackorderEnvelope
POST/backorder/promiseBackorderPromiseRequestBackorderEnvelope
POST/channel/policy/getChannelPolicyGetRequestChannelPolicyEnvelope
POST/channel/policy/setChannelPolicySetRequestChannelPolicyEnvelope
POST/commentCommentAddRequestCommentEnvelope
POST/comment/getCommentGetRequestCommentEnvelope
POST/comment/listCommentListRequestCommentListEnvelope
POST/comment/reportCommentReportRequestCommentReportEnvelope
POST/comment/reviseCommentReviseRequestCommentEnvelope
POST/comment/statusCommentStatusRequestCommentEnvelope
POST/edi/getEdiGetRequestEdiEnvelope
POST/edi/listEdiListRequestEdiListEnvelope
POST/edi/recordEdiRecordRequestEdiEnvelope
POST/edi/status/setEdiStatusSetRequestEdiEnvelope
POST/fulfillment/shipment/cancelShipmentCancelRequestShipmentEnvelope
POST/fulfillment/shipment/createShipmentCreateRequestShipmentEnvelope
POST/fulfillment/shipment/deliverShipmentDeliverRequestShipmentEnvelope
POST/fulfillment/shipment/exceptionShipmentExceptionRequestShipmentEnvelope
POST/fulfillment/shipment/exception/carrier-failureShipmentExceptionCarrierFailureRequestShipmentEnvelope
POST/fulfillment/shipment/exception/damagedShipmentExceptionDamagedRequestShipmentEnvelope
POST/fulfillment/shipment/exception/partialShipmentExceptionPartialRequestShipmentEnvelope
POST/fulfillment/shipment/exception/resolveShipmentExceptionResolveRequestShipmentEnvelope
POST/fulfillment/shipment/exception/short-pickShipmentExceptionShortPickRequestShipmentEnvelope
POST/fulfillment/shipment/getShipmentGetRequestShipmentEnvelope
POST/fulfillment/shipment/listShipmentListRequestShipmentListEnvelope
POST/fulfillment/shipment/packShipmentPackRequestShipmentEnvelope
POST/fulfillment/shipment/pickShipmentPickRequestShipmentEnvelope
POST/fulfillment/shipment/pickup/completeShipmentPickupCompleteRequestShipmentEnvelope
POST/fulfillment/shipment/pickup/no_showShipmentPickupNoShowRequestShipmentEnvelope
POST/fulfillment/shipment/pickup/readyShipmentPickupReadyRequestShipmentEnvelope
POST/fulfillment/shipment/shipShipmentShipRequestShipmentEnvelope
POST/fulfillment/shipment/substitution/applyShipmentSubstitutionApplyRequestShipmentEnvelope
POST/inbox/createInboxCreateRequestInboxEnvelope
POST/inbox/getInboxGetRequestInboxEnvelope
POST/inbox/listInboxListRequestInboxListEnvelope
POST/inbox/stateInboxStateRequestInboxEnvelope
POST/inbox/statusInboxStatusRequestInboxEnvelope
POST/order/cancelOrderCancelRequestOrderEnvelope
POST/order/closeOrderCloseRequestOrderEnvelope
POST/order/createOrderCreateRequestOrderEnvelope
POST/order/fulfillOrderFulfillRequestOrderEnvelope
POST/order/getOrderGetRequestOrderEnvelope
POST/order/line/cancelOrderLineCancelRequestOrderEnvelope
POST/order/listOrderListRequestOrderListEnvelope
POST/order/placeOrderPlaceRequestOrderEnvelope
POST/order/promise/allocateOrderPromiseAllocateRequestOrderEnvelope
POST/order/promise/commitOrderPromiseCommitRequestOrderEnvelope
POST/order/promise/quoteOrderPromiseQuoteRequestPromiseQuoteEnvelope
POST/order/promise/releaseOrderPromiseReleaseRequestOrderEnvelope
POST/order/promise/reserveOrderPromiseReserveRequestOrderEnvelope
POST/order/searchOrderSearchRequestOrderListEnvelope
POST/quote/acceptQuoteAcceptRequestQuoteEnvelope
POST/quote/approveQuoteApproveRequestQuoteEnvelope
POST/quote/convertQuoteConvertRequestOrderEnvelope
POST/quote/createQuoteCreateRequestQuoteEnvelope
POST/quote/expireQuoteExpireRequestQuoteEnvelope
POST/quote/getQuoteGetRequestQuoteEnvelope
POST/quote/listQuoteListRequestQuoteListEnvelope
POST/quote/rejectQuoteRejectRequestQuoteEnvelope
POST/quote/sendQuoteSendRequestQuoteEnvelope
POST/refund/issueRefundRequestRefundEnvelope
POST/return/authorizeReturnAuthorizeRequestReturnEnvelope
POST/return/getReturnGetRequestReturnEnvelope
POST/return/inspectReturnInspectRequestReturnEnvelope
POST/return/listReturnListRequestReturnListEnvelope
POST/return/receiveReturnReceiveRequestReturnEnvelope
POST/return/requestReturnRequestReturnEnvelope
POST/return/resolveReturnResolveRequestReturnEnvelope
POST/routing/plan/createRoutingPlanCreateRequestRoutingPlanEnvelope
POST/routing/plan/getRoutingPlanGetRequestRoutingPlanEnvelope
POST/routing/plan/listRoutingPlanListRequestRoutingPlanListEnvelope
POST/routing/policy/getRoutingPolicyGetRequestRoutingPolicyEnvelope
POST/routing/policy/listRoutingPolicyListRequestRoutingPolicyListEnvelope
POST/routing/policy/setRoutingPolicySetRequestRoutingPolicyEnvelope
POST/special-order/approveSpecialOrderApproveRequestSpecialOrderEnvelope
POST/special-order/cancelSpecialOrderCancelRequestSpecialOrderEnvelope
POST/special-order/createSpecialOrderCreateRequestSpecialOrderEnvelope
POST/special-order/getSpecialOrderGetRequestSpecialOrderEnvelope
POST/special-order/listSpecialOrderListRequestSpecialOrderListEnvelope
POST/special-order/submitSpecialOrderSubmitRequestSpecialOrderEnvelope
POST/tax/finalizeTaxFinalizeRequestTaxRecordEnvelope
POST/tax/policy/getTaxPolicyGetRequestTaxPolicyEnvelope
POST/tax/policy/listTaxPolicyListRequestTaxPolicyListEnvelope
POST/tax/policy/setTaxPolicySetRequestTaxPolicyEnvelope
POST/tax/quoteTaxQuoteRequestTaxQuoteEnvelope
POST/tender/captureTenderCaptureRequestTenderEnvelope
POST/tender/getTenderGetRequestTenderEnvelope
POST/tender/listTenderListRequestTenderListEnvelope
POST/tender/settleTenderSettleRequestTenderEnvelope
POST/tender/voidTenderVoidRequestTenderEnvelope

Entity lifecycle (state machines)

  • Quote: draft → approved → sent → accepted / expired / rejected, accepted → converted
  • Backorder: draft → approved → promised → partially_fulfilled → fulfilled / cancelled / expired
  • Return: requested → authorized → received → inspected → resolved
  • Order: draft → placed → fulfilled → closed / cancelled

Error tags

Common tags (see /common/error-tags.html for definitions): validation-error, unauthorized, forbidden, not-found, expected-revision-required, conflict, invalid-state, throttled, internal-error.

Example envelopes

Success envelope (shape-only):

json
{
  "success": true,
  "data": { "example": "see schema for fields" },
  "build": { "build_major": "MONDAY", "build_minor": "0000000000", "build_id": "MONDAY-0000000000" },
  "stats": { "call": "example", "service": "scm", "timestamp_utc": "2026-01-21T00:00:00Z" }
}

Error envelope (shape-only):

json
{
  "success": false,
  "error": {
    "error_code": "scm.conflict_revision",
    "http_status": 409,
    "retryable": false,
    "request_id": "req-123",
    "trace_id": "trace-abc",
    "major": { "tag": "conflict", "message": { "en_US": "Expected revision does not match the current record." } },
    "details": { "expected_revision": "3", "current_revision": "4" },
    "conflict_snapshot": { "revision": 4 }
  },
  "build": { "...": "..." },
  "stats": { "call": "example", "service": "scm", "timestamp_utc": "2026-01-21T00:00:00Z", "request_id": "req-123" }
}

Role requirements (by endpoint family)

  • Read/list/search: scm_view (or owner).
  • Order placement & promise: scm_order (or owner).
  • Fulfillment & shipments: scm_fulfillment (or owner).
  • Returns/refunds: scm_returns / scm_credit (or owner).
  • Approvals: scm_discount_approve, scm_special_order_approve, scm_backorder_approve as applicable.

Idempotency & retries

  • Use expected_revision for state changes (order status, shipment status).
  • Idempotent write endpoints accept idempotency_key (ASCII <=128 chars). When supplied, the service replays the original response for 24h; replays with a different payload return 409 idempotency-conflict.
  • Calls without a documented idempotency key are not idempotent.

Common pitfalls

  • Facility-scoped calls require logical_guid.
  • Promise/allocate/commit flows must be sequenced; use release on cancel.
  • Comment/inbox lists default to status=current / status=inbox; use status=all to include archived/doomed.

Examples (core families)

Order create

json
{ "logical_guid": "LOGICAL_GUID", "channel_code": "WEB", "items": [{ "variant_id": "VARIANT_ID", "qty": 1 }], "reason": "checkout" }

Response (shape):

json
{ "success": true, "data": { "order_id": "ORDER_ID" }, "build": { "...": "..." }, "stats": { "...": "..." } }

Shipment record

json
{ "order_id": "ORDER_ID", "shipment": { "carrier": "UPS", "tracking": "1Z..." }, "reason": "ship" }

Response (shape):

json
{ "success": true, "data": { "shipment_id": "SHIP_ID" }, "build": { "...": "..." }, "stats": { "...": "..." } }