{
  "components": {
    "schemas": {
      "apiresponse.Error": {
        "additionalProperties": false,
        "properties": {
          "code": {
            "$ref": "#/components/schemas/apiresponse_enums.Code"
          },
          "details": {
            "additionalProperties": {
              "type": "string"
            },
            "type": "object"
          },
          "message": {
            "type": "string"
          }
        },
        "required": [
          "code",
          "message"
        ],
        "type": "object"
      },
      "apiresponse_enums.Code": {
        "type": "string"
      },
      "audience.Audience": {
        "additionalProperties": false,
        "properties": {
          "customer_type": {
            "$ref": "#/components/schemas/audience_enums.CustomerType"
          },
          "platform": {
            "$ref": "#/components/schemas/audience_enums.Platform"
          }
        },
        "required": [],
        "type": "object"
      },
      "audience_enums.CustomerType": {
        "enum": [
          "guest",
          "retail",
          "wholesale"
        ],
        "type": "string"
      },
      "audience_enums.Platform": {
        "enum": [
          "web",
          "mobile"
        ],
        "type": "string"
      },
      "audit.LifecycleAction": {
        "properties": {
          "at": {
            "type": "string"
          },
          "by": {
            "type": "string"
          },
          "reason": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "benefit.BenefitRef": {
        "properties": {
          "code": {
            "type": "string"
          },
          "kind": {
            "type": "string"
          },
          "name": {
            "items": {
              "$ref": "#/components/schemas/localization.LocalizedName"
            },
            "type": "array",
            "uniqueItems": false
          }
        },
        "type": "object"
      },
      "buyer.BuyerContext": {
        "properties": {
          "organisation_access_id": {
            "type": "string"
          },
          "retail_customer_number": {
            "type": "string"
          },
          "type": {
            "$ref": "#/components/schemas/retail_enums.BuyerType"
          },
          "wholesale_organisation_code": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "campaign.Campaign": {
        "additionalProperties": false,
        "properties": {
          "archived_at": {
            "format": "date-time",
            "type": "string"
          },
          "audience": {
            "items": {
              "$ref": "#/components/schemas/campaign_enums.CampaignCustomerType"
            },
            "type": "array"
          },
          "campaign_code": {
            "type": "string"
          },
          "country_code": {
            "$ref": "#/components/schemas/geography.CountryCode"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "created_by": {
            "type": "string"
          },
          "currency_code": {
            "type": "string"
          },
          "deleted_at": {
            "format": "date-time",
            "type": "string"
          },
          "deleted_by": {
            "type": "string"
          },
          "description": {
            "items": {
              "$ref": "#/components/schemas/localization.LocalizedText"
            },
            "type": "array"
          },
          "effective_status": {
            "type": "string"
          },
          "ends_at": {
            "format": "date-time",
            "type": "string"
          },
          "geographic_scope": {
            "$ref": "#/components/schemas/geography.GeographicScope"
          },
          "id": {
            "type": "string"
          },
          "market_code": {
            "type": "string"
          },
          "media": {
            "$ref": "#/components/schemas/security.ObjectMedia"
          },
          "offers": {
            "items": {
              "$ref": "#/components/schemas/campaign.OfferLink"
            },
            "type": "array"
          },
          "paused_at": {
            "format": "date-time",
            "type": "string"
          },
          "placements": {
            "items": {
              "$ref": "#/components/schemas/campaign.Placement"
            },
            "type": "array"
          },
          "publication_revision": {
            "type": "integer"
          },
          "publication_status": {
            "$ref": "#/components/schemas/campaign_enums.CampaignStatus"
          },
          "published": {
            "type": "boolean"
          },
          "published_at": {
            "format": "date-time",
            "type": "string"
          },
          "revision": {
            "type": "integer"
          },
          "schedule_timezone": {
            "type": "string"
          },
          "starts_at": {
            "format": "date-time",
            "type": "string"
          },
          "targets": {
            "$ref": "#/components/schemas/campaign.CampaignTarget"
          },
          "title": {
            "items": {
              "$ref": "#/components/schemas/localization.LocalizedName"
            },
            "type": "array"
          },
          "updated_at": {
            "format": "date-time",
            "type": "string"
          },
          "updated_by": {
            "type": "string"
          }
        },
        "required": [
          "campaign_code",
          "placements",
          "offers",
          "published",
          "audience",
          "publication_status",
          "effective_status",
          "revision",
          "publication_revision",
          "created_at",
          "updated_at"
        ],
        "type": "object"
      },
      "campaign.CampaignCategoryTarget": {
        "additionalProperties": false,
        "properties": {
          "category_tag_code": {
            "type": "string"
          },
          "collection_code": {
            "type": "string"
          }
        },
        "required": [
          "collection_code",
          "category_tag_code"
        ],
        "type": "object"
      },
      "campaign.CampaignTarget": {
        "additionalProperties": false,
        "properties": {
          "categories": {
            "items": {
              "$ref": "#/components/schemas/campaign.CampaignCategoryTarget"
            },
            "type": "array"
          },
          "sku_codes": {
            "items": {
              "type": "string"
            },
            "type": "array"
          }
        },
        "required": [],
        "type": "object"
      },
      "campaign.OfferLink": {
        "additionalProperties": false,
        "properties": {
          "display_order": {
            "type": "integer"
          },
          "id": {
            "type": "string"
          },
          "kind": {
            "type": "string"
          },
          "revision": {
            "type": "string"
          }
        },
        "required": [
          "kind",
          "id",
          "display_order"
        ],
        "type": "object"
      },
      "campaign.Placement": {
        "additionalProperties": false,
        "properties": {
          "media": {
            "$ref": "#/components/schemas/security.ObjectMedia"
          },
          "platforms": {
            "items": {
              "$ref": "#/components/schemas/campaign_enums.CampaignPlatform"
            },
            "type": "array"
          },
          "position": {
            "$ref": "#/components/schemas/campaign_enums.CampaignPlacement"
          },
          "priority": {
            "type": "integer"
          }
        },
        "required": [
          "position",
          "platforms",
          "priority"
        ],
        "type": "object"
      },
      "campaign_enums.CampaignCustomerType": {
        "enum": [
          "retail",
          "wholesale"
        ],
        "type": "string"
      },
      "campaign_enums.CampaignPlacement": {
        "enum": [
          "announcement_bar",
          "home_banner",
          "account_banner",
          "home_modal"
        ],
        "type": "string"
      },
      "campaign_enums.CampaignPlatform": {
        "enum": [
          "web",
          "mobile"
        ],
        "type": "string"
      },
      "campaign_enums.CampaignStatus": {
        "enum": [
          "draft",
          "published",
          "paused",
          "archived"
        ],
        "type": "string"
      },
      "campaignoffers.DisplayTerms": {
        "additionalProperties": false,
        "properties": {
          "discount_amount": {
            "$ref": "#/components/schemas/money.Money"
          },
          "discount_basis_points": {
            "type": "integer"
          },
          "free_shipping": {
            "type": "boolean"
          },
          "maximum_discount_amount": {
            "$ref": "#/components/schemas/money.Money"
          },
          "minimum_order_amount": {
            "$ref": "#/components/schemas/money.Money"
          }
        },
        "required": [],
        "type": "object"
      },
      "campaignoffers.Eligibility": {
        "additionalProperties": false,
        "properties": {
          "audience": {
            "items": {
              "$ref": "#/components/schemas/campaign_enums.CampaignCustomerType"
            },
            "type": "array"
          },
          "geographic_scope": {
            "$ref": "#/components/schemas/geography.GeographicScope"
          },
          "platforms": {
            "items": {
              "$ref": "#/components/schemas/campaign_enums.CampaignPlatform"
            },
            "type": "array"
          },
          "product_scope": {
            "$ref": "#/components/schemas/promotion.PromotionScope"
          }
        },
        "required": [
          "audience",
          "platforms",
          "geographic_scope",
          "product_scope"
        ],
        "type": "object"
      },
      "campaignoffers.Failure": {
        "additionalProperties": false,
        "properties": {
          "client_key": {
            "type": "string"
          },
          "field": {
            "type": "string"
          },
          "reason": {
            "type": "string"
          },
          "stage": {
            "type": "string"
          }
        },
        "required": [
          "stage",
          "reason"
        ],
        "type": "object"
      },
      "campaignoffers.Identity": {
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "string"
          },
          "kind": {
            "type": "string"
          }
        },
        "required": [
          "kind",
          "id"
        ],
        "type": "object"
      },
      "campaignoffers.Offer": {
        "additionalProperties": false,
        "properties": {
          "client_key": {
            "type": "string"
          },
          "country_code": {
            "type": "string"
          },
          "eligibility": {
            "$ref": "#/components/schemas/campaignoffers.Eligibility"
          },
          "ends_at": {
            "format": "date-time",
            "type": "string"
          },
          "identity": {
            "$ref": "#/components/schemas/campaignoffers.Identity"
          },
          "lifecycle_revision": {
            "format": "int64",
            "type": "integer"
          },
          "market_code": {
            "type": "string"
          },
          "published": {
            "type": "boolean"
          },
          "schedule_timezone": {
            "type": "string"
          },
          "starts_at": {
            "format": "date-time",
            "type": "string"
          },
          "version": {
            "type": "string"
          }
        },
        "required": [
          "identity",
          "version",
          "published",
          "schedule_timezone",
          "country_code",
          "market_code",
          "lifecycle_revision"
        ],
        "type": "object"
      },
      "campaignoffers.OfferProjection": {
        "additionalProperties": false,
        "properties": {
          "actions": {
            "items": {
              "$ref": "#/components/schemas/campaignoffers.SemanticAction"
            },
            "type": "array"
          },
          "available": {
            "type": "boolean"
          },
          "coupon": {
            "$ref": "#/components/schemas/campaignoffers.StorefrontCoupon"
          },
          "identity": {
            "$ref": "#/components/schemas/campaignoffers.Identity"
          },
          "promotion": {
            "$ref": "#/components/schemas/campaignoffers.StorefrontPromotion"
          },
          "reason": {
            "type": "string"
          }
        },
        "required": [
          "identity",
          "available",
          "actions"
        ],
        "type": "object"
      },
      "campaignoffers.SemanticAction": {
        "additionalProperties": false,
        "properties": {
          "coupon_id": {
            "type": "string"
          },
          "kind": {
            "type": "string"
          }
        },
        "required": [
          "kind"
        ],
        "type": "object"
      },
      "campaignoffers.Snapshot": {
        "additionalProperties": false,
        "properties": {
          "campaign_code": {
            "type": "string"
          },
          "campaign_id": {
            "type": "string"
          },
          "content_revision": {
            "format": "int64",
            "type": "integer"
          },
          "eligibility": {
            "$ref": "#/components/schemas/campaignoffers.Eligibility"
          },
          "ends_at": {
            "format": "date-time",
            "type": "string"
          },
          "generation": {
            "format": "int64",
            "minimum": 0,
            "type": "integer"
          },
          "identity": {
            "$ref": "#/components/schemas/campaignoffers.Identity"
          },
          "published": {
            "type": "boolean"
          },
          "revision": {
            "format": "int64",
            "minimum": 0,
            "type": "integer"
          },
          "schedule_timezone": {
            "type": "string"
          },
          "starts_at": {
            "format": "date-time",
            "type": "string"
          },
          "state": {
            "enum": [
              "unlinked",
              "pending",
              "linked"
            ],
            "type": "string"
          }
        },
        "required": [
          "identity",
          "state",
          "revision",
          "generation",
          "published"
        ],
        "type": "object"
      },
      "campaignoffers.StorefrontCoupon": {
        "additionalProperties": false,
        "properties": {
          "acquisition": {
            "$ref": "#/components/schemas/coupon_enums.Acquisition"
          },
          "acquisition_status": {
            "type": "string"
          },
          "availability": {
            "type": "string"
          },
          "claimable": {
            "type": "boolean"
          },
          "code": {
            "type": "string"
          },
          "content": {
            "$ref": "#/components/schemas/coupon.CouponContent"
          },
          "eligibility_reason": {
            "type": "string"
          },
          "ends_at": {
            "format": "date-time",
            "type": "string"
          },
          "entitlement_status": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "lifecycle": {
            "type": "string"
          },
          "owned": {
            "type": "boolean"
          },
          "pending_issuance": {
            "type": "boolean"
          },
          "schedule_timezone": {
            "type": "string"
          },
          "starts_at": {
            "format": "date-time",
            "type": "string"
          },
          "terms": {
            "$ref": "#/components/schemas/campaignoffers.DisplayTerms"
          },
          "visibility": {
            "$ref": "#/components/schemas/coupon_enums.Visibility"
          }
        },
        "required": [
          "terms",
          "id",
          "content",
          "visibility",
          "acquisition",
          "availability",
          "claimable",
          "lifecycle",
          "acquisition_status",
          "entitlement_status",
          "owned",
          "pending_issuance",
          "schedule_timezone"
        ],
        "type": "object"
      },
      "campaignoffers.StorefrontDisplayRelation": {
        "additionalProperties": false,
        "properties": {
          "kind": {
            "type": "string"
          },
          "qualifier_scope": {
            "$ref": "#/components/schemas/promotion.PromotionScope"
          },
          "target_scope": {
            "$ref": "#/components/schemas/promotion.PromotionScope"
          }
        },
        "required": [
          "kind",
          "qualifier_scope",
          "target_scope"
        ],
        "type": "object"
      },
      "campaignoffers.StorefrontDisplayScope": {
        "additionalProperties": false,
        "properties": {
          "promotion_scope": {
            "$ref": "#/components/schemas/promotion.PromotionScope"
          },
          "relations": {
            "items": {
              "$ref": "#/components/schemas/campaignoffers.StorefrontDisplayRelation"
            },
            "type": "array"
          }
        },
        "required": [
          "promotion_scope"
        ],
        "type": "object"
      },
      "campaignoffers.StorefrontGiftTerms": {
        "additionalProperties": false,
        "description": "Customer-visible facts for one gift tier. Omitted properties are not applicable; eligibility remains subject to checkout.",
        "properties": {
          "gift_base_units": {
            "format": "int64",
            "minimum": 1,
            "type": "integer"
          },
          "minimum_order_amount": {
            "$ref": "#/components/schemas/money.Money"
          },
          "qualifier_base_units": {
            "format": "int64",
            "minimum": 1,
            "type": "integer"
          }
        },
        "type": "object"
      },
      "campaignoffers.StorefrontPromotion": {
        "additionalProperties": false,
        "properties": {
          "badge_labels": {
            "items": {
              "$ref": "#/components/schemas/localization.LocalizedText"
            },
            "type": "array"
          },
          "display_messages": {
            "items": {
              "$ref": "#/components/schemas/localization.LocalizedText"
            },
            "type": "array"
          },
          "display_scope": {
            "$ref": "#/components/schemas/campaignoffers.StorefrontDisplayScope"
          },
          "ends_at": {
            "format": "date-time",
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "is_active": {
            "type": "boolean"
          },
          "kind": {
            "type": "string"
          },
          "names": {
            "items": {
              "$ref": "#/components/schemas/localization.LocalizedName"
            },
            "type": "array"
          },
          "series_key": {
            "type": "string"
          },
          "starts_at": {
            "format": "date-time",
            "type": "string"
          },
          "terms": {
            "$ref": "#/components/schemas/campaignoffers.StorefrontPromotionTerms"
          },
          "timezone": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "series_key",
          "kind",
          "display_scope",
          "timezone",
          "is_active"
        ],
        "type": "object"
      },
      "campaignoffers.StorefrontPromotionTerms": {
        "additionalProperties": false,
        "description": "Customer-visible authored terms. The promotion-wide minimum and each gift tier's minimum are distinct; displayed terms do not promise eligibility or final price.",
        "properties": {
          "addon_package_price": {
            "$ref": "#/components/schemas/money.Money"
          },
          "bundle_package_price": {
            "$ref": "#/components/schemas/money.Money"
          },
          "discount_amount": {
            "$ref": "#/components/schemas/money.Money"
          },
          "discount_basis_points": {
            "format": "int64",
            "type": "integer"
          },
          "fixed_package_price": {
            "$ref": "#/components/schemas/money.Money"
          },
          "gift_base_units": {
            "format": "int64",
            "minimum": 1,
            "type": "integer"
          },
          "gift_tiers": {
            "description": "Follows the order of gift relations in display_scope.relations without exposing internal relation identity.",
            "items": {
              "$ref": "#/components/schemas/campaignoffers.StorefrontGiftTerms"
            },
            "type": "array"
          },
          "maximum_applications_per_customer": {
            "format": "int64",
            "minimum": 1,
            "type": "integer"
          },
          "minimum_order_amount": {
            "$ref": "#/components/schemas/money.Money"
          },
          "qualifier_base_units": {
            "format": "int64",
            "minimum": 1,
            "type": "integer"
          }
        },
        "type": "object"
      },
      "campaigns.ApplicabilityRequest": {
        "additionalProperties": false,
        "properties": {
          "offers": {
            "items": {
              "$ref": "#/components/schemas/campaignoffers.Identity"
            },
            "maxItems": 50,
            "minItems": 1,
            "type": "array"
          }
        },
        "required": [
          "offers"
        ],
        "type": "object"
      },
      "campaigns.ApplicabilityResponse": {
        "additionalProperties": false,
        "properties": {
          "offers": {
            "items": {
              "$ref": "#/components/schemas/campaignoffers.Snapshot"
            },
            "maxItems": 50,
            "type": "array"
          }
        },
        "required": [
          "offers"
        ],
        "type": "object"
      },
      "campaigns.AssociationRequest": {
        "additionalProperties": false,
        "properties": {
          "expected_version": {
            "type": "string"
          },
          "generation": {
            "type": "integer"
          },
          "pause": {
            "type": "boolean"
          },
          "replacement_offers": {
            "items": {
              "$ref": "#/components/schemas/campaign.OfferLink"
            },
            "type": "array"
          },
          "review_token": {
            "type": "string"
          }
        },
        "required": [
          "expected_version",
          "generation"
        ],
        "type": "object"
      },
      "campaigns.BulkLifecycleInput": {
        "additionalProperties": false,
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/campaigns.BulkLifecycleItem"
            },
            "type": "array"
          }
        },
        "required": [
          "items"
        ],
        "type": "object"
      },
      "campaigns.BulkLifecycleItem": {
        "additionalProperties": false,
        "properties": {
          "campaign_code": {
            "type": "string"
          },
          "campaign_etag": {
            "type": "string"
          },
          "offers": {
            "items": {
              "$ref": "#/components/schemas/campaigns.OfferPrecondition"
            },
            "type": "array"
          }
        },
        "required": [
          "campaign_code",
          "campaign_etag",
          "offers"
        ],
        "type": "object"
      },
      "campaigns.BulkLifecycleItemResult": {
        "additionalProperties": false,
        "properties": {
          "campaign_code": {
            "type": "string"
          },
          "error": {
            "$ref": "#/components/schemas/apiresponse.Error"
          },
          "operation": {
            "$ref": "#/components/schemas/campaigns.OperationResult"
          }
        },
        "required": [
          "campaign_code"
        ],
        "type": "object"
      },
      "campaigns.BulkLifecycleResponse": {
        "properties": {
          "data": {
            "$ref": "#/components/schemas/campaigns.BulkLifecycleResult"
          },
          "success": {
            "type": "boolean"
          }
        },
        "required": [
          "success",
          "data"
        ],
        "type": "object"
      },
      "campaigns.BulkLifecycleResult": {
        "additionalProperties": false,
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/campaigns.BulkLifecycleItemResult"
            },
            "type": "array"
          }
        },
        "required": [
          "items"
        ],
        "type": "object"
      },
      "campaigns.CampaignUpdateRequest": {
        "additionalProperties": false,
        "properties": {
          "campaign": {
            "$ref": "#/components/schemas/campaigns.DraftInput"
          },
          "offers": {
            "items": {
              "$ref": "#/components/schemas/campaigns.OfferPrecondition"
            },
            "type": "array"
          },
          "pause": {
            "type": "boolean"
          },
          "replacement_offers": {
            "items": {
              "$ref": "#/components/schemas/campaign.OfferLink"
            },
            "type": "array"
          },
          "review_token": {
            "type": "string"
          }
        },
        "required": [
          "campaign",
          "offers"
        ],
        "type": "object"
      },
      "campaigns.CompositionAdmissionResponse": {
        "additionalProperties": false,
        "properties": {
          "data": {
            "$ref": "#/components/schemas/campaigns.CompositionAdmissionResult"
          },
          "success": {
            "type": "boolean"
          }
        },
        "required": [
          "success",
          "data"
        ],
        "type": "object"
      },
      "campaigns.CompositionAdmissionResult": {
        "additionalProperties": false,
        "properties": {
          "abort_operation": {
            "$ref": "#/components/schemas/campaigns.OperationResult"
          },
          "admission": {
            "description": "Unknown is not proof of non-admission. Only a durable cancellation tombstone proves cancelled_before_admission. Admitted includes completed or aborted original work; inspect operation and abort_operation.",
            "enum": [
              "unknown",
              "admitted",
              "cancelled_before_admission"
            ],
            "type": "string"
          },
          "operation": {
            "$ref": "#/components/schemas/campaigns.OperationResult"
          },
          "original_operation_id": {
            "type": "string"
          }
        },
        "required": [
          "admission",
          "original_operation_id"
        ],
        "type": "object"
      },
      "campaigns.CompositionCancellationRequest": {
        "additionalProperties": false,
        "properties": {
          "original_idempotency_key": {
            "description": "Original composition create key. Must differ from the cancellation Idempotency-Key header.",
            "maxLength": 128,
            "minLength": 16,
            "type": "string"
          }
        },
        "required": [
          "original_idempotency_key"
        ],
        "type": "object"
      },
      "campaigns.CompositionRequest": {
        "additionalProperties": false,
        "properties": {
          "campaign_code": {
            "type": "string"
          },
          "campaign_etag": {
            "type": "string"
          },
          "coupons": {
            "items": {
              "$ref": "#/components/schemas/campaigns.CouponCompositionItem"
            },
            "type": "array"
          },
          "offers": {
            "items": {
              "$ref": "#/components/schemas/campaigns.OfferPrecondition"
            },
            "type": "array"
          },
          "promotions": {
            "items": {
              "$ref": "#/components/schemas/campaigns.PromotionCompositionItem"
            },
            "type": "array"
          }
        },
        "required": [
          "campaign_code",
          "campaign_etag",
          "promotions"
        ],
        "type": "object"
      },
      "campaigns.CompositionView": {
        "additionalProperties": false,
        "properties": {
          "campaign_code": {
            "type": "string"
          },
          "campaign_etag": {
            "type": "string"
          },
          "offers": {
            "items": {
              "$ref": "#/components/schemas/campaigns.ResolvedOffer"
            },
            "maxItems": 50,
            "type": "array"
          },
          "pending_operation_id": {
            "type": "string"
          },
          "pending_operation_state": {
            "type": "string"
          }
        },
        "required": [
          "campaign_code",
          "campaign_etag",
          "offers"
        ],
        "type": "object"
      },
      "campaigns.CouponAuthoring": {
        "additionalProperties": false,
        "properties": {
          "acquisition": {
            "$ref": "#/components/schemas/coupon_enums.Acquisition"
          },
          "acquisition_window": {
            "$ref": "#/components/schemas/promotion.PromotionPeriod"
          },
          "automatic_policy": {
            "$ref": "#/components/schemas/coupon_enums.AutomaticPolicy"
          },
          "benefit": {
            "$ref": "#/components/schemas/coupon.Benefit"
          },
          "code": {
            "type": "string"
          },
          "content": {
            "$ref": "#/components/schemas/coupon.CouponContent"
          },
          "controls": {
            "$ref": "#/components/schemas/promotion.PromotionControls"
          },
          "country_code": {
            "$ref": "#/components/schemas/geography.CountryCode"
          },
          "entitlement_validity_days": {
            "format": "int64",
            "maximum": 3650,
            "minimum": 1,
            "type": "integer"
          },
          "exclusive_promotions": {
            "type": "boolean"
          },
          "inheritance": {
            "$ref": "#/components/schemas/coupon.Inheritance"
          },
          "issuance_limit": {
            "type": "integer"
          },
          "market_code": {
            "type": "string"
          },
          "merchandise_only": {
            "type": "boolean"
          },
          "minimum_spend": {
            "$ref": "#/components/schemas/money.Money"
          },
          "profile_completion_only": {
            "type": "boolean"
          },
          "profile_programme": {
            "type": "boolean"
          },
          "receiving_eligibility": {
            "$ref": "#/components/schemas/coupon.ReceivingEligibility"
          },
          "redemption_eligibility": {
            "$ref": "#/components/schemas/coupon.RedemptionEligibility"
          },
          "redemption_limits": {
            "$ref": "#/components/schemas/coupon.RedemptionLimits"
          },
          "redemption_window": {
            "$ref": "#/components/schemas/promotion.PromotionPeriod"
          },
          "scope": {
            "$ref": "#/components/schemas/promotion.PromotionScope"
          },
          "visibility": {
            "$ref": "#/components/schemas/coupon_enums.Visibility"
          }
        },
        "required": [
          "code",
          "content",
          "acquisition",
          "visibility",
          "receiving_eligibility",
          "redemption_eligibility",
          "acquisition_window",
          "inheritance",
          "redemption_limits",
          "scope",
          "redemption_window",
          "benefit",
          "controls"
        ],
        "type": "object"
      },
      "campaigns.CouponCompositionItem": {
        "additionalProperties": false,
        "properties": {
          "client_key": {
            "type": "string"
          },
          "create": {
            "$ref": "#/components/schemas/campaigns.CouponAuthoring"
          },
          "reuse": {
            "$ref": "#/components/schemas/campaigns.ReuseOffer"
          }
        },
        "required": [
          "client_key"
        ],
        "type": "object"
      },
      "campaigns.DraftInput": {
        "additionalProperties": false,
        "properties": {
          "audience": {
            "items": {
              "$ref": "#/components/schemas/campaign_enums.CampaignCustomerType"
            },
            "type": "array"
          },
          "description": {
            "items": {
              "$ref": "#/components/schemas/localization.LocalizedText"
            },
            "type": "array"
          },
          "ends_at": {
            "format": "date-time",
            "type": "string"
          },
          "geographic_scope": {
            "$ref": "#/components/schemas/geography.GeographicScope"
          },
          "market_code": {
            "type": "string"
          },
          "media": {
            "$ref": "#/components/schemas/security.ObjectMedia"
          },
          "placements": {
            "items": {
              "$ref": "#/components/schemas/campaign.Placement"
            },
            "type": "array"
          },
          "schedule_timezone": {
            "type": "string"
          },
          "starts_at": {
            "format": "date-time",
            "type": "string"
          },
          "targets": {
            "$ref": "#/components/schemas/campaign.CampaignTarget"
          },
          "title": {
            "items": {
              "$ref": "#/components/schemas/localization.LocalizedName"
            },
            "type": "array"
          }
        },
        "required": [],
        "type": "object"
      },
      "campaigns.EmptyCommand": {
        "additionalProperties": false,
        "properties": {},
        "type": "object"
      },
      "campaigns.NotificationCampaignView": {
        "additionalProperties": false,
        "properties": {
          "audience": {
            "items": {
              "$ref": "#/components/schemas/campaign_enums.CampaignCustomerType"
            },
            "type": "array"
          },
          "campaign_code": {
            "type": "string"
          },
          "content_revision": {
            "type": "integer"
          },
          "description": {
            "items": {
              "$ref": "#/components/schemas/localization.LocalizedText"
            },
            "type": "array"
          },
          "ends_at": {
            "format": "date-time",
            "type": "string"
          },
          "market_code": {
            "type": "string"
          },
          "publication_revision": {
            "type": "integer"
          },
          "published": {
            "type": "boolean"
          },
          "starts_at": {
            "format": "date-time",
            "type": "string"
          },
          "title": {
            "items": {
              "$ref": "#/components/schemas/localization.LocalizedName"
            },
            "type": "array"
          }
        },
        "required": [
          "audience",
          "campaign_code",
          "published",
          "publication_revision",
          "market_code",
          "title",
          "content_revision"
        ],
        "type": "object"
      },
      "campaigns.OfferPrecondition": {
        "additionalProperties": false,
        "properties": {
          "expected_version": {
            "type": "string"
          },
          "generation": {
            "type": "integer"
          },
          "identity": {
            "$ref": "#/components/schemas/campaignoffers.Identity"
          }
        },
        "required": [
          "identity",
          "expected_version",
          "generation"
        ],
        "type": "object"
      },
      "campaigns.OperationFailure": {
        "additionalProperties": false,
        "description": "Optional service-owned diagnostics from the most recent failed step. Contains reviewed vocabulary and schema paths only; never raw provider messages or request values. Legacy operations can omit this evidence. A failure does not change admission, state, or retry permissions.",
        "properties": {
          "client_key": {
            "description": "Optional correlation key, echoed only when it matches the safe syntax. Legacy commands with other keys retain their original acceptance behavior.",
            "maxLength": 128,
            "minLength": 1,
            "pattern": "^[A-Za-z0-9][A-Za-z0-9_-]{0,127}$",
            "type": "string"
          },
          "field": {
            "description": "Optional reviewed schema path. Missing when the provider cannot safely identify one.",
            "enum": [
              "operation_id",
              "actor",
              "market_code",
              "campaign_code",
              "action",
              "offers",
              "items",
              "eligibility",
              "items.client_key",
              "items.id",
              "items.definition",
              "items.policy",
              "items.expected_version",
              "promotion.id",
              "promotion.country_code",
              "promotion.market_code",
              "promotion.controls.audience",
              "promotion.series_key",
              "promotion.kind",
              "promotion.status",
              "promotion.revision",
              "promotion.period",
              "promotion.controls",
              "promotion.controls.stackable",
              "promotion.scope",
              "promotion.relations",
              "coupon.id",
              "coupon.country_code",
              "coupon.market_code",
              "coupon.visibility",
              "coupon.acquisition",
              "coupon.acquisition_window",
              "coupon.receiving_eligibility",
              "coupon.redemption_eligibility",
              "coupon.automatic_policy",
              "coupon.code",
              "coupon.benefit",
              "coupon.redemption_window",
              "coupon.controls",
              "coupon.scope"
            ],
            "type": "string"
          },
          "reason": {
            "enum": [
              "invalid_request",
              "invalid_policy",
              "invalid_offer",
              "incompatible_offer",
              "offer_not_found",
              "offer_changed",
              "permission_denied",
              "dependency_unavailable"
            ],
            "type": "string"
          },
          "stage": {
            "enum": [
              "request_validation",
              "policy_install",
              "offer_preparation",
              "offer_publication",
              "offer_resolution",
              "operation_persistence",
              "campaign_finalization",
              "policy_finalization"
            ],
            "type": "string"
          }
        },
        "required": [
          "stage",
          "reason"
        ],
        "type": "object"
      },
      "campaigns.OperationOffer": {
        "additionalProperties": false,
        "properties": {
          "client_key": {
            "type": "string"
          },
          "generation": {
            "type": "integer"
          },
          "identity": {
            "$ref": "#/components/schemas/campaignoffers.Identity"
          },
          "published": {
            "type": "boolean"
          },
          "version": {
            "type": "string"
          }
        },
        "required": [
          "identity",
          "version",
          "generation",
          "published"
        ],
        "type": "object"
      },
      "campaigns.OperationResult": {
        "additionalProperties": false,
        "properties": {
          "campaign_code": {
            "type": "string"
          },
          "campaign_etag": {
            "type": "string"
          },
          "can_abort": {
            "type": "boolean"
          },
          "error_code": {
            "type": "string"
          },
          "failure": {
            "$ref": "#/components/schemas/campaignoffers.Failure"
          },
          "offers": {
            "items": {
              "$ref": "#/components/schemas/campaigns.OperationOffer"
            },
            "type": "array"
          },
          "operation_id": {
            "type": "string"
          },
          "parent_status": {
            "type": "string"
          },
          "retryable": {
            "type": "boolean"
          },
          "state": {
            "type": "string"
          }
        },
        "required": [
          "operation_id",
          "state",
          "campaign_code",
          "offers",
          "retryable",
          "can_abort"
        ],
        "type": "object"
      },
      "campaigns.PositionGroup": {
        "additionalProperties": false,
        "properties": {
          "campaigns": {
            "items": {
              "$ref": "#/components/schemas/campaigns.StorefrontCampaign"
            },
            "type": "array"
          },
          "position": {
            "$ref": "#/components/schemas/campaign_enums.CampaignPlacement"
          }
        },
        "required": [
          "position",
          "campaigns"
        ],
        "type": "object"
      },
      "campaigns.PromotionCompositionItem": {
        "additionalProperties": false,
        "properties": {
          "client_key": {
            "type": "string"
          },
          "create": {
            "$ref": "#/components/schemas/promotion.Promotion"
          },
          "reuse": {
            "$ref": "#/components/schemas/campaigns.ReuseOffer"
          }
        },
        "required": [
          "client_key"
        ],
        "type": "object"
      },
      "campaigns.PublicationRequest": {
        "additionalProperties": false,
        "properties": {
          "action": {
            "enum": [
              "publish",
              "pause",
              "archive",
              "update",
              "attach",
              "detach",
              "replace"
            ],
            "type": "string"
          },
          "offers": {
            "items": {
              "$ref": "#/components/schemas/campaigns.OfferPrecondition"
            },
            "type": "array"
          },
          "pause": {
            "type": "boolean"
          },
          "replacement_offers": {
            "items": {
              "$ref": "#/components/schemas/campaign.OfferLink"
            },
            "type": "array"
          },
          "review_token": {
            "type": "string"
          }
        },
        "required": [
          "action",
          "offers"
        ],
        "type": "object"
      },
      "campaigns.ResolveRequest": {
        "additionalProperties": false,
        "properties": {
          "country_code": {
            "type": "string"
          },
          "market_code": {
            "type": "string"
          },
          "offers": {
            "items": {
              "$ref": "#/components/schemas/campaignoffers.Identity"
            },
            "maxItems": 50,
            "minItems": 1,
            "type": "array"
          }
        },
        "required": [
          "offers",
          "country_code",
          "market_code"
        ],
        "type": "object"
      },
      "campaigns.ResolveResponse": {
        "additionalProperties": false,
        "properties": {
          "offers": {
            "items": {
              "$ref": "#/components/schemas/campaigns.ResolvedOffer"
            },
            "maxItems": 50,
            "type": "array"
          }
        },
        "required": [
          "offers"
        ],
        "type": "object"
      },
      "campaigns.ResolvedOffer": {
        "additionalProperties": false,
        "properties": {
          "client_key": {
            "type": "string"
          },
          "country_code": {
            "type": "string"
          },
          "eligibility": {
            "$ref": "#/components/schemas/campaignoffers.Eligibility"
          },
          "ends_at": {
            "format": "date-time",
            "type": "string"
          },
          "identity": {
            "$ref": "#/components/schemas/campaignoffers.Identity"
          },
          "lifecycle_revision": {
            "format": "int64",
            "type": "integer"
          },
          "market_code": {
            "type": "string"
          },
          "policy": {
            "$ref": "#/components/schemas/campaignoffers.Snapshot"
          },
          "published": {
            "type": "boolean"
          },
          "schedule_timezone": {
            "type": "string"
          },
          "starts_at": {
            "format": "date-time",
            "type": "string"
          },
          "version": {
            "type": "string"
          }
        },
        "required": [
          "identity",
          "version",
          "published",
          "schedule_timezone",
          "country_code",
          "market_code",
          "lifecycle_revision",
          "policy"
        ],
        "type": "object"
      },
      "campaigns.ReuseOffer": {
        "additionalProperties": false,
        "properties": {
          "expected_version": {
            "type": "string"
          },
          "generation": {
            "type": "integer"
          },
          "id": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "expected_version",
          "generation"
        ],
        "type": "object"
      },
      "campaigns.ReviewRequest": {
        "additionalProperties": false,
        "properties": {
          "action": {
            "enum": [
              "publish",
              "pause",
              "archive",
              "update",
              "attach",
              "detach",
              "replace"
            ],
            "type": "string"
          },
          "campaign": {
            "$ref": "#/components/schemas/campaigns.DraftInput"
          },
          "offers": {
            "items": {
              "$ref": "#/components/schemas/campaigns.OfferPrecondition"
            },
            "type": "array"
          },
          "pause": {
            "type": "boolean"
          },
          "replacement_offers": {
            "items": {
              "$ref": "#/components/schemas/campaign.OfferLink"
            },
            "type": "array"
          },
          "review_token": {
            "type": "string"
          },
          "selected": {
            "$ref": "#/components/schemas/campaignoffers.Identity"
          }
        },
        "required": [
          "action",
          "offers"
        ],
        "type": "object"
      },
      "campaigns.StorefrontCampaign": {
        "additionalProperties": false,
        "properties": {
          "campaign_code": {
            "type": "string"
          },
          "description": {
            "items": {
              "$ref": "#/components/schemas/localization.LocalizedText"
            },
            "type": "array"
          },
          "effective_status": {
            "type": "string"
          },
          "ends_at": {
            "format": "date-time",
            "type": "string"
          },
          "media": {
            "$ref": "#/components/schemas/security.ObjectMedia"
          },
          "offers": {
            "items": {
              "$ref": "#/components/schemas/campaignoffers.OfferProjection"
            },
            "type": "array"
          },
          "placements": {
            "items": {
              "$ref": "#/components/schemas/campaign.Placement"
            },
            "type": "array"
          },
          "publication_revision": {
            "type": "integer"
          },
          "revision": {
            "type": "integer"
          },
          "starts_at": {
            "format": "date-time",
            "type": "string"
          },
          "title": {
            "items": {
              "$ref": "#/components/schemas/localization.LocalizedName"
            },
            "type": "array"
          }
        },
        "required": [
          "campaign_code",
          "title",
          "placements",
          "offers",
          "revision",
          "publication_revision",
          "effective_status",
          "starts_at",
          "ends_at"
        ],
        "type": "object"
      },
      "campaigns.StorefrontGroups": {
        "additionalProperties": false,
        "properties": {
          "positions": {
            "items": {
              "$ref": "#/components/schemas/campaigns.PositionGroup"
            },
            "type": "array"
          }
        },
        "required": [
          "positions"
        ],
        "type": "object"
      },
      "campaigns.ValidationFinding": {
        "additionalProperties": false,
        "properties": {
          "field": {
            "type": "string"
          },
          "reason": {
            "type": "string"
          }
        },
        "required": [
          "field",
          "reason"
        ],
        "type": "object"
      },
      "campaigns.ValidationResult": {
        "additionalProperties": false,
        "properties": {
          "expires_at": {
            "format": "date-time",
            "type": "string"
          },
          "findings": {
            "items": {
              "$ref": "#/components/schemas/campaigns.ValidationFinding"
            },
            "type": "array"
          },
          "offers": {
            "items": {
              "$ref": "#/components/schemas/campaigns.OperationOffer"
            },
            "type": "array"
          },
          "review_token": {
            "type": "string"
          },
          "valid": {
            "type": "boolean"
          }
        },
        "required": [
          "valid",
          "findings",
          "offers"
        ],
        "type": "object"
      },
      "classification_enums.StorageType": {
        "enum": [
          "AMBIENT",
          "CHILLED",
          "FROZEN"
        ],
        "type": "string",
        "x-enum-varnames": [
          "StorageAmbient",
          "StorageChilled",
          "StorageFrozen"
        ]
      },
      "commerce_enums.OrderType": {
        "type": "string"
      },
      "coupon.Benefit": {
        "additionalProperties": false,
        "properties": {
          "amount": {
            "$ref": "#/components/schemas/money.Money"
          },
          "basis_points": {
            "type": "integer"
          },
          "free_shipping": {
            "type": "boolean"
          },
          "maximum_discount": {
            "$ref": "#/components/schemas/money.Money"
          }
        },
        "required": [],
        "type": "object"
      },
      "coupon.CouponContent": {
        "additionalProperties": false,
        "properties": {
          "descriptions": {
            "items": {
              "$ref": "#/components/schemas/localization.LocalizedDescription"
            },
            "type": "array"
          },
          "names": {
            "items": {
              "$ref": "#/components/schemas/localization.LocalizedName"
            },
            "type": "array"
          }
        },
        "required": [
          "names"
        ],
        "type": "object"
      },
      "coupon.Inheritance": {
        "additionalProperties": false,
        "properties": {
          "acquisition_window": {
            "$ref": "#/components/schemas/coupon_enums.InheritanceSource"
          },
          "redemption_window": {
            "$ref": "#/components/schemas/coupon_enums.InheritanceSource"
          },
          "scope": {
            "$ref": "#/components/schemas/coupon_enums.InheritanceSource"
          }
        },
        "required": [
          "scope",
          "acquisition_window",
          "redemption_window"
        ],
        "type": "object"
      },
      "coupon.ProfileCompletionRestriction": {
        "additionalProperties": false,
        "properties": {
          "active": {
            "type": "boolean"
          }
        },
        "required": [
          "active"
        ],
        "type": "object"
      },
      "coupon.ReceivingEligibility": {
        "additionalProperties": false,
        "properties": {
          "geographic_scope": {
            "$ref": "#/components/schemas/geography.GeographicScope"
          },
          "membership": {
            "$ref": "#/components/schemas/coupon.ReceivingTierPolicy"
          },
          "profile": {
            "$ref": "#/components/schemas/coupon.ProfileCompletionRestriction"
          }
        },
        "required": [
          "membership",
          "profile"
        ],
        "type": "object"
      },
      "coupon.ReceivingTierPolicy": {
        "additionalProperties": false,
        "properties": {
          "match": {
            "$ref": "#/components/schemas/coupon_enums.TierMatch"
          },
          "specification": {
            "$ref": "#/components/schemas/coupon_enums.TierSpecification"
          },
          "tier_key": {
            "type": "string"
          }
        },
        "required": [
          "specification"
        ],
        "type": "object"
      },
      "coupon.RedemptionEligibility": {
        "additionalProperties": false,
        "properties": {
          "membership": {
            "$ref": "#/components/schemas/coupon.TierRestriction"
          }
        },
        "required": [
          "membership"
        ],
        "type": "object"
      },
      "coupon.RedemptionLimits": {
        "additionalProperties": false,
        "properties": {
          "per_entitlement": {
            "type": "integer"
          },
          "total": {
            "type": "integer"
          }
        },
        "required": [],
        "type": "object"
      },
      "coupon.TierRestriction": {
        "additionalProperties": false,
        "properties": {
          "active": {
            "type": "boolean"
          },
          "match": {
            "$ref": "#/components/schemas/coupon_enums.TierMatch"
          },
          "tier_key": {
            "type": "string"
          }
        },
        "required": [
          "active"
        ],
        "type": "object"
      },
      "coupon_enums.Acquisition": {
        "enum": [
          "self_claim",
          "automatic",
          "manual_assignment",
          "referral"
        ],
        "type": "string"
      },
      "coupon_enums.AutomaticPolicy": {
        "enum": [
          "once_when_live",
          "while_active"
        ],
        "type": "string"
      },
      "coupon_enums.InheritanceSource": {
        "enum": [
          "campaign",
          "independent"
        ],
        "type": "string"
      },
      "coupon_enums.TierMatch": {
        "type": "string"
      },
      "coupon_enums.TierSpecification": {
        "type": "string"
      },
      "coupon_enums.Visibility": {
        "enum": [
          "public",
          "campaign_only",
          "unlisted"
        ],
        "type": "string"
      },
      "courier.DeliveryCompanyRef": {
        "description": "Customer preference display snapshot; checkout revalidates company and availability with Supply.",
        "properties": {
          "code": {
            "maxLength": 32,
            "type": "string"
          },
          "name": {
            "maxLength": 200,
            "type": "string"
          },
          "revision": {
            "format": "int64",
            "minimum": 0,
            "type": "integer"
          }
        },
        "required": [
          "code",
          "name",
          "revision"
        ],
        "type": "object"
      },
      "geography.Address": {
        "description": "Saved customer and organisation addresses support manual entry without provider verification. Line1, locality and an ISO 3166-1 alpha-2 country code are required by persistence. Administrative area and postal code are optional; a supplied subdivision code must start with the country code and a hyphen, and a supplied type must be a valid enum. Postal codes may use any format up to 32 bytes without control characters. Display names may be localized. Saved retail addresses also require a label. Saving an address does not establish delivery coverage, charges or a commercial market. The optional Australian address-verification endpoints apply their own stricter format checks.",
        "properties": {
          "administrative_area": {
            "$ref": "#/components/schemas/geography.AdministrativeAreaRef"
          },
          "country": {
            "$ref": "#/components/schemas/geography.CountryRef"
          },
          "formatted_address": {
            "type": "string"
          },
          "label": {
            "type": "string"
          },
          "latitude": {
            "type": "number"
          },
          "line1": {
            "type": "string"
          },
          "line2": {
            "type": "string"
          },
          "locality": {
            "description": "Locality covers a city, suburb, town, municipality, or equivalent\npostal locality.",
            "type": "string"
          },
          "longitude": {
            "type": "number"
          },
          "place_id": {
            "type": "string"
          },
          "postal_code": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "geography.AdministrativeAreaRef": {
        "properties": {
          "code": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "type": {
            "$ref": "#/components/schemas/geography_enums.AdministrativeAreaType"
          }
        },
        "type": "object"
      },
      "geography.CountryCode": {
        "type": "string"
      },
      "geography.CountryRef": {
        "properties": {
          "code": {
            "type": "string"
          },
          "name": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "geography.GeographicContext": {
        "additionalProperties": false,
        "properties": {
          "evaluation_timezone": {
            "type": "string"
          },
          "market_code": {
            "type": "string"
          },
          "matched_path": {
            "$ref": "#/components/schemas/geography.GeographicPath"
          },
          "path": {
            "$ref": "#/components/schemas/geography.GeographicPath"
          },
          "rule_revision": {
            "type": "integer"
          },
          "scope_revision": {
            "type": "integer"
          },
          "source": {
            "$ref": "#/components/schemas/geography_enums.GeographicContextSource"
          }
        },
        "required": [
          "source",
          "scope_revision",
          "rule_revision",
          "evaluation_timezone"
        ],
        "type": "object"
      },
      "geography.GeographicPath": {
        "additionalProperties": false,
        "properties": {
          "country_code": {
            "$ref": "#/components/schemas/geography.CountryCode"
          },
          "depot_code": {
            "type": "string"
          },
          "market_code": {
            "type": "string"
          },
          "state_code": {
            "$ref": "#/components/schemas/geography.SubdivisionCode"
          }
        },
        "required": [
          "country_code"
        ],
        "type": "object"
      },
      "geography.GeographicScope": {
        "additionalProperties": false,
        "properties": {
          "mode": {
            "$ref": "#/components/schemas/geography_enums.GeographicScopeMode"
          },
          "targets": {
            "items": {
              "$ref": "#/components/schemas/geography.GeographicPath"
            },
            "type": "array"
          }
        },
        "required": [
          "mode"
        ],
        "type": "object"
      },
      "geography.SubdivisionCode": {
        "type": "string"
      },
      "geography_enums.AdministrativeAreaType": {
        "enum": [
          "STATE",
          "TERRITORY",
          "PROVINCE",
          "PREFECTURE",
          "REGION",
          "DISTRICT"
        ],
        "type": "string",
        "x-enum-varnames": [
          "AdministrativeAreaState",
          "AdministrativeAreaTerritory",
          "AdministrativeAreaProvince",
          "AdministrativeAreaPrefecture",
          "AdministrativeAreaRegion",
          "AdministrativeAreaDistrict"
        ]
      },
      "geography_enums.GeographicContextSource": {
        "type": "string"
      },
      "geography_enums.GeographicScopeMode": {
        "type": "string"
      },
      "geography_enums.GeographicTargetKind": {
        "enum": [
          "COUNTRY",
          "MARKET",
          "STATE",
          "DEPOT"
        ],
        "type": "string",
        "x-enum-varnames": [
          "GeographicTargetCountry",
          "GeographicTargetMarket",
          "GeographicTargetState",
          "GeographicTargetDepot"
        ]
      },
      "github_com_Potato-Mart_Backend-Customers_internal_modules_retailcustomers.CreateInput": {
        "description": "Address lists and both default snapshots are saved atomically. Defaults select list members by id, or by an exact unique normalized address match when id is omitted. List entries are authoritative; supplied snapshot values do not overwrite them. Omitted or null default fields do not clear a selection. Removing a selected member from a replacement list clears its defaults without choosing a replacement.",
        "properties": {
          "account_id": {
            "type": "string"
          },
          "auth_identity_id": {
            "type": "string"
          },
          "auth_user_id": {
            "type": "string"
          },
          "billing_same_as_delivery": {
            "description": "True selects the shipping default for billing and requires a shipping selection. An explicitly different billing selection conflicts with true. The stored flag is true exactly when both defaults select the same member.",
            "type": "boolean"
          },
          "classification": {
            "$ref": "#/components/schemas/security_enums.DataClassification"
          },
          "contains_pii": {
            "type": "boolean"
          },
          "contains_sensitive_pii": {
            "type": "boolean"
          },
          "data_owner_id": {
            "type": "string"
          },
          "date_of_birth": {
            "type": "string"
          },
          "default_billing": {
            "allOf": [
              {
                "$ref": "#/components/schemas/party.ContactAddress"
              }
            ],
            "description": "Select a saved list member by id (an id-only object is accepted), or supply its complete normalized address before ids exist. The response uses the canonical list member."
          },
          "default_shipping": {
            "allOf": [
              {
                "$ref": "#/components/schemas/party.ContactAddress"
              }
            ],
            "description": "Select a saved list member by id (an id-only object is accepted), or supply its complete normalized address before ids exist. The response uses the canonical list member."
          },
          "deletion_completed_at": {
            "type": "string"
          },
          "deletion_requested_at": {
            "type": "string"
          },
          "email": {
            "type": "string"
          },
          "first_name": {
            "type": "string"
          },
          "gender": {
            "$ref": "#/components/schemas/retail_enums.CustomerGender"
          },
          "identifier_preview_token": {
            "type": "string"
          },
          "last_name": {
            "type": "string"
          },
          "legal_hold": {
            "type": "boolean"
          },
          "notes": {
            "type": "string"
          },
          "phone": {
            "description": "E.164 profile phone (a plus sign followed by 2-15 ASCII digits, with a nonzero first digit). Surrounding whitespace is trimmed. National numbers, formatting and extensions are rejected; no country is inferred. Empty or whitespace-only values store an empty phone.",
            "example": "+61412345678",
            "type": "string"
          },
          "preferred_delivery_slot": {
            "$ref": "#/components/schemas/shipping.PreferredDeliverySlot"
          },
          "protection_basis": {
            "$ref": "#/components/schemas/security_enums.DataProtectionBasis"
          },
          "referral_code": {
            "type": "string"
          },
          "retention_policy_key": {
            "type": "string"
          },
          "retention_until": {
            "type": "string"
          },
          "shipping_list": {
            "description": "Complete saved address list, including shipping and billing members. Maximum 20 entries with unique ids and required address labels. Missing ids are generated and returned; retain returned ids on later writes. Empty list clears both defaults.",
            "items": {
              "$ref": "#/components/schemas/party.ContactAddress"
            },
            "maxItems": 20,
            "type": "array",
            "uniqueItems": false
          },
          "source": {
            "description": "\"online\" | \"pos\" | \"import\" | \"manual\" | \"phone\"",
            "type": "string"
          },
          "status": {
            "$ref": "#/components/schemas/retail_enums.CustomerStatus"
          },
          "tags": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "uniqueItems": false
          }
        },
        "required": [
          "email"
        ],
        "type": "object"
      },
      "github_com_Potato-Mart_Backend-Customers_internal_platform_apiresponse.Error": {
        "properties": {
          "code": {
            "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_apiresponse_apiresponse_enums.Code"
          },
          "details": {
            "additionalProperties": {
              "type": "string"
            },
            "type": "object"
          },
          "message": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "github_com_Potato-Mart_Backend-Customers_internal_platform_apiresponse_apiresponse_enums.Code": {
        "enum": [
          "INTERNAL_ERROR",
          "BAD_REQUEST",
          "VALIDATION_ERROR",
          "NOT_FOUND",
          "CONFLICT",
          "UNAUTHORIZED",
          "FORBIDDEN",
          "TOO_MANY_REQUESTS",
          "REQUEST_BODY_TOO_LARGE",
          "SERVICE_UNAVAILABLE",
          "AUTH_INVALID_CREDENTIALS",
          "AUTH_INVALID_TOKEN",
          "AUTH_EXPIRED_TOKEN",
          "AUTH_WRONG_PORTAL",
          "AUTH_ACCOUNT_DISABLED",
          "AUTH_MFA_REQUIRED",
          "AUTH_REAUTH_REQUIRED",
          "EMAIL_VERIFICATION_REQUIRED",
          "SECURITY_POLICY_VIOLATION",
          "IDENTITY_ACCOUNT_TYPE_NOT_ALLOWED",
          "IDENTITY_PORTAL_ACCESS_DENIED",
          "IDENTITY_PORTAL_ACCESS_REVOKED",
          "IDENTITY_ACCOUNT_SUSPENDED",
          "IDENTITY_AUTH_IDENTITY_DISABLED",
          "IDENTITY_MFA_REQUIRED",
          "IDENTITY_WHOLESALE_ORGANISATION_NOT_APPROVED",
          "IDENTITY_ORGANISATION_ACCESS_REQUIRED",
          "MEMBERSHIP_NOT_FOUND",
          "MEMBERSHIP_INACTIVE",
          "MEMBERSHIP_INSUFFICIENT_POINTS",
          "MEMBERSHIP_REWARD_UNAVAILABLE",
          "MEMBERSHIP_POINT_RESERVATION_EXPIRED",
          "USER_EMAIL_TAKEN",
          "SKU_CODE_TAKEN",
          "STORAGE_LOCATION_CODE_TAKEN",
          "PRODUCT_CODE_TAKEN",
          "STORAGE_MISMATCH",
          "INSUFFICIENT_STOCK",
          "ORDER_INVALID_TRANSITION",
          "ORDER_TERMINAL",
          "ORDER_EMPTY",
          "CART_NOT_ACTIVE",
          "DISCOUNT_NOT_FOUND",
          "DISCOUNT_INACTIVE",
          "DISCOUNT_NOT_STARTED",
          "DISCOUNT_EXPIRED",
          "DISCOUNT_EXHAUSTED",
          "DISCOUNT_MIN_NOT_MET",
          "DISCOUNT_CODE_TAKEN",
          "DISCOUNT_INAPPLICABLE",
          "TERMINAL_NOT_CONNECTED",
          "TERMINAL_NOT_REGISTERED",
          "TERMINAL_OUTCOME_UNKNOWN",
          "TERMINAL_SIGNATURE_FAIL",
          "TERMINAL_TIMEOUT",
          "TERMINAL_REQUEST_REJECTED",
          "TERMINAL_BUSY"
        ],
        "type": "string",
        "x-enum-varnames": [
          "CodeInternal",
          "CodeBadRequest",
          "CodeValidation",
          "CodeNotFound",
          "CodeConflict",
          "CodeUnauthorized",
          "CodeForbidden",
          "CodeTooManyRequests",
          "CodeRequestTooLarge",
          "CodeServiceUnavailable",
          "CodeAuthInvalidCredentials",
          "CodeAuthInvalidToken",
          "CodeAuthExpiredToken",
          "CodeAuthWrongPortal",
          "CodeAuthAccountDisabled",
          "CodeAuthMFARequired",
          "CodeAuthReauthRequired",
          "CodeEmailVerificationRequired",
          "CodeSecurityPolicyViolation",
          "CodeIdentityAccountTypeNotAllowed",
          "CodeIdentityPortalAccessDenied",
          "CodeIdentityPortalAccessRevoked",
          "CodeIdentityAccountSuspended",
          "CodeIdentityAuthIdentityDisabled",
          "CodeIdentityMFARequired",
          "CodeIdentityWholesaleOrganisationNotApproved",
          "CodeIdentityOrganisationAccessRequired",
          "CodeMembershipNotFound",
          "CodeMembershipInactive",
          "CodeMembershipInsufficientPoints",
          "CodeMembershipRewardUnavailable",
          "CodeMembershipPointReservationExpired",
          "CodeUserEmailTaken",
          "CodeSKUCodeTaken",
          "CodeStorageLocationCodeTaken",
          "CodeProductCodeTaken",
          "CodeStorageMismatch",
          "CodeInsufficientStock",
          "CodeOrderInvalidTransition",
          "CodeOrderTerminal",
          "CodeOrderEmpty",
          "CodeCartNotActive",
          "CodeDiscountNotFound",
          "CodeDiscountInactive",
          "CodeDiscountNotStarted",
          "CodeDiscountExpired",
          "CodeDiscountExhausted",
          "CodeDiscountMinNotMet",
          "CodeDiscountCodeTaken",
          "CodeDiscountInapplicable",
          "CodeTerminalNotConnected",
          "CodeTerminalNotRegistered",
          "CodeTerminalOutcomeUnknown",
          "CodeTerminalSignatureFail",
          "CodeTerminalTimeout",
          "CodeTerminalRequestRejected",
          "CodeTerminalBusy"
        ]
      },
      "github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse": {
        "properties": {
          "data": {},
          "error": {
            "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_apiresponse.Error"
          },
          "success": {
            "type": "boolean"
          }
        },
        "type": "object"
      },
      "github_com_Potato-Mart_Backend-Customers_internal_platform_paging.PageResponse": {
        "properties": {
          "page": {
            "type": "integer"
          },
          "page_size": {
            "type": "integer"
          },
          "total_items": {
            "type": "integer"
          },
          "total_pages": {
            "type": "integer"
          }
        },
        "type": "object"
      },
      "github_com_Potato-Mart_Backend-Shared-Contract_v35_pkg_contracts_common_money.Money": {
        "properties": {
          "amount_minor": {
            "type": "integer"
          },
          "currency": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "internal_modules_businessregistry.LookupResult": {
        "properties": {
          "abn": {
            "type": "string"
          },
          "abn_current": {
            "type": "boolean"
          },
          "acn": {
            "type": "string"
          },
          "advisory": {
            "type": "boolean"
          },
          "business_names": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "uniqueItems": false
          },
          "entity_name": {
            "type": "string"
          },
          "entity_status": {
            "type": "string"
          },
          "entity_status_effective_at": {
            "type": "string"
          },
          "entity_type_code": {
            "type": "string"
          },
          "entity_type_name": {
            "type": "string"
          },
          "gst_registered_from": {
            "type": "string"
          },
          "postcode": {
            "type": "string"
          },
          "register_last_updated_at": {
            "type": "string"
          },
          "replaced_abn": {
            "type": "string"
          },
          "retrieved_at": {
            "type": "string"
          },
          "state": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "internal_modules_businessregistry.lookupResponse": {
        "properties": {
          "data": {
            "$ref": "#/components/schemas/internal_modules_businessregistry.LookupResult"
          },
          "success": {
            "type": "boolean"
          }
        },
        "type": "object"
      },
      "internal_modules_campaigns.PromotionReadinessResult": {
        "properties": {
          "campaign_code": {
            "type": "string"
          },
          "campaign_id": {
            "type": "string"
          },
          "geographic_scope": {
            "$ref": "#/components/schemas/geography.GeographicScope"
          },
          "ready": {
            "type": "boolean"
          },
          "schedule_timezone": {
            "type": "string"
          },
          "scope_revision": {
            "type": "integer"
          }
        },
        "type": "object"
      },
      "internal_modules_campaigns.notificationCampaignResponse": {
        "properties": {
          "data": {
            "$ref": "#/components/schemas/campaigns.NotificationCampaignView"
          },
          "success": {
            "type": "boolean"
          }
        },
        "required": [
          "data",
          "success"
        ],
        "type": "object"
      },
      "internal_modules_campaigns.promotionReadinessResponse": {
        "properties": {
          "data": {
            "$ref": "#/components/schemas/internal_modules_campaigns.PromotionReadinessResult"
          },
          "success": {
            "type": "boolean"
          }
        },
        "required": [
          "data",
          "success"
        ],
        "type": "object"
      },
      "internal_modules_groupordermanagerapplications.CreateInput": {
        "properties": {
          "applicant_note": {
            "type": "string"
          },
          "proposed_group_name": {
            "type": "string"
          }
        },
        "required": [
          "proposed_group_name"
        ],
        "type": "object"
      },
      "internal_modules_groupordermanagerapplications.DecisionInput": {
        "properties": {
          "reason": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "internal_modules_media.FinalizeRequest": {
        "properties": {
          "media_code": {
            "type": "string"
          }
        },
        "required": [
          "media_code"
        ],
        "type": "object"
      },
      "internal_modules_media.UploadRequest": {
        "description": "membership-tier-card accepts JPEG, PNG, WebP, GIF and AVIF only, at most 10 MiB. SVG/PDF are rejected. Finalize reads actual generation-bound bytes, checks declared MIME, decodes an image and requires dimensions \u003c=8192 per edge and \u003c=16000000 pixels. Upload ownership binds to authenticated staff. Required signed PUT headers include x-goog-if-generation-match: 0; a ticket cannot overwrite an existing object. No new bucket is created for this folder.",
        "properties": {
          "classification": {
            "$ref": "#/components/schemas/security_enums.DataClassification"
          },
          "contains_pii": {
            "type": "boolean"
          },
          "contains_sensitive_pii": {
            "type": "boolean"
          },
          "data_owner_id": {
            "type": "string"
          },
          "deletion_completed_at": {
            "type": "string"
          },
          "deletion_requested_at": {
            "type": "string"
          },
          "filename": {
            "type": "string"
          },
          "folder": {
            "type": "string"
          },
          "legal_hold": {
            "type": "boolean"
          },
          "mime_type": {
            "type": "string"
          },
          "protection_basis": {
            "$ref": "#/components/schemas/security_enums.DataProtectionBasis"
          },
          "retention_policy_key": {
            "type": "string"
          },
          "retention_until": {
            "type": "string"
          },
          "size_bytes": {
            "type": "integer"
          }
        },
        "required": [
          "filename",
          "folder",
          "mime_type",
          "size_bytes"
        ],
        "type": "object"
      },
      "internal_modules_media.selfAvatarFinalizeRequest": {
        "properties": {
          "media_code": {
            "type": "string"
          }
        },
        "required": [
          "media_code"
        ],
        "type": "object"
      },
      "internal_modules_media.selfAvatarUploadRequest": {
        "additionalProperties": false,
        "properties": {
          "content_type": {
            "type": "string"
          },
          "file_name": {
            "type": "string"
          },
          "size_bytes": {
            "minimum": 1,
            "type": "integer"
          }
        },
        "required": [
          "file_name",
          "content_type",
          "size_bytes"
        ],
        "type": "object"
      },
      "internal_modules_places.ResolveRequest": {
        "properties": {
          "place_id": {
            "maxLength": 500,
            "type": "string"
          },
          "session": {
            "maxLength": 128,
            "type": "string"
          }
        },
        "required": [
          "place_id",
          "session"
        ],
        "type": "object"
      },
      "internal_modules_places.SearchRequest": {
        "properties": {
          "query": {
            "maxLength": 200,
            "type": "string"
          },
          "session": {
            "maxLength": 128,
            "type": "string"
          }
        },
        "required": [
          "query",
          "session"
        ],
        "type": "object"
      },
      "internal_modules_pos.summaryListData": {
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/retail.RetailCustomerSummary"
            },
            "type": "array",
            "uniqueItems": false
          },
          "page": {
            "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_paging.PageResponse"
          }
        },
        "type": "object"
      },
      "internal_modules_pos.summaryListResponse": {
        "properties": {
          "data": {
            "$ref": "#/components/schemas/internal_modules_pos.summaryListData"
          },
          "success": {
            "type": "boolean"
          }
        },
        "type": "object"
      },
      "internal_modules_pos.summaryResponse": {
        "properties": {
          "data": {
            "$ref": "#/components/schemas/retail.RetailCustomerSummary"
          },
          "success": {
            "type": "boolean"
          }
        },
        "type": "object"
      },
      "internal_modules_profilegeography.Result": {
        "description": "Buyer-owned address snapshot, including manually entered overseas addresses. The source and revision identify the profile evidence; they do not determine the commercial market or prove delivery serviceability.",
        "properties": {
          "address": {
            "$ref": "#/components/schemas/geography.Address"
          },
          "captured_at": {
            "format": "date-time",
            "type": "string"
          },
          "profile_revision": {
            "format": "int64",
            "type": "integer"
          },
          "source": {
            "$ref": "#/components/schemas/geography_enums.GeographicContextSource"
          }
        },
        "required": [
          "address",
          "captured_at",
          "profile_revision",
          "source"
        ],
        "type": "object"
      },
      "internal_modules_profilegeography.response": {
        "properties": {
          "data": {
            "$ref": "#/components/schemas/internal_modules_profilegeography.Result"
          },
          "success": {
            "type": "boolean"
          }
        },
        "required": [
          "data",
          "success"
        ],
        "type": "object"
      },
      "internal_modules_retailcustomers.ClaimProfileInput": {
        "additionalProperties": false,
        "properties": {
          "account_id": {
            "description": "Nonzero canonical owned retail account ID.",
            "pattern": "^[0-9a-f]{24}$",
            "type": "string"
          },
          "auth_identity_id": {
            "description": "Nonzero canonical active customer credential ID.",
            "pattern": "^[0-9a-f]{24}$",
            "type": "string"
          },
          "email": {
            "description": "Canonical verified Identity mailbox; used for exact target lookup.",
            "format": "email",
            "maxLength": 254,
            "type": "string"
          },
          "operation_id": {
            "description": "Immutable Identity claim operation, reused exactly on every retry.",
            "pattern": "^[A-Za-z0-9][A-Za-z0-9_-]{15,127}$",
            "type": "string"
          },
          "referral_code": {
            "description": "Must be omitted or empty. Existing referral attribution is preserved.",
            "enum": [
              ""
            ],
            "type": "string"
          },
          "user_id": {
            "description": "Nonzero canonical Identity user ID.",
            "pattern": "^[0-9a-f]{24}$",
            "type": "string"
          }
        },
        "required": [
          "operation_id",
          "user_id",
          "account_id",
          "auth_identity_id",
          "email"
        ],
        "type": "object"
      },
      "internal_modules_retailcustomers.CreateInput": {
        "description": "Address lists and both default snapshots are saved atomically. Defaults select list members by id, or by an exact unique normalized address match when id is omitted. List entries are authoritative; supplied snapshot values do not overwrite them. Omitted or null default fields do not clear a selection. Removing a selected member from a replacement list clears its defaults without choosing a replacement.",
        "properties": {
          "account_id": {
            "type": "string"
          },
          "auth_identity_id": {
            "type": "string"
          },
          "auth_user_id": {
            "type": "string"
          },
          "billing_same_as_delivery": {
            "description": "True selects the shipping default for billing and requires a shipping selection. An explicitly different billing selection conflicts with true. The stored flag is true exactly when both defaults select the same member.",
            "type": "boolean"
          },
          "classification": {
            "$ref": "#/components/schemas/security_enums.DataClassification"
          },
          "contains_pii": {
            "type": "boolean"
          },
          "contains_sensitive_pii": {
            "type": "boolean"
          },
          "data_owner_id": {
            "type": "string"
          },
          "date_of_birth": {
            "type": "string"
          },
          "default_billing": {
            "allOf": [
              {
                "$ref": "#/components/schemas/party.ContactAddress"
              }
            ],
            "description": "Select a saved list member by id (an id-only object is accepted), or supply its complete normalized address before ids exist. The response uses the canonical list member."
          },
          "default_shipping": {
            "allOf": [
              {
                "$ref": "#/components/schemas/party.ContactAddress"
              }
            ],
            "description": "Select a saved list member by id (an id-only object is accepted), or supply its complete normalized address before ids exist. The response uses the canonical list member."
          },
          "deletion_completed_at": {
            "type": "string"
          },
          "deletion_requested_at": {
            "type": "string"
          },
          "email": {
            "type": "string"
          },
          "first_name": {
            "type": "string"
          },
          "gender": {
            "$ref": "#/components/schemas/retail_enums.CustomerGender"
          },
          "identifier_preview_token": {
            "type": "string"
          },
          "last_name": {
            "type": "string"
          },
          "legal_hold": {
            "type": "boolean"
          },
          "notes": {
            "type": "string"
          },
          "phone": {
            "description": "E.164 profile phone (a plus sign followed by 2-15 ASCII digits, with a nonzero first digit). Surrounding whitespace is trimmed. National numbers, formatting and extensions are rejected; no country is inferred. Empty or whitespace-only values store an empty phone.",
            "example": "+61412345678",
            "type": "string"
          },
          "preferred_delivery_slot": {
            "$ref": "#/components/schemas/shipping.PreferredDeliverySlot"
          },
          "protection_basis": {
            "$ref": "#/components/schemas/security_enums.DataProtectionBasis"
          },
          "referral_code": {
            "type": "string"
          },
          "retention_policy_key": {
            "type": "string"
          },
          "retention_until": {
            "type": "string"
          },
          "shipping_list": {
            "description": "Complete saved address list, including shipping and billing members. Maximum 20 entries with unique ids and required address labels. Missing ids are generated and returned; retain returned ids on later writes. Empty list clears both defaults.",
            "items": {
              "$ref": "#/components/schemas/party.ContactAddress"
            },
            "maxItems": 20,
            "type": "array",
            "uniqueItems": false
          },
          "source": {
            "description": "\"online\" | \"pos\" | \"import\" | \"manual\" | \"phone\"",
            "type": "string"
          },
          "status": {
            "$ref": "#/components/schemas/retail_enums.CustomerStatus"
          },
          "tags": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "uniqueItems": false
          }
        },
        "required": [
          "email"
        ],
        "type": "object"
      },
      "internal_modules_retailcustomers.IdentifierPreview": {
        "properties": {
          "customer_number": {
            "type": "string"
          },
          "expires_at": {
            "type": "string"
          },
          "preview_token": {
            "type": "string"
          },
          "referral_code": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "internal_modules_retailcustomers.ReceiptPreferencesInput": {
        "properties": {
          "formats": {
            "items": {
              "$ref": "#/components/schemas/preference_enums.ReceiptFormat"
            },
            "type": "array",
            "uniqueItems": false
          }
        },
        "required": [
          "formats"
        ],
        "type": "object"
      },
      "internal_modules_retailcustomers.ReferralCapacity": {
        "additionalProperties": false,
        "properties": {
          "at_limit": {
            "description": "True when no unreserved reward capacity remains, including capacity temporarily exhausted by reservations.",
            "type": "boolean"
          },
          "code": {
            "example": "ABCDEF",
            "pattern": "^[A-Z]{6}$",
            "type": "string"
          },
          "referrer_reward_limit": {
            "description": "Current configured referrer_coupon_ids list length. There is no built-in reward count.",
            "format": "int64",
            "minimum": 0,
            "type": "integer"
          },
          "referrer_rewards_issued": {
            "description": "Issued referrer rewards, excluding this customer's own friend reward.",
            "format": "int64",
            "minimum": 0,
            "type": "integer"
          },
          "referrer_rewards_remaining": {
            "description": "Unreserved reward capacity, clamped at zero after subtracting issued and reserved rewards from the enforced limit. This is not an invitation quota or programme eligibility decision.",
            "format": "int64",
            "minimum": 0,
            "type": "integer"
          },
          "referrer_rewards_reserved": {
            "description": "In-flight referrer rewards that already consume reward capacity.",
            "format": "int64",
            "minimum": 0,
            "type": "integer"
          }
        },
        "required": [
          "code",
          "referrer_reward_limit",
          "referrer_rewards_issued",
          "referrer_rewards_reserved",
          "referrer_rewards_remaining",
          "at_limit"
        ],
        "type": "object"
      },
      "internal_modules_retailcustomers.SavedAddressInput": {
        "description": "A labeled saved address. Create assigns a server id. Replacement preserves the path id and synchronizes both default snapshots that reference it. The first address becomes shipping default only when is_default is omitted; explicit false prevents selection on create. On replacement, false does not clear an existing default.",
        "properties": {
          "address": {
            "$ref": "#/components/schemas/geography.Address"
          },
          "contact": {
            "$ref": "#/components/schemas/party.Recipient"
          },
          "id": {
            "type": "string"
          },
          "is_default": {
            "type": "boolean"
          }
        },
        "required": [
          "address"
        ],
        "type": "object"
      },
      "internal_modules_retailcustomers.SelfProfileUpdateInput": {
        "description": "Address lists and both default snapshots are saved atomically. Defaults select list members by id, or by an exact unique normalized address match when id is omitted. List entries are authoritative; supplied snapshot values do not overwrite them. Omitted or null default fields do not clear a selection. Removing a selected member from a replacement list clears its defaults without choosing a replacement.",
        "properties": {
          "billing_same_as_delivery": {
            "description": "True selects the shipping default for billing and requires a shipping selection. An explicitly different billing selection conflicts with true. The stored flag is true exactly when both defaults select the same member.",
            "type": "boolean"
          },
          "date_of_birth": {
            "type": "string"
          },
          "default_billing": {
            "allOf": [
              {
                "$ref": "#/components/schemas/party.ContactAddress"
              }
            ],
            "description": "Select a saved list member by id (an id-only object is accepted), or supply its complete normalized address before ids exist. The response uses the canonical list member."
          },
          "default_shipping": {
            "allOf": [
              {
                "$ref": "#/components/schemas/party.ContactAddress"
              }
            ],
            "description": "Select a saved list member by id (an id-only object is accepted), or supply its complete normalized address before ids exist. The response uses the canonical list member."
          },
          "first_name": {
            "type": "string"
          },
          "gender": {
            "$ref": "#/components/schemas/retail_enums.CustomerGender"
          },
          "last_name": {
            "type": "string"
          },
          "phone": {
            "description": "E.164 profile phone (a plus sign followed by 2-15 ASCII digits, with a nonzero first digit). Surrounding whitespace is trimmed. National numbers, formatting and extensions are rejected; no country is inferred. Omitted or null leaves the phone unchanged; empty or whitespace-only clears it. Updates only basic_info.contacts.phone. Saved address recipient phones and shipping/billing snapshots are unchanged; edit recipient phones through the address routes.",
            "example": "+61412345678",
            "type": "string"
          },
          "preferred_contact_method": {
            "$ref": "#/components/schemas/preference_enums.PreferredContactMethod"
          },
          "preferred_delivery_slot": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/shipping.PreferredDeliverySlot"
              },
              {
                "type": "null"
              }
            ],
            "description": "Omitted retains the saved preference. An object replaces it after validation. Explicit null removes it atomically with profile history and the profile-updated event; repeated clearing is a no-op."
          },
          "shipping_addresses": {
            "description": "Complete saved address list, including shipping and billing members. Maximum 20 entries with unique ids and required address labels. Missing ids are generated and returned; retain returned ids on later writes. Empty list clears both defaults.",
            "items": {
              "$ref": "#/components/schemas/party.ContactAddress"
            },
            "maxItems": 20,
            "type": "array",
            "uniqueItems": false
          }
        },
        "type": "object"
      },
      "internal_modules_retailcustomers.StatsSummary": {
        "additionalProperties": false,
        "description": "Exact counts over the same eligible records and filters as the staff list. With include_commerce=true, Orders supplies order history and Payments-owned captured receipts minus completed refunds by currency. Commerce is verified only when every cohort batch succeeds; owner failure leaves base customer counts available and commerce unavailable. Default requests retain unavailable nonempty commerce. Empty populations have verified zero totals. Results may be reused for at most 15 seconds from calculated_at; no customer identities or contact details are returned.",
        "properties": {
          "birthday_customers_this_month": {
            "format": "int64",
            "minimum": 0,
            "type": "integer"
          },
          "calculated_at": {
            "format": "date-time",
            "type": "string"
          },
          "commerce_status": {
            "enum": [
              "unavailable",
              "verified_empty",
              "verified"
            ],
            "type": "string"
          },
          "commerce_unavailable_reason": {
            "enum": [
              "source_unverified",
              null
            ],
            "type": [
              "string",
              "null"
            ]
          },
          "never_ordered_customers": {
            "format": "int64",
            "minimum": 0,
            "type": [
              "integer",
              "null"
            ]
          },
          "stale_customers": {
            "format": "int64",
            "minimum": 0,
            "type": [
              "integer",
              "null"
            ]
          },
          "time_zone": {
            "example": "Australia/Melbourne",
            "type": "string"
          },
          "total_customers": {
            "format": "int64",
            "minimum": 0,
            "type": "integer"
          },
          "total_orders": {
            "format": "int64",
            "minimum": 0,
            "type": [
              "integer",
              "null"
            ]
          },
          "total_spend_by_currency": {
            "items": {
              "additionalProperties": false,
              "properties": {
                "amount_minor": {
                  "format": "int64",
                  "type": "integer"
                },
                "currency": {
                  "type": "string"
                }
              },
              "required": [
                "currency",
                "amount_minor"
              ],
              "type": "object"
            },
            "type": [
              "array",
              "null"
            ]
          }
        },
        "required": [
          "total_customers",
          "birthday_customers_this_month",
          "total_orders",
          "total_spend_by_currency",
          "stale_customers",
          "never_ordered_customers",
          "commerce_status",
          "commerce_unavailable_reason",
          "calculated_at",
          "time_zone"
        ],
        "type": "object"
      },
      "internal_modules_retailcustomers.UpdateInput": {
        "description": "Address lists and both default snapshots are saved atomically. Defaults select list members by id, or by an exact unique normalized address match when id is omitted. List entries are authoritative; supplied snapshot values do not overwrite them. Omitted or null default fields do not clear a selection. Removing a selected member from a replacement list clears its defaults without choosing a replacement.",
        "properties": {
          "auth_user_id": {
            "type": "string"
          },
          "billing_same_as_delivery": {
            "description": "True selects the shipping default for billing and requires a shipping selection. An explicitly different billing selection conflicts with true. The stored flag is true exactly when both defaults select the same member.",
            "type": "boolean"
          },
          "classification": {
            "$ref": "#/components/schemas/security_enums.DataClassification"
          },
          "contains_pii": {
            "type": "boolean"
          },
          "contains_sensitive_pii": {
            "type": "boolean"
          },
          "data_owner_id": {
            "type": "string"
          },
          "date_of_birth": {
            "type": "string"
          },
          "default_billing": {
            "allOf": [
              {
                "$ref": "#/components/schemas/party.ContactAddress"
              }
            ],
            "description": "Select a saved list member by id (an id-only object is accepted), or supply its complete normalized address before ids exist. The response uses the canonical list member."
          },
          "default_shipping": {
            "allOf": [
              {
                "$ref": "#/components/schemas/party.ContactAddress"
              }
            ],
            "description": "Select a saved list member by id (an id-only object is accepted), or supply its complete normalized address before ids exist. The response uses the canonical list member."
          },
          "email": {
            "type": "string"
          },
          "first_name": {
            "type": "string"
          },
          "gender": {
            "$ref": "#/components/schemas/retail_enums.CustomerGender"
          },
          "last_name": {
            "type": "string"
          },
          "legal_hold": {
            "type": "boolean"
          },
          "notes": {
            "type": "string"
          },
          "phone": {
            "description": "E.164 profile phone (a plus sign followed by 2-15 ASCII digits, with a nonzero first digit). Surrounding whitespace is trimmed. National numbers, formatting and extensions are rejected; no country is inferred. Omitted or null leaves the phone unchanged; empty or whitespace-only clears it.",
            "example": "+61412345678",
            "type": "string"
          },
          "preferred_contact_method": {
            "$ref": "#/components/schemas/preference_enums.PreferredContactMethod"
          },
          "preferred_delivery_slot": {
            "$ref": "#/components/schemas/shipping.PreferredDeliverySlot"
          },
          "protection_basis": {
            "$ref": "#/components/schemas/security_enums.DataProtectionBasis"
          },
          "retention_policy_key": {
            "type": "string"
          },
          "retention_until": {
            "type": "string"
          },
          "shipping_list": {
            "description": "Complete saved address list, including shipping and billing members. Maximum 20 entries with unique ids and required address labels. Missing ids are generated and returned; retain returned ids on later writes. Empty list clears both defaults.",
            "items": {
              "$ref": "#/components/schemas/party.ContactAddress"
            },
            "maxItems": 20,
            "type": "array",
            "uniqueItems": false
          },
          "source": {
            "type": "string"
          },
          "status": {
            "$ref": "#/components/schemas/retail_enums.CustomerStatus"
          },
          "tags": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "uniqueItems": false
          }
        },
        "type": "object"
      },
      "internal_modules_retailcustomers.identifierPreviewResponse": {
        "properties": {
          "data": {
            "$ref": "#/components/schemas/internal_modules_retailcustomers.IdentifierPreview"
          },
          "success": {
            "type": "boolean"
          }
        },
        "type": "object"
      },
      "internal_modules_retailcustomers.referralCapacityResponse": {
        "additionalProperties": false,
        "properties": {
          "data": {
            "$ref": "#/components/schemas/internal_modules_retailcustomers.ReferralCapacity"
          },
          "success": {
            "enum": [
              true
            ],
            "type": "boolean"
          }
        },
        "required": [
          "success",
          "data"
        ],
        "type": "object"
      },
      "internal_modules_retailcustomers.statsResponse": {
        "additionalProperties": false,
        "properties": {
          "data": {
            "$ref": "#/components/schemas/internal_modules_retailcustomers.StatsSummary"
          },
          "success": {
            "enum": [
              true
            ],
            "type": "boolean"
          }
        },
        "required": [
          "success",
          "data"
        ],
        "type": "object"
      },
      "internal_modules_retailcustomersinternal.ClearPreferredDeliverySlotAPIResponse": {
        "properties": {
          "data": {
            "$ref": "#/components/schemas/internal_modules_retailcustomersinternal.ClearPreferredDeliverySlotResponse"
          },
          "error": {
            "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_apiresponse.Error"
          },
          "success": {
            "type": "boolean"
          }
        },
        "required": [
          "data",
          "success"
        ],
        "type": "object"
      },
      "internal_modules_retailcustomersinternal.ClearPreferredDeliverySlotRequest": {
        "additionalProperties": false,
        "properties": {
          "expected_preference": {
            "allOf": [
              {
                "$ref": "#/components/schemas/shipping.PreferredDeliverySlot"
              },
              {
                "properties": {
                  "date": {
                    "format": "date",
                    "type": "string"
                  },
                  "delivery_company": {
                    "allOf": [
                      {
                        "$ref": "#/components/schemas/courier.DeliveryCompanyRef"
                      },
                      {
                        "properties": {
                          "revision": {
                            "minimum": 1,
                            "type": "integer"
                          }
                        },
                        "type": "object"
                      }
                    ]
                  },
                  "end_at": {
                    "format": "date-time",
                    "type": "string"
                  },
                  "schedule_revision": {
                    "minimum": 0,
                    "type": "integer"
                  },
                  "slot_id": {
                    "maxLength": 200,
                    "minLength": 1,
                    "type": "string"
                  },
                  "start_at": {
                    "format": "date-time",
                    "type": "string"
                  }
                },
                "required": [
                  "slot_id",
                  "date",
                  "start_at",
                  "end_at",
                  "delivery_company"
                ],
                "type": "object"
              }
            ],
            "description": "Complete canonical saved preference, including native slot ID, company code/name and positive configuration revision, date, RFC3339 window, and nonnegative schedule revision. Every field is compared atomically."
          }
        },
        "required": [
          "expected_preference"
        ],
        "type": "object"
      },
      "internal_modules_retailcustomersinternal.ClearPreferredDeliverySlotResponse": {
        "properties": {
          "cleared": {
            "type": "boolean"
          }
        },
        "type": "object"
      },
      "internal_modules_retailcustomersinternal.EnsureProfileRequest": {
        "properties": {
          "actor": {
            "type": "string"
          },
          "input": {
            "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_modules_retailcustomers.CreateInput"
          }
        },
        "required": [
          "actor",
          "input"
        ],
        "type": "object"
      },
      "internal_modules_retailcustomersinternal.GiftRecipientOwner": {
        "properties": {
          "retail_customer_number": {
            "type": "string"
          },
          "user_id": {
            "type": "string"
          }
        },
        "required": [
          "retail_customer_number",
          "user_id"
        ],
        "type": "object"
      },
      "internal_modules_retailcustomersinternal.GiftRecipientResolution": {
        "properties": {
          "matched": {
            "type": "boolean"
          },
          "owner": {
            "$ref": "#/components/schemas/internal_modules_retailcustomersinternal.GiftRecipientOwner"
          }
        },
        "type": "object"
      },
      "internal_modules_retailcustomersinternal.ResolveGiftRecipientRequest": {
        "properties": {
          "email": {
            "format": "email",
            "maxLength": 320,
            "type": "string"
          }
        },
        "required": [
          "email"
        ],
        "type": "object"
      },
      "internal_modules_retailcustomersinternal.RetailAudiencePage": {
        "properties": {
          "items": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "uniqueItems": false
          },
          "next_cursor": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "internal_modules_retailcustomersinternal.giftRecipientResolutionResponse": {
        "properties": {
          "data": {
            "$ref": "#/components/schemas/internal_modules_retailcustomersinternal.GiftRecipientResolution"
          },
          "success": {
            "type": "boolean"
          }
        },
        "required": [
          "data",
          "success"
        ],
        "type": "object"
      },
      "internal_modules_retailcustomersinternal.retailAudienceAPIResponse": {
        "properties": {
          "data": {
            "$ref": "#/components/schemas/internal_modules_retailcustomersinternal.RetailAudiencePage"
          },
          "error": {
            "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_apiresponse.Error"
          },
          "success": {
            "type": "boolean"
          }
        },
        "required": [
          "data",
          "success"
        ],
        "type": "object"
      },
      "internal_modules_retailcustomersinternal.retailCustomerAPIResponse": {
        "properties": {
          "data": {
            "$ref": "#/components/schemas/retail.RetailCustomer"
          },
          "error": {
            "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_apiresponse.Error"
          },
          "success": {
            "type": "boolean"
          }
        },
        "required": [
          "data",
          "success"
        ],
        "type": "object"
      },
      "internal_modules_settings.ProgrammeValidation": {
        "properties": {
          "profile_coupon_id": {
            "type": "string"
          },
          "profile_revision": {
            "properties": {
              "coupon_id": {
                "type": "string"
              },
              "publication_revision": {
                "format": "int64",
                "minimum": 1,
                "type": "integer"
              },
              "rule_revision": {
                "format": "int64",
                "minimum": 1,
                "type": "integer"
              },
              "scope_revision": {
                "format": "int64",
                "minimum": 1,
                "type": "integer"
              }
            },
            "required": [
              "coupon_id",
              "scope_revision",
              "rule_revision",
              "publication_revision"
            ],
            "type": "object"
          },
          "referrer_revisions": {
            "items": {
              "properties": {
                "coupon_id": {
                  "type": "string"
                },
                "publication_revision": {
                  "format": "int64",
                  "minimum": 1,
                  "type": "integer"
                },
                "rule_revision": {
                  "format": "int64",
                  "minimum": 1,
                  "type": "integer"
                },
                "scope_revision": {
                  "format": "int64",
                  "minimum": 1,
                  "type": "integer"
                }
              },
              "required": [
                "coupon_id",
                "scope_revision",
                "rule_revision",
                "publication_revision"
              ],
              "type": "object"
            },
            "maxItems": 5,
            "minItems": 5,
            "type": "array"
          },
          "status": {
            "enum": [
              "active",
              "paused"
            ],
            "type": "string"
          },
          "validated_at": {
            "format": "date-time",
            "type": "string"
          }
        },
        "required": [
          "profile_coupon_id",
          "profile_revision",
          "referrer_revisions",
          "status",
          "validated_at"
        ],
        "type": "object"
      },
      "internal_modules_settings.ReferralRewardsValue": {
        "additionalProperties": false,
        "description": "Configuration for the referral_rewards_v2 setting. The profile coupon and five distinct referral coupon IDs are immutable once created. Their order selects the permanent reward slots. Pricing owns value, expiry and eligibility.",
        "properties": {
          "profile_coupon_id": {
            "pattern": "^[0-9a-f]{24}$",
            "type": "string"
          },
          "referrer_coupon_ids": {
            "items": {
              "pattern": "^[0-9a-f]{24}$",
              "type": "string"
            },
            "maxItems": 5,
            "minItems": 5,
            "type": "array",
            "uniqueItems": true
          }
        },
        "required": [
          "profile_coupon_id",
          "referrer_coupon_ids"
        ],
        "type": "object"
      },
      "internal_modules_settings.Setting": {
        "properties": {
          "description": {
            "type": "string"
          },
          "key": {
            "type": "string"
          },
          "revision": {
            "description": "Server-generated referral_rewards_v2 revision. Metadata updates advance it; coupon IDs cannot be changed or deleted.",
            "format": "int64",
            "minimum": 1,
            "readOnly": true,
            "type": "integer"
          },
          "updated_at": {
            "format": "date-time",
            "type": "string"
          },
          "updated_by": {
            "type": "string"
          },
          "value": {
            "description": "For key referral_rewards_v2, this object follows ReferralRewardsValue. Other keys retain their existing value shape."
          }
        },
        "required": [
          "key",
          "value",
          "updated_at"
        ],
        "type": "object"
      },
      "internal_modules_settings.setReq": {
        "properties": {
          "description": {
            "type": "string"
          },
          "validation": {
            "$ref": "#/components/schemas/internal_modules_settings.ProgrammeValidation"
          },
          "value": {}
        },
        "type": "object"
      },
      "internal_modules_settings.settingResponse": {
        "properties": {
          "data": {
            "$ref": "#/components/schemas/internal_modules_settings.Setting"
          },
          "success": {
            "type": "boolean"
          }
        },
        "required": [
          "success",
          "data"
        ],
        "type": "object"
      },
      "internal_modules_suppliers.CreateInput": {
        "properties": {
          "contact_name": {
            "type": "string"
          },
          "country_code": {
            "type": "string"
          },
          "email": {
            "type": "string"
          },
          "market_code": {
            "description": "MarketCode and CountryCode default to the creating staff member's own\nscope. A scoped creator cannot name a geography it could not read back.",
            "type": "string"
          },
          "password": {
            "type": "string"
          },
          "phone": {
            "type": "string"
          },
          "supplier_code": {
            "type": "string"
          },
          "supplier_name": {
            "type": "string"
          }
        },
        "required": [
          "email",
          "password",
          "supplier_code",
          "supplier_name"
        ],
        "type": "object"
      },
      "internal_modules_suppliers.UpdateInput": {
        "properties": {
          "active": {
            "type": "boolean"
          },
          "contact_name": {
            "type": "string"
          },
          "phone": {
            "type": "string"
          },
          "supplier_name": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "internal_modules_wholesaleaccount.AccountTerms": {
        "properties": {
          "allowed_checkout_methods": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "uniqueItems": false
          },
          "business_name": {
            "type": "string"
          },
          "default_billing_address": {
            "$ref": "#/components/schemas/party.ContactAddress"
          },
          "default_shipping_address": {
            "$ref": "#/components/schemas/party.ContactAddress"
          },
          "invoice_payment_methods": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "uniqueItems": false
          },
          "organisation_access_id": {
            "type": "string"
          },
          "organisation_code": {
            "type": "string"
          },
          "payment_terms_label": {
            "type": "string"
          },
          "terms": {
            "$ref": "#/components/schemas/wholesale.WholesaleTerms"
          },
          "trading_name": {
            "type": "string"
          },
          "user_id": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "internal_modules_wholesaleaccount.accountTermsAPIResponse": {
        "properties": {
          "data": {
            "$ref": "#/components/schemas/internal_modules_wholesaleaccount.AccountTerms"
          },
          "error": {
            "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_apiresponse.Error"
          },
          "success": {
            "type": "boolean"
          }
        },
        "required": [
          "data",
          "success"
        ],
        "type": "object"
      },
      "internal_modules_wholesaleapplications.Application": {
        "allOf": [
          {
            "$ref": "#/components/schemas/wholesale.WholesaleApplication"
          },
          {
            "properties": {
              "source_site": {
                "$ref": "#/components/schemas/internal_modules_wholesaleapplications.ApplicationSourceSite"
              }
            },
            "required": [
              "source_site"
            ],
            "type": "object"
          }
        ]
      },
      "internal_modules_wholesaleapplications.ApplicationApplicantInput": {
        "properties": {
          "email": {
            "format": "email",
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "phone": {
            "type": "string"
          },
          "role": {
            "type": "string"
          }
        },
        "required": [
          "email",
          "name",
          "phone"
        ],
        "type": "object"
      },
      "internal_modules_wholesaleapplications.ApplicationApprovalRequest": {
        "properties": {
          "category": {
            "$ref": "#/components/schemas/wholesale_enums.WholesaleOrganisationCategory"
          },
          "reason": {
            "type": "string"
          }
        },
        "required": [
          "category"
        ],
        "type": "object"
      },
      "internal_modules_wholesaleapplications.ApplicationOrganisationInput": {
        "description": "Registered, billing and shipping addresses accept manual entry, including overseas countries, without provider verification. Omitted billing and shipping addresses independently copy the registered address. The registration market is configured by Customers, never inferred from these addresses. Delivery coverage and charges are checked at checkout.",
        "properties": {
          "abn": {
            "type": "string"
          },
          "acn": {
            "type": "string"
          },
          "billing_address": {
            "$ref": "#/components/schemas/party.ContactAddress"
          },
          "brand_name": {
            "type": "string"
          },
          "business_number_label": {
            "type": "string"
          },
          "contact_person": {
            "type": "string"
          },
          "currency_code": {
            "description": "CurrencyCode is an open typed string\nwith the same JSON, so the wire shape is unchanged and no service may\nkeep assuming every currency has two decimals.",
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "email": {
            "format": "email",
            "type": "string"
          },
          "industry": {
            "type": "string"
          },
          "legal_name": {
            "type": "string"
          },
          "logo": {
            "$ref": "#/components/schemas/security.ObjectMedia"
          },
          "name": {
            "type": "string"
          },
          "phone": {
            "type": "string"
          },
          "registered_address": {
            "$ref": "#/components/schemas/party.ContactAddress"
          },
          "shipping_address": {
            "$ref": "#/components/schemas/party.ContactAddress"
          },
          "tax_registered": {
            "type": "boolean"
          },
          "tax_registration_id": {
            "type": "string"
          },
          "timezone": {
            "type": "string"
          },
          "trading_name": {
            "type": "string"
          },
          "website": {
            "type": "string"
          }
        },
        "required": [
          "name",
          "registered_address"
        ],
        "type": "object"
      },
      "internal_modules_wholesaleapplications.ApplicationRejectionRequest": {
        "properties": {
          "reason": {
            "type": "string"
          }
        },
        "required": [
          "reason"
        ],
        "type": "object"
      },
      "internal_modules_wholesaleapplications.ApplicationResponse": {
        "properties": {
          "access_status": {
            "$ref": "#/components/schemas/wholesale_enums.OrganisationAccessStatus"
          },
          "email_verification_required": {
            "type": "boolean"
          },
          "message": {
            "type": "string"
          },
          "organisation_access_id": {
            "type": "string"
          },
          "organisation_status": {
            "$ref": "#/components/schemas/wholesale_enums.WholesaleOrganisationStatus"
          },
          "state": {
            "$ref": "#/components/schemas/wholesale_enums.WholesaleApplicationState"
          },
          "user_id": {
            "type": "string"
          },
          "wholesale_organisation_code": {
            "type": "string"
          }
        },
        "required": [
          "email_verification_required",
          "state"
        ],
        "type": "object"
      },
      "internal_modules_wholesaleapplications.ApplicationSourceSite": {
        "enum": [
          "wholesale",
          "events"
        ],
        "type": "string"
      },
      "internal_modules_wholesaleapplications.ApplicationStatusResponse": {
        "properties": {
          "access_status": {
            "$ref": "#/components/schemas/wholesale_enums.OrganisationAccessStatus"
          },
          "business_name": {
            "type": "string"
          },
          "contact_name": {
            "type": "string"
          },
          "email": {
            "type": "string"
          },
          "email_verification_required": {
            "type": "boolean"
          },
          "message": {
            "type": "string"
          },
          "organisation_access_id": {
            "type": "string"
          },
          "organisation_status": {
            "$ref": "#/components/schemas/wholesale_enums.WholesaleOrganisationStatus"
          },
          "state": {
            "$ref": "#/components/schemas/wholesale_enums.WholesaleApplicationState"
          },
          "trading_name": {
            "type": "string"
          },
          "user_id": {
            "type": "string"
          },
          "wholesale_organisation_code": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "internal_modules_wholesaleapplications.applicationPageData": {
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/internal_modules_wholesaleapplications.Application"
            },
            "type": "array",
            "uniqueItems": false
          },
          "page": {
            "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_paging.PageResponse"
          }
        },
        "type": "object"
      },
      "internal_modules_wholesaleapplications.applicationPageEnvelope": {
        "properties": {
          "data": {
            "$ref": "#/components/schemas/internal_modules_wholesaleapplications.applicationPageData"
          },
          "success": {
            "type": "boolean"
          }
        },
        "type": "object"
      },
      "internal_modules_wholesaleapplications.applicationResponseEnvelope": {
        "properties": {
          "data": {
            "$ref": "#/components/schemas/internal_modules_wholesaleapplications.Application"
          },
          "success": {
            "type": "boolean"
          }
        },
        "type": "object"
      },
      "internal_modules_wholesaleapplications.applicationStatusResponseEnvelope": {
        "properties": {
          "data": {
            "$ref": "#/components/schemas/internal_modules_wholesaleapplications.ApplicationStatusResponse"
          },
          "success": {
            "type": "boolean"
          }
        },
        "type": "object"
      },
      "internal_modules_wholesaleapplications.submitRequest": {
        "properties": {
          "applicant": {
            "$ref": "#/components/schemas/internal_modules_wholesaleapplications.ApplicationApplicantInput"
          },
          "expected_monthly_orders": {
            "minimum": 0,
            "type": "integer"
          },
          "expected_monthly_spend": {
            "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Shared-Contract_v35_pkg_contracts_common_money.Money"
          },
          "locale": {
            "enum": [
              "en",
              "zh-TW",
              "zh-CN"
            ],
            "type": "string"
          },
          "notes": {
            "type": "string"
          },
          "organisation": {
            "$ref": "#/components/schemas/internal_modules_wholesaleapplications.ApplicationOrganisationInput"
          },
          "password": {
            "minLength": 10,
            "type": "string"
          },
          "payment_preference": {
            "type": "string"
          },
          "preferred_delivery_days": {
            "items": {
              "type": "integer"
            },
            "type": "array",
            "uniqueItems": false
          },
          "source_site": {
            "$ref": "#/components/schemas/internal_modules_wholesaleapplications.ApplicationSourceSite"
          },
          "storage_requirements": {
            "items": {
              "$ref": "#/components/schemas/classification_enums.StorageType"
            },
            "type": "array",
            "uniqueItems": false
          }
        },
        "required": [
          "applicant",
          "organisation",
          "password"
        ],
        "type": "object"
      },
      "internal_modules_wholesaleapplications.submitResponseEnvelope": {
        "properties": {
          "data": {
            "$ref": "#/components/schemas/internal_modules_wholesaleapplications.ApplicationResponse"
          },
          "success": {
            "type": "boolean"
          }
        },
        "type": "object"
      },
      "internal_modules_wholesaleorganisations.PricingOrganisationView": {
        "properties": {
          "category": {
            "$ref": "#/components/schemas/wholesale_enums.WholesaleOrganisationCategory"
          },
          "code": {
            "type": "string"
          },
          "profile_revision": {
            "type": "integer"
          },
          "status": {
            "$ref": "#/components/schemas/wholesale_enums.WholesaleOrganisationStatus"
          }
        },
        "type": "object"
      },
      "internal_modules_wholesaleorganisations.pricingOrganisationResponse": {
        "properties": {
          "data": {
            "$ref": "#/components/schemas/internal_modules_wholesaleorganisations.PricingOrganisationView"
          },
          "success": {
            "type": "boolean"
          }
        },
        "required": [
          "data",
          "success"
        ],
        "type": "object"
      },
      "internal_modules_wholesaleteam.NotificationInviteView": {
        "properties": {
          "expires_at": {
            "type": "string"
          },
          "invite_id": {
            "type": "string"
          },
          "invitee_email": {
            "type": "string"
          },
          "invitee_name": {
            "type": "string"
          },
          "organisation_code": {
            "type": "string"
          },
          "organisation_name": {
            "type": "string"
          },
          "status": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "internal_modules_wholesaleteam.notificationInviteResponse": {
        "properties": {
          "data": {
            "$ref": "#/components/schemas/internal_modules_wholesaleteam.NotificationInviteView"
          },
          "success": {
            "type": "boolean"
          }
        },
        "required": [
          "data",
          "success"
        ],
        "type": "object"
      },
      "localization.LocalizedDescription": {
        "additionalProperties": false,
        "properties": {
          "description": {
            "type": "string"
          },
          "language": {
            "type": "string"
          }
        },
        "required": [
          "language",
          "description"
        ],
        "type": "object"
      },
      "localization.LocalizedName": {
        "additionalProperties": false,
        "properties": {
          "language": {
            "type": "string"
          },
          "name": {
            "type": "string"
          }
        },
        "required": [
          "language",
          "name"
        ],
        "type": "object"
      },
      "localization.LocalizedText": {
        "additionalProperties": false,
        "properties": {
          "language": {
            "type": "string"
          },
          "text": {
            "type": "string"
          }
        },
        "required": [
          "language",
          "text"
        ],
        "type": "object"
      },
      "media.AvatarDownloadURLResponse": {
        "additionalProperties": false,
        "properties": {
          "expires_at": {
            "description": "Signed URL expiry in RFC3339 UTC.",
            "format": "date-time",
            "type": "string"
          },
          "url": {
            "description": "Short-lived signed HTTPS GET URL for this caller's active avatar. Fetch directly without application credentials; do not persist as ObjectMedia.url.",
            "format": "uri",
            "type": "string"
          }
        },
        "required": [
          "url",
          "expires_at"
        ],
        "type": "object"
      },
      "media.AvatarDownloadURLSuccess": {
        "properties": {
          "data": {
            "$ref": "#/components/schemas/media.AvatarDownloadURLResponse"
          },
          "success": {
            "enum": [
              true
            ],
            "type": "boolean"
          }
        },
        "required": [
          "success",
          "data"
        ],
        "type": "object"
      },
      "media.ManagedImage": {
        "additionalProperties": false,
        "properties": {
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "filename": {
            "type": "string"
          },
          "folder": {
            "type": "string"
          },
          "height": {
            "type": "integer"
          },
          "kind": {
            "enum": [
              "image"
            ],
            "type": "string"
          },
          "media_code": {
            "type": "string"
          },
          "mime_type": {
            "type": "string"
          },
          "preview_expires_at": {
            "format": "date-time",
            "type": "string"
          },
          "preview_url": {
            "description": "Authorized short-lived signed image URL. Do not persist it as a campaign or tier-card reference.",
            "type": "string"
          },
          "size_bytes": {
            "format": "int64",
            "type": "integer"
          },
          "status": {
            "enum": [
              "active"
            ],
            "type": "string"
          },
          "url": {
            "description": "Stable saved-reference URL; unpublished campaign and tier-card images are not publicly accessible.",
            "type": "string"
          },
          "width": {
            "type": "integer"
          }
        },
        "required": [
          "media_code",
          "filename",
          "folder",
          "kind",
          "status",
          "mime_type",
          "size_bytes",
          "width",
          "height",
          "url",
          "preview_url",
          "preview_expires_at",
          "created_at"
        ],
        "type": "object"
      },
      "media.ManagedImagePage": {
        "properties": {
          "data": {
            "properties": {
              "items": {
                "items": {
                  "$ref": "#/components/schemas/media.ManagedImage"
                },
                "type": "array"
              },
              "page": {
                "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_paging.PageResponse"
              }
            },
            "required": [
              "items",
              "page"
            ],
            "type": "object"
          },
          "success": {
            "type": "boolean"
          }
        },
        "required": [
          "success",
          "data"
        ],
        "type": "object"
      },
      "media.ObjectMediaRef": {
        "additionalProperties": false,
        "properties": {
          "code": {
            "maxLength": 128,
            "minLength": 1,
            "type": "string"
          }
        },
        "required": [
          "code"
        ],
        "type": "object"
      },
      "media.TierCardAssociation": {
        "additionalProperties": false,
        "properties": {
          "generation": {
            "format": "int64",
            "minimum": 1,
            "type": "integer"
          },
          "media": {
            "allOf": [
              {
                "$ref": "#/components/schemas/media.ObjectMediaRef"
              }
            ],
            "nullable": true
          },
          "operation_id": {
            "maxLength": 128,
            "minLength": 1,
            "type": "string"
          },
          "state": {
            "enum": [
              "PREPARED",
              "READY",
              "RELEASED",
              "DETACHED"
            ],
            "type": "string"
          },
          "tier_key": {
            "maxLength": 128,
            "minLength": 1,
            "type": "string"
          }
        },
        "required": [
          "operation_id",
          "tier_key",
          "generation",
          "media",
          "state"
        ],
        "type": "object"
      },
      "media.TierCardAssociationResponse": {
        "additionalProperties": false,
        "properties": {
          "data": {
            "$ref": "#/components/schemas/media.TierCardAssociation"
          },
          "success": {
            "type": "boolean"
          }
        },
        "required": [
          "success",
          "data"
        ],
        "type": "object"
      },
      "media.TierCardCommand": {
        "additionalProperties": false,
        "description": "Exact durable Pricing candidate command. generation must exceed expected_generation; media null removes a card. The actor is authenticated by Pricing and verified against candidate proof and upload ownership. Only a code reference is accepted.",
        "properties": {
          "actor": {
            "maxLength": 128,
            "minLength": 1,
            "type": "string"
          },
          "expected_generation": {
            "format": "int64",
            "minimum": 0,
            "type": "integer"
          },
          "generation": {
            "format": "int64",
            "minimum": 1,
            "type": "integer"
          },
          "media": {
            "allOf": [
              {
                "$ref": "#/components/schemas/media.ObjectMediaRef"
              }
            ],
            "nullable": true
          },
          "operation_id": {
            "maxLength": 128,
            "minLength": 1,
            "type": "string"
          },
          "tier_key": {
            "maxLength": 128,
            "minLength": 1,
            "type": "string"
          }
        },
        "required": [
          "operation_id",
          "tier_key",
          "expected_generation",
          "generation",
          "actor",
          "media"
        ],
        "type": "object"
      },
      "media.TierCardDetach": {
        "additionalProperties": false,
        "properties": {
          "generation": {
            "format": "int64",
            "minimum": 1,
            "type": "integer"
          },
          "operation_id": {
            "maxLength": 128,
            "minLength": 1,
            "type": "string"
          },
          "tier_key": {
            "maxLength": 128,
            "minLength": 1,
            "type": "string"
          }
        },
        "required": [
          "operation_id",
          "tier_key",
          "generation"
        ],
        "type": "object"
      },
      "metadata.Metadata": {
        "additionalProperties": {},
        "type": "object"
      },
      "money.CurrencyCode": {
        "type": "string"
      },
      "money.Money": {
        "additionalProperties": false,
        "properties": {
          "amount_minor": {
            "type": "integer"
          },
          "currency": {
            "$ref": "#/components/schemas/money.CurrencyCode"
          }
        },
        "required": [
          "amount_minor",
          "currency"
        ],
        "type": "object"
      },
      "packaging.PackageOptionRef": {
        "additionalProperties": false,
        "properties": {
          "code": {
            "type": "string"
          },
          "sku_code": {
            "type": "string"
          },
          "version": {
            "type": "integer"
          }
        },
        "required": [
          "sku_code",
          "code",
          "version"
        ],
        "type": "object"
      },
      "party.ContactAddress": {
        "description": "Addresses.",
        "properties": {
          "address": {
            "$ref": "#/components/schemas/geography.Address"
          },
          "contact": {
            "$ref": "#/components/schemas/party.Recipient"
          },
          "id": {
            "description": "ID is populated for persisted address-book entries. Inline checkout,\norder, billing, and fulfilment snapshots may leave it empty.",
            "type": "string"
          }
        },
        "type": "object"
      },
      "party.ContactChannels": {
        "properties": {
          "email": {
            "type": "string"
          },
          "external_handles": {
            "additionalProperties": {
              "type": "string"
            },
            "type": "object"
          },
          "phone": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "party.OrganisationDetail": {
        "properties": {
          "abn": {
            "description": "Registration and tax details.",
            "type": "string"
          },
          "acn": {
            "type": "string"
          },
          "billing_address": {
            "$ref": "#/components/schemas/party.ContactAddress"
          },
          "brand_name": {
            "type": "string"
          },
          "business_number_label": {
            "type": "string"
          },
          "code": {
            "description": "Code is the organisation / supplier business key (supplier_code /\norganisation_code) used as the canonical cross-struct reference. It is\nempty for person-like parties (e.g. an order customer) that have no\norganisation code.",
            "type": "string"
          },
          "contact_person": {
            "type": "string"
          },
          "currency_code": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "email": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "industry": {
            "description": "Additional business metadata.",
            "type": "string"
          },
          "legal_name": {
            "type": "string"
          },
          "logo": {
            "$ref": "#/components/schemas/security.ObjectMedia"
          },
          "metadata": {
            "$ref": "#/components/schemas/metadata.Metadata"
          },
          "name": {
            "type": "string"
          },
          "phone": {
            "type": "string"
          },
          "registered_address": {
            "$ref": "#/components/schemas/party.ContactAddress"
          },
          "shipping_address": {
            "$ref": "#/components/schemas/party.ContactAddress"
          },
          "tax_registered": {
            "type": "boolean"
          },
          "tax_registration_id": {
            "type": "string"
          },
          "timezone": {
            "type": "string"
          },
          "trading_name": {
            "type": "string"
          },
          "website": {
            "description": "Additional contact details (primary phone/email come from PartyRef).",
            "type": "string"
          }
        },
        "type": "object"
      },
      "party.PersonName": {
        "properties": {
          "display_name": {
            "type": "string"
          },
          "first_name": {
            "type": "string"
          },
          "last_name": {
            "type": "string"
          },
          "middle_name": {
            "type": "string"
          },
          "preferred_name": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "party.Recipient": {
        "properties": {
          "email": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "phone": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "preference.RetailCustomerReceiptPreferences": {
        "properties": {
          "formats": {
            "items": {
              "$ref": "#/components/schemas/preference_enums.ReceiptFormat"
            },
            "type": "array",
            "uniqueItems": false
          },
          "source": {
            "type": "string"
          },
          "updated_at": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "preference_enums.PreferredContactMethod": {
        "enum": [
          "email",
          "phone"
        ],
        "type": "string",
        "x-enum-varnames": [
          "PreferredContactMethodEmail",
          "PreferredContactMethodPhone"
        ]
      },
      "preference_enums.ReceiptFormat": {
        "enum": [
          "electronic",
          "paper"
        ],
        "type": "string",
        "x-enum-varnames": [
          "ReceiptFormatElectronic",
          "ReceiptFormatPaper"
        ]
      },
      "promotion.Promotion": {
        "additionalProperties": false,
        "properties": {
          "content": {
            "$ref": "#/components/schemas/promotion.PromotionContent"
          },
          "controls": {
            "$ref": "#/components/schemas/promotion.PromotionControls"
          },
          "country_code": {
            "$ref": "#/components/schemas/geography.CountryCode"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "created_by": {
            "type": "string"
          },
          "deleted_at": {
            "format": "date-time",
            "type": "string"
          },
          "deleted_by": {
            "type": "string"
          },
          "history": {
            "items": {
              "$ref": "#/components/schemas/security.HistoryEntry"
            },
            "type": "array"
          },
          "id": {
            "type": "string"
          },
          "kind": {
            "type": "string"
          },
          "market_code": {
            "type": "string"
          },
          "period": {
            "$ref": "#/components/schemas/promotion.PromotionPeriod"
          },
          "relations": {
            "items": {
              "$ref": "#/components/schemas/promotion.PromotionRelation"
            },
            "type": "array"
          },
          "revision": {
            "type": "integer"
          },
          "scope": {
            "$ref": "#/components/schemas/promotion.PromotionScope"
          },
          "series_key": {
            "type": "string"
          },
          "source": {
            "$ref": "#/components/schemas/promotion.PromotionSource"
          },
          "status": {
            "$ref": "#/components/schemas/promotion_enums.PromotionStatus"
          },
          "updated_at": {
            "format": "date-time",
            "type": "string"
          },
          "updated_by": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "series_key",
          "kind",
          "status",
          "revision",
          "content",
          "period",
          "scope",
          "controls",
          "created_at",
          "updated_at"
        ],
        "type": "object"
      },
      "promotion.PromotionContent": {
        "additionalProperties": false,
        "properties": {
          "descriptions": {
            "items": {
              "$ref": "#/components/schemas/localization.LocalizedDescription"
            },
            "type": "array"
          },
          "display_messages": {
            "items": {
              "$ref": "#/components/schemas/localization.LocalizedText"
            },
            "type": "array"
          },
          "names": {
            "items": {
              "$ref": "#/components/schemas/localization.LocalizedName"
            },
            "type": "array"
          },
          "receipt_messages": {
            "items": {
              "$ref": "#/components/schemas/localization.LocalizedText"
            },
            "type": "array"
          }
        },
        "required": [],
        "type": "object"
      },
      "promotion.PromotionControls": {
        "additionalProperties": false,
        "properties": {
          "audience": {
            "$ref": "#/components/schemas/audience.Audience"
          },
          "channels": {
            "items": {
              "$ref": "#/components/schemas/commerce_enums.OrderType"
            },
            "type": "array"
          },
          "geographic_scope": {
            "$ref": "#/components/schemas/geography.GeographicScope"
          },
          "maximum_applications": {
            "type": "integer"
          },
          "maximum_applications_per_customer": {
            "type": "integer"
          },
          "priority": {
            "type": "integer"
          },
          "stackable": {
            "type": "boolean"
          }
        },
        "required": [
          "geographic_scope"
        ],
        "type": "object"
      },
      "promotion.PromotionPeriod": {
        "additionalProperties": false,
        "properties": {
          "ends_at": {
            "format": "date-time",
            "type": "string"
          },
          "starts_at": {
            "format": "date-time",
            "type": "string"
          },
          "timezone": {
            "type": "string"
          }
        },
        "required": [
          "timezone"
        ],
        "type": "object"
      },
      "promotion.PromotionRelation": {
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "string"
          },
          "kind": {
            "type": "string"
          },
          "qualifier_scope": {
            "$ref": "#/components/schemas/promotion.PromotionScope"
          },
          "target_scope": {
            "$ref": "#/components/schemas/promotion.PromotionScope"
          },
          "terms": {
            "items": {
              "$ref": "#/components/schemas/promotion.PromotionTerm"
            },
            "type": "array"
          }
        },
        "required": [
          "id",
          "kind",
          "qualifier_scope",
          "target_scope"
        ],
        "type": "object"
      },
      "promotion.PromotionScope": {
        "additionalProperties": false,
        "properties": {
          "groups": {
            "items": {
              "$ref": "#/components/schemas/promotion.PromotionScopeGroup"
            },
            "type": "array"
          },
          "match_mode": {
            "$ref": "#/components/schemas/promotion_enums.PromotionMatchMode"
          },
          "unrestricted": {
            "type": "boolean"
          }
        },
        "required": [
          "unrestricted",
          "match_mode"
        ],
        "type": "object"
      },
      "promotion.PromotionScopeGroup": {
        "additionalProperties": false,
        "properties": {
          "category_tag_codes": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "collection_codes": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "match_mode": {
            "$ref": "#/components/schemas/promotion_enums.PromotionMatchMode"
          },
          "maximum_base_units": {
            "type": "integer"
          },
          "minimum_base_units": {
            "type": "integer"
          },
          "package_options": {
            "items": {
              "$ref": "#/components/schemas/packaging.PackageOptionRef"
            },
            "type": "array"
          },
          "sku_codes": {
            "items": {
              "type": "string"
            },
            "type": "array"
          }
        },
        "required": [
          "match_mode"
        ],
        "type": "object"
      },
      "promotion.PromotionSource": {
        "additionalProperties": false,
        "properties": {
          "kind": {
            "type": "string"
          },
          "ref": {
            "type": "string"
          }
        },
        "required": [],
        "type": "object"
      },
      "promotion.PromotionTerm": {
        "additionalProperties": false,
        "properties": {
          "basis_points_value": {
            "type": "integer"
          },
          "boolean_value": {
            "type": "boolean"
          },
          "integer_value": {
            "type": "integer"
          },
          "key": {
            "type": "string"
          },
          "money_value": {
            "$ref": "#/components/schemas/money.Money"
          },
          "string_value": {
            "type": "string"
          },
          "timestamp_value": {
            "format": "date-time",
            "type": "string"
          }
        },
        "required": [
          "key"
        ],
        "type": "object"
      },
      "promotion_enums.PromotionMatchMode": {
        "type": "string"
      },
      "promotion_enums.PromotionStatus": {
        "type": "string"
      },
      "retail.RetailCustomer": {
        "properties": {
          "account_id": {
            "type": "string"
          },
          "auth_identity_ids": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "uniqueItems": false
          },
          "basic_info": {
            "$ref": "#/components/schemas/retail.RetailCustomerBasicInfo"
          },
          "billing_same_as_delivery": {
            "type": "boolean"
          },
          "classification": {
            "$ref": "#/components/schemas/security_enums.DataClassification"
          },
          "commerce": {
            "$ref": "#/components/schemas/retail.RetailCustomerCommerceProfile"
          },
          "contains_pii": {
            "type": "boolean"
          },
          "contains_sensitive_pii": {
            "type": "boolean"
          },
          "created_at": {
            "type": "string"
          },
          "created_by": {
            "type": "string"
          },
          "customer_number": {
            "type": "string"
          },
          "data_owner_id": {
            "type": "string"
          },
          "default_billing": {
            "$ref": "#/components/schemas/party.ContactAddress"
          },
          "default_shipping": {
            "$ref": "#/components/schemas/party.ContactAddress"
          },
          "deleted_at": {
            "type": "string"
          },
          "deleted_by": {
            "type": "string"
          },
          "deletion_completed_at": {
            "type": "string"
          },
          "deletion_requested_at": {
            "type": "string"
          },
          "history": {
            "items": {
              "$ref": "#/components/schemas/security.HistoryEntry"
            },
            "type": "array",
            "uniqueItems": false
          },
          "id": {
            "type": "string"
          },
          "legal_hold": {
            "type": "boolean"
          },
          "lifecycle": {
            "$ref": "#/components/schemas/retail.RetailCustomerLifecycle"
          },
          "management": {
            "$ref": "#/components/schemas/retail.RetailCustomerManagementProfile"
          },
          "preferred_delivery_slot": {
            "$ref": "#/components/schemas/shipping.PreferredDeliverySlot"
          },
          "primary_auth_identity_id": {
            "type": "string"
          },
          "profile_completion": {
            "$ref": "#/components/schemas/retail.RetailCustomerProfileCompletion"
          },
          "protection_basis": {
            "$ref": "#/components/schemas/security_enums.DataProtectionBasis"
          },
          "receipt_preferences": {
            "$ref": "#/components/schemas/preference.RetailCustomerReceiptPreferences"
          },
          "referral": {
            "$ref": "#/components/schemas/retail.RetailCustomerReferralProfile"
          },
          "retention_policy_key": {
            "type": "string"
          },
          "retention_until": {
            "type": "string"
          },
          "shipping_addresses": {
            "items": {
              "$ref": "#/components/schemas/party.ContactAddress"
            },
            "type": "array",
            "uniqueItems": false
          },
          "updated_at": {
            "type": "string"
          },
          "updated_by": {
            "type": "string"
          },
          "user_id": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "retail.RetailCustomerBasicInfo": {
        "properties": {
          "acquisition_source": {
            "$ref": "#/components/schemas/retail_enums.CustomerAcquisitionSource"
          },
          "contacts": {
            "$ref": "#/components/schemas/party.ContactChannels"
          },
          "date_of_birth": {
            "type": "string"
          },
          "gender": {
            "$ref": "#/components/schemas/retail_enums.CustomerGender"
          },
          "name": {
            "$ref": "#/components/schemas/party.PersonName"
          },
          "preferred_contact_method": {
            "$ref": "#/components/schemas/preference_enums.PreferredContactMethod"
          }
        },
        "type": "object"
      },
      "retail.RetailCustomerCommerceProfile": {
        "properties": {
          "average_order_value": {
            "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Shared-Contract_v35_pkg_contracts_common_money.Money"
          },
          "first_order_at": {
            "type": "string"
          },
          "last_order_at": {
            "type": "string"
          },
          "provinces": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "uniqueItems": false
          },
          "suburbs": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "uniqueItems": false
          },
          "synced_at": {
            "type": "string"
          },
          "total_orders": {
            "type": "integer"
          },
          "total_spend": {
            "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Shared-Contract_v35_pkg_contracts_common_money.Money"
          },
          "total_units": {
            "type": "integer"
          }
        },
        "type": "object"
      },
      "retail.RetailCustomerLifecycle": {
        "properties": {
          "activated_at": {
            "type": "string"
          },
          "blocked_at": {
            "type": "string"
          },
          "blocked_reason": {
            "type": "string"
          },
          "closed_at": {
            "type": "string"
          },
          "closed_reason": {
            "type": "string"
          },
          "registered_at": {
            "type": "string"
          },
          "status": {
            "$ref": "#/components/schemas/retail_enums.CustomerStatus"
          }
        },
        "type": "object"
      },
      "retail.RetailCustomerManagementProfile": {
        "properties": {
          "crm_tier": {
            "type": "string"
          },
          "notes": {
            "type": "string"
          },
          "sales_rep": {
            "type": "string"
          },
          "tags": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "uniqueItems": false
          }
        },
        "type": "object"
      },
      "retail.RetailCustomerProfileCompletion": {
        "description": "Completion measures seven equally weighted profile fields, rounded to the nearest integer percent. The fields are email, full_name, date_of_birth, phone_number, gender, default_shipping_address, and default_billing_address, in that stable order. Email and phone_number count nonempty basic_info.contacts fields independently of account verification; recipient phones do not substitute for the profile phone. Full name requires a display name or both first and last names. Default addresses must satisfy the existing address completeness validation. Only all seven filled fields produce 100 percent. Completion is derived from Customers data without an Identity lookup; account verification and checkout security remain separate.",
        "properties": {
          "completed_fields": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "uniqueItems": false
          },
          "missing_fields": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "uniqueItems": false
          },
          "percent": {
            "type": "integer"
          }
        },
        "type": "object"
      },
      "retail.RetailCustomerReferralProfile": {
        "properties": {
          "code": {
            "type": "string"
          },
          "last_reward_issued_at": {
            "type": "string"
          },
          "referrer_customer_number": {
            "type": "string"
          },
          "reward_coupon_codes": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "uniqueItems": false
          },
          "reward_coupons_issued": {
            "type": "integer"
          },
          "used_by_count": {
            "type": "integer"
          },
          "used_referral_code_confirmed": {
            "type": "boolean"
          }
        },
        "type": "object"
      },
      "retail.RetailCustomerSummary": {
        "properties": {
          "account_id": {
            "type": "string"
          },
          "customer_number": {
            "type": "string"
          },
          "display_name": {
            "type": "string"
          },
          "email": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "metadata": {
            "$ref": "#/components/schemas/metadata.Metadata"
          },
          "phone": {
            "type": "string"
          },
          "receipt_preferences": {
            "$ref": "#/components/schemas/preference.RetailCustomerReceiptPreferences"
          },
          "status": {
            "$ref": "#/components/schemas/retail_enums.CustomerStatus"
          },
          "tags": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "uniqueItems": false
          },
          "user_id": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "retail_enums.BuyerType": {
        "enum": [
          "guest_retail",
          "retail_customer",
          "wholesale_organisation"
        ],
        "type": "string",
        "x-enum-varnames": [
          "BuyerTypeGuestRetail",
          "BuyerTypeRetailCustomer",
          "BuyerTypeWholesaleOrganisation"
        ]
      },
      "retail_enums.CustomerAcquisitionSource": {
        "enum": [
          "online",
          "pos",
          "import",
          "manual",
          "phone"
        ],
        "type": "string",
        "x-enum-varnames": [
          "CustomerAcquisitionSourceOnline",
          "CustomerAcquisitionSourcePOS",
          "CustomerAcquisitionSourceImport",
          "CustomerAcquisitionSourceManual",
          "CustomerAcquisitionSourcePhone"
        ]
      },
      "retail_enums.CustomerGender": {
        "enum": [
          "female",
          "male",
          "non_binary"
        ],
        "type": "string",
        "x-enum-varnames": [
          "CustomerGenderFemale",
          "CustomerGenderMale",
          "CustomerGenderNonBinary"
        ]
      },
      "retail_enums.CustomerStatus": {
        "enum": [
          "ACTIVE",
          "INACTIVE",
          "BLOCKED",
          "CLOSED"
        ],
        "type": "string",
        "x-enum-varnames": [
          "CustomerStatusActive",
          "CustomerStatusInactive",
          "CustomerStatusBlocked",
          "CustomerStatusClosed"
        ]
      },
      "retailcustomers.BulkPatch": {
        "additionalProperties": false,
        "description": "CLOSED retains the existing 409 refusal; identity closure is not a profile edit.",
        "minProperties": 1,
        "properties": {
          "source": {
            "description": "Trimmed; empty string clears the acquisition source.",
            "enum": [
              "",
              "online",
              "pos",
              "import",
              "manual",
              "phone"
            ],
            "type": "string"
          },
          "status": {
            "$ref": "#/components/schemas/retail_enums.CustomerStatus"
          },
          "tags": {
            "description": "Replaces the existing tag list; [] clears it. Null is invalid.",
            "items": {
              "type": "string"
            },
            "type": "array"
          }
        },
        "type": "object"
      },
      "retailcustomers.BulkRequest": {
        "additionalProperties": false,
        "properties": {
          "customer_numbers": {
            "description": "Explicit unique identifiers after normalization, returned in request order.",
            "items": {
              "description": "Trimmed case-sensitive business key, at most 128 UTF-8 bytes, no control characters.",
              "maxLength": 128,
              "minLength": 1,
              "type": "string"
            },
            "maxItems": 100,
            "minItems": 1,
            "type": "array",
            "uniqueItems": true
          },
          "patch": {
            "$ref": "#/components/schemas/retailcustomers.BulkPatch"
          }
        },
        "required": [
          "customer_numbers",
          "patch"
        ],
        "type": "object"
      },
      "retailcustomers.BulkResult": {
        "additionalProperties": false,
        "properties": {
          "customer_numbers": {
            "description": "Explicit unique identifiers after normalization, returned in request order.",
            "items": {
              "description": "Trimmed case-sensitive business key, at most 128 UTF-8 bytes, no control characters.",
              "maxLength": 128,
              "minLength": 1,
              "type": "string"
            },
            "maxItems": 100,
            "minItems": 1,
            "type": "array",
            "uniqueItems": true
          },
          "updated_count": {
            "description": "Number of selected records, including unchanged targets.",
            "maximum": 100,
            "minimum": 1,
            "type": "integer"
          }
        },
        "required": [
          "customer_numbers",
          "updated_count"
        ],
        "type": "object"
      },
      "retailcustomers.CouponRecipient": {
        "additionalProperties": false,
        "properties": {
          "customer_number": {
            "type": "string"
          },
          "registered_at": {
            "description": "Customers server-owned creation time, as published in customer.registered.",
            "format": "date-time",
            "type": "string"
          }
        },
        "required": [
          "customer_number",
          "registered_at"
        ],
        "type": "object"
      },
      "retailcustomers.CouponRecipientPage": {
        "additionalProperties": false,
        "properties": {
          "captured_at": {
            "format": "date-time",
            "type": "string"
          },
          "items": {
            "items": {
              "$ref": "#/components/schemas/retailcustomers.CouponRecipient"
            },
            "maxItems": 100,
            "type": "array"
          },
          "next_cursor": {
            "description": "Empty when this population or continuing sweep is exhausted.",
            "type": "string"
          }
        },
        "required": [
          "items",
          "next_cursor",
          "captured_at"
        ],
        "type": "object"
      },
      "retailcustomers.CouponRecipientRequest": {
        "additionalProperties": false,
        "properties": {
          "cohort_started_at": {
            "description": "Fixed initial or continuing sweep boundary, no later than the current instant.",
            "format": "date-time",
            "type": "string"
          },
          "cursor": {
            "description": "Opaque continuation bound to the same cohort boundary and population mode.",
            "maxLength": 1024,
            "type": "string"
          },
          "limit": {
            "default": 100,
            "format": "int64",
            "maximum": 100,
            "minimum": 1,
            "type": "integer"
          },
          "population_mode": {
            "default": "frozen_cohort",
            "description": "Frozen cohorts read one completed durable population. Continuing sweeps use live bounded pages and revisit later qualifiers in subsequent sweeps.",
            "enum": [
              "frozen_cohort",
              "continuing_sweep"
            ],
            "type": "string"
          }
        },
        "required": [
          "cohort_started_at"
        ],
        "type": "object"
      },
      "retailcustomers.CouponRecipientResponse": {
        "properties": {
          "data": {
            "$ref": "#/components/schemas/retailcustomers.CouponRecipientPage"
          },
          "success": {
            "type": "boolean"
          }
        },
        "required": [
          "success",
          "data"
        ],
        "type": "object"
      },
      "retailcustomers.EligibilityFact": {
        "additionalProperties": false,
        "properties": {
          "active": {
            "type": "boolean"
          },
          "customer_number": {
            "type": "string"
          },
          "found": {
            "type": "boolean"
          },
          "identity_linked": {
            "type": "boolean"
          },
          "location": {
            "$ref": "#/components/schemas/retailcustomers.EligibilityLocation"
          },
          "phone_verified": {
            "type": "boolean"
          },
          "profile_complete": {
            "type": "boolean"
          },
          "profile_completion_percent": {
            "enum": [
              0,
              14,
              29,
              43,
              57,
              71,
              86,
              100
            ],
            "type": "integer"
          },
          "profile_revision": {
            "type": "integer"
          }
        },
        "required": [
          "customer_number",
          "found",
          "active",
          "identity_linked",
          "phone_verified",
          "profile_complete",
          "profile_completion_percent"
        ],
        "type": "object"
      },
      "retailcustomers.EligibilityLocation": {
        "additionalProperties": false,
        "properties": {
          "address_revision": {
            "type": "integer"
          },
          "captured_at": {
            "format": "date-time",
            "type": "string"
          },
          "coverage_revision": {
            "type": "string"
          },
          "geographic_context": {
            "$ref": "#/components/schemas/geography.GeographicContext"
          },
          "source": {
            "type": "string"
          },
          "status": {
            "type": "string"
          }
        },
        "required": [
          "status",
          "geographic_context",
          "source",
          "address_revision",
          "coverage_revision",
          "captured_at"
        ],
        "type": "object"
      },
      "retailcustomers.EligibilityResponse": {
        "additionalProperties": false,
        "properties": {
          "data": {
            "additionalProperties": false,
            "properties": {
              "captured_at": {
                "format": "date-time",
                "type": "string"
              },
              "items": {
                "items": {
                  "$ref": "#/components/schemas/retailcustomers.EligibilityFact"
                },
                "type": "array"
              }
            },
            "required": [
              "items",
              "captured_at"
            ],
            "type": "object"
          },
          "success": {
            "type": "boolean"
          }
        },
        "required": [
          "success",
          "data"
        ],
        "type": "object"
      },
      "retailcustomers.ProfileEligibilityFact": {
        "additionalProperties": false,
        "properties": {
          "active": {
            "type": "boolean"
          },
          "customer_number": {
            "type": "string"
          },
          "found": {
            "type": "boolean"
          },
          "identity_linked": {
            "type": "boolean"
          },
          "profile_complete": {
            "type": "boolean"
          },
          "profile_completion_percent": {
            "type": "integer"
          },
          "profile_revision": {
            "type": "integer"
          }
        },
        "required": [
          "customer_number",
          "found",
          "active",
          "identity_linked",
          "profile_complete",
          "profile_completion_percent"
        ],
        "type": "object"
      },
      "retailcustomers.ProfileEligibilityResponse": {
        "additionalProperties": false,
        "properties": {
          "data": {
            "additionalProperties": false,
            "properties": {
              "captured_at": {
                "format": "date-time",
                "type": "string"
              },
              "items": {
                "items": {
                  "$ref": "#/components/schemas/retailcustomers.ProfileEligibilityFact"
                },
                "type": "array"
              }
            },
            "required": [
              "items",
              "captured_at"
            ],
            "type": "object"
          },
          "success": {
            "type": "boolean"
          }
        },
        "required": [
          "success",
          "data"
        ],
        "type": "object"
      },
      "retailcustomersinternal.EligibilityRequest": {
        "additionalProperties": false,
        "properties": {
          "customer_numbers": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "market_code": {
            "type": "string"
          },
          "require_location": {
            "type": "boolean"
          }
        },
        "required": [
          "customer_numbers"
        ],
        "type": "object"
      },
      "security.HistoryChange": {
        "additionalProperties": false,
        "properties": {
          "field": {
            "type": "string"
          },
          "from_value": {
            "type": "string"
          },
          "to_value": {
            "type": "string"
          }
        },
        "required": [
          "field"
        ],
        "type": "object"
      },
      "security.HistoryEntry": {
        "additionalProperties": false,
        "properties": {
          "actor_domain": {
            "$ref": "#/components/schemas/security_enums.IdentityDomain"
          },
          "actor_email": {
            "type": "string"
          },
          "actor_id": {
            "type": "string"
          },
          "actor_role": {
            "type": "string"
          },
          "changes": {
            "items": {
              "$ref": "#/components/schemas/security.HistoryChange"
            },
            "type": "array"
          },
          "id": {
            "type": "string"
          },
          "metadata": {
            "$ref": "#/components/schemas/metadata.Metadata"
          },
          "note": {
            "type": "string"
          },
          "occurred_at": {
            "format": "date-time",
            "type": "string"
          },
          "reason_code": {
            "type": "string"
          },
          "related_resource": {
            "type": "string"
          },
          "related_resource_id": {
            "type": "string"
          },
          "risk_flags": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "risk_level": {
            "$ref": "#/components/schemas/security_enums.SecurityRiskLevel"
          },
          "sequence": {
            "type": "integer"
          },
          "source": {
            "type": "string"
          },
          "summary": {
            "type": "string"
          },
          "type": {
            "type": "string"
          }
        },
        "required": [
          "occurred_at",
          "type"
        ],
        "type": "object"
      },
      "security.ObjectMedia": {
        "additionalProperties": false,
        "properties": {
          "code": {
            "type": "string"
          },
          "url": {
            "type": "string"
          }
        },
        "required": [
          "code"
        ],
        "type": "object"
      },
      "security_enums.DataClassification": {
        "enum": [
          "public",
          "internal",
          "confidential",
          "restricted"
        ],
        "type": "string",
        "x-enum-varnames": [
          "DataClassificationPublic",
          "DataClassificationInternal",
          "DataClassificationConfidential",
          "DataClassificationRestricted"
        ]
      },
      "security_enums.DataProtectionBasis": {
        "enum": [
          "not_applicable",
          "consent",
          "contract",
          "legal_obligation",
          "legitimate_interest"
        ],
        "type": "string",
        "x-enum-varnames": [
          "DataProtectionBasisNotApplicable",
          "DataProtectionBasisConsent",
          "DataProtectionBasisContract",
          "DataProtectionBasisLegalObligation",
          "DataProtectionBasisLegitimateInterest"
        ]
      },
      "security_enums.IdentityDomain": {
        "type": "string"
      },
      "security_enums.SecurityRiskLevel": {
        "type": "string"
      },
      "shipping.PreferredDeliverySlot": {
        "properties": {
          "date": {
            "type": "string"
          },
          "delivery_company": {
            "$ref": "#/components/schemas/courier.DeliveryCompanyRef"
          },
          "end_at": {
            "type": "string"
          },
          "schedule_revision": {
            "type": "integer"
          },
          "slot_id": {
            "type": "string"
          },
          "start_at": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "wholesale.OrganisationAccess": {
        "properties": {
          "account_id": {
            "type": "string"
          },
          "classification": {
            "$ref": "#/components/schemas/security_enums.DataClassification"
          },
          "contacts": {
            "$ref": "#/components/schemas/party.ContactChannels"
          },
          "contains_pii": {
            "type": "boolean"
          },
          "contains_sensitive_pii": {
            "type": "boolean"
          },
          "created_at": {
            "type": "string"
          },
          "created_by": {
            "type": "string"
          },
          "data_owner_id": {
            "type": "string"
          },
          "deleted_at": {
            "type": "string"
          },
          "deleted_by": {
            "type": "string"
          },
          "deletion_completed_at": {
            "type": "string"
          },
          "deletion_requested_at": {
            "type": "string"
          },
          "department": {
            "type": "string"
          },
          "expires_at": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "invitation": {
            "$ref": "#/components/schemas/audit.LifecycleAction"
          },
          "is_primary": {
            "type": "boolean"
          },
          "job_title": {
            "type": "string"
          },
          "joined_at": {
            "type": "string"
          },
          "legal_hold": {
            "type": "boolean"
          },
          "metadata": {
            "$ref": "#/components/schemas/metadata.Metadata"
          },
          "name": {
            "$ref": "#/components/schemas/party.PersonName"
          },
          "protection_basis": {
            "$ref": "#/components/schemas/security_enums.DataProtectionBasis"
          },
          "retention_policy_key": {
            "type": "string"
          },
          "retention_until": {
            "type": "string"
          },
          "revocation": {
            "$ref": "#/components/schemas/audit.LifecycleAction"
          },
          "role_key": {
            "$ref": "#/components/schemas/wholesale_enums.WholesaleBuyerRole"
          },
          "status": {
            "$ref": "#/components/schemas/wholesale_enums.OrganisationAccessStatus"
          },
          "suspension": {
            "$ref": "#/components/schemas/audit.LifecycleAction"
          },
          "updated_at": {
            "type": "string"
          },
          "updated_by": {
            "type": "string"
          },
          "user_id": {
            "type": "string"
          },
          "wholesale_organisation_code": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "wholesale.WholesaleApplicantSnapshot": {
        "properties": {
          "email": {
            "type": "string"
          },
          "email_verified": {
            "type": "boolean"
          },
          "name": {
            "type": "string"
          },
          "phone": {
            "type": "string"
          },
          "role": {
            "type": "string"
          },
          "user_id": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "wholesale.WholesaleApplication": {
        "properties": {
          "applicant": {
            "$ref": "#/components/schemas/wholesale.WholesaleApplicantSnapshot"
          },
          "application_number": {
            "type": "string"
          },
          "approval": {
            "$ref": "#/components/schemas/audit.LifecycleAction"
          },
          "classification": {
            "$ref": "#/components/schemas/security_enums.DataClassification"
          },
          "contains_pii": {
            "type": "boolean"
          },
          "contains_sensitive_pii": {
            "type": "boolean"
          },
          "created_at": {
            "type": "string"
          },
          "created_by": {
            "type": "string"
          },
          "data_owner_id": {
            "type": "string"
          },
          "deleted_at": {
            "type": "string"
          },
          "deleted_by": {
            "type": "string"
          },
          "deletion_completed_at": {
            "type": "string"
          },
          "deletion_requested_at": {
            "type": "string"
          },
          "expected_monthly_orders": {
            "type": "integer"
          },
          "expected_monthly_spend": {
            "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Shared-Contract_v35_pkg_contracts_common_money.Money"
          },
          "id": {
            "type": "string"
          },
          "legal_hold": {
            "type": "boolean"
          },
          "notes": {
            "type": "string"
          },
          "organisation": {
            "$ref": "#/components/schemas/party.OrganisationDetail"
          },
          "organisation_access_id": {
            "type": "string"
          },
          "payment_preference": {
            "type": "string"
          },
          "preferred_delivery_days": {
            "items": {
              "type": "integer"
            },
            "type": "array",
            "uniqueItems": false
          },
          "protection_basis": {
            "$ref": "#/components/schemas/security_enums.DataProtectionBasis"
          },
          "rejection": {
            "$ref": "#/components/schemas/audit.LifecycleAction"
          },
          "retention_policy_key": {
            "type": "string"
          },
          "retention_until": {
            "type": "string"
          },
          "status": {
            "$ref": "#/components/schemas/wholesale_enums.WholesaleApplicationStatus"
          },
          "storage_requirements": {
            "items": {
              "$ref": "#/components/schemas/classification_enums.StorageType"
            },
            "type": "array",
            "uniqueItems": false
          },
          "submitted_at": {
            "type": "string"
          },
          "updated_at": {
            "type": "string"
          },
          "updated_by": {
            "type": "string"
          },
          "wholesale_organisation_code": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "wholesale.WholesaleOrganisation": {
        "properties": {
          "abn": {
            "description": "Registration and tax details.",
            "type": "string"
          },
          "acn": {
            "type": "string"
          },
          "approval": {
            "$ref": "#/components/schemas/audit.LifecycleAction"
          },
          "auth_identity_ids": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "uniqueItems": false
          },
          "billing_address": {
            "$ref": "#/components/schemas/party.ContactAddress"
          },
          "brand_name": {
            "type": "string"
          },
          "business_number_label": {
            "type": "string"
          },
          "category": {
            "$ref": "#/components/schemas/wholesale_enums.WholesaleOrganisationCategory"
          },
          "classification": {
            "$ref": "#/components/schemas/security_enums.DataClassification"
          },
          "closure": {
            "$ref": "#/components/schemas/audit.LifecycleAction"
          },
          "code": {
            "description": "Code is the organisation / supplier business key (supplier_code /\norganisation_code) used as the canonical cross-struct reference. It is\nempty for person-like parties (e.g. an order customer) that have no\norganisation code.",
            "type": "string"
          },
          "contact_person": {
            "type": "string"
          },
          "contains_pii": {
            "type": "boolean"
          },
          "contains_sensitive_pii": {
            "type": "boolean"
          },
          "country_code": {
            "type": "string"
          },
          "created_at": {
            "type": "string"
          },
          "created_by": {
            "type": "string"
          },
          "currency_code": {
            "type": "string"
          },
          "data_owner_id": {
            "type": "string"
          },
          "deleted_at": {
            "type": "string"
          },
          "deleted_by": {
            "type": "string"
          },
          "deletion_completed_at": {
            "type": "string"
          },
          "deletion_requested_at": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "email": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "industry": {
            "description": "Additional business metadata.",
            "type": "string"
          },
          "legal_hold": {
            "type": "boolean"
          },
          "legal_name": {
            "type": "string"
          },
          "logo": {
            "$ref": "#/components/schemas/security.ObjectMedia"
          },
          "market_code": {
            "type": "string"
          },
          "metadata": {
            "$ref": "#/components/schemas/metadata.Metadata"
          },
          "name": {
            "type": "string"
          },
          "phone": {
            "type": "string"
          },
          "primary_auth_identity_id": {
            "type": "string"
          },
          "primary_organisation_access_id": {
            "type": "string"
          },
          "principal_account_id": {
            "type": "string"
          },
          "principal_user_id": {
            "type": "string"
          },
          "protection_basis": {
            "$ref": "#/components/schemas/security_enums.DataProtectionBasis"
          },
          "registered_address": {
            "$ref": "#/components/schemas/party.ContactAddress"
          },
          "rejection": {
            "$ref": "#/components/schemas/audit.LifecycleAction"
          },
          "retention_policy_key": {
            "type": "string"
          },
          "retention_until": {
            "type": "string"
          },
          "shipping_address": {
            "$ref": "#/components/schemas/party.ContactAddress"
          },
          "status": {
            "$ref": "#/components/schemas/wholesale_enums.WholesaleOrganisationStatus"
          },
          "suspension": {
            "$ref": "#/components/schemas/audit.LifecycleAction"
          },
          "tax_registered": {
            "type": "boolean"
          },
          "tax_registration_id": {
            "type": "string"
          },
          "timezone": {
            "type": "string"
          },
          "trading_name": {
            "type": "string"
          },
          "updated_at": {
            "type": "string"
          },
          "updated_by": {
            "type": "string"
          },
          "website": {
            "description": "Additional contact details (primary phone/email come from PartyRef).",
            "type": "string"
          }
        },
        "type": "object"
      },
      "wholesale.WholesaleTerms": {
        "properties": {
          "account_checkout_enabled": {
            "type": "boolean"
          },
          "credit_limit": {
            "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Shared-Contract_v35_pkg_contracts_common_money.Money"
          },
          "due_days": {
            "type": "integer"
          },
          "freight_rule": {
            "$ref": "#/components/schemas/metadata.Metadata"
          },
          "payment_instructions": {
            "type": "string"
          },
          "purchase_order_required": {
            "type": "boolean"
          },
          "rebate_rate": {
            "type": "number"
          },
          "shipping_fee": {
            "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Shared-Contract_v35_pkg_contracts_common_money.Money"
          }
        },
        "type": "object"
      },
      "wholesale_enums.OrganisationAccessStatus": {
        "enum": [
          "pending",
          "active",
          "suspended",
          "revoked"
        ],
        "type": "string",
        "x-enum-varnames": [
          "OrganisationAccessStatusPending",
          "OrganisationAccessStatusActive",
          "OrganisationAccessStatusSuspended",
          "OrganisationAccessStatusRevoked"
        ]
      },
      "wholesale_enums.WholesaleApplicationState": {
        "enum": [
          "missing",
          "pending",
          "approved",
          "rejected",
          "suspended"
        ],
        "type": "string",
        "x-enum-varnames": [
          "WholesaleApplicationStateMissing",
          "WholesaleApplicationStatePending",
          "WholesaleApplicationStateApproved",
          "WholesaleApplicationStateRejected",
          "WholesaleApplicationStateSuspended"
        ]
      },
      "wholesale_enums.WholesaleApplicationStatus": {
        "enum": [
          "pending",
          "approved",
          "rejected"
        ],
        "type": "string",
        "x-enum-varnames": [
          "WholesaleApplicationStatusPending",
          "WholesaleApplicationStatusApproved",
          "WholesaleApplicationStatusRejected"
        ]
      },
      "wholesale_enums.WholesaleBuyerRole": {
        "enum": [
          "owner",
          "buyer",
          "finance",
          "read_only",
          "group_order_manager"
        ],
        "type": "string",
        "x-enum-varnames": [
          "WholesaleBuyerRoleOwner",
          "WholesaleBuyerRoleBuyer",
          "WholesaleBuyerRoleFinance",
          "WholesaleBuyerRoleReadOnly",
          "WholesaleBuyerRoleGroupOrderManager"
        ]
      },
      "wholesale_enums.WholesaleOrganisationCategory": {
        "description": "Category is the middle tier of wholesale price resolution:\nexact-organisation override book, then organisation-CATEGORY book, then\nthe general wholesale channel book. It is empty only for an organisation\nthat was never approved, because approval requires one.",
        "enum": [
          "regional_agent",
          "supermarket",
          "restaurant"
        ],
        "type": "string",
        "x-enum-varnames": [
          "WholesaleOrganisationCategoryRegionalAgent",
          "WholesaleOrganisationCategorySupermarket",
          "WholesaleOrganisationCategoryRestaurant"
        ]
      },
      "wholesale_enums.WholesaleOrganisationStatus": {
        "enum": [
          "pending",
          "approved",
          "suspended",
          "rejected",
          "closed"
        ],
        "type": "string",
        "x-enum-varnames": [
          "WholesaleOrganisationStatusPending",
          "WholesaleOrganisationStatusApproved",
          "WholesaleOrganisationStatusSuspended",
          "WholesaleOrganisationStatusRejected",
          "WholesaleOrganisationStatusClosed"
        ]
      },
      "wholesaleorganisations.BulkPatch": {
        "additionalProperties": false,
        "properties": {
          "status": {
            "$ref": "#/components/schemas/wholesale_enums.WholesaleOrganisationStatus"
          }
        },
        "required": [
          "status"
        ],
        "type": "object"
      },
      "wholesaleorganisations.BulkRequest": {
        "additionalProperties": false,
        "properties": {
          "organisation_codes": {
            "description": "Explicit unique identifiers after normalization, returned in request order.",
            "items": {
              "description": "Trimmed case-sensitive business key, at most 128 UTF-8 bytes, no control characters.",
              "maxLength": 128,
              "minLength": 1,
              "type": "string"
            },
            "maxItems": 100,
            "minItems": 1,
            "type": "array",
            "uniqueItems": true
          },
          "patch": {
            "$ref": "#/components/schemas/wholesaleorganisations.BulkPatch"
          }
        },
        "required": [
          "organisation_codes",
          "patch"
        ],
        "type": "object"
      },
      "wholesaleorganisations.BulkResult": {
        "additionalProperties": false,
        "properties": {
          "organisation_codes": {
            "description": "Explicit unique identifiers after normalization, returned in request order.",
            "items": {
              "description": "Trimmed case-sensitive business key, at most 128 UTF-8 bytes, no control characters.",
              "maxLength": 128,
              "minLength": 1,
              "type": "string"
            },
            "maxItems": 100,
            "minItems": 1,
            "type": "array",
            "uniqueItems": true
          },
          "updated_count": {
            "description": "Number of selected records, including unchanged targets.",
            "maximum": 100,
            "minimum": 1,
            "type": "integer"
          }
        },
        "required": [
          "organisation_codes",
          "updated_count"
        ],
        "type": "object"
      },
      "wholesalesupport.BulkPatch": {
        "additionalProperties": false,
        "minProperties": 1,
        "properties": {
          "priority": {
            "enum": [
              "normal",
              "high",
              "urgent"
            ],
            "type": "string"
          },
          "status": {
            "enum": [
              "open",
              "in_review",
              "waiting_on_customer",
              "resolved",
              "closed"
            ],
            "type": "string"
          }
        },
        "type": "object"
      },
      "wholesalesupport.BulkRequest": {
        "additionalProperties": false,
        "properties": {
          "ids": {
            "description": "Explicit unique identifiers after normalization, returned in request order.",
            "items": {
              "description": "Trimmed and normalized to lowercase ObjectId hex.",
              "pattern": "^[0-9a-fA-F]{24}$",
              "type": "string"
            },
            "maxItems": 100,
            "minItems": 1,
            "type": "array",
            "uniqueItems": true
          },
          "patch": {
            "$ref": "#/components/schemas/wholesalesupport.BulkPatch"
          }
        },
        "required": [
          "ids",
          "patch"
        ],
        "type": "object"
      },
      "wholesalesupport.BulkResult": {
        "additionalProperties": false,
        "properties": {
          "ids": {
            "description": "Explicit unique identifiers after normalization, returned in request order.",
            "items": {
              "description": "Trimmed and normalized to lowercase ObjectId hex.",
              "pattern": "^[0-9a-fA-F]{24}$",
              "type": "string"
            },
            "maxItems": 100,
            "minItems": 1,
            "type": "array",
            "uniqueItems": true
          },
          "updated_count": {
            "description": "Number of selected records, including unchanged targets.",
            "maximum": 100,
            "minimum": 1,
            "type": "integer"
          }
        },
        "required": [
          "ids",
          "updated_count"
        ],
        "type": "object"
      }
    },
    "securitySchemes": {
      "BearerAuth": {
        "description": "Google-signed OIDC identity token for the configured Pub/Sub push audience and allowed service account. Send as: `Bearer \u003ctoken\u003e`.",
        "in": "header",
        "name": "Authorization",
        "type": "apiKey"
      },
      "PubSubPushOIDCAuth": {
        "bearerFormat": "JWT",
        "description": "Google-signed OIDC bearer token for authenticated Pub/Sub push delivery.",
        "scheme": "bearer",
        "type": "http"
      },
      "ServiceBearerAuth": {
        "bearerFormat": "JWT",
        "description": "Service access token. Obtain one from POST /internal/token.",
        "scheme": "bearer",
        "type": "http"
      }
    }
  },
  "externalDocs": {
    "description": "",
    "url": ""
  },
  "info": {
    "contact": {
      "name": "Potato Mart Platform Team"
    },
    "description": "Potato Mart Backend-Customers service. Owns retail customer records,\nwholesale organisations / organisation access / applications / team /\nsupport, group-order-manager applications, supplier login accounts,\nmedia, storefront campaigns, address search and runtime\nsettings. Users, RBAC and authentication live in Backend-Identity;\npricing/wallet in Backend-Pricing; customer notification delivery\nin Backend-Notification.\nEvery response uses the shared envelope `{ \"success\": bool, \"data\": ..., \"error\": ... }`.",
    "license": {
      "name": "Proprietary"
    },
    "title": "Backend-Customers API",
    "version": "46.1.0"
  },
  "openapi": "3.1.0",
  "paths": {
    "/addresses/resolve": {
      "post": {
        "description": "Optional Places lookup returning the existing contact-address fields. Requires only the same structural address shape as persistence: line1, locality and a valid country code. Administrative area, postcode and coordinates may be absent. Country and other geography come from the provider response, not the Australian request bias. No Address Validation call, verdict or confirmation step is part of resolution or saving. Manual entry can be saved directly without calling any address helper.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "object"
                  },
                  {
                    "$ref": "#/components/schemas/internal_modules_places.ResolveRequest",
                    "description": "Place and billing session token",
                    "summary": "body"
                  }
                ]
              }
            }
          },
          "description": "Place and billing session token",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Too Many Requests"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Service Unavailable"
          }
        },
        "summary": "Resolve a selected place to contact-address fields",
        "tags": [
          "addresses"
        ]
      }
    },
    "/addresses/search": {
      "post": {
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "object"
                  },
                  {
                    "$ref": "#/components/schemas/internal_modules_places.SearchRequest",
                    "description": "Query and billing session token",
                    "summary": "body"
                  }
                ]
              }
            }
          },
          "description": "Query and billing session token",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Too Many Requests"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Service Unavailable"
          }
        },
        "summary": "Search Australian addresses",
        "tags": [
          "addresses"
        ]
      }
    },
    "/business-registry/abns/{abn}": {
      "get": {
        "parameters": [
          {
            "description": "Australian Business Number",
            "in": "path",
            "name": "abn",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Comma-separated JSON fields or approved dotted JSON paths to project from the response",
            "in": "query",
            "name": "fields",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/internal_modules_businessregistry.lookupResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Not Found"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Service Unavailable"
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "summary": "Look up an ABN for advisory wholesale autofill",
        "tags": [
          "business-registry"
        ]
      }
    },
    "/business-registry/acns/{acn}": {
      "get": {
        "parameters": [
          {
            "description": "Australian Company Number",
            "in": "path",
            "name": "acn",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Comma-separated JSON fields or approved dotted JSON paths to project from the response",
            "in": "query",
            "name": "fields",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/internal_modules_businessregistry.lookupResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Not Found"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Service Unavailable"
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "summary": "Look up an ACN for advisory wholesale autofill",
        "tags": [
          "business-registry"
        ]
      }
    },
    "/campaign-compositions": {
      "post": {
        "description": "Replacement campaign v2 contract. Marketless drafts are creator-private. Revision-checked operations preserve immutable identity. Publication requires a suitable promotion; accepted operations recover durably.",
        "operationId": "CreateCampaignComposition",
        "parameters": [
          {
            "description": "Persist the exact body and key before sending. Same actor/key/body resumes; changed body conflicts.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "maxLength": 128,
              "minLength": 16,
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/campaigns.CompositionRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/campaigns.OperationResult"
                    },
                    "success": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Completed command or current safe projection."
          },
          "202": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/campaigns.OperationResult"
                    },
                    "success": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Durably accepted, incomplete. Follow operation_id. A failed peer receipt leaves applicability fenced."
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Before durable acceptance error.details.accepted is false. Ambiguous persistence returns accepted=unknown and operation_id; after acceptance accepted=true and operation_id. Details values are strings. Authentication middleware rejects before execution. Reuse the same frozen command after uncertain delivery."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Before durable acceptance error.details.accepted is false. Ambiguous persistence returns accepted=unknown and operation_id; after acceptance accepted=true and operation_id. Details values are strings. Authentication middleware rejects before execution. Reuse the same frozen command after uncertain delivery."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Before durable acceptance error.details.accepted is false. Ambiguous persistence returns accepted=unknown and operation_id; after acceptance accepted=true and operation_id. Details values are strings. Authentication middleware rejects before execution. Reuse the same frozen command after uncertain delivery."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Before durable acceptance error.details.accepted is false. Ambiguous persistence returns accepted=unknown and operation_id; after acceptance accepted=true and operation_id. Details values are strings. Authentication middleware rejects before execution. Reuse the same frozen command after uncertain delivery."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Before durable acceptance error.details.accepted is false. Ambiguous persistence returns accepted=unknown and operation_id; after acceptance accepted=true and operation_id. Details values are strings. Authentication middleware rejects before execution. Reuse the same frozen command after uncertain delivery."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Before durable acceptance error.details.accepted is false. Ambiguous persistence returns accepted=unknown and operation_id; after acceptance accepted=true and operation_id. Details values are strings. Authentication middleware rejects before execution. Reuse the same frozen command after uncertain delivery."
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "servers": [
          {
            "url": "/v2"
          }
        ],
        "summary": "CreateCampaignComposition",
        "tags": [
          "campaign-compositions"
        ]
      }
    },
    "/campaign-compositions/by-key": {
      "get": {
        "description": "Replacement campaign v2 contract. Marketless drafts are creator-private. Revision-checked operations preserve immutable identity. Publication requires a suitable promotion; accepted operations recover durably.",
        "operationId": "GetCampaignCompositionByKey",
        "parameters": [
          {
            "description": "Original composition create key, scoped to the authenticated actor.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "maxLength": 128,
              "minLength": 16,
              "type": "string"
            }
          },
          {
            "description": "Comma-separated approved JSON projection fields.",
            "in": "query",
            "name": "fields",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/campaigns.CompositionAdmissionResponse"
                }
              }
            },
            "description": "Authoritative safe status; unknown does not permit discarding the original recovery key.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store",
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Invalid original key."
          },
          "401": {
            "description": "Authentication required."
          },
          "403": {
            "description": "Required promotion or coupon read permission missing."
          },
          "404": {
            "description": "An admitted operation is outside the current actor or campaign scope. Not proof of non-admission."
          },
          "503": {
            "description": "Authoritative store unavailable; outcome remains unknown."
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "servers": [
          {
            "url": "/v2"
          }
        ],
        "summary": "Look up composition admission using the saved original key",
        "tags": [
          "campaign-compositions"
        ]
      }
    },
    "/campaign-compositions/cancellations": {
      "post": {
        "description": "Replacement campaign v2 contract. Marketless drafts are creator-private. Revision-checked operations preserve immutable identity. Publication requires a suitable promotion; accepted operations recover durably.",
        "operationId": "CancelCampaignCompositionByKey",
        "parameters": [
          {
            "description": "New cancellation key, distinct from original_idempotency_key. Same actor/key/target replays; changed target conflicts.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "maxLength": 128,
              "minLength": 16,
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/campaigns.CompositionCancellationRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/campaigns.CompositionAdmissionResponse"
                }
              }
            },
            "description": "Durable cancelled_before_admission receipt or completed abort saga for admitted work."
          },
          "202": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/campaigns.CompositionAdmissionResponse"
                }
              }
            },
            "description": "Abort saga durably admitted and incomplete. Preserve both keys and follow the original by-key status."
          },
          "400": {
            "description": "Invalid or identical keys, or invalid strict JSON body."
          },
          "401": {
            "description": "Authentication required."
          },
          "403": {
            "description": "Required promotion or coupon write/publish permission missing."
          },
          "404": {
            "description": "Admitted operation outside current actor or campaign scope; not proof of non-admission."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Key conflict, completed or unsafe operation, uncertain inline draft, or live worker lease. Retryable lease/inline conflicts include string error.details.retryable=true and original_operation_id. Retain original key/body and locks until an authoritative terminal status."
          },
          "503": {
            "description": "Store or required peer unavailable; no terminal cancellation can be claimed."
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "servers": [
          {
            "url": "/v2"
          }
        ],
        "summary": "Cancel a composition with only its original idempotency key",
        "tags": [
          "campaign-compositions"
        ]
      }
    },
    "/campaign-compositions/{operationID}": {
      "get": {
        "description": "Replacement campaign v2 contract. Marketless drafts are creator-private. Revision-checked operations preserve immutable identity. Publication requires a suitable promotion; accepted operations recover durably.",
        "operationId": "GetCampaignCompositionOperation",
        "parameters": [
          {
            "in": "path",
            "name": "operationID",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Comma-separated approved JSON projection fields.",
            "in": "query",
            "name": "fields",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/campaigns.OperationResult"
                    },
                    "success": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Completed command or current safe projection."
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Invalid, denied, missing, conflicting or unavailable authoritative data."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Invalid, denied, missing, conflicting or unavailable authoritative data."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Invalid, denied, missing, conflicting or unavailable authoritative data."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Invalid, denied, missing, conflicting or unavailable authoritative data."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Invalid, denied, missing, conflicting or unavailable authoritative data."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Invalid, denied, missing, conflicting or unavailable authoritative data."
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "servers": [
          {
            "url": "/v2"
          }
        ],
        "summary": "GetCampaignCompositionOperation",
        "tags": [
          "campaign-compositions"
        ]
      }
    },
    "/campaign-compositions/{operationID}/abort": {
      "post": {
        "description": "Replacement campaign v2 contract. Marketless drafts are creator-private. Revision-checked operations preserve immutable identity. Publication requires a suitable promotion; accepted operations recover durably.",
        "operationId": "AbortCampaignComposition",
        "parameters": [
          {
            "in": "path",
            "name": "operationID",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Persist the exact body and key before sending. Same actor/key/body resumes; changed body conflicts.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "maxLength": 128,
              "minLength": 16,
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/campaigns.EmptyCommand"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/campaigns.OperationResult"
                    },
                    "success": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Completed command or current safe projection."
          },
          "202": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/campaigns.OperationResult"
                    },
                    "success": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Durably accepted, incomplete. Follow operation_id. A failed peer receipt leaves applicability fenced."
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Before durable acceptance error.details.accepted is false. Ambiguous persistence returns accepted=unknown and operation_id; after acceptance accepted=true and operation_id. Details values are strings. Authentication middleware rejects before execution. Reuse the same frozen command after uncertain delivery."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Before durable acceptance error.details.accepted is false. Ambiguous persistence returns accepted=unknown and operation_id; after acceptance accepted=true and operation_id. Details values are strings. Authentication middleware rejects before execution. Reuse the same frozen command after uncertain delivery."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Before durable acceptance error.details.accepted is false. Ambiguous persistence returns accepted=unknown and operation_id; after acceptance accepted=true and operation_id. Details values are strings. Authentication middleware rejects before execution. Reuse the same frozen command after uncertain delivery."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Before durable acceptance error.details.accepted is false. Ambiguous persistence returns accepted=unknown and operation_id; after acceptance accepted=true and operation_id. Details values are strings. Authentication middleware rejects before execution. Reuse the same frozen command after uncertain delivery."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Before durable acceptance error.details.accepted is false. Ambiguous persistence returns accepted=unknown and operation_id; after acceptance accepted=true and operation_id. Details values are strings. Authentication middleware rejects before execution. Reuse the same frozen command after uncertain delivery."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Before durable acceptance error.details.accepted is false. Ambiguous persistence returns accepted=unknown and operation_id; after acceptance accepted=true and operation_id. Details values are strings. Authentication middleware rejects before execution. Reuse the same frozen command after uncertain delivery."
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "servers": [
          {
            "url": "/v2"
          }
        ],
        "summary": "AbortCampaignComposition",
        "tags": [
          "campaign-compositions"
        ]
      }
    },
    "/campaign-offers/resolve": {
      "post": {
        "description": "Replacement campaign v2 contract. Marketless drafts are creator-private. Revision-checked operations preserve immutable identity. Publication requires a suitable promotion; accepted operations recover durably.",
        "operationId": "ResolveCampaignOffers",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/campaigns.ResolveRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/campaigns.ResolveResponse"
                    },
                    "success": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Completed command or current safe projection."
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Invalid, denied, missing, conflicting or unavailable authoritative data."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Invalid, denied, missing, conflicting or unavailable authoritative data."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Invalid, denied, missing, conflicting or unavailable authoritative data."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Invalid, denied, missing, conflicting or unavailable authoritative data."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Invalid, denied, missing, conflicting or unavailable authoritative data."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Invalid, denied, missing, conflicting or unavailable authoritative data."
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "servers": [
          {
            "url": "/v2"
          }
        ],
        "summary": "ResolveCampaignOffers",
        "tags": [
          "campaign-compositions"
        ]
      }
    },
    "/campaigns": {
      "get": {
        "description": "Replacement campaign v2 contract. Marketless drafts are creator-private. Revision-checked operations preserve immutable identity. Publication requires a suitable promotion; accepted operations recover durably.",
        "parameters": [
          {
            "description": "Linked offer kind; must be supplied together with one nonblank offer_id. Matches the same current offers element and preserves authorization and pagination. Duplicate query parameters are rejected.",
            "in": "query",
            "name": "offer_kind",
            "schema": {
              "enum": [
                "promotion",
                "coupon"
              ],
              "type": "string"
            }
          },
          {
            "description": "Exact opaque offer ID, not a coupon redemption code. Requires offer_kind; blank, surrounding whitespace, colon, slash and NUL are invalid.",
            "in": "query",
            "name": "offer_id",
            "schema": {
              "maxLength": 128,
              "minLength": 1,
              "type": "string"
            }
          },
          {
            "description": "Persisted publication status, independent of the effective schedule status.",
            "in": "query",
            "name": "publication_status",
            "schema": {
              "$ref": "#/components/schemas/campaign_enums.CampaignStatus"
            }
          },
          {
            "description": "Exact owning market code; narrows the caller's authorized campaigns.",
            "in": "query",
            "name": "market_code",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Sort before pagination, with ascending identity as a stable tiebreaker. When omitted, preserve priority descending, creation time descending, then identity ascending. Unscheduled drafts sort before dates ascending and after dates descending.",
            "in": "query",
            "name": "sort_by",
            "schema": {
              "enum": [
                "updated_at",
                "starts_at"
              ],
              "type": "string"
            }
          },
          {
            "description": "Requires sort_by. Explicit sorting defaults to descending.",
            "in": "query",
            "name": "order",
            "schema": {
              "enum": [
                "asc",
                "desc"
              ],
              "type": "string"
            }
          },
          {
            "description": "Optional canonical placement filter. Retired and unknown names are rejected.",
            "in": "query",
            "name": "placement",
            "schema": {
              "$ref": "#/components/schemas/campaign_enums.CampaignPlacement"
            }
          },
          {
            "description": "Search campaign title or message (max 200 characters)",
            "in": "query",
            "name": "q",
            "schema": {
              "maxLength": 200,
              "type": "string"
            }
          },
          {
            "description": "Page number (1-based)",
            "in": "query",
            "name": "page",
            "schema": {
              "type": "integer"
            }
          },
          {
            "description": "Items per page (max 200)",
            "in": "query",
            "name": "page_size",
            "schema": {
              "type": "integer"
            }
          },
          {
            "description": "Comma-separated JSON fields or approved dotted JSON paths to project from the response",
            "in": "query",
            "name": "fields",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "data = { items: [], page: {...} }"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Forbidden"
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "servers": [
          {
            "url": "/v2"
          }
        ],
        "summary": "List campaigns",
        "tags": [
          "campaigns"
        ]
      },
      "post": {
        "description": "Accepts {}. Creates an actor-owned immutable draft. Idempotency-Key binds actor and exact authored input. Assigning a market resolves canonical country/currency and checks staff scope. Removed fields and server-owned fields are rejected.",
        "parameters": [
          {
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "maxLength": 128,
              "minLength": 16,
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/campaigns.DraftInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/campaign.Campaign"
                    },
                    "success": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Actor-owned draft created; empty authored input is valid."
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Forbidden"
          },
          "409": {
            "description": "Idempotency key was used with another authored request."
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "servers": [
          {
            "url": "/v2"
          }
        ],
        "summary": "Create a campaign",
        "tags": [
          "campaigns"
        ]
      }
    },
    "/campaigns/bulk/archive": {
      "post": {
        "description": "Replacement campaign v2 contract. Marketless drafts are creator-private. Revision-checked operations preserve immutable identity. Publication requires a suitable promotion; accepted operations recover durably.",
        "operationId": "bulkArchiveCampaigns",
        "parameters": [
          {
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "maxLength": 128,
              "minLength": 16,
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/campaigns.BulkLifecycleInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "202": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/campaigns.BulkLifecycleResult"
                    },
                    "success": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Per-campaign durable operation results; acceptance is not completion."
          },
          "400": {
            "description": "Invalid batch"
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "servers": [
          {
            "url": "/v2"
          }
        ],
        "summary": "Atomically archive selected standalone campaigns",
        "tags": [
          "campaigns"
        ]
      }
    },
    "/campaigns/bulk/pause": {
      "post": {
        "description": "Replacement campaign v2 contract. Marketless drafts are creator-private. Revision-checked operations preserve immutable identity. Publication requires a suitable promotion; accepted operations recover durably.",
        "operationId": "bulkDeactivateCampaigns",
        "parameters": [
          {
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "maxLength": 128,
              "minLength": 16,
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/campaigns.BulkLifecycleInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "202": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/campaigns.BulkLifecycleResult"
                    },
                    "success": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Per-campaign durable operation results; acceptance is not completion."
          },
          "400": {
            "description": "Invalid batch"
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "servers": [
          {
            "url": "/v2"
          }
        ],
        "summary": "Atomically deactivate selected standalone campaigns",
        "tags": [
          "campaigns"
        ]
      }
    },
    "/campaigns/{campaignCode}": {
      "delete": {
        "description": "Replacement campaign v2 contract. Marketless drafts are creator-private. Revision-checked operations preserve immutable identity. Publication requires a suitable promotion; accepted operations recover durably.",
        "parameters": [
          {
            "description": "Immutable campaign code",
            "in": "path",
            "name": "campaignCode",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "OK"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Not Found"
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "servers": [
          {
            "url": "/v2"
          }
        ],
        "summary": "Delete a campaign",
        "tags": [
          "campaigns"
        ]
      },
      "get": {
        "description": "Replacement campaign v2 contract. Marketless drafts are creator-private. Revision-checked operations preserve immutable identity. Publication requires a suitable promotion; accepted operations recover durably.",
        "parameters": [
          {
            "description": "Immutable campaign code",
            "in": "path",
            "name": "campaignCode",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Comma-separated JSON fields or approved dotted JSON paths to project from the response",
            "in": "query",
            "name": "fields",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "OK"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Not Found"
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "servers": [
          {
            "url": "/v2"
          }
        ],
        "summary": "Get a campaign by id",
        "tags": [
          "campaigns"
        ]
      },
      "put": {
        "description": "Replacement campaign v2 contract. Marketless drafts are creator-private. Revision-checked operations preserve immutable identity. Publication requires a suitable promotion; accepted operations recover durably.",
        "parameters": [
          {
            "description": "Immutable campaign code",
            "in": "path",
            "name": "campaignCode",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "ETag returned by the campaign detail endpoint",
            "in": "header",
            "name": "If-Match",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/campaigns.DraftInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Conflict"
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "servers": [
          {
            "url": "/v2"
          }
        ],
        "summary": "Update a campaign",
        "tags": [
          "campaigns"
        ]
      }
    },
    "/campaigns/{campaignCode}/composition": {
      "get": {
        "description": "Replacement campaign v2 contract. Marketless drafts are creator-private. Revision-checked operations preserve immutable identity. Publication requires a suitable promotion; accepted operations recover durably.",
        "operationId": "ReadCampaignComposition",
        "parameters": [
          {
            "in": "path",
            "name": "campaignCode",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Comma-separated approved JSON projection fields.",
            "in": "query",
            "name": "fields",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/campaigns.CompositionView"
                    },
                    "success": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Completed command or current safe projection."
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Invalid, denied, missing, conflicting or unavailable authoritative data."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Invalid, denied, missing, conflicting or unavailable authoritative data."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Invalid, denied, missing, conflicting or unavailable authoritative data."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Invalid, denied, missing, conflicting or unavailable authoritative data."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Invalid, denied, missing, conflicting or unavailable authoritative data."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Invalid, denied, missing, conflicting or unavailable authoritative data."
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "servers": [
          {
            "url": "/v2"
          }
        ],
        "summary": "ReadCampaignComposition",
        "tags": [
          "campaign-compositions"
        ]
      }
    },
    "/campaigns/{campaignCode}/offers/{kind}/{offerID}/attach": {
      "post": {
        "description": "Replacement campaign v2 contract. Marketless drafts are creator-private. Revision-checked operations preserve immutable identity. Publication requires a suitable promotion; accepted operations recover durably.",
        "operationId": "AttachCampaignOffer",
        "parameters": [
          {
            "in": "path",
            "name": "campaignCode",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "kind",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "offerID",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Persist the exact body and key before sending. Same actor/key/body resumes; changed body conflicts.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "maxLength": 128,
              "minLength": 16,
              "type": "string"
            }
          },
          {
            "description": "Exact campaign_etag from the composition read.",
            "in": "header",
            "name": "If-Match",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/campaigns.AssociationRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/campaigns.OperationResult"
                    },
                    "success": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Completed command or current safe projection."
          },
          "202": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/campaigns.OperationResult"
                    },
                    "success": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Durably accepted, incomplete. Follow operation_id. A failed peer receipt leaves applicability fenced."
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Before durable acceptance error.details.accepted is false. Ambiguous persistence returns accepted=unknown and operation_id; after acceptance accepted=true and operation_id. Details values are strings. Authentication middleware rejects before execution. Reuse the same frozen command after uncertain delivery."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Before durable acceptance error.details.accepted is false. Ambiguous persistence returns accepted=unknown and operation_id; after acceptance accepted=true and operation_id. Details values are strings. Authentication middleware rejects before execution. Reuse the same frozen command after uncertain delivery."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Before durable acceptance error.details.accepted is false. Ambiguous persistence returns accepted=unknown and operation_id; after acceptance accepted=true and operation_id. Details values are strings. Authentication middleware rejects before execution. Reuse the same frozen command after uncertain delivery."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Before durable acceptance error.details.accepted is false. Ambiguous persistence returns accepted=unknown and operation_id; after acceptance accepted=true and operation_id. Details values are strings. Authentication middleware rejects before execution. Reuse the same frozen command after uncertain delivery."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Before durable acceptance error.details.accepted is false. Ambiguous persistence returns accepted=unknown and operation_id; after acceptance accepted=true and operation_id. Details values are strings. Authentication middleware rejects before execution. Reuse the same frozen command after uncertain delivery."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Before durable acceptance error.details.accepted is false. Ambiguous persistence returns accepted=unknown and operation_id; after acceptance accepted=true and operation_id. Details values are strings. Authentication middleware rejects before execution. Reuse the same frozen command after uncertain delivery."
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "servers": [
          {
            "url": "/v2"
          }
        ],
        "summary": "AttachCampaignOffer",
        "tags": [
          "campaign-compositions"
        ]
      }
    },
    "/campaigns/{campaignCode}/offers/{kind}/{offerID}/detach": {
      "post": {
        "description": "Replacement campaign v2 contract. Marketless drafts are creator-private. Revision-checked operations preserve immutable identity. Publication requires a suitable promotion; accepted operations recover durably.",
        "operationId": "DetachCampaignOffer",
        "parameters": [
          {
            "in": "path",
            "name": "campaignCode",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "kind",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "offerID",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Persist the exact body and key before sending. Same actor/key/body resumes; changed body conflicts.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "maxLength": 128,
              "minLength": 16,
              "type": "string"
            }
          },
          {
            "description": "Exact campaign_etag from the composition read.",
            "in": "header",
            "name": "If-Match",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/campaigns.AssociationRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/campaigns.OperationResult"
                    },
                    "success": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Completed command or current safe projection."
          },
          "202": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/campaigns.OperationResult"
                    },
                    "success": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Durably accepted, incomplete. Follow operation_id. A failed peer receipt leaves applicability fenced."
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Before durable acceptance error.details.accepted is false. Ambiguous persistence returns accepted=unknown and operation_id; after acceptance accepted=true and operation_id. Details values are strings. Authentication middleware rejects before execution. Reuse the same frozen command after uncertain delivery."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Before durable acceptance error.details.accepted is false. Ambiguous persistence returns accepted=unknown and operation_id; after acceptance accepted=true and operation_id. Details values are strings. Authentication middleware rejects before execution. Reuse the same frozen command after uncertain delivery."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Before durable acceptance error.details.accepted is false. Ambiguous persistence returns accepted=unknown and operation_id; after acceptance accepted=true and operation_id. Details values are strings. Authentication middleware rejects before execution. Reuse the same frozen command after uncertain delivery."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Before durable acceptance error.details.accepted is false. Ambiguous persistence returns accepted=unknown and operation_id; after acceptance accepted=true and operation_id. Details values are strings. Authentication middleware rejects before execution. Reuse the same frozen command after uncertain delivery."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Before durable acceptance error.details.accepted is false. Ambiguous persistence returns accepted=unknown and operation_id; after acceptance accepted=true and operation_id. Details values are strings. Authentication middleware rejects before execution. Reuse the same frozen command after uncertain delivery."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Before durable acceptance error.details.accepted is false. Ambiguous persistence returns accepted=unknown and operation_id; after acceptance accepted=true and operation_id. Details values are strings. Authentication middleware rejects before execution. Reuse the same frozen command after uncertain delivery."
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "servers": [
          {
            "url": "/v2"
          }
        ],
        "summary": "DetachCampaignOffer",
        "tags": [
          "campaign-compositions"
        ]
      }
    },
    "/campaigns/{campaignCode}/operations": {
      "post": {
        "operationId": "CampaignOperations",
        "parameters": [
          {
            "in": "path",
            "name": "campaignCode",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "If-Match",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "maxLength": 128,
              "minLength": 16,
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/campaigns.ReviewRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/campaigns.OperationResult"
                    },
                    "success": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "OK"
          },
          "202": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/campaigns.OperationResult"
                    },
                    "success": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Durably accepted; poll operation status."
          },
          "400": {
            "description": "Invalid supplied fields"
          },
          "404": {
            "description": "Campaign unavailable in caller scope"
          },
          "409": {
            "description": "Stale campaign or offer revisions, missing or expired review"
          },
          "503": {
            "description": "Authority temporarily unavailable"
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "servers": [
          {
            "url": "/v2"
          }
        ],
        "tags": [
          "campaigns"
        ]
      }
    },
    "/campaigns/{campaignCode}/publication-operations": {
      "post": {
        "description": "Replacement campaign v2 contract. Marketless drafts are creator-private. Revision-checked operations preserve immutable identity. Publication requires a suitable promotion; accepted operations recover durably.",
        "operationId": "PublishCampaignOffers",
        "parameters": [
          {
            "in": "path",
            "name": "campaignCode",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Persist the exact body and key before sending. Same actor/key/body resumes; changed body conflicts.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "maxLength": 128,
              "minLength": 16,
              "type": "string"
            }
          },
          {
            "description": "Exact campaign_etag from the composition read.",
            "in": "header",
            "name": "If-Match",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/campaigns.PublicationRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/campaigns.OperationResult"
                    },
                    "success": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Completed command or current safe projection."
          },
          "202": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/campaigns.OperationResult"
                    },
                    "success": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Durably accepted, incomplete. Follow operation_id. A failed peer receipt leaves applicability fenced."
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Before durable acceptance error.details.accepted is false. Ambiguous persistence returns accepted=unknown and operation_id; after acceptance accepted=true and operation_id. Details values are strings. Authentication middleware rejects before execution. Reuse the same frozen command after uncertain delivery."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Before durable acceptance error.details.accepted is false. Ambiguous persistence returns accepted=unknown and operation_id; after acceptance accepted=true and operation_id. Details values are strings. Authentication middleware rejects before execution. Reuse the same frozen command after uncertain delivery."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Before durable acceptance error.details.accepted is false. Ambiguous persistence returns accepted=unknown and operation_id; after acceptance accepted=true and operation_id. Details values are strings. Authentication middleware rejects before execution. Reuse the same frozen command after uncertain delivery."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Before durable acceptance error.details.accepted is false. Ambiguous persistence returns accepted=unknown and operation_id; after acceptance accepted=true and operation_id. Details values are strings. Authentication middleware rejects before execution. Reuse the same frozen command after uncertain delivery."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Before durable acceptance error.details.accepted is false. Ambiguous persistence returns accepted=unknown and operation_id; after acceptance accepted=true and operation_id. Details values are strings. Authentication middleware rejects before execution. Reuse the same frozen command after uncertain delivery."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Before durable acceptance error.details.accepted is false. Ambiguous persistence returns accepted=unknown and operation_id; after acceptance accepted=true and operation_id. Details values are strings. Authentication middleware rejects before execution. Reuse the same frozen command after uncertain delivery."
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "servers": [
          {
            "url": "/v2"
          }
        ],
        "summary": "PublishCampaignOffers",
        "tags": [
          "campaign-compositions"
        ]
      }
    },
    "/campaigns/{campaignCode}/update-operations": {
      "post": {
        "description": "Replacement campaign v2 contract. Marketless drafts are creator-private. Revision-checked operations preserve immutable identity. Publication requires a suitable promotion; accepted operations recover durably.",
        "operationId": "UpdateCampaignComposition",
        "parameters": [
          {
            "in": "path",
            "name": "campaignCode",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Persist the exact body and key before sending. Same actor/key/body resumes; changed body conflicts.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "maxLength": 128,
              "minLength": 16,
              "type": "string"
            }
          },
          {
            "description": "Exact campaign_etag from the composition read.",
            "in": "header",
            "name": "If-Match",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/campaigns.CampaignUpdateRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/campaigns.OperationResult"
                    },
                    "success": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Completed command or current safe projection."
          },
          "202": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/campaigns.OperationResult"
                    },
                    "success": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Durably accepted, incomplete. Follow operation_id. A failed peer receipt leaves applicability fenced."
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Before durable acceptance error.details.accepted is false. Ambiguous persistence returns accepted=unknown and operation_id; after acceptance accepted=true and operation_id. Details values are strings. Authentication middleware rejects before execution. Reuse the same frozen command after uncertain delivery."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Before durable acceptance error.details.accepted is false. Ambiguous persistence returns accepted=unknown and operation_id; after acceptance accepted=true and operation_id. Details values are strings. Authentication middleware rejects before execution. Reuse the same frozen command after uncertain delivery."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Before durable acceptance error.details.accepted is false. Ambiguous persistence returns accepted=unknown and operation_id; after acceptance accepted=true and operation_id. Details values are strings. Authentication middleware rejects before execution. Reuse the same frozen command after uncertain delivery."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Before durable acceptance error.details.accepted is false. Ambiguous persistence returns accepted=unknown and operation_id; after acceptance accepted=true and operation_id. Details values are strings. Authentication middleware rejects before execution. Reuse the same frozen command after uncertain delivery."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Before durable acceptance error.details.accepted is false. Ambiguous persistence returns accepted=unknown and operation_id; after acceptance accepted=true and operation_id. Details values are strings. Authentication middleware rejects before execution. Reuse the same frozen command after uncertain delivery."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Before durable acceptance error.details.accepted is false. Ambiguous persistence returns accepted=unknown and operation_id; after acceptance accepted=true and operation_id. Details values are strings. Authentication middleware rejects before execution. Reuse the same frozen command after uncertain delivery."
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "servers": [
          {
            "url": "/v2"
          }
        ],
        "summary": "UpdateCampaignComposition",
        "tags": [
          "campaign-compositions"
        ]
      }
    },
    "/campaigns/{campaignCode}/validate": {
      "post": {
        "description": "Review binds actor, proposed action, campaign and every offer revision for ten minutes. Admission rechecks authority and revisions. An admitted operation survives token expiry.",
        "operationId": "CampaignValidate",
        "parameters": [
          {
            "in": "path",
            "name": "campaignCode",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "If-Match",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/campaigns.ReviewRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/campaigns.ValidationResult"
                    },
                    "success": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "description": "Invalid supplied fields"
          },
          "404": {
            "description": "Campaign unavailable in caller scope"
          },
          "409": {
            "description": "Stale campaign or offer revisions, missing or expired review"
          },
          "503": {
            "description": "Authority temporarily unavailable"
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "servers": [
          {
            "url": "/v2"
          }
        ],
        "tags": [
          "campaigns"
        ]
      }
    },
    "/group-order-manager-applications": {
      "get": {
        "parameters": [
          {
            "description": "pending, approved, rejected, or cancelled",
            "in": "query",
            "name": "status",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Comma-separated JSON fields or approved dotted JSON paths to project from the response",
            "in": "query",
            "name": "fields",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "OK"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Forbidden"
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "summary": "List group-order-manager applications for admin review",
        "tags": [
          "group-order-manager-applications"
        ]
      }
    },
    "/group-order-manager-applications/{applicationNumber}": {
      "get": {
        "parameters": [
          {
            "description": "Application number",
            "in": "path",
            "name": "applicationNumber",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Comma-separated JSON fields or approved dotted JSON paths to project from the response",
            "in": "query",
            "name": "fields",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "OK"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Not Found"
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "summary": "Get a group-order-manager application for admin review",
        "tags": [
          "group-order-manager-applications"
        ]
      }
    },
    "/group-order-manager-applications/{applicationNumber}/approve": {
      "post": {
        "parameters": [
          {
            "description": "Application number",
            "in": "path",
            "name": "applicationNumber",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "object"
                  },
                  {
                    "$ref": "#/components/schemas/internal_modules_groupordermanagerapplications.DecisionInput",
                    "description": "Decision",
                    "summary": "body"
                  }
                ]
              }
            }
          },
          "description": "Decision"
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "OK"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Conflict"
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "summary": "Approve a group-order-manager application",
        "tags": [
          "group-order-manager-applications"
        ]
      }
    },
    "/group-order-manager-applications/{applicationNumber}/reject": {
      "post": {
        "parameters": [
          {
            "description": "Application number",
            "in": "path",
            "name": "applicationNumber",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "object"
                  },
                  {
                    "$ref": "#/components/schemas/internal_modules_groupordermanagerapplications.DecisionInput",
                    "description": "Decision",
                    "summary": "body"
                  }
                ]
              }
            }
          },
          "description": "Decision"
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "OK"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Conflict"
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "summary": "Reject or revoke a group-order-manager application",
        "tags": [
          "group-order-manager-applications"
        ]
      }
    },
    "/me/addresses": {
      "get": {
        "parameters": [
          {
            "description": "Comma-separated JSON fields or approved dotted JSON paths to project from the response",
            "in": "query",
            "name": "fields",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "OK"
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "summary": "List the authenticated customer's saved addresses",
        "tags": [
          "retail-customers"
        ]
      },
      "post": {
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "object"
                  },
                  {
                    "$ref": "#/components/schemas/internal_modules_retailcustomers.SavedAddressInput",
                    "description": "Saved address and optional default selection",
                    "summary": "body"
                  }
                ]
              }
            }
          },
          "description": "Saved address and optional default selection",
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Created"
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "summary": "Create a saved address for the authenticated customer",
        "tags": [
          "retail-customers"
        ]
      }
    },
    "/me/addresses/{id}": {
      "delete": {
        "description": "Deletes the member and clears any shipping or billing default that references it in one transaction. No remaining address is selected automatically.",
        "parameters": [
          {
            "description": "Saved address id",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "OK"
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "summary": "Delete one saved address owned by the authenticated customer",
        "tags": [
          "retail-customers"
        ]
      },
      "patch": {
        "parameters": [
          {
            "description": "Saved address id",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "object"
                  },
                  {
                    "$ref": "#/components/schemas/internal_modules_retailcustomers.SavedAddressInput",
                    "description": "Saved address and optional default selection",
                    "summary": "body"
                  }
                ]
              }
            }
          },
          "description": "Saved address and optional default selection",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "OK"
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "summary": "Replace one saved address owned by the authenticated customer",
        "tags": [
          "retail-customers"
        ]
      }
    },
    "/me/campaigns": {
      "get": {
        "description": "Authenticated retail identity is resolved by Customers. Backend-decided actions only; Cache-Control: private, no-store and Vary: Authorization.",
        "parameters": [
          {
            "description": "Market the campaigns belong to. Required: a country code is not a market, and campaigns are never merged across markets.",
            "in": "query",
            "name": "market_code",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Optional position filter.",
            "in": "query",
            "name": "placement",
            "schema": {
              "$ref": "#/components/schemas/campaign_enums.CampaignPlacement"
            }
          },
          {
            "description": "Client platform (web|mobile)",
            "in": "query",
            "name": "platform",
            "required": true,
            "schema": {
              "enum": [
                "web",
                "mobile"
              ],
              "type": "string"
            }
          },
          {
            "description": "Campaign audience; defaults to retail.",
            "in": "query",
            "name": "customer_type",
            "schema": {
              "enum": [
                "retail",
                "wholesale"
              ],
              "type": "string"
            }
          },
          {
            "description": "ISO country code, validated with the selected market",
            "in": "query",
            "name": "country_code",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "ISO subdivision code (for example AU-NSW)",
            "in": "query",
            "name": "state_code",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Exact depot identifier",
            "in": "query",
            "name": "depot_code",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Comma-separated JSON fields or approved dotted JSON paths to project from the response",
            "in": "query",
            "name": "fields",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/campaigns.StorefrontGroups"
                    },
                    "success": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Missing or invalid market_code, invalid query, or unavailable market facts"
          },
          "404": {
            "description": "Market not found; detail also returns this for an unavailable campaign"
          },
          "503": {
            "description": "Market, geography, or offer authority temporarily unavailable"
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "servers": [
          {
            "url": "/v2"
          }
        ],
        "summary": "List active storefront campaigns (public)",
        "tags": [
          "campaigns"
        ]
      }
    },
    "/me/campaigns/{campaignCode}": {
      "get": {
        "description": "Authenticated retail identity is resolved by Customers. Backend-decided actions only; Cache-Control: private, no-store and Vary: Authorization.",
        "parameters": [
          {
            "description": "Market the campaigns belong to. Required: a country code is not a market, and campaigns are never merged across markets.",
            "in": "query",
            "name": "market_code",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Optional position filter.",
            "in": "query",
            "name": "placement",
            "schema": {
              "$ref": "#/components/schemas/campaign_enums.CampaignPlacement"
            }
          },
          {
            "description": "Client platform (web|mobile)",
            "in": "query",
            "name": "platform",
            "required": true,
            "schema": {
              "enum": [
                "web",
                "mobile"
              ],
              "type": "string"
            }
          },
          {
            "description": "Campaign audience; defaults to retail.",
            "in": "query",
            "name": "customer_type",
            "schema": {
              "enum": [
                "retail",
                "wholesale"
              ],
              "type": "string"
            }
          },
          {
            "description": "ISO country code, validated with the selected market",
            "in": "query",
            "name": "country_code",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "ISO subdivision code (for example AU-NSW)",
            "in": "query",
            "name": "state_code",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Exact depot identifier",
            "in": "query",
            "name": "depot_code",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Comma-separated JSON fields or approved dotted JSON paths to project from the response",
            "in": "query",
            "name": "fields",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "campaignCode",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/campaigns.StorefrontCampaign"
                    },
                    "success": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Missing or invalid market_code, invalid query, or unavailable market facts"
          },
          "404": {
            "description": "Market not found; detail also returns this for an unavailable campaign"
          },
          "503": {
            "description": "Market, geography, or offer authority temporarily unavailable"
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "servers": [
          {
            "url": "/v2"
          }
        ],
        "summary": "List active storefront campaigns (public)",
        "tags": [
          "campaigns"
        ]
      }
    },
    "/me/group-order-manager-applications": {
      "get": {
        "parameters": [
          {
            "description": "Comma-separated JSON fields or approved dotted JSON paths to project from the response",
            "in": "query",
            "name": "fields",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "OK"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Forbidden"
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "summary": "List the retail account's group-order-manager applications",
        "tags": [
          "group-order-manager-applications"
        ]
      },
      "post": {
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "object"
                  },
                  {
                    "$ref": "#/components/schemas/internal_modules_groupordermanagerapplications.CreateInput",
                    "description": "Application",
                    "summary": "body"
                  }
                ]
              }
            }
          },
          "description": "Application",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Forbidden"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Conflict"
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "summary": "Apply to become a group-order manager",
        "tags": [
          "group-order-manager-applications"
        ]
      }
    },
    "/me/group-order-manager-applications/{applicationNumber}": {
      "delete": {
        "parameters": [
          {
            "description": "Application number",
            "in": "path",
            "name": "applicationNumber",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "OK"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Conflict"
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "summary": "Withdraw a pending group-order-manager application",
        "tags": [
          "group-order-manager-applications"
        ]
      },
      "get": {
        "parameters": [
          {
            "description": "Application number",
            "in": "path",
            "name": "applicationNumber",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Comma-separated JSON fields or approved dotted JSON paths to project from the response",
            "in": "query",
            "name": "fields",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "OK"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Not Found"
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "summary": "Get the retail account's group-order-manager application",
        "tags": [
          "group-order-manager-applications"
        ]
      }
    },
    "/me/retail-customer": {
      "get": {
        "description": "Returns profile completion derived from the seven equally weighted Customers profile fields. Profile email and phone presence count independently of account verification; no Identity verification lookup is required.",
        "parameters": [
          {
            "description": "Comma-separated JSON fields or approved dotted JSON paths to project from the response",
            "in": "query",
            "name": "fields",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "OK"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Not Found"
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "summary": "Get the authenticated customer's own retail-customer profile",
        "tags": [
          "retail-customers"
        ]
      }
    },
    "/me/retail-customer/profile": {
      "patch": {
        "description": "Updates profile contacts separately from address recipients. Profile completion uses seven equally weighted filled fields, including the profile contact phone independently of account verification. This operation does not verify an Identity account phone or change checkout verification requirements.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "object"
                  },
                  {
                    "$ref": "#/components/schemas/internal_modules_retailcustomers.SelfProfileUpdateInput",
                    "description": "Profile fields to update",
                    "summary": "body"
                  }
                ]
              }
            }
          },
          "description": "Profile fields to update",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Unauthorized"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Not Found"
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "summary": "Update the authenticated customer's own retail profile",
        "tags": [
          "retail-customers"
        ]
      }
    },
    "/me/retail-customer/profile-coupon/claim": {
      "post": {
        "description": "Resolves the authenticated subject's retail profile, then requests the verified Pricing programme coupon. No customer identity or coupon ID is accepted from the caller. Profile completion is rechecked by Pricing.",
        "operationId": "claimMyProfileProgrammeCoupon",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "properties": {
                        "assignment_id": {
                          "type": "string"
                        },
                        "coupon_id": {
                          "type": "string"
                        },
                        "expires_at": {
                          "format": "date-time",
                          "type": "string"
                        }
                      },
                      "required": [
                        "coupon_id",
                        "assignment_id",
                        "expires_at"
                      ],
                      "type": "object"
                    },
                    "success": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Profile coupon entitlement"
          },
          "401": {
            "description": "Missing authentication"
          },
          "404": {
            "description": "Retail profile not found"
          },
          "409": {
            "description": "Profile coupon cannot be claimed"
          },
          "503": {
            "description": "Programme or claim authority unavailable"
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "summary": "Claim the configured profile completion coupon",
        "tags": [
          "retail-customers"
        ]
      }
    },
    "/me/retail-customer/programme-terms": {
      "get": {
        "description": "Resolves the authenticated retail profile and verifies the configured coupon definitions and market with Pricing. Returns 503 if the setting is missing or Pricing is unavailable. Availability is determined by Pricing from live configuration and the Customers capability. When Pricing refuses a configured coupon, the response is still 200 with status paused and no terms; market_code, country_code and currency are empty, every amount, count and revision is zero, every condition is false and referrer_revisions is empty. Those values are not offers.",
        "operationId": "getMyRetailProgrammeTerms",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "properties": {
                        "combines_with_coupons": {
                          "type": "boolean"
                        },
                        "combines_with_promotions": {
                          "type": "boolean"
                        },
                        "country_code": {
                          "type": "string"
                        },
                        "currency": {
                          "type": "string"
                        },
                        "delivery_and_pickup_eligible": {
                          "type": "boolean"
                        },
                        "discount_minor": {
                          "format": "int64",
                          "type": "integer"
                        },
                        "excludes_delivery": {
                          "type": "boolean"
                        },
                        "excludes_stored_value": {
                          "type": "boolean"
                        },
                        "market_code": {
                          "type": "string"
                        },
                        "minimum_merchandise_minor": {
                          "format": "int64",
                          "type": "integer"
                        },
                        "profile_claim_limit": {
                          "format": "int64",
                          "type": "integer"
                        },
                        "profile_coupon_id": {
                          "type": "string"
                        },
                        "profile_revision": {
                          "properties": {
                            "coupon_id": {
                              "type": "string"
                            },
                            "publication_revision": {
                              "format": "int64",
                              "minimum": 0,
                              "type": "integer"
                            },
                            "rule_revision": {
                              "format": "int64",
                              "minimum": 0,
                              "type": "integer"
                            },
                            "scope_revision": {
                              "format": "int64",
                              "minimum": 0,
                              "type": "integer"
                            }
                          },
                          "required": [
                            "coupon_id",
                            "scope_revision",
                            "rule_revision",
                            "publication_revision"
                          ],
                          "type": "object"
                        },
                        "redemptions_per_coupon": {
                          "format": "int64",
                          "type": "integer"
                        },
                        "referral_lifetime_limit": {
                          "format": "int64",
                          "type": "integer"
                        },
                        "referrer_revisions": {
                          "items": {
                            "properties": {
                              "coupon_id": {
                                "type": "string"
                              },
                              "publication_revision": {
                                "format": "int64",
                                "minimum": 0,
                                "type": "integer"
                              },
                              "rule_revision": {
                                "format": "int64",
                                "minimum": 0,
                                "type": "integer"
                              },
                              "scope_revision": {
                                "format": "int64",
                                "minimum": 0,
                                "type": "integer"
                              }
                            },
                            "required": [
                              "coupon_id",
                              "scope_revision",
                              "rule_revision",
                              "publication_revision"
                            ],
                            "type": "object"
                          },
                          "maxItems": 5,
                          "type": "array"
                        },
                        "requires_completed_order": {
                          "type": "boolean"
                        },
                        "status": {
                          "enum": [
                            "paused",
                            "active"
                          ],
                          "type": "string"
                        },
                        "validity_days": {
                          "format": "int64",
                          "type": "integer"
                        }
                      },
                      "required": [
                        "profile_revision",
                        "referrer_revisions",
                        "profile_coupon_id",
                        "excludes_delivery",
                        "excludes_stored_value",
                        "combines_with_promotions",
                        "combines_with_coupons",
                        "requires_completed_order",
                        "delivery_and_pickup_eligible",
                        "status",
                        "market_code",
                        "country_code",
                        "currency",
                        "discount_minor",
                        "minimum_merchandise_minor",
                        "validity_days",
                        "redemptions_per_coupon",
                        "profile_claim_limit",
                        "referral_lifetime_limit"
                      ],
                      "type": "object"
                    },
                    "success": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Verified programme terms and availability, or status paused with no terms when Pricing refuses a configured coupon"
          },
          "401": {
            "description": "Missing authentication"
          },
          "404": {
            "description": "Linked retail profile unavailable"
          },
          "503": {
            "description": "Programme configuration or Pricing unavailable"
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "summary": "Read verified coupon programme terms",
        "tags": [
          "retail-customers"
        ]
      }
    },
    "/me/retail-customer/receipt-preferences": {
      "put": {
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "object"
                  },
                  {
                    "$ref": "#/components/schemas/internal_modules_retailcustomers.ReceiptPreferencesInput",
                    "description": "Receipt formats the customer elects to receive",
                    "summary": "body"
                  }
                ]
              }
            }
          },
          "description": "Receipt formats the customer elects to receive",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Unauthorized"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Not Found"
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "summary": "Replace the authenticated customer's receipt preferences",
        "tags": [
          "retail-customers"
        ]
      }
    },
    "/me/retail-customer/referral-capacity": {
      "get": {
        "description": "Resolves only the authenticated subject's linked retail profile. Returns the current configured coupon-list cap with issued referrer-only rewards and in-flight reservations from one profile snapshot. Missing or invalid programme settings pause rewards and return 503. Remaining capacity includes reservations and never becomes negative. Does not issue rewards or change customer data. Does not establish reward value, validity, market availability or invitation eligibility. No customer identifier or field projection is accepted.",
        "operationId": "getMyRetailCustomerReferralCapacity",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/internal_modules_retailcustomers.referralCapacityResponse"
                }
              }
            },
            "description": "Current referrer reward capacity."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Missing or unacceptable authentication."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "No retail profile linked to the authenticated subject."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "SERVICE_UNAVAILABLE with the sanitized message \"referral capacity is unavailable\" when the profile cannot be read or referral state is missing or malformed. No customer data is repaired or changed."
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "summary": "Read the authenticated customer's referrer reward capacity",
        "tags": [
          "retail-customers"
        ]
      }
    },
    "/media": {
      "get": {
        "description": "Requires media.read and an authenticated workforce actor. Active images in campaign, home-hero, marketing-poster and website-asset are shared marketing-library assets regardless of uploader or data owner, and may be reused by geographically authorized campaign editors. Upload attribution is preserved. Membership tier cards still require exact owner and creator matches and a positive validated image generation. Always ordered by created_at descending then immutable record ID descending. Uses managed records, never raw bucket objects; public campaign-image access still requires a live campaign.",
        "parameters": [
          {
            "in": "query",
            "name": "folder",
            "schema": {
              "default": "marketing-poster",
              "enum": [
                "marketing-poster",
                "campaign",
                "home-hero",
                "website-asset",
                "membership-tier-card"
              ],
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "status",
            "schema": {
              "default": "active",
              "enum": [
                "active"
              ],
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "kind",
            "schema": {
              "default": "image",
              "enum": [
                "image"
              ],
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "page",
            "schema": {
              "default": 1,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "page_size",
            "schema": {
              "default": 50,
              "maximum": 100,
              "minimum": 1,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/media.ManagedImagePage"
                }
              }
            },
            "description": "Authorized image metadata and expiring previews"
          },
          "401": {
            "description": "Unauthenticated"
          },
          "403": {
            "description": "Missing media.read permission"
          },
          "422": {
            "description": "Unsupported folder, status or kind"
          },
          "503": {
            "description": "Managed collection unavailable"
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "summary": "List authorized active managed campaign and tier-card images",
        "tags": [
          "media"
        ]
      }
    },
    "/media/buckets": {
      "get": {
        "parameters": [
          {
            "description": "Comma-separated JSON fields or approved dotted JSON paths to project from the response",
            "in": "query",
            "name": "fields",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "OK"
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "summary": "List GCS buckets in the project (requires media.read)",
        "tags": [
          "media"
        ]
      },
      "post": {
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Created"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Conflict"
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "summary": "Create a new GCS bucket (requires media.upload)",
        "tags": [
          "media"
        ]
      }
    },
    "/media/buckets/{bucket}/objects": {
      "get": {
        "parameters": [
          {
            "description": "Bucket name",
            "in": "path",
            "name": "bucket",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Folder prefix",
            "in": "query",
            "name": "prefix",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Comma-separated JSON fields or approved dotted JSON paths to project from the response",
            "in": "query",
            "name": "fields",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "OK"
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "summary": "List folders and objects under a prefix in a bucket (requires media.read)",
        "tags": [
          "media"
        ]
      }
    },
    "/media/buckets/{bucket}/upload-url": {
      "post": {
        "parameters": [
          {
            "description": "Bucket name",
            "in": "path",
            "name": "bucket",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "OK"
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "summary": "Sign a direct upload URL into a chosen bucket + folder (requires media.upload)",
        "tags": [
          "media"
        ]
      }
    },
    "/media/finalize": {
      "post": {
        "description": "Finalize managed upload. Membership tier cards require media.upload, workforce identity and uploader ownership. Customers reads the exact uploaded generation and decodes image pixels; MIME/size/dimensions must match the allowed folder policy. An ACTIVE tier card with a validated generation returns the existing metadata on retry without another storage read. Concurrent finalizers may return the validated winner; deleted or unvalidated media is rejected.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "object"
                  },
                  {
                    "$ref": "#/components/schemas/internal_modules_media.FinalizeRequest",
                    "description": "Finalize request",
                    "summary": "body"
                  }
                ]
              }
            }
          },
          "description": "Finalize request",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Media not found."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Finalization changed concurrently without a validated ACTIVE winner."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Uploaded image fails MIME, size, encoding or dimension validation."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Immutable image storage is unavailable."
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "summary": "Finalize an upload",
        "tags": [
          "media"
        ]
      }
    },
    "/media/folders": {
      "get": {
        "description": "Returns the configured upload folders with their size and MIME-type limits. Any authenticated user.",
        "parameters": [
          {
            "description": "Comma-separated JSON fields or approved dotted JSON paths to project from the response",
            "in": "query",
            "name": "fields",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "OK"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Unauthorized"
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "summary": "List media folders",
        "tags": [
          "media"
        ]
      }
    },
    "/media/upload-url": {
      "post": {
        "description": "Returns a short-lived signed URL the client PUTs the file to, plus the media code to finalize with.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "object"
                  },
                  {
                    "$ref": "#/components/schemas/internal_modules_media.UploadRequest",
                    "description": "Upload request",
                    "summary": "body"
                  }
                ]
              }
            }
          },
          "description": "Upload request",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Forbidden"
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "summary": "Request an upload URL",
        "tags": [
          "media"
        ]
      }
    },
    "/media/{id}": {
      "delete": {
        "description": "Soft-deletes unreferenced ACTIVE media or a PENDING membership-tier-card draft. References and legal holds block deletion. Tier cards require workforce identity and exact creator/data-owner matches. Repeated tier-card deletion succeeds without changing its deletion timestamp. Other folders do not support pending cancellation. Storage remains until the externally scheduled reaper runs after its grace period.",
        "parameters": [
          {
            "description": "Media id",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Media state, references or legal hold prevent deletion."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Not Found"
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "summary": "Soft-delete a media record",
        "tags": [
          "media"
        ]
      },
      "get": {
        "description": "Requires media.read. Membership tier-card metadata additionally requires workforce identity and exact creator and data-owner matches.",
        "parameters": [
          {
            "description": "Media id",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Comma-separated JSON fields or approved dotted JSON paths to project from the response",
            "in": "query",
            "name": "fields",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "OK"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Not Found"
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "summary": "Get a media record by id",
        "tags": [
          "media"
        ]
      }
    },
    "/media/{id}/content": {
      "get": {
        "description": "Stable public delivery URL. Membership tier cards require a READY association and Pricing current-published tier/code/generation proof; pending drafts are not public, and old cards stay public until replacement publication. Storage reads pin the validated immutable generation. Authority outages fail closed.",
        "parameters": [
          {
            "description": "Media id",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Comma-separated JSON fields or approved dotted JSON paths to project from the response",
            "in": "query",
            "name": "fields",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "307": {
            "description": "Authorized content redirected to a short-lived signed URL.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "example": "public, max-age=60",
                  "type": "string"
                }
              },
              "Location": {
                "description": "Signed storage URL; tier cards pin the validated object generation.",
                "schema": {
                  "format": "uri",
                  "type": "string"
                }
              }
            }
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Media is missing, unpublished, detached, or unavailable to public readers."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Media lookup or storage signing failed."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Publication authority is temporarily unavailable."
          }
        },
        "summary": "Redirect authorized campaign or membership tier-card media to a short-lived signed URL",
        "tags": [
          "media"
        ]
      }
    },
    "/media/{id}/download-url": {
      "get": {
        "description": "Authorized staff preview. Membership tier cards require media.read, workforce identity and uploader ownership; the signed URL pins validated generation and is not stored in tier definitions.",
        "parameters": [
          {
            "description": "Media id",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Comma-separated JSON fields or approved dotted JSON paths to project from the response",
            "in": "query",
            "name": "fields",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "data = { url, expires_at }"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Not Found"
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "summary": "Get a signed download URL",
        "tags": [
          "media"
        ]
      }
    },
    "/organisation-access": {
      "get": {
        "parameters": [
          {
            "description": "Filter grants by wholesale organisation code (e.g. WOXHEKDO)",
            "in": "query",
            "name": "organisation_code",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Filter grants by user id",
            "in": "query",
            "name": "user_id",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Filter grants by status",
            "in": "query",
            "name": "status",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Comma-separated JSON fields or dotted paths to project from the response",
            "in": "query",
            "name": "fields",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "data = [ wholesale.OrganisationAccess ]"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Forbidden"
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "summary": "List organisation-access grants",
        "tags": [
          "organisation-access"
        ]
      },
      "post": {
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "object"
                  },
                  {
                    "$ref": "#/components/schemas/wholesale.OrganisationAccess",
                    "description": "New access grant",
                    "summary": "body"
                  }
                ]
              }
            }
          },
          "description": "New access grant",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Forbidden"
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "summary": "Create an organisation-access grant",
        "tags": [
          "organisation-access"
        ]
      }
    },
    "/organisation-access/{id}": {
      "delete": {
        "parameters": [
          {
            "description": "Organisation-access grant id",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "OK"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Not Found"
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "summary": "Delete an organisation-access grant",
        "tags": [
          "organisation-access"
        ]
      },
      "get": {
        "parameters": [
          {
            "description": "Organisation-access grant id",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Comma-separated JSON fields or dotted paths to project from the response",
            "in": "query",
            "name": "fields",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "OK"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Not Found"
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "summary": "Get an organisation-access grant",
        "tags": [
          "organisation-access"
        ]
      },
      "patch": {
        "parameters": [
          {
            "description": "Organisation-access grant id",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "object"
                  },
                  {
                    "$ref": "#/components/schemas/wholesale.OrganisationAccess",
                    "description": "Fields to update",
                    "summary": "body"
                  }
                ]
              }
            }
          },
          "description": "Fields to update",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Not Found"
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "summary": "Update an organisation-access grant",
        "tags": [
          "organisation-access"
        ]
      }
    },
    "/organisation-access/{id}/team": {
      "parameters": [
        {
          "in": "path",
          "name": "id",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "patch": {
        "responses": null,
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "summary": "Update wholesale organisation access team fields",
        "tags": [
          "wholesale-team"
        ]
      }
    },
    "/pos/customers": {
      "get": {
        "parameters": [
          {
            "description": "Case-insensitive literal substring search over customer number, name, phone, email, and tags",
            "in": "query",
            "name": "q",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Page number (1-based)",
            "in": "query",
            "name": "page",
            "schema": {
              "type": "integer"
            }
          },
          {
            "description": "Items per page (default 50, max 200)",
            "in": "query",
            "name": "page_size",
            "schema": {
              "type": "integer"
            }
          },
          {
            "description": "Comma-separated JSON fields or approved dotted JSON paths to project from the response",
            "in": "query",
            "name": "fields",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/internal_modules_pos.summaryListResponse"
                }
              }
            },
            "description": "OK"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Forbidden"
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "summary": "Search retail customers for the point of sale",
        "tags": [
          "pos"
        ]
      }
    },
    "/pos/customers/{customerNumber}": {
      "get": {
        "parameters": [
          {
            "description": "Customer number (e.g. RCABCDOI)",
            "in": "path",
            "name": "customerNumber",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Comma-separated JSON fields or approved dotted JSON paths to project from the response",
            "in": "query",
            "name": "fields",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/internal_modules_pos.summaryResponse"
                }
              }
            },
            "description": "OK"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Not Found"
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "summary": "Get one retail customer summary by customer number for the point of sale",
        "tags": [
          "pos"
        ]
      }
    },
    "/retail-customers": {
      "get": {
        "parameters": [
          {
            "description": "Page number (1-based)",
            "in": "query",
            "name": "page",
            "schema": {
              "type": "integer"
            }
          },
          {
            "description": "Items per page (default 50, max 200)",
            "in": "query",
            "name": "page_size",
            "schema": {
              "type": "integer"
            }
          },
          {
            "description": "Filter by first or last name",
            "in": "query",
            "name": "name",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Filter by phone number",
            "in": "query",
            "name": "phone",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Filter by email",
            "in": "query",
            "name": "email",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Filter by English name alias",
            "in": "query",
            "name": "english_name",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Filter by tags; repeat or comma-separate values",
            "in": "query",
            "name": "tags",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Filter by status (ACTIVE/INACTIVE/BLOCKED)",
            "in": "query",
            "name": "status",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Filter first order time exactly (RFC3339 or YYYY-MM-DD)",
            "in": "query",
            "name": "first_order_time",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Filter first order time on/after (RFC3339 or YYYY-MM-DD)",
            "in": "query",
            "name": "first_order_from",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Filter first order time on/before (RFC3339 or YYYY-MM-DD)",
            "in": "query",
            "name": "first_order_to",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Filter last order time exactly (RFC3339 or YYYY-MM-DD)",
            "in": "query",
            "name": "last_order_time",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Filter last order time on/after (RFC3339 or YYYY-MM-DD)",
            "in": "query",
            "name": "last_order_from",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Filter last order time on/before (RFC3339 or YYYY-MM-DD)",
            "in": "query",
            "name": "last_order_to",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Free-text search",
            "in": "query",
            "name": "q",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Search mode: substring (default) or text (indexed token search)",
            "in": "query",
            "name": "search_mode",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Comma-separated JSON fields or approved dotted JSON paths to project from the response",
            "in": "query",
            "name": "fields",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "data = { items: [], page: {...} }"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Forbidden"
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "summary": "List retail customers",
        "tags": [
          "retail-customers"
        ]
      },
      "post": {
        "description": "Requires retail_customer.create or the existing retail_customer.write grant, an authenticated workforce session and valid geographic scope. Creation-only grants require empty auth_user_id, account_id and auth_identity_id, default omitted source to pos and reject an explicit non-pos source. They do not authorize individual or bulk updates. POS creation uses default-off coordinated Identity enrollment and server-derived identity linkage. Replaying the same actor and normalized request returns its committed profile; a key reused with different input conflicts. Invitation confirmation failures leave durable recovery work and do not roll back committed profiles. Non-POS profile-write creation retains its existing behavior.",
        "parameters": [
          {
            "description": "Optional immutable POS operation key; omitted keys derive from actor and normalized input. One key value only.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": false,
            "schema": {
              "maxLength": 128,
              "minLength": 16,
              "pattern": "^[A-Za-z0-9][A-Za-z0-9_-]{15,127}$",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "object"
                  },
                  {
                    "$ref": "#/components/schemas/internal_modules_retailcustomers.CreateInput",
                    "description": "New customer",
                    "summary": "body"
                  }
                ]
              }
            }
          },
          "description": "New customer",
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Created"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Forbidden"
          },
          "409": {
            "description": "Immutable POS operation key conflicts with its actor/input or registration state."
          },
          "503": {
            "description": "POS enrollment is disabled, temporarily unavailable or awaiting authoritative reconciliation."
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "summary": "Create a retail customer",
        "tags": [
          "retail-customers"
        ]
      }
    },
    "/retail-customers/bulk": {
      "patch": {
        "description": "Requires retail_customer.write under existing authenticated live-session routes. Body limited to 128 KiB; 1-100 unique explicit identifiers, with no all-records selector. One mandatory Mongo transaction reads current targets and commits all updates or none. No client full-record reads or revisions required. Mongo may retry the complete local transaction for transient conflicts; callbacks have no external provider calls. A later per-target domain error may include error.details.failed_identifier. Existing retail geographic scope applies: country, market and depot staff cannot access retail records because these records have no geographic columns. No orders-based composer access applies. Profile history, profile revision and field-name-only customer.profile_updated outbox events commit with each changed profile. Exact no-ops leave those unchanged.",
        "operationId": "bulkUpdateRetailcustomers",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/retailcustomers.BulkRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/retailcustomers.BulkResult"
                    },
                    "success": {
                      "const": true,
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "All targets committed atomically. Refetch list records after success."
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Invalid identifiers, domain state or body. Empty, unknown and null patch fields are rejected. No writes."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Unauthenticated or no workforce role."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Permission or staff scope denied."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "No writes. error.details.missing_customer_numbers is a JSON-encoded array string containing all absent or hidden targets in request order."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Unsupported retail closure, revision conflict or exhausted transaction conflict. Reload and retry the whole batch."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Body exceeds 128 KiB, including trailing whitespace."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "No partial per-item result. A network/commit failure can have an ambiguous outcome; refetch before reapplying. Support status timestamps may advance when reapplied."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Transactional store unavailable; no fallback writes."
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "summary": "Atomically update selected retail-customers",
        "tags": [
          "retail-customers"
        ]
      }
    },
    "/retail-customers/identifier-previews": {
      "post": {
        "description": "Returns a non-persisted customer number and referral code that can be supplied back to create through identifier_preview_token.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/internal_modules_retailcustomers.identifierPreviewResponse"
                }
              }
            },
            "description": "OK"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Forbidden"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Conflict"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Service Unavailable"
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "summary": "Generate a signed retail customer identifier candidate",
        "tags": [
          "retail-customers"
        ]
      }
    },
    "/retail-customers/stats": {
      "get": {
        "description": "Requires retail_customer.read and the same geographic scope as the staff list. Includes the list's wholesale-account exclusions and lifecycle semantics. Resolves eligibility once and calculates counts in one database aggregation, without profile hydration or Identity lookups. Pagination and sorting do not affect this summary. Birthday dates retain their recorded UTC calendar month, compared with the calculation month in time_zone. Missing or invalid birthdays do not match. The five-second deadline covers eligibility and aggregation. With include_commerce=true the exact cohort is streamed in batches of at most 5000 customer numbers with at most four concurrent Orders requests. No per-customer owner requests or Identity profile lookups occur. No-order customers are included in stale_customers; recent orders are strictly newer than 30 market-calendar days before calculated_at. Verified results may be reused for up to 15 seconds from calculated_at with filter, scope and eligibility isolation; public responses remain private and no-store. Owner failures preserve base customer counts and mark every commerce total unavailable; incomplete customer enumeration fails the whole request.",
        "operationId": "getRetailCustomerStats",
        "parameters": [
          {
            "description": "Filter by first or last name",
            "in": "query",
            "name": "name",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Filter by phone number",
            "in": "query",
            "name": "phone",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Filter by email",
            "in": "query",
            "name": "email",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Filter by English name alias",
            "in": "query",
            "name": "english_name",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Repeat or comma-separate tags",
            "in": "query",
            "name": "tags",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Stored lifecycle status including CLOSED",
            "in": "query",
            "name": "status",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Free-text search",
            "in": "query",
            "name": "q",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Substring by default or indexed text search",
            "in": "query",
            "name": "search_mode",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Exact stored first-order date or timestamp",
            "in": "query",
            "name": "first_order_time",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Inclusive stored first-order lower bound",
            "in": "query",
            "name": "first_order_from",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Inclusive stored first-order upper bound",
            "in": "query",
            "name": "first_order_to",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Exact stored last-order date or timestamp",
            "in": "query",
            "name": "last_order_time",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Inclusive stored last-order lower bound",
            "in": "query",
            "name": "last_order_from",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Inclusive stored last-order upper bound",
            "in": "query",
            "name": "last_order_to",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "IANA timezone for the current calendar month and 30-calendar-day inactivity cutoff; Local is not accepted",
            "in": "query",
            "name": "time_zone",
            "schema": {
              "default": "UTC",
              "type": "string"
            }
          },
          {
            "description": "Opt in to owner-verified order totals and net captured payments minus completed refunds. The default preserves legacy commerce availability.",
            "in": "query",
            "name": "include_commerce",
            "schema": {
              "default": false,
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/internal_modules_retailcustomers.statsResponse"
                }
              }
            },
            "description": "Verified counts with explicit commerce availability",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "enum": [
                    "private, no-store"
                  ],
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "Invalid date range or timezone"
          },
          "401": {
            "description": "Authentication required"
          },
          "403": {
            "description": "Retail customer read permission required"
          },
          "503": {
            "description": "Eligibility lookup or statistics query failed or exceeded its deadline"
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "summary": "Get verified retail customer statistics",
        "tags": [
          "RetailCustomers"
        ]
      }
    },
    "/retail-customers/{customerNumber}": {
      "get": {
        "parameters": [
          {
            "description": "Customer number (e.g. RCABCDOI)",
            "in": "path",
            "name": "customerNumber",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Comma-separated JSON fields or approved dotted JSON paths to project from the response",
            "in": "query",
            "name": "fields",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "OK"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Not Found"
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "summary": "Get a retail customer by its customer number",
        "tags": [
          "retail-customers"
        ]
      },
      "patch": {
        "parameters": [
          {
            "description": "Customer number",
            "in": "path",
            "name": "customerNumber",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "object"
                  },
                  {
                    "$ref": "#/components/schemas/internal_modules_retailcustomers.UpdateInput",
                    "description": "Fields to update",
                    "summary": "body"
                  }
                ]
              }
            }
          },
          "description": "Fields to update",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Not Found"
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "summary": "Update a retail customer",
        "tags": [
          "retail-customers"
        ]
      }
    },
    "/settings": {
      "get": {
        "parameters": [
          {
            "description": "Comma-separated JSON fields or approved dotted JSON paths to project from the response",
            "in": "query",
            "name": "fields",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "OK"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Forbidden"
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "summary": "List settings",
        "tags": [
          "settings"
        ]
      }
    },
    "/settings/referral-rewards/registration": {
      "get": {
        "description": "Requires settings.write. Returns the Pricing-owned selection so a save with an uncertain outcome can be retried with the same IDs. It never changes the selection.",
        "operationId": "readReferralProgrammeRegistration",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "properties": {
                        "created_at": {
                          "format": "date-time",
                          "type": "string"
                        },
                        "id": {
                          "type": "string"
                        },
                        "profile_coupon_id": {
                          "type": "string"
                        },
                        "referrer_coupon_ids": {
                          "items": {
                            "type": "string"
                          },
                          "type": "array"
                        },
                        "state": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "id",
                        "state",
                        "profile_coupon_id",
                        "referrer_coupon_ids",
                        "created_at"
                      ],
                      "type": "object"
                    },
                    "success": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Registered permanent programme identity"
          },
          "403": {
            "description": "settings.write required"
          },
          "503": {
            "description": "Registration unavailable or absent"
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "summary": "Recover the registered programme coupon identities"
      }
    },
    "/settings/referral-rewards/validate": {
      "post": {
        "description": "Requires settings.write. Pricing verifies the active AU-VIC market and all six coupon definitions. The returned validation must accompany the settings write and is rechecked before saving.",
        "operationId": "validateReferralProgramme",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/internal_modules_settings.ReferralRewardsValue"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/internal_modules_settings.ProgrammeValidation"
                    },
                    "success": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Verified candidate terms and availability"
          },
          "400": {
            "description": "Invalid coupon IDs"
          },
          "403": {
            "description": "settings.write required"
          },
          "409": {
            "description": "Pricing refused a candidate coupon. The message and details (reason_code PROGRAMME_NOT_AVAILABLE, coupon_id, role, reason) name it; nothing is saved."
          },
          "503": {
            "description": "Programme terms unavailable"
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "summary": "Validate candidate programme coupons without changing settings"
      }
    },
    "/settings/{key}": {
      "delete": {
        "description": "Deleting referral_rewards_v2 is rejected because its coupon identities are permanent.",
        "parameters": [
          {
            "description": "Setting key",
            "in": "path",
            "name": "key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "OK"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Not Found"
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "summary": "Delete a setting",
        "tags": [
          "settings"
        ]
      },
      "get": {
        "parameters": [
          {
            "description": "Setting key",
            "in": "path",
            "name": "key",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Comma-separated JSON fields or approved dotted JSON paths to project from the response",
            "in": "query",
            "name": "fields",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/internal_modules_settings.settingResponse"
                }
              }
            },
            "description": "OK"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Not Found"
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "summary": "Get a setting by key",
        "tags": [
          "settings"
        ]
      },
      "put": {
        "description": "For key referral_rewards_v2, value must follow ReferralRewardsValue. The six coupon IDs are immutable after the first successful new-policy write; definitions may be corrected under those same IDs. A recognized legacy policy can be explicitly replaced once without copying old IDs. Concurrent first writes with different IDs produce one winner. Unknown fields and duplicate IDs are rejected. A candidate Pricing refuses is not saved and returns 409 naming the coupon and reason.",
        "parameters": [
          {
            "description": "Setting key",
            "in": "path",
            "name": "key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "object"
                  },
                  {
                    "$ref": "#/components/schemas/internal_modules_settings.setReq",
                    "description": "Value and optional description",
                    "summary": "body"
                  }
                ]
              }
            }
          },
          "description": "Value and optional description",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/internal_modules_settings.settingResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Forbidden"
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "summary": "Create or update a setting",
        "tags": [
          "settings"
        ]
      }
    },
    "/storefront/campaigns": {
      "get": {
        "description": "Position-grouped safe campaign views, ordered independently by priority and identity. Lists and detail apply identical market, location, audience, platform, schedule and live-promotion filtering. Reads never issue coupons.",
        "parameters": [
          {
            "description": "Market the campaigns belong to. Required: a country code is not a market, and campaigns are never merged across markets.",
            "in": "query",
            "name": "market_code",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Optional position filter.",
            "in": "query",
            "name": "placement",
            "schema": {
              "$ref": "#/components/schemas/campaign_enums.CampaignPlacement"
            }
          },
          {
            "description": "Client platform (web|mobile)",
            "in": "query",
            "name": "platform",
            "required": true,
            "schema": {
              "enum": [
                "web",
                "mobile"
              ],
              "type": "string"
            }
          },
          {
            "description": "Campaign audience; defaults to retail.",
            "in": "query",
            "name": "customer_type",
            "schema": {
              "enum": [
                "retail",
                "wholesale"
              ],
              "type": "string"
            }
          },
          {
            "description": "ISO country code, validated with the selected market",
            "in": "query",
            "name": "country_code",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "ISO subdivision code (for example AU-NSW)",
            "in": "query",
            "name": "state_code",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Exact depot identifier",
            "in": "query",
            "name": "depot_code",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Comma-separated JSON fields or approved dotted JSON paths to project from the response",
            "in": "query",
            "name": "fields",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/campaigns.StorefrontGroups"
                    },
                    "success": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Missing or invalid market_code, invalid query, or unavailable market facts"
          },
          "404": {
            "description": "Market not found; detail also returns this for an unavailable campaign"
          },
          "503": {
            "description": "Market, geography, or offer authority temporarily unavailable"
          }
        },
        "servers": [
          {
            "url": "/v2"
          }
        ],
        "summary": "List active storefront campaigns (public)",
        "tags": [
          "campaigns"
        ]
      }
    },
    "/storefront/campaigns/{campaignCode}": {
      "get": {
        "description": "Position-grouped safe campaign views, ordered independently by priority and identity. Lists and detail apply identical market, location, audience, platform, schedule and live-promotion filtering. Reads never issue coupons.",
        "parameters": [
          {
            "description": "Market the campaigns belong to. Required: a country code is not a market, and campaigns are never merged across markets.",
            "in": "query",
            "name": "market_code",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Optional position filter.",
            "in": "query",
            "name": "placement",
            "schema": {
              "$ref": "#/components/schemas/campaign_enums.CampaignPlacement"
            }
          },
          {
            "description": "Client platform (web|mobile)",
            "in": "query",
            "name": "platform",
            "required": true,
            "schema": {
              "enum": [
                "web",
                "mobile"
              ],
              "type": "string"
            }
          },
          {
            "description": "Campaign audience; defaults to retail.",
            "in": "query",
            "name": "customer_type",
            "schema": {
              "enum": [
                "retail",
                "wholesale"
              ],
              "type": "string"
            }
          },
          {
            "description": "ISO country code, validated with the selected market",
            "in": "query",
            "name": "country_code",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "ISO subdivision code (for example AU-NSW)",
            "in": "query",
            "name": "state_code",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Exact depot identifier",
            "in": "query",
            "name": "depot_code",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Comma-separated JSON fields or approved dotted JSON paths to project from the response",
            "in": "query",
            "name": "fields",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "campaignCode",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/campaigns.StorefrontCampaign"
                    },
                    "success": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Missing or invalid market_code, invalid query, or unavailable market facts"
          },
          "404": {
            "description": "Market not found; detail also returns this for an unavailable campaign"
          },
          "503": {
            "description": "Market, geography, or offer authority temporarily unavailable"
          }
        },
        "servers": [
          {
            "url": "/v2"
          }
        ],
        "summary": "List active storefront campaigns (public)",
        "tags": [
          "campaigns"
        ]
      }
    },
    "/supplier-users": {
      "get": {
        "parameters": [
          {
            "description": "Page number (1-based)",
            "in": "query",
            "name": "page",
            "schema": {
              "type": "integer"
            }
          },
          {
            "description": "Items per page (max 200)",
            "in": "query",
            "name": "page_size",
            "schema": {
              "type": "integer"
            }
          },
          {
            "description": "Free-text search",
            "in": "query",
            "name": "q",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Comma-separated JSON fields or approved dotted JSON paths to project from the response",
            "in": "query",
            "name": "fields",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "data = { items: [], page: {...} }"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Forbidden"
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "summary": "List supplier users",
        "tags": [
          "suppliers"
        ]
      },
      "post": {
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "object"
                  },
                  {
                    "$ref": "#/components/schemas/internal_modules_suppliers.CreateInput",
                    "description": "New supplier user",
                    "summary": "body"
                  }
                ]
              }
            }
          },
          "description": "New supplier user",
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Created"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Forbidden"
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "summary": "Create a supplier user",
        "tags": [
          "suppliers"
        ]
      }
    },
    "/supplier-users/{supplierCode}": {
      "delete": {
        "parameters": [
          {
            "description": "Supplier code",
            "in": "path",
            "name": "supplierCode",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "OK"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Not Found"
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "summary": "Delete a supplier user",
        "tags": [
          "suppliers"
        ]
      },
      "get": {
        "parameters": [
          {
            "description": "Supplier code",
            "in": "path",
            "name": "supplierCode",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Comma-separated JSON fields or approved dotted JSON paths to project from the response",
            "in": "query",
            "name": "fields",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "OK"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Not Found"
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "summary": "Get a supplier user by id",
        "tags": [
          "suppliers"
        ]
      },
      "patch": {
        "parameters": [
          {
            "description": "Supplier code",
            "in": "path",
            "name": "supplierCode",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "object"
                  },
                  {
                    "$ref": "#/components/schemas/internal_modules_suppliers.UpdateInput",
                    "description": "Fields to update",
                    "summary": "body"
                  }
                ]
              }
            }
          },
          "description": "Fields to update",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Not Found"
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "summary": "Update a supplier user",
        "tags": [
          "suppliers"
        ]
      }
    },
    "/users/me/avatar/finalize": {
      "post": {
        "description": "Activates a pending customer-avatar media record created by the authenticated caller and returns avatar fields suitable for PATCH /users/me.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "object"
                  },
                  {
                    "$ref": "#/components/schemas/internal_modules_media.selfAvatarFinalizeRequest",
                    "description": "Avatar finalize request",
                    "summary": "body"
                  }
                ]
              }
            }
          },
          "description": "Avatar finalize request",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Forbidden"
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "summary": "Finalize your own avatar upload",
        "tags": [
          "users"
        ]
      }
    },
    "/users/me/avatar/media/{id}/download-url": {
      "get": {
        "description": "Returns a signed GET URL and expiry as JSON for an active customer-avatar whose creator and data owner both exactly match the authenticated caller. No media.read permission is required. Fetch the returned HTTPS URL directly without application Authorization or cookies; this avoids the cross-origin redirect of the content route. The URL is ephemeral and must not replace the saved ObjectMedia reference.",
        "parameters": [
          {
            "description": "Immutable avatar media code (as returned by Identity avatar.code), or root media record id",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/media.AvatarDownloadURLSuccess"
                }
              }
            },
            "description": "Signed avatar URL and expiry in the standard success envelope",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "enum": [
                    "private, no-store"
                  ],
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Missing or invalid authentication"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Media is not an active customer-avatar owned by this caller"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Media record not found"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Media lookup or URL signing failed"
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "summary": "Get a signed download URL for your own avatar",
        "tags": [
          "users"
        ]
      }
    },
    "/users/me/avatar/upload-url": {
      "post": {
        "description": "Returns a short-lived signed upload URL for customer-avatar images. No media.upload permission required; the pending media record is created by the authenticated caller with both creator and data owner set to that principal. Only file_name, content_type and size_bytes are accepted.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "object"
                  },
                  {
                    "$ref": "#/components/schemas/internal_modules_media.selfAvatarUploadRequest",
                    "description": "Avatar upload request",
                    "summary": "body"
                  }
                ]
              }
            }
          },
          "description": "Avatar upload request",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Unauthorized"
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "summary": "Request your own avatar upload URL",
        "tags": [
          "users"
        ]
      }
    },
    "/wholesale-account/locations": {
      "get": {
        "responses": null
      },
      "post": {
        "responses": null
      }
    },
    "/wholesale-account/locations/{locationId}": {
      "delete": {
        "responses": null
      },
      "get": {
        "responses": null
      },
      "parameters": [
        {
          "in": "path",
          "name": "locationId",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "patch": {
        "responses": null
      }
    },
    "/wholesale-account/locations/{locationId}/default-billing": {
      "parameters": [
        {
          "in": "path",
          "name": "locationId",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "post": {
        "responses": null
      }
    },
    "/wholesale-account/locations/{locationId}/default-delivery": {
      "parameters": [
        {
          "in": "path",
          "name": "locationId",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "post": {
        "responses": null
      }
    },
    "/wholesale-account/me": {
      "get": {
        "parameters": [
          {
            "description": "Comma-separated JSON fields or approved dotted JSON paths to project from the response",
            "in": "query",
            "name": "fields",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "OK"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Forbidden"
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "summary": "Get signed-in wholesale account terms",
        "tags": [
          "wholesale-account"
        ]
      }
    },
    "/wholesale-account/profile": {
      "get": {
        "responses": null,
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "summary": "Get signed-in wholesale buyer profile",
        "tags": [
          "wholesale-team"
        ]
      }
    },
    "/wholesale-account/support-contact": {
      "get": {
        "responses": null
      }
    },
    "/wholesale-account/team": {
      "get": {
        "responses": null,
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "summary": "Get signed-in wholesale buyer team view",
        "tags": [
          "wholesale-team"
        ]
      }
    },
    "/wholesale-applications": {
      "get": {
        "parameters": [
          {
            "description": "Application status",
            "in": "query",
            "name": "status",
            "schema": {
              "enum": [
                "pending",
                "approved",
                "rejected"
              ],
              "type": "string"
            }
          },
          {
            "description": "Search business/contact fields",
            "in": "query",
            "name": "q",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Page number",
            "in": "query",
            "name": "page",
            "schema": {
              "type": "integer"
            }
          },
          {
            "description": "Page size",
            "in": "query",
            "name": "page_size",
            "schema": {
              "type": "integer"
            }
          },
          {
            "description": "Comma-separated JSON fields or approved dotted JSON paths to project from the response",
            "in": "query",
            "name": "fields",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/internal_modules_wholesaleapplications.applicationPageEnvelope"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Forbidden"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "summary": "List wholesale trade account applications for admin review",
        "tags": [
          "wholesale-applications"
        ]
      },
      "post": {
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "object"
                  },
                  {
                    "$ref": "#/components/schemas/internal_modules_wholesaleapplications.submitRequest",
                    "description": "Wholesale application",
                    "summary": "request"
                  }
                ]
              }
            }
          },
          "description": "Wholesale application",
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/internal_modules_wholesaleapplications.submitResponseEnvelope"
                }
              }
            },
            "description": "Created"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Conflict"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Internal Server Error"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Service Unavailable"
          }
        },
        "summary": "Submit a wholesale trade account application",
        "tags": [
          "wholesale-applications"
        ]
      }
    },
    "/wholesale-applications/me": {
      "get": {
        "parameters": [
          {
            "description": "Comma-separated JSON fields or approved dotted JSON paths to project from the response",
            "in": "query",
            "name": "fields",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/internal_modules_wholesaleapplications.applicationStatusResponseEnvelope"
                }
              }
            },
            "description": "OK"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Unauthorized"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Not Found"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "summary": "Get the signed-in user's wholesale application status",
        "tags": [
          "wholesale-applications"
        ]
      }
    },
    "/wholesale-applications/{applicationNumber}": {
      "get": {
        "parameters": [
          {
            "description": "Wholesale application number",
            "in": "path",
            "name": "applicationNumber",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Comma-separated JSON fields or approved dotted JSON paths to project from the response",
            "in": "query",
            "name": "fields",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/internal_modules_wholesaleapplications.applicationResponseEnvelope"
                }
              }
            },
            "description": "OK"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Not Found"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "summary": "Get one wholesale trade account application for admin review",
        "tags": [
          "wholesale-applications"
        ]
      }
    },
    "/wholesale-applications/{applicationNumber}/approve": {
      "post": {
        "parameters": [
          {
            "description": "Wholesale application number",
            "in": "path",
            "name": "applicationNumber",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "object"
                  },
                  {
                    "$ref": "#/components/schemas/internal_modules_wholesaleapplications.ApplicationApprovalRequest",
                    "description": "Decision details",
                    "summary": "request"
                  }
                ]
              }
            }
          },
          "description": "Decision details",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/internal_modules_wholesaleapplications.applicationResponseEnvelope"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Conflict"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "summary": "Approve a wholesale trade account application",
        "tags": [
          "wholesale-applications"
        ]
      }
    },
    "/wholesale-applications/{applicationNumber}/reject": {
      "post": {
        "parameters": [
          {
            "description": "Wholesale application number",
            "in": "path",
            "name": "applicationNumber",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "object"
                  },
                  {
                    "$ref": "#/components/schemas/internal_modules_wholesaleapplications.ApplicationRejectionRequest",
                    "description": "Decision details",
                    "summary": "request"
                  }
                ]
              }
            }
          },
          "description": "Decision details",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/internal_modules_wholesaleapplications.applicationResponseEnvelope"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Conflict"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "summary": "Reject a wholesale trade account application",
        "tags": [
          "wholesale-applications"
        ]
      }
    },
    "/wholesale-organisations": {
      "get": {
        "parameters": [
          {
            "description": "Comma-separated JSON fields or approved dotted JSON paths to project from the response",
            "in": "query",
            "name": "fields",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "data = [ wholesale.WholesaleOrganisation ] ordered by name"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Forbidden"
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "summary": "List wholesale organisations",
        "tags": [
          "wholesale-organisations"
        ]
      },
      "post": {
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "object"
                  },
                  {
                    "$ref": "#/components/schemas/wholesale.WholesaleOrganisation",
                    "description": "New organisation",
                    "summary": "body"
                  }
                ]
              }
            }
          },
          "description": "New organisation",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Forbidden"
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "summary": "Create a wholesale organisation",
        "tags": [
          "wholesale-organisations"
        ]
      }
    },
    "/wholesale-organisations/bulk": {
      "patch": {
        "description": "Requires wholesale.write under existing authenticated live-session routes. Body limited to 128 KiB; 1-100 unique explicit identifiers, with no all-records selector. One mandatory Mongo transaction reads current targets and commits all updates or none. No client full-record reads or revisions required. Mongo may retry the complete local transaction for transient conflicts; callbacks have no external provider calls. A later per-target domain error may include error.details.failed_identifier. Existing organisation geographic scope applies, hiding absent and out-of-scope targets identically. Validates current full records, including required category for approved status and address shape. Profiles needing normalization must be corrected through the individual editor first. Writes only status, updated_at and profile_revision; preserves all other stored values.",
        "operationId": "bulkUpdateWholesaleorganisations",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/wholesaleorganisations.BulkRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/wholesaleorganisations.BulkResult"
                    },
                    "success": {
                      "const": true,
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "All targets committed atomically. Refetch list records after success."
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Invalid identifiers, domain state or body. Empty, unknown and null patch fields are rejected. No writes."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Unauthenticated or no workforce role."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Permission or staff scope denied."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "No writes. error.details.missing_organisation_codes is a JSON-encoded array string containing all absent or hidden targets in request order."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Unsupported retail closure, revision conflict or exhausted transaction conflict. Reload and retry the whole batch."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Body exceeds 128 KiB, including trailing whitespace."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "No partial per-item result. A network/commit failure can have an ambiguous outcome; refetch before reapplying. Support status timestamps may advance when reapplied."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Transactional store unavailable; no fallback writes."
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "summary": "Atomically update selected wholesale-organisations",
        "tags": [
          "wholesale-organisations"
        ]
      }
    },
    "/wholesale-organisations/{organisationCode}": {
      "delete": {
        "parameters": [
          {
            "description": "Organisation code",
            "in": "path",
            "name": "organisationCode",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "OK"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Not Found"
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "summary": "Delete a wholesale organisation",
        "tags": [
          "wholesale-organisations"
        ]
      },
      "get": {
        "parameters": [
          {
            "description": "Organisation code",
            "in": "path",
            "name": "organisationCode",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Comma-separated JSON fields or approved dotted JSON paths to project from the response",
            "in": "query",
            "name": "fields",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "OK"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Not Found"
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "summary": "Get a wholesale organisation",
        "tags": [
          "wholesale-organisations"
        ]
      },
      "patch": {
        "parameters": [
          {
            "description": "Organisation code",
            "in": "path",
            "name": "organisationCode",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "object"
                  },
                  {
                    "$ref": "#/components/schemas/wholesale.WholesaleOrganisation",
                    "description": "Fields to update",
                    "summary": "body"
                  }
                ]
              }
            }
          },
          "description": "Fields to update",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Not Found"
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "summary": "Update a wholesale organisation",
        "tags": [
          "wholesale-organisations"
        ]
      }
    },
    "/wholesale-organisations/{organisationCode}/team-invitations": {
      "get": {
        "responses": null,
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "summary": "List wholesale organisation team invitations",
        "tags": [
          "wholesale-team"
        ]
      },
      "parameters": [
        {
          "in": "path",
          "name": "organisationCode",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "post": {
        "responses": null,
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "summary": "Create a wholesale team invitation",
        "tags": [
          "wholesale-team"
        ]
      }
    },
    "/wholesale-organisations/{organisationCode}/team-members": {
      "get": {
        "responses": null,
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "summary": "List wholesale organisation team members",
        "tags": [
          "wholesale-team"
        ]
      },
      "parameters": [
        {
          "in": "path",
          "name": "organisationCode",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "post": {
        "responses": null,
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "summary": "Link an existing user to a wholesale organisation",
        "tags": [
          "wholesale-team"
        ]
      }
    },
    "/wholesale-support/attachments/finalize": {
      "post": {
        "responses": null
      }
    },
    "/wholesale-support/attachments/upload-url": {
      "post": {
        "responses": null
      }
    },
    "/wholesale-support/requests": {
      "get": {
        "responses": null
      },
      "post": {
        "responses": null
      }
    },
    "/wholesale-support/requests/bulk": {
      "patch": {
        "description": "Requires wholesale.write under existing authenticated live-session routes. Body limited to 128 KiB; 1-100 unique explicit identifiers, with no all-records selector. One mandatory Mongo transaction reads current targets and commits all updates or none. No client full-record reads or revisions required. Mongo may retry the complete local transaction for transient conflicts; callbacks have no external provider calls. A later per-target domain error may include error.details.failed_identifier. Uses the existing support staff permission gate. Existing support staff APIs do not apply geographic record filtering; this command preserves that boundary. Status timestamps, updated_by and updated_at match individual updates. Does not hydrate or sign attachment URLs and preserves messages, assignment and attachments.",
        "operationId": "bulkUpdateWholesalesupport",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/wholesalesupport.BulkRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/wholesalesupport.BulkResult"
                    },
                    "success": {
                      "const": true,
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "All targets committed atomically. Refetch list records after success."
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Invalid identifiers, domain state or body. Empty, unknown and null patch fields are rejected. No writes."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Unauthenticated or no workforce role."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Permission or staff scope denied."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "No writes. error.details.missing_ids is a JSON-encoded array string containing all absent or hidden targets in request order."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Unsupported retail closure, revision conflict or exhausted transaction conflict. Reload and retry the whole batch."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Body exceeds 128 KiB, including trailing whitespace."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "No partial per-item result. A network/commit failure can have an ambiguous outcome; refetch before reapplying. Support status timestamps may advance when reapplied."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Customers_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Transactional store unavailable; no fallback writes."
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "summary": "Atomically update selected wholesale-support requests",
        "tags": [
          "wholesale-support"
        ]
      }
    },
    "/wholesale-support/requests/{requestId}": {
      "get": {
        "responses": null
      },
      "parameters": [
        {
          "in": "path",
          "name": "requestId",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "patch": {
        "responses": null
      }
    },
    "/wholesale-support/requests/{requestId}/messages": {
      "parameters": [
        {
          "in": "path",
          "name": "requestId",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "post": {
        "responses": null
      }
    },
    "/wholesale-team-invitations/accept": {
      "post": {
        "responses": null,
        "summary": "Accept a wholesale team invitation",
        "tags": [
          "wholesale-team"
        ]
      }
    },
    "/wholesale-team-invitations/preview": {
      "get": {
        "responses": null,
        "summary": "Preview a wholesale team invitation",
        "tags": [
          "wholesale-team"
        ]
      }
    },
    "/wholesale-team-invitations/{id}/resend": {
      "parameters": [
        {
          "in": "path",
          "name": "id",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "post": {
        "responses": null,
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "summary": "Resend a wholesale team invitation",
        "tags": [
          "wholesale-team"
        ]
      }
    },
    "/wholesale-team-invitations/{id}/revoke": {
      "parameters": [
        {
          "in": "path",
          "name": "id",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "post": {
        "responses": null,
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "summary": "Revoke a wholesale team invitation",
        "tags": [
          "wholesale-team"
        ]
      }
    }
  },
  "servers": [
    {
      "url": "/v1"
    }
  ]
}
