openapi: 3.1.1
info:
  title: Retail — Core Offer Attributes (v2.1)
  version: 2.1.0
  description: >
    Cross-vertical offer attributes for retail domains.
    Carries commercial terms, policies, and serviceability constraints.
    Attaches to beckn:Offer via offerAttributes.

components:
  schemas:
    RetailOffer:
      type: object
      x-beckn-container: offerAttributes
      x-jsonld:
        "@context": "https://schema.nfh.global/RetailOffer/v2.1/context.jsonld"
        "@type": rcoa:RetailOffer
      properties:
        price:
          allOf:
            - $ref: "https://schema.nfh.global/PriceSpecification/v2.0/attributes.yaml#/components/schemas/PriceSpecification"
          description: >
            Published price snapshot for this offer at discovery time. Used for catalog rendering
            and search. The formal agreed price is established via Consideration in the Contract
            from the select call onwards.
          x-jsonld-id: "rcoa:price"
        isActive:
          type: boolean
          description: Whether the offer is active and available for discovery
          default: true
          x-jsonld-id: "rcoa:isActive"
        validity:
          allOf:
            - $ref: "https://schema.nfh.global/TimePeriod/v2.0/attributes.yaml#/components/schemas/TimePeriod"
          description: Calendar window during which the offer is valid (start/end timestamps)
          x-jsonld-id: "rcoa:validity"
        eligibleRegion:
          type: array
          items:
            $ref: "https://schema.nfh.global/Location/v2.0/attributes.yaml#/components/schemas/Location"
          description: Regions where the offer is eligible
          x-jsonld-id: "rcoa:eligibleRegion"
        acceptedPaymentMethod:
          allOf:
            - $ref: "https://schema.nfh.global/AcceptedPaymentMethod/v2.0/attributes.yaml#/components/schemas/AcceptedPaymentMethod"
          description: Payment methods accepted for this offer
          x-jsonld-id: "rcoa:acceptedPaymentMethod"
        policies:
          type: object
          properties:
            returns:
              type: object
              properties:
                policyRef:
                  type: string
                  format: uri
                  description: Stable URI pointing to the canonical returns policy definition. Use as an alternative to repeating inline fields on every catalog entry.
                  x-jsonld-id: "rcoa:policyRef"
                allowed:
                  type: boolean
                  x-jsonld-id: "rcoa:returnAllowed"
                window:
                  type: string
                  description: ISO 8601 duration
                  x-jsonld-id: "rcoa:returnWindow"
                method:
                  type: string
                  enum: [SELLER_PICKUP, BUYER_SHIP, DROP_OFF]
                  x-jsonld-id: "rcoa:returnMethod"
                restockingFee:
                  type: object
                  properties:
                    type:
                      type: string
                      enum: [PERCENTAGE, FIXED]
                      x-jsonld-id: "rcoa:restockingFeeType"
                    value:
                      type: number
                      x-jsonld-id: "rcoa:restockingFeeValue"
                  x-jsonld-id: "rcoa:restockingFee"
                conditions:
                  type: string
                  x-jsonld-id: "rcoa:returnConditions"
              x-jsonld-id: "rcoa:returns"
            cancellation:
              type: object
              properties:
                policyRef:
                  type: string
                  format: uri
                  description: Stable URI pointing to the canonical cancellation policy definition. Use as an alternative to repeating inline fields on every catalog entry.
                  x-jsonld-id: "rcoa:policyRef"
                allowed:
                  type: boolean
                  x-jsonld-id: "rcoa:cancellationAllowed"
                window:
                  type: string
                  description: ISO 8601 duration
                  x-jsonld-id: "rcoa:cancellationWindow"
                cutoffEvent:
                  type: string
                  enum: [BEFORE_CONFIRMATION, BEFORE_PACKING, BEFORE_DISPATCH, BEFORE_SHIPMENT]
                  description: >
                    Latest operational event up to which cancellation is permitted.
                    BEFORE_DISPATCH sits between BEFORE_PACKING (goods packed) and
                    BEFORE_SHIPMENT (handed to carrier) — use it when the cutoff is
                    internal release/dispatch readiness.
                  x-jsonld-id: "rcoa:cancellationCutoffEvent"
                fee:
                  type: object
                  properties:
                    type:
                      type: string
                      enum: [PERCENTAGE, FIXED]
                    value:
                      type: number
                  x-jsonld-id: "rcoa:cancellationFee"
              x-jsonld-id: "rcoa:cancellation"
            replacement:
              type: object
              properties:
                policyRef:
                  type: string
                  format: uri
                  description: Stable URI pointing to the canonical replacement policy definition. Use as an alternative to repeating inline fields on every catalog entry.
                  x-jsonld-id: "rcoa:policyRef"
                allowed:
                  type: boolean
                  x-jsonld-id: "rcoa:replacementAllowed"
                window:
                  type: string
                  description: ISO 8601 duration
                  x-jsonld-id: "rcoa:replacementWindow"
                method:
                  type: string
                  enum: [SELLER_PICKUP, BUYER_SHIP, DROP_OFF]
                  x-jsonld-id: "rcoa:replacementMethod"
                conditions:
                  type: string
                  x-jsonld-id: "rcoa:replacementConditions"
                subjectToAvailability:
                  type: boolean
                  x-jsonld-id: "rcoa:replacementSubjectToAvailability"
              x-jsonld-id: "rcoa:replacement"
            warranty:
              type: object
              description: >
                Offer-level warranty declaration. Can extend, curtail, or overwrite the
                resource-level warranty declared in RetailResource.warranty. When both are
                present, this offer-level declaration takes precedence for transactions
                under this offer.
              properties:
                policyRef:
                  type: string
                  format: uri
                  description: Stable URI pointing to the canonical warranty policy definition
                  x-jsonld-id: "rcoa:policyRef"
                duration:
                  type: string
                  description: Warranty duration as ISO 8601 duration (e.g., "P1Y" for 1 year, "P2Y6M" for 2.5 years)
                  x-jsonld-id: "rcoa:warrantyDuration"
                type:
                  type: string
                  enum: [MANUFACTURER, SELLER, EXTENDED, NONE]
                  description: Type of warranty being declared at offer level
                  x-jsonld-id: "rcoa:warrantyType"
                serviceCenter:
                  type: string
                  description: Name or description of the warranty service centre (may be geography-specific for this offer)
                  x-jsonld-id: "rcoa:warrantyServiceCenter"
                terms:
                  type: string
                  description: Warranty terms and conditions specific to this offer (overrides resource-level terms when present)
                  x-jsonld-id: "rcoa:warrantyTerms"
              x-jsonld-id: "rcoa:warranty"
          x-jsonld-id: "rcoa:policies"
        paymentConstraints:
          type: object
          properties:
            codAvailable:
              type: boolean
              description: Whether cash-on-delivery is available for this offer
              x-jsonld-id: "rcoa:codAvailable"
            codMaxAmount:
              type: number
              description: >
                Maximum order value eligible for COD. Denominated in the same currency
                as the offer price. Only relevant when codAvailable is true.
              x-jsonld-id: "rcoa:codMaxAmount"
            prepaidOnly:
              type: boolean
              description: Whether prepayment is mandatory for this offer (e.g. high-value items, pre-orders)
              x-jsonld-id: "rcoa:prepaidOnly"
          x-jsonld-id: "rcoa:paymentConstraints"
        serviceability:
          type: object
          properties:
            distanceConstraint:
              type: object
              properties:
                maxDistance:
                  type: number
                  x-jsonld-id: "rcoa:maxDistance"
                unit:
                  type: string
                  enum: [KM]
                  x-jsonld-id: "rcoa:distanceUnit"
              x-jsonld-id: "rcoa:distanceConstraint"
            timing:
              type: array
              items:
                type: object
                properties:
                  daysOfWeek:
                    type: array
                    items:
                      type: string
                    x-jsonld-id: "rcoa:daysOfWeek"
                  timeRange:
                    type: object
                    properties:
                      start:
                        type: string
                        x-jsonld-id: "rcoa:timingStart"
                      end:
                        type: string
                        x-jsonld-id: "rcoa:timingEnd"
                    x-jsonld-id: "rcoa:timeRange"
              x-jsonld-id: "rcoa:timing"
          x-jsonld-id: "rcoa:serviceability"
        timeRange:
          type: object
          required: [start, end]
          properties:
            start:
              type: string
              description: "HH:MM format"
              x-jsonld-id: "rcoa:offerTimeStart"
            end:
              type: string
              description: "HH:MM format"
              x-jsonld-id: "rcoa:offerTimeEnd"
          x-jsonld-id: "rcoa:timeRange"
        holidays:
          type: array
          items:
            type: string
            format: date
          x-jsonld-id: "rcoa:holidays"
        minOrderQuantity:
          type: number
          description: >
            Minimum quantity a buyer must order in a single transaction (inclusive).
            For weight-sold items this may be a decimal (e.g. 0.5 kg).
          x-jsonld-id: "rcoa:minOrderQuantity"
        maxOrderQuantity:
          type: number
          description: >
            Maximum quantity a buyer may order in a single transaction (inclusive).
            For weight-sold items this may be a decimal (e.g. 5.0 kg).
          x-jsonld-id: "rcoa:maxOrderQuantity"
        subscriptionAvailable:
          type: boolean
          description: >
            Whether this offer can be purchased as a recurring subscription.
            This is a discovery hint only — subscription terms (frequency, billing
            cycle, renewal) are modelled in a separate SubscriptionOffer extension.
          x-jsonld-id: "rcoa:subscriptionAvailable"
