Skip to content

Surfaces

Interactive API Explorer: Explorer

The authoritative surface is the OpenAPI spec:

  • /ppm/openapi.yaml

Surface Types (explicit)

API Gateway

  • Status: Available.
  • Base: https://api.g3nretailstack.com/ppm
  • Notes: Primary tenant surface for pricing and promotions workflows.

Direct Lambda

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

CLI

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

MCP

  • Status: Available.
  • Canonical protocol: https://mcp.g3nretailstack.com/ppm/PROTOCOL.md
  • Mirror: https://doc.g3nretailstack.com/ppm/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/ppm/<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.

Implemented surfaces now include:

  • Price approvals: /ppm/price/approval/*
  • Price lists: /ppm/price-list/* (set/get/list/status + assign/clear/resolve/assignments)
  • Price zones: /ppm/price-zone/* (set/get/list/status/assign/clear/resolve/assignments)
  • Price resolve uses customer_ref to auto-resolve a contract price list when price_list_code is omitted.
  • Price recommendations: /ppm/recommendation/* (set/get/list/status)
  • Commission rules: /ppm/commission-rule/* (set/get/list/status/set)
  • Comments: /ppm/comment|comment/get|comment/list|comment/revise|comment/status|comment/report
  • Inbox: /ppm/inbox/create|get|list|status|state

Endpoint inventory (OpenAPI parity)

Request/response schema names reference OpenAPI component schemas.

MethodPathRequest schemaResponse schema
POST/commentCommentAddRequestCommentEnvelope
POST/comment/getCommentGetRequestCommentEnvelope
POST/comment/listCommentListRequestCommentListEnvelope
POST/comment/reportCommentReportRequestCommentReportEnvelope
POST/comment/reviseCommentReviseRequestCommentEnvelope
POST/comment/statusCommentStatusRequestCommentEnvelope
POST/dynamic-rule/getDynamicPricingRuleGetRequestDynamicPricingRuleEnvelope
POST/dynamic-rule/listDynamicPricingRuleListRequestDynamicPricingRuleListEnvelope
POST/dynamic-rule/setDynamicPricingRuleSetRequestDynamicPricingRuleEnvelope
POST/dynamic-rule/status/setDynamicPricingRuleStatusSetRequestDynamicPricingRuleEnvelope
POST/inbox/createInboxCreateRequestInboxEnvelope
POST/inbox/getInboxGetRequestInboxEnvelope
POST/inbox/listInboxListRequestInboxListEnvelope
POST/inbox/stateInboxStateRequestInboxEnvelope
POST/inbox/statusInboxStatusRequestInboxEnvelope
POST/policy/getPricePolicyGetRequestPricePolicyEnvelope
POST/policy/setPricePolicySetRequestPricePolicyEnvelope
POST/price-list/assignPriceListAssignRequestPriceListAssignmentEnvelope
POST/price-list/assign/clearPriceListAssignClearRequestPriceListAssignmentEnvelope
POST/price-list/assignmentsPriceListAssignmentsRequestPriceListAssignmentListEnvelope
POST/price-list/getPriceListGetRequestPriceListEnvelope
POST/price-list/listPriceListListRequestPriceListListEnvelope
POST/price-list/resolvePriceListResolveRequestPriceListAssignmentEnvelope
POST/price-list/setPriceListSetRequestPriceListEnvelope
POST/price-list/status/setPriceListStatusSetRequestPriceListEnvelope
POST/price-zone/assignPriceZoneAssignRequestPriceZoneAssignmentEnvelope
POST/price-zone/assign/clearPriceZoneAssignClearRequestPriceZoneAssignmentEnvelope
POST/price-zone/assignmentsPriceZoneAssignmentsRequestPriceZoneAssignmentListEnvelope
POST/price-zone/getPriceZoneGetRequestPriceZoneEnvelope
POST/price-zone/listPriceZoneListRequestPriceZoneListEnvelope
POST/price-zone/resolvePriceZoneResolveRequestPriceZoneAssignmentEnvelope
POST/price-zone/setPriceZoneSetRequestPriceZoneEnvelope
POST/price-zone/status/setPriceZoneStatusSetRequestPriceZoneEnvelope
POST/price/approval/approvePriceApprovalApproveRequestPriceEntryEnvelope
POST/price/approval/rejectPriceApprovalRejectRequestPriceEntryEnvelope
POST/price/approval/submitPriceApprovalSubmitRequestPriceEntryEnvelope
POST/price/getPriceEntryGetRequestPriceEntryEnvelope
POST/price/listPriceEntryListRequestPriceEntryListEnvelope
POST/price/resolvePriceResolveRequestPriceResolveEnvelope
POST/price/setPriceEntrySetRequestPriceEntryEnvelope
POST/recommendation/getPriceRecommendationGetRequestPriceRecommendationEnvelope
POST/recommendation/listPriceRecommendationListRequestPriceRecommendationListEnvelope
POST/recommendation/setPriceRecommendationSetRequestPriceRecommendationEnvelope
POST/recommendation/status/setPriceRecommendationStatusSetRequestPriceRecommendationEnvelope
POST/promotion/createPromotionCreateRequestPromotionEnvelope
POST/promotion/endPromotionEndRequestPromotionEnvelope
POST/promotion/getPromotionGetRequestPromotionEnvelope
POST/promotion/listPromotionListRequestPromotionListEnvelope
POST/commission-rule/setCommissionRuleSetRequestEnvelope
POST/commission-rule/getCommissionRuleGetRequestEnvelope
POST/commission-rule/listCommissionRuleListRequestEnvelope
POST/commission-rule/status/setCommissionRuleStatusSetRequestEnvelope
POST/uom/getUomConversionGetRequestUomConversionEnvelope
POST/uom/listUomConversionListRequestUomConversionListEnvelope
POST/uom/setUomConversionSetRequestUomConversionEnvelope

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": "ppm", "timestamp_utc": "2026-01-21T00:00:00Z" }
}

Error envelope (shape-only):

json
{
  "success": false,
  "error": {
    "error_code": "ppm.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": "ppm", "timestamp_utc": "2026-01-21T00:00:00Z", "request_id": "req-123" }
}

Role requirements (by endpoint family)

  • Read/list/resolve: ppm_view (or owner).
  • Price rule writes: ppm_price_admin (or owner).
  • Commission rule writes: ppm_price_admin (or owner).
  • Promo writes: ppm_promo_admin (or owner).
  • Approvals: ppm_approver / ppm_approve (or owner).

Idempotency & retries

  • Use expected_revision for updates to policies and promos.
  • 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

  • Price resolution requires logical_guid + channel_code when facility/channel scoped.
  • Scheduled promotions respect timezone; ensure effective_from/to are UTC.
  • Comment/inbox lists default to status=current / status=inbox; use status=all to include archived/doomed.

Examples (core families)

Price resolve

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

Response (shape):

json
{ "success": true, "data": { "prices": [] }, "build": { "...": "..." }, "stats": { "...": "..." } }

Promotion create

json
{ "promo": { "code": "SAVE10", "type": "percent", "value": 10 }, "reason": "launch" }

Response (shape):

json
{ "success": true, "data": { "promo_id": "PROMO_ID" }, "build": { "...": "..." }, "stats": { "...": "..." } }