---
openapi: 3.0.3
info:
  title: Promotion Engine
  version: v1
  description: |

    This API is built on HTTP and is a RESTful API. This API is developed for merchants to be able to manage orders.
    The API services are published on HTTPS and use OAUTH2 protocol. Every call carries an OAuth2 access token, obtained with the client ID and client secret Gridbees gives you: `POST /accesstoken` with `grant_type` `client_credentials`, then the header `Authorization: Bearer ACCESS_TOKEN` on each request (details under "Security" in every operation).

    # Definitions

    ### Product
      A product is the stock keeping unit (SKU), the item to sale. The attributes of a product could include manufacturer, material, service, warranty terms.
      The PIM is the repository of all products used by the different services of the solution

    ### Offer
      An offer is a set of products and represents the commercial agreements sent by the merchant.
      An offer can have:
      -  one or many products
      -  Prices
      -  Additional services
      -  A publication period, during this period the offer is active and can be ordered

    ### Order
      An order contains information allowing to purchase some offers.
      An order has one or several order lines, and each order line is for an offer.
      The order has mandatory information such as amounts, payments, and addresses.

    ### Dates
      All Gridbees services use UTC datetime and the default format is: <b>yyyy-MM-dd'T'HH:mm:ss.SSSZ</b>.

tags:
  - name: Product Service

  - name: Offer Service
    description: |
      A merchant needs to pull the offers list to sell. Each offer has a publication period (offer.startdate, offer.enddate). During this period, the merchant can sell the offer depending the availability.

  - name: Pricing Service
    description: |
      The pricing service is used to check and guarantee all prices and services inside the submitted basket.

  - name: Customer Service

  - name: Promotion Service
    description: |
      List of services to manage promotions.
  - name: Booking Service
  - name: MasterData Service

servers:
  - url: "https://mock.gridbees.com/"

security:
  - ClientCredentials: []

components:
  securitySchemes:
    ClientCredentials:
      type: oauth2
      description: |
        Every call is authenticated with an OAuth2 access token. Gridbees gives each partner a **client ID** and a
        **client secret**: contact Gridbees support to get them, and keep the secret on your servers, never in a
        browser page or a mobile application.

        To call a service, an application:
        -  requests an access token with its client ID and client secret (`POST /accesstoken` on its Gridbees API host),
        -  receives an access token, its lifetime and a refresh token (to get a new access token when it expires),
        -  sends the access token in the `Authorization` header of every request: `Authorization: Bearer ACCESS_TOKEN`.

        Gridbees services authenticate and authorize each request from its access token.

        ####	Request an access token with the client ID and client secret
        ```
        POST /accesstoken HTTP/1.1
        Host: YOUR_GRIDBEES_API_HOST
        Content-Type: application/json

        {
          "grant_type" : "client_credentials",
          "client_id" : "YOUR_CLIENT_ID",
          "client_secret" : "YOUR_CLIENT_SECRET"
        }
        ```

        ####	Response
        ```
          {
            "token_type": "Bearer",
            "access_token": "ACCESS_TOKEN",
            "expires_in": 35999,     //lifetime in seconds
            "refresh_token": "REFRESH_TOKEN"
          }
        ```

        #### Refresh an expired access token with the refresh token
        ```
        POST /accesstoken HTTP/1.1
        Host: YOUR_GRIDBEES_API_HOST
        Content-Type: application/json

        {
          "grant_type" : "refresh_token",
          "client_id" : "YOUR_CLIENT_ID",
          "client_secret" : "YOUR_CLIENT_SECRET",
          "refresh_token" : "REFRESH_TOKEN"
        }
        ```

        #### Call a service, for example /contact/search
        ```
        POST /contact/search HTTP/1.1
        Host: YOUR_GRIDBEES_API_HOST
        Authorization: Bearer ACCESS_TOKEN
        Content-Type: application/json

        {
          //request body
        }
        ```
      flows:
        clientCredentials:
          tokenUrl: /accesstoken
          refreshUrl: /accesstoken
          scopes: {}

  schemas:
    Address:
      type: object
      description: "Address object"
      required:
        - streetname
        - city
        - postalcode
      properties:
        uid:
          type: string
          description: unique identifier
          format: uuid
        usage:
          type: string
          description: "Usage of this address"
          enum:
            - DLV
            - BIL
            - DROPOFF
            - PICKUP
        Isnormalized:
          type: boolean
          description: Is Normalized ?
        qualitycode:
          type: boolean
          description: Quality code
        isative:
          type: boolean
          description: Is active ?
        streetnumber:
          type: string
          description: Street number
        streetname:
          type: string
          description: Street name
        streettype:
          type: string
          description: Street type
        district:
          type: string
          description: District
        building:
          type: string
          description: Building
        city:
          type: string
          description: City
        postalcode:
          type: string
          description: Postal code
        province:
          type: string
          description: Province
        countrycode:
          type: string
          description: Country code
        additionalinfo:
          type: array
          description: Additional info
          items:
            $ref: '#/components/schemas/MetaData'
        name:
          $ref: '#/components/schemas/Person'
        legalentity:
          $ref: '#/components/schemas/LegalEntity'
        geoloc:
          $ref: '#/components/schemas/Geoloc'
        createdate:
          type: string
          description: creation date
          format: date-time
        updatedate:
          type: string
          description: update date
          format: date-time

    AdditionalService:
      type: object
      required:
        - servicetype
        - code
        - quantity
      properties:
        servicetype:
          type: string
          description: Type of additionnal service
          example: NIGHT, GUARANTEE, RECOVERY, ASSEMBLY, ...
        code:
          type: string
          description: additionnal service code
        quantity:
          type: number
        pricing:
          description: Prices of the additional service
          type: array
          items:
            $ref: '#/components/schemas/MasterData'
    Amount:
      type: object
      required:
        - currency
      properties:
        currency:
          type: string
        grossamount:
          type: number
          description:
            the public price of an offer
          format: double
        netamount:
          type: number
          description:
            the amount resulting from the difference of the gross amount and the different prices to reduce or to add
          format: double
        totaltorefund:
          type: number
          format: double
          description:
            the amount to refund to the customer
        totaltopay:
          type: number
          format: double
          description:
            the amount to pay by the customer
        adjustedamount:
          type: number
          format: double
          description:
            The amount to add to the gross amount. Could come from promotion rules
        discountamount:
          type: number
          format: double
          description:
            the amount to be reduced to the gross amount. Could come from promotion rules
        commisionamount:
          type: number
          format: double
          description:
            the commission amount to be returned to the merchant
        fees:
          type: number
          format: double
          description:
            the delivery fees amount. Calculated by valorize service
        feesdiscountamount:
          type: number
          format: double
          description:
            The fees discount amount to reduce to the fees
        additionalserviceamount:
          type: number
          format: double
          description:
            additional services amount to add to the gross amount.
        additionalassemblyamount:
          type: number
          format: double
          description:
            The amount of the assembly fees
        additionalrecoveryamount:
          type: number
          format: double
          description:
            The amount of the recovery fees
        hashamount:
          type: string
      description: Basket valorized amounts

    ApplicableDay:
      type: object
      properties:
        fromhour:
          type: string
        tohour:
          type: string
        weekdays:
          type: array
          items:
            type: integer
          description: opening days

    Availability:
      type: object
      properties:
        availabilityline:
          type: array
          items:
            $ref: '#/components/schemas/AvailabilityLine'
          description: Availability lines
        isactual:
          type: boolean
          description: Actual or theoretical availability
        messagetype:
          type: string
        version:
          type: string
        revision:
          type: string
        channelcode:
          type: string
        site:
          type: string
    AvailabilityLine:
      type: object
      required:
        - offerid
      properties:
        offerid:
          type: string
          description: offer technical identifier
        offercode:
          type: string
          description: Offer business code
        quantity:
          type: integer
          description: Requested quantity
        date:
          type: string
          format: date-time
          description: date in UTC
        hour:
          type: string
          description: hour in format HH:MM
        lang:
          type: string
          description: two digits language code (iso -639-1)
        vendorcode:
          type: string
          description: vendor code
        totalquantity:
          type: integer
          description: actual total quantity returned
        freesales:
          type: boolean
          description: means the stock is infinite
        quantitydetails:
          description: optionnaly used to give details aboout the returned availability
          items:
            $ref: '#/components/schemas/MasterData'
        canbeordered:
          type: boolean
          description: if this flag is set to FALSE, that means this offer cannot be purchased
        currency:
          type: string
        unitpriceselling:
          type: number
        resupplyingdelay:
          type: integer
          description: resupplying delay, in case of shortage
        retrocessiondelay:
          type: integer
          description: Retrocession delay
    AvailabilitiesRequest:
      type: object
      properties:
        startdate:
          type: string
          format: date-time
        enddate:
          type: string
          format: date-time
        availabilitylines:
          type: array
          items:
            $ref: '#/components/schemas/OfferCode'
      example:
        {"startdate":"2020-04-01T23:00:00.000Z", "enddate":"2020-04-02T22:59:59.000Z"}

    AvailabilitiesResponse:
      type: object
      properties:
        startdate:
          type: string
          format: date-time
        enddate:
          type: string
          format: date-time
        availabilitylines:
          type: array
          items:
            $ref: '#/components/schemas/OfferCode'
      example:
        {"startdate":"2020-04-01T22:00:00.000Z", "enddate":"2020-04-03T21:59:59.000Z", "availabilitylines":[{"offerid":"1f3d07b1647144ce999d5b0ab31ee385", "offercode":"TDS1", "date":"2020-04-02T00:00:00.000+02:00", "hour":"09:00", "totalquantity":10}, {"offerid":"71825be3a4d74cfe8d679d26c98980a8", "offercode":"VTP8", "date":"2020-04-02T00:00:00.000+02:00", "hour":"08:00", "lang":"en", "totalquantity":10}, {"offerid":"71825be3a4d74cfe8d679d26c98980a8", "offercode":"VTP8", "date":"2020-04-02T00:00:00.000+02:00", "hour":"08:00", "lang":"fr", "totalquantity":10}]}

    AvailabilityRequest:
      type: object
      properties:
        availability:
          $ref: '#/components/schemas/Availability'
        availabilitycontext:
          $ref: '#/components/schemas/ContextDetails'
      example:
        {"availability":{"availabilityline":[{"offerid":"1f3d07b1647144ce999d5b0ab31ee385", "date":"2020-04-02T00:00:00.000Z", "hour":"09:00", "quantity":7, "lang":"en", "quantitydetails":[{"mdobject":"INDIVIDUAL", "code":"ADULT", "value":"4"}, {"mdobject":"INDIVIDUAL", "code":"CHILD", "value":"3"}, {"mdobject":"INDIVIDUAL", "code":"INFANT", "value":"0"}]}]}}

    AvailabilityResponse:
      type: object
      properties:
        availability:
          $ref: '#/components/schemas/Availability'
        availabilitycontext:
          $ref: '#/components/schemas/ContextDetails'

    Backend:
      type: object
      properties:
        backendtype:
          type: string
          description: type of the master data
        ismandatory:
          type: boolean
        isvisible:
          type: boolean
        publishable:
          type: boolean
        url:
          type: string
        keyindex:
          type: integer

    BackendDisplay:
      type: object
      properties:
        backendtype:
          type: string
          description: type of the master data
        keyindex:
          type: integer
        objectname:
          type: string
        idname:
          type: string
        islocalizable:
          type: boolean
        ismandatory:
          type: boolean
        isautocompleted:
          type: boolean
        isactive:
          type: boolean
        isvisible:
          type: boolean
        publishable:
          type: boolean
        isinternal:
          type: boolean
        isexportable:
          type: boolean
        guioption:
          $ref: '#/components/schemas/DisplayGUI'
        urls:
          $ref: '#/components/schemas/DisplayURL'

    DisplayGUI:
      type: object
      properties:
        searchresultindex:
          type: integer
        searchindex:
          type: integer
        searchfields:
          type: string
        returnfield:
          type: string
        displayfields:
          type: string
        mdimport:
          type: array
          items:
            $ref: '#/components/schemas/DisplayImport'

    DisplayImport:
      type: object
      properties:
        code:
          type: string
        label:
          type: string
        translations:
          type: array
          items:
            $ref: '#/components/schemas/Translation'
        dataseparator:
          type: string
        mapping:
          type: string
        helper:
          type: string
          description: for tooltip


    DisplayURL:
      type: object
      properties:
        searchurl:
          type: string
        seturl:
          type: string
        updateurl:
          type: string
        deleteurl:
          type: string
        streamurl:
          type: string
        upserturl:
          type: string

    BankAccount:
      type: object
      properties:
        bankname:
          type: string
          description: Bank name
        bic:
          type: string
          description: BIC/ SWIFT Code
        banknumber:
          type: string
          description: Bank number
        bankaccount:
          type: string
          description: Bank acount number
        customername:
          type: string
          description: Customer name

    BankAuthorization:
      type: object
      properties:
        authorizationcode:
          type: string
          description: authorization code
        rumcode:
          type: string
          description: RUM Code
        rumvaliditydate:
          type: string
          format: date-time
          description: RUM validity date
        cardtransactionid:
          type: string
        validydate:
          type: string
          format: date-time
          description: validity date
        debitauthid:
          type: string
        debitauthdate:
          type: string
          format: date-time
          description: Debit validity date

    BasketAddedProduct:
      type: object
      properties:
        reference:
          type: string
          description: offer busyness reference
        offerid:
          type: string
          description: offer technical key
        crossedoutPrice:
          type: number
          format: double
          description: crossed-out price
        sellingPrice:
          type: number
          format: double
          description: selling price
        discount:
          type: number
          format: double
          description: discount price
        productItem:
          $ref: '#/components/schemas/ProductItem'

    BasketProfile:
      type: object
      properties:
        usersubcriptions:
          $ref: '#/components/schemas/UserSubscription'
        trackingdata:
          $ref: '#/components/schemas/TrackingData'
        person:
          $ref: '#/components/schemas/Person'
        customdata:
          type: array
          items:
            $ref: '#/components/schemas/MetaData'
          description: To use to store key/value list

    BasketRequest:
      required:
        - identifier
        - lines
        - ordertracking
      type: object
      properties:
        profile:
          $ref: '#/components/schemas/BasketProfile'
        identifier:
          $ref: '#/components/schemas/Identifier'
        ordertracking:
          $ref: '#/components/schemas/TrackingData'
        comtracking:
          $ref: '#/components/schemas/CommercialTracking'
        businesscreationdate:
          type: string
          description: Business creation date
          format: date-time
        lines:
          type: array
          description: Cart lines
          items:
            $ref: '#/components/schemas/BasketLine'
    BasketLine:
      required:
        - linenum
        - offerid
        - quantity
      type: object
      properties:
        linenum:
          type: integer
          description: Line number
        referencecode:
          type: string
          description: Reference code
        offercode:
          type: string
        offerid:
          type: string
          description: Technical identifier
        linestatus:
          type: string
          description: Status of the line.
          example: 1 - Productadded 2 - offer refused by customer
        offercodification:
          type: string
          description: Codification
        quantity:
          type: integer
          description: Quantity
        amount:
          $ref: '#/components/schemas/Amount'
        crossedoutprice:
          type: number
          format: double
          description: Crossed out price
        sellingprice:
          type: number
          format: double
          description: Selling price
        promotionenddate:
          type: string
          format: date-time
          description: Info on expiration of the promotion
        options:
          description: Offer Options
          $ref: '#/components/schemas/OptionOffer'
        taxdetails:
          type: array
          items:
            $ref: '#/components/schemas/TaxDetail'
          description: Info on expiration of the promotion
        additionalservices:
          type: array
          items:
            $ref: '#/components/schemas/AdditionalService'
          description: Additional service
        offerbookingdate:
          type: string
          description: Date of the booking
        offerbookinghour:
          type: string
          description: Hour of the booking
        offerlang:
          type: string
          description: Lang of the booking
        group:
          type: string
          description: Group number
        groupcode:
          type: string
          description: Group code
        pricing:
          items:
            $ref: '#/components/schemas/MasterData'
          description: Additional info on prices

    BasketResponse:
      type: object
      properties:
        profile:
          $ref: '#/components/schemas/BasketProfile'
        identifier:
          $ref: '#/components/schemas/Identifier'
        ordertracking:
          $ref: '#/components/schemas/TrackingData'
        comtracking:
          $ref: '#/components/schemas/CommercialTracking'
        businesscreationdate:
          type: string
          description: Business creation date
          format: date-time
        lines:
          type: array
          items:
            $ref: '#/components/schemas/BasketLine'
        basketdetails:
          $ref: '#/components/schemas/ContextDetails'
        amount:
          $ref: '#/components/schemas/Amount'
        basketrules:
          type: array
          description: Applied rules
          items:
            $ref: '#/components/schemas/BasketRule'
        suggestions:
          type: array
          items:
            $ref: '#/components/schemas/SuggestPromotion'

    BasketRule:
      type: object
      properties:
        linenum:
          type: integer
        rulename:
          type: string
        initialamount:
          type: number
          format: double
        discountamount:
          type: number
          format: double
        adjustedamount:
          type: number
          format: double
        walletamount:
          type: number
          format: double
        priorityrule:
          items:
            $ref: '#/components/schemas/PriorityRule'

    BillingInfo:
      type: object
      properties:
        groupcode:
          type: string
          description: Billing group code
        paymentmode:
          type: string
          description: Payment mode
        paymentdelay:
          type: string
          description: Delay to pay the invoice
        prepaymentmode:
          type: string
          description: Pre payment information. Possible values are BILLING, NET, GROSS
        pricecode1:
          type: string
          description: First price code to access to the commission grid
        pricecode2:
          type: string
          description: Second price code to access to the commission grid
        receipttopassenger:
          type: boolean
          description: If the payment receipt must be sent to the customer
        vouchertopassenger:
          type: boolean
          description: If the voucher document must be sent to the customer
    BookingOffer:
      type: object
      properties:
        offercode:
          type: string
          description: Code of the offer
        quantity:
          type: integer
          description: quantity
        baseprice:
          type: number
          description: Initial price

    BookingProduct:
      type: object
      properties:
        productcode:
          type: string
          description: Code of the Product
        quantity:
          type: integer
          description: quantity
        baseprice:
          type: number
          description: Initial price

    BookingSubscription:
      type: object
      properties:
        isinclusion:
          type: boolean
          description: the offer must belong to the customer
        ispercent:
          type: boolean
        datatype:
          type: string
          enum:
            - OFFER
            - PRODUCT
        code:
          type: string
          description: Produc or Offer code
        quantity:
          type: integer
          description: quantity
        discountvalue:
          type: number
        baseprice:
          type: number
          description: Initial price

    BookingCondition:
      type: object
      properties:
        basketamount:
          type: number
          format: double
          description: Basket amount
        basketlineamount:
          type: number
          format: double
          description: Basket line amount
        operator:
          type: string
          description: Operator
        channelcodes:
          type: array
          items:
            type: string
          description: Channel conditions
        applications:
          type: array
          items:
            type: string
          description: Allowed applications list
        offers:
          type: array
          items:
            $ref: '#/components/schemas/BookingOffer'
        products:
          type: array
          items:
            $ref: '#/components/schemas/BookingProduct'
        subscription:
          type: array
          items:
            $ref: '#/components/schemas/BookingSubscription'
        productfilter:
          type: array
          items:
            $ref: '#/components/schemas/MetaData'
          description: Filter to restrict the discount
        productexception:
          type: array
          items:
            $ref: '#/components/schemas/MetaData'
          description: Filter to exclude some offers in the discount
    BookingDiscount:
      type: object
      properties:
        discountname:
          type: string
          enum:
            - Enumeration
            - BasketDiscountPercent
            - BasketDiscountAmount
            - LineDiscountAmount
            - LineDiscountPercent
            - OfferDiscountAmount
            - OfferDiscountPercent
            - ProductDiscountAmount
            - ProductDiscountPercent
            - SubscriptionDiscountAmount
            - SubscriptionDiscountPercent
            - FeeDiscountPercent
            - TheCheapestPercent
            - TheMostExpensive
            - PaxDiscountPercent
            - PaxDiscountAmount
            - FeeDiscountAmount
            - FeeDiscountPercent
            - SetDiscountLine
            - SetFees
        quantity:
          type: integer
          description: Quantity
        discounttype:
          description: Type of discount
          enum:
            - PERCENT
            - FIXED
        discountvalue:
          type: number
          format: double
          description: Discount value
        isreverseprice:
          type: boolean
        isforwallet:
          type: boolean
        perpurchase:
          type: number
          format: double
          description: Per purchase
        perquantity:
          type: integer
          format: double
          description: Per quantity
        productfilter:
          type: array
          items:
            $ref: '#/components/schemas/MetaData'
          description: Filter to restrict the discount
        productexception:
          type: array
          items:
            $ref: '#/components/schemas/MetaData'
          description: Filter to exclude some offers in the discount
        offers:
          type: array
          items:
            $ref: '#/components/schemas/BookingOffer'
        products:
          type: array
          items:
            $ref: '#/components/schemas/BookingProduct'

    BookingPassenger:
      type: object
      properties:
        reservationtype:
          type: string
          description: Reservation type
          example: INDIVIDUAL, PRIVATIZATION
        passengertype:
          type: string
          description: Passenger type
          example: ADULT, CHILD, INFANT
        quantity:
          type: integer
          description: quantity
    BookingRule:
      type: object
      properties:
        conditions:
          type: array
          items:
            $ref: '#/components/schemas/BookingCondition'
          description: Conditions list
        behaviours:
          type: array
          items:
            $ref: '#/components/schemas/BookingDiscount'
          description: Discounts list
    BookingRequest:
      type: object
      properties:
        externaltransactionnumber:
          type: string
        destinationcode:
          type: string
        offercode:
          type: string
        offercodes:
          description: list of offer codes to query
          type: array
          items:
            type: string
        typologies:
          description: list of offer typologies to query
          type: array
          items:
            type: string
        startdate:
          type: string
          format: date-time
        enddate:
          type: string
          format: date-time
        requestcontext:
          $ref: '#/components/schemas/RequestContext'

    OptionOfferDetail:
      type: object
      properties:
        unicitykey:
          type: string
          description: unicitykey reference for lookup
        unicitycode:
          type: string
          description: unicitycode reference for lookup
        title:
          type: string
          description: name of  this option
        rank:
          type: integer
        adjustedprice:
          type: number
          format: double
          description: additional price for this option

    OptionOffer:
      type: object
      properties:
        title:
          type: string
          description: name of this option
        rank:
          type: integer
          description: rank of this option
        minquantity:
          type: integer
          description: Minimum quantity
        maxquantity:
          type: integer
          description: Maximum quantity
        optiondetails:
          type: array
          items:
            $ref: '#/components/schemas/OptionOfferDetail'
          description: Describe each option details

    Cancellation:
      type: object
      properties:
        minday:
          type: integer
          description: Minimum day before cancellation date
        maxday:
          type: integer
          description: Maximum day before cancellation date
        rate:
          type: number
          format: double
          description: Rate to apply

    CancellationDetail:
      type: object
      properties:
        creditnote:
          type: string
          description: Credit note amount
        cancellationfees:
          description: Cancellation fees amount
          type: number
          format: double
        cancellationdate:
          description: Cancellation date amount
          type: string
          format: date-time
        commissionamount:
          description: Commission amount after the cancellation
          type: number
          format: double

    CancellationRequest:
      type: object
      required:
        - orderid
      properties:
        orderid:
          type: integer
          description: Order primary key
        vendorcode:
          type: string
          description: Vendor code
        cancellationdate:
          type: string
          format: date-time
        ordernumid:
          type: string
          description: Order transaction number
        comment:
          type: string
          description: Comment to store on the cancellation
      example:
        {"orderid":"9ed8c8fb5f034ffda61a4b81a3bce42d", "ordernumid": "LZI3Y00000895"}

    CancellationBookingResponse:
      type: object
      properties:
        order:
          $ref: '#/components/schemas/Order'
        ordercontext:
          $ref: '#/components/schemas/ContextDetails'
      example:
        {"order":{"orderid":"82bf4511e2d74876ad12bebac9a2f3df", "ordertracking":{"user":"s.lavenant", "platformreferencenumber":"2003WS4895", "transactionnumber":"L1IRC000010047", "vendorcode":"003298", "orderchannel":"CALLCENTER", "emitterid":"GUI", "bookingid":"7ccb7b1fe8a2473dac86bf73994f2dde"}, "cancellationdetail":{"cancellationfees":0, "notification":{"eventcode":"STANDARD", "eventtype":"CANCELLATION"}, "cancellationdate":"2020-03-12T23:00:00.000Z", "commissionamount":0, "creditnote":829}, "identifier":{"contactid":"4423af5e37264a87917b43e392ecdeed", "structure":{"countrycode":"FR", "marketcode":"FR", "blcode":"PCV"}}, "businesscreationdate":"2020-03-13T13:17:03.684Z", "statusdetail":{"latest":[{"statustype":"Operational", "user":"Api USer", "code":"CANCELLED", "date":"2020-03-13T13:19:08.089Z"}, {"user":"Api USer", "code":"PAID", "date":"2020-03-13T13:17:48.206Z", "statustype":"PAYMENT"}], "order":[{"user":"Api USer", "code":"CANCELLED", "date":"2020-03-13T13:19:08.089Z", "statustype":"Operational"}, {"user":"Api USer", "code":"PROCESSED", "date":"2020-03-13T13:17:48.815Z", "statustype":"Operational"}, {"statustype":"PAYMENT", "user":"Api USer", "code":"PAID", "date":"2020-03-13T13:17:48.206Z"}, {"statustype":"Operational", "user":"merchant user", "code":"PENDING", "date":"2020-03-13T13:17:04.106Z"}, {"user":"merchant user", "code":"PENDING", "date":"2020-03-13T13:17:04.106Z", "statustype":"PAYMENT"}]}, "deliverydetail":{"email":{"usage":"BIL", "isprincipal":true, "emailvalue":"s.wolf@gridbees.com"}, "customdata":[{"attribute":"pickuphour", "value":"2020-03-20T09:00:00.000Z"}, {"attribute":"dropoffhour", "value":"2020-03-20T13:00:00.000Z"}]}, "amount":{"currency":"EUR", "hashamount":"b80f7b95d4456a2208528f02c1d3e58a9f2dcc596c156d973d2bc43647d9997c", "grossamount":830, "totaltorefund":828, "totaltopay":830, "netamount":830}, "payment":{"isprepaid":true, "groupedpayment":{"orderids":["82bf4511e2d74876ad12bebac9a2f3df"], "totalpaid":830}, "paymentdate":"2020-03-13T13:17:48.206Z", "prepaidamount":830, "details":[{"paymentmode":"CASH", "paymentdate":"2020-03-13T13:17:48.206Z", "paymentcode":"DISCOUNT", "status":"PAID", "totalpaid":430, "updatedate":"2020-03-13T13:17:48.206Z", "externalpaymentreference":"548d49696d544dcb86263524c5ca8c27", "movementtype":"CASHING"}, {"paymentmode":"CASH", "paymentdate":"2020-03-13T13:17:48.206Z", "paymentcode":"EURO", "status":"PAID", "totalpaid":400, "updatedate":"2020-03-13T13:17:48.206Z", "externalpaymentreference":"548d49696d544dcb86263524c5ca8c27", "movementtype":"CASHING"}], "totalpaid":830, "processingmode":"PREPAYMENT", "updatedate":"2020-03-13T13:17:48.354Z", "externalpaymentreference":"93195671"}, "updatedate":"2020-03-13T13:19:08.089Z", "comtracking":{"isgift":false, "isquotation":false, "tickets":[{"media":{"url":"http://api-uat.gridbees.com/medias/tickets/3776/715a/3776715a9dfe6f91b02a37ac263b79092a47a.pdf", "size":29489, "languagecode":"fr", "mediatype":"PDF"}, "suppliercode":"PCV", "formattype":"BARCODE", "value":"L1IRC000010047", "categories":{"ADULT":10}, "businesstype":"VOUCHER", "subformattype":"QR", "reservationdate":"2020-03-20T09:00:00.000Z", "transactionnumber":"L1IRC000010047", "languagecode":"fr"}], "documents":[{"media":{"mediatype":"PDF", "url":"http://api-uat.gridbees.com/medias/docs/7931/b7ef/79310f1000f2a2f499e35d512ea6912cc0c2.pdf", "size":1263, "languagecode":"fr-FR"}, "businesstype":"RECEIPT_CC_PAYMENT", "documentnumid":"D548d49696d544dcb86263524c5ca8c27", "linkedtransactionnumbers":["L1IRC000010047"], "createdate":"2020-03-13T13:17:48.280Z", "amount":32}]}, "billingaddress":{"isactive":true, "isnormalized":false, "usage":"BIL", "name":{"lastname":"Loustria", "civility":"MR", "firstname":"Solange"}}, "createdate":"2020-03-13T13:17:04.106Z", "ordertype":"ORDER", "lines":[{"bookinglang":"fr", "quantity":10, "linenum":1, "offerdestinations":[{"destinationcode":"CITYTOUR"}], "offercancellations":[{"minday":2, "maxday":2, "rate":50}, {"minday":0, "maxday":1, "rate":100}], "productitems":[{"quantity":1, "productcode":"HISTOV-HISTO", "suppliers":[]}, {"productcode":"BP-CROI", "suppliers":[], "quantity":1}, {"suppliers":[], "quantity":1, "productcode":"TE-VIS-2E"}, {"productcode":"VIS-TDV", "suppliers":[], "quantity":1}], "amount":{"currency":"EUR", "hashamount":"a0a965586ea81c2f30f189a286ce2cf0d18047d19660ae180a340cadffe1df8a", "additionalassemblyamount":0, "additionalserviceamount":0, "additionalrecoveryamount":0, "grossamount":830, "totaltopay":830, "totaltorefund":829, "netamount":830}, "bookingdate":"2020-03-19T23:00:00.000Z", "sellingprice":83, "bookinghour":"10:00", "offerid":"93dd2ab917ab4746901aac6f4a5f3930", "referencecode":"PS", "cancellationdetail":{"creditnote":829, "commissionamount":0, "cancellationfees":0}, "pricing":[{"price":83, "mdobject":"INDIVIDUAL", "quantity":10, "code":"ADULT"}]}]}, "ordercontext":{"status":"OK"}}

    CancellationValorizationResponse:
      type: object
      properties:
        order:
          $ref: '#/components/schemas/OrderCancel'
        ordercontext:
          $ref: '#/components/schemas/ContextDetails'
      example:
        {"order":{"orderid":"9ed8c8fb5f034ffda61a4b81a3bce42d", "amount":{"currency":"THB", "grossamount":69.0, "netamount":62.1, "totaltopay":62.1, "totaltorefund":9.0, "commissionamount":6.9, "hashamount":"08271aece4aa37b6e81728a7bc5f9e536460967ebaba0d009d8e8871b6b7c56e"}, "cancellationdetail":{"creditnote":47.1, "cancellationfees":0.0, "commissionamount":6.9}}, "ordercontext":{"status":"OK", "message":"PAYMENTMODECHANGED"}}

    ClaimDetail:
      type: object
      properties:
        typology:
          type: string
          description: Typology
        channel:
          type: string
          description: Channel code
        emitterid:
          type: string
          description: Emitter of the claim
        origin:
          type: string
          description: Origin
        detailcontent:
          type: string
          description: Content of the detail
        createdate:
          type: string
          format: date-time
          description: Creation date

    Card:
      type: object
      properties:
        cardaliasid:
          type: string
          description: card alias ID
        validitydate:
          type: string
          format: date-time
          description: validity date
        cardtype:
          type: string
          description: card type
        partner:
          type: string
        portal:
          type: string

    ClaimTrack:
      type: object
      properties:
        codification:
          items:
            $ref: '#/components/schemas/Codification'
          description: Codification of the claim
        identifier:
          items:
            $ref: '#/components/schemas/Identifier'
          description: Identifier
        structure:
          items:
            $ref: '#/components/schemas/Structure'
          description: Structure
        claimtype:
          type: string
          description: Claim type
        claimcode:
          type: string
          description: Claim code
        claimjuscode:
          type: string
          description: Claim proof code
        topic:
          type: string
          description: Topic of the claim
        details:
          type: array
          items:
            $ref: '#/components/schemas/ClaimDetail'
          description: Details list
        status:
          type: string
          description: Status of the claim
        satisfaction:
          type: string
          description: Comment on the claim

    Commission:
      type: object
      properties:
        commissionid:
          type: string
          description: Unique technical key
        unicitykey:
          type: string
          description: Business key
        offercode:
          type: string
          description: Offer code  concerned by this commission
        pricecode:
          type: string
          description: Price code of the commission
        departmentcode:
          type: string
          description: Department code of the commission
        prices:
          type: array
          items:
            $ref: '#/components/schemas/Price'
          description: List of commission prices
        createdate:
          type: string
          format: date-time
          description: Creation date
        updatedate:
          type: string
          format: date-time
          description: Modification date
    Codification:
      type: object
      properties:
        code:
          type: string
          description: Code
        numid:
          type: string
          description: Identifier number
        typology:
          type: string
          description: Typology
        statecode:
          type: string
          description: State code
        eancode:
          type: string
          description: EAN code
        label:
          type: string
          description: Label
        externalcode:
          type: string
          description: External code
        externalref:
          type: string
          description: External reference
        vendorcode:
          type: string
          description: Vendor code
        programcode1:
          type: string
          description: Custom code 1
        programcode2:
          type: string
          description: Custom code 2
        programref:
          type: string
          description: Custom reference
        categorycode:
          type: string

    Comment:
      type: object
      properties:
        user:
          type: string
          description: User creating the comment
        message:
          type: string
          description: The message of the comment
        createdate:
          type: string
          format: date-time
          description: Creation date
        updatedate:
          type: string
          format: date-time
          description: Modification date

    Conflict:
      type: object
      properties:
        includedcodes:
          items:
            $ref: '#/components/schemas/ConflictCode'
        excludedcodes:
          items:
            $ref: '#/components/schemas/ConflictCode'

    ConflictCode:
      type: object
      properties:
        offercodes:
          type: array
          items:
            type: string
        productcodes:
          type: array
          items:
            type: string

    Contact:
      type: object
      properties:
        contactid:
          type: string
          description: unique technical key of the contact
        unicitykey:
          type: string
          description: unique business key of the contact
        typology:
          type: string
          description: Type of the client
        person:
          $ref: '#/components/schemas/Person'
        legalentity:
          $ref: '#/components/schemas/LegalEntity'
        structure:
          $ref: '#/components/schemas/Structure'
        identifier:
          $ref: '#/components/schemas/Identifier'
        identitydocuments:
          type: array
          items:
            $ref: '#/components/schemas/IdentityDocument'
        emails:
          type: array
          items:
            $ref: '#/components/schemas/Email'
          description: Email contact
        phones:
          type: array
          items:
            $ref: '#/components/schemas/Phone'
          description: Phone contact
        addresses:
          type: array
          items:
            $ref: '#/components/schemas/Address'
        paymentdata:
          $ref: '#/components/schemas/PaymentData'
        loyaltycards:
          type: array
          items:
            $ref: '#/components/schemas/LoyaltyCard'
        trackingdata:
          $ref: '#/components/schemas/TrackingData'
        customdata:
          type: array
          items:
            $ref: '#/components/schemas/MetaData'
          description: To use to store key/value list
        statusdetail:
          $ref: '#/components/schemas/ContactStatusDetail'
        businesscreationdate:
          type: string
          description: creation date
          format: date-time
        createdate:
          type: string
          description: creation date
          format: date-time
        updatedate:
          type: string
          description: update date
          format: date-time

    ContactStatus:
      type: object
      required:
        - statustype
        - code
      properties:
        statustype:
          type: string
          description: Status type (Operational, Payment, Filtering)
        code:
          type: string
          description: Code of the type (PENDING, PROCESSED, ..)
        cause:
          type: string
          description: Cause of the error
        message:
          type: string
          description: Status message
        source:
          type: string
          description: Status source
        user:
          type: string
          description: User
        date:
          type: string
          description: date
          format: date-time

    ContactStatusDetail:
      type: object
      properties:
        latest:
          $ref: '#/components/schemas/ContactStatus'
          description: lastest status per statustype
        order:
          type: array
          items:
            $ref: '#/components/schemas/ContactStatus'
            description: contact status history

    ContactRequest:
      type: object
      properties:
        contactids:
          type: array
          items:
            type: string
        unicitykeys:
          type: array
          items:
            type: string
        emails:
          type: array
          items:
            type: string
        phones:
          type: array
          items:
            type: string
        addresses:
          type: array
          items:
            type: string
        typology:
          type: string
          description: Type of the client
        countrycode:
          type: string
        postalcode:
          type: string
        walletnumid:
          type: string
        externalnumid:
          type: string
        marketcode:
          type: string
        shopcode:
          type: string
        companyname:
          type: string
        attribute:
          type: string
        attributevalue:
          type: string
        startbirthdate:
          type: string
          description: birthdate start date
          format: date-time
        endbirthdate:
          type: string
          description: birthdate end date
          format: date-time
        startlastpurchasedate:
          type: string
          description: last purchase start date
          format: date-time
        endlastpurchasedate:
          type: string
          description: last purchase end date
          format: date-time
        lastupdatedate:
          type: string
          description: consider entries such  as updatedate greater than lastupdatedate
          format: date-time
        showstatusdetails:
          type: boolean
          description: include status details ?
        showdeletedaddresses:
          type: boolean
          description: include deleted addresses ?
        requestcontext:
          $ref: '#/components/schemas/RequestContext'
          description:  and restricted fields to return

    ContactAttributeRequest:
      type: object
      properties:
        unicitykey:
          type: string
        customdata:
          type: array
          items:
            $ref: '#/components/schemas/MetaData'
          description: Custom attributes definitions

    Exclusion:
      type: object
      properties:
        vendorcodes:
          type: string
          description: Vendor codes
        offercodes:
          type: string
          description: Offer codes
        cancellations:
          type: array
          items:
            $ref: '#/components/schemas/Cancellation'
          description: Cancellation definitions

    WebaccountRequest:
      type: object
      properties:
        login:
          type: string
          description: User login handle
        structure:
          $ref: '#/components/schemas/Structure'

    WebaccountDeleteRequest:
      type: object
      properties:
        webaccountid:
          type: string
          description: Web account ID
        contactid:
          type: string
          description: Contact ID

    WebaccountLoginRequest:
      type: object
      properties:
        login:
          type: string
          description: User login handle
        password:
          type: string
          description: Password

    WebaccountResetPasswordRequest:
      type: object
      properties:
        login:
          type: string
          description: User login handle
        password:
          type: string
          description: Password

    SupplierRequest:
      type: object
      properties:
        supplierid:
          type: string
          description: Supplier ID

    MailDeleteRequest:
      type: object
      properties:
        mailid:
          type: string
          description: Mail ID
        contactids:
          type: array
          description: contact IDs of recipients
          items:
            type: string

    MailGetRequest:
      type: object
      properties:
        mailid:
          type: string
          description: Mail ID

    MailRequest:
      type: object
      properties:
        mailid:
          type: string
          description: Mail ID
        mailids:
          type: array
          items:
            type: string
        tenantid:
          type: string
          description: Tenant ID
        structure:
          $ref: '#/components/schemas/Structure'
        contactids:
          type: array
          items:
            type: string
        ordernums:
          type: array
          items:
            type: string
        from:
          type: string
          description: Sender
        to:
          type: string
          description: Receiver
        cc:
          type: string
          description: Carbon Copy
        bcc:
          type: string
          description: Blind Carbon Copy
        subject:
          type: string
          description: Title of the mail
        status:
          type: string
          description: Status
        statuses:
          type: array
          items:
            type: string
        withwords:
          type: string
          description: With words (TODO)
        withoutwords:
          type: string
          description: Without words (TODO)
        user:
          type: string
          description: Status
        isreserved:
          type: boolean
          description: is reserved ?
        startdate:
          type: string
          description: Date query (from startdate to enddate)
          format: date-time
        enddate:
          type: string
          description: Date query (from startdate to enddate)
          format: date-time
        requestcontext:
          $ref: '#/components/schemas/RequestContext'

    Mail:
      type: object
      properties:
        mailid:
          type: string
          description: Mail ID
        tenantid:
          type: string
          description: Tenant ID
        contactid:
          type: string
          description: Contact ID
        trackingdata:
          $ref: '#/components/schemas/TrackingData'
        trackings:
          type: array
          items:
            $ref: '#/components/schemas/TrackingData'
        person:
          $ref: '#/components/schemas/Person'
        properties:
          $ref: '#/components/schemas/MailProperties'
        comments:
          type: array
          items:
            $ref: '#/components/schemas/Comment'
        status:
          type: string
          description: Status
        customdata:
          type: array
          items:
            $ref: '#/components/schemas/MetaData'
        createdate:
          type: string
          description: creation date
          format: date-time
        updatedate:
          type: string
          description: last update date
          format: date-time
        sentdate:
          type: string
          description: sent date
          format: date-time
        user:
          type: string
          description: User
        isreserved:
          type: boolean
          description: is reserved ?
        reservationdate:
          type: string
          description: reservation date
          format: date-time
        sendandarchive:
          type: boolean
          description: is sent and archived ?
        lang:
          type: string
          description: Langage code

    MailProperties:
      type: object
      properties:
        from:
          type: string
          description: From
        to:
          type: string
          description: To
        cc:
          type: string
          description: Cc
        bcc:
          type: string
          description: Bcc
        subject:
          type: string
          description: Subject
        message:
          type: string
          description: Message
        attachments:
          type: array
          items:
            $ref: '#/components/schemas/Attachment'

    Attachment:
      type: object
      properties:
        filename:
          type: string
          description: Filename
        description:
          type: string
          description: Description
        uploadref:
          type: string
          description: Upload reference
        content:
          type: string
          description: Content
        contenttype:
          type: string
          description: Content type

    MailTemplate:
      type: object
      properties:
        mailtemplateid:
          type: string
          description: mail template id
        code:
          type: string
          description: template code
        tenantid:
          type: string
          description: tenant id
        structure:
          $ref: '#/components/schemas/Structure'
        description:
          type: string
          description: description
        typology:
          type: string
          description: typology
        maildata:
          type: array
          items:
            $ref: '#/components/schemas/MailData'
        startdate:
          type: string
          description: start date
          format: date-time
        endate:
          type: string
          description: end date
          format: date-time
        campaigncode:
          type: string
          description: campaign code
        customdata:
          type: array
          items:
            $ref: '#/components/schemas/MetaData'
        createdate:
          type: string
          description: creation date
          format: date-time
        updatedate:
          type: string
          description: update date
          format: date-time

    MailData:
      type: object
      properties:
        lang:
          type: string
          description: langage code
        subject:
          type: string
          description: subject
        body:
          type: string
          description: body
        updatedate:
          type: string
          description: update date
          format: date-time

    MailTemplateRequest:
      type: object
      properties:
        mailtemplateid:
          type: string
          description: mail template id
        structure:
          $ref: '#/components/schemas/Structure'
        typology:
          type: string
          description: typology
        lang:
          type: string
          description: langage code
        tenantid:
          type: string
          description: tenant id
        code:
          type: string
          description: template code
        subject:
          type: string
          description: subject
        body:
          type: string
          description: body
        description:
          type: string
          description: description
        startdate:
          type: string
          description: start date
          format: date-time
        endate:
          type: string
          description: end date
          format: date-time
        requestcontext:
          $ref: '#/components/schemas/RequestContext'

    Notification:
      type: object
      properties:
        notificationid:
          type: string
          description: notification id
        unicitykey:
          type: string
          description: notification unicity key
        identifier:
          $ref: '#/components/schemas/Identifier'
        eventtype:
          type: string
          description: event type
        eventcode:
          type: string
          description: event code (event type specialization)
        topic:
          type: string
          description: topic
        justificationcode:
          type: string
          description: justification code
        retentiondelay:
          type: integer
          description: retention delay
        retentionunit:
          type: integer
          description: retention unit
        trackingdata:
          $ref: '#/components/schemas/TrackingData'
        emitterid:
          type: string
          description: emitter id
        channel:
          type: string
          description: channel
        user:
          type: string
          description: user
        status:
          type: string
          description: status
        claims:
          type: array
          items:
            $ref: '#/components/schemas/ClaimTrack'
        cancellations:
          type: array
          items:
            $ref: '#/components/schemas/Cancellation'
        exclusions:
          type: array
          items:
            $ref: '#/components/schemas/Exclusion'
        attributes:
          type: array
          items:
            $ref: '#/components/schemas/MasterData'
        updatedate:
          type: string
          description: update date
          format: date-time
        createdate:
          type: string
          description: create date
          format: date-time

    NotificationRequest:
      type: object
      properties:
        notificationid:
          type: string
          description: notification id
        unicitykey:
          type: string
          description: notification unicity key
        contactid:
          type: string
          description: contact id
        eventtype:
          type: string
          description: event type
        eventcode:
          type: string
          description: event code (event type specialization)
        justificationcode:
          type: string
          description: justification code
        ordernum:
          type: string
          description: order number
        invoicenumber:
          type: string
          description: invoice number
        paymentbookingid:
          type: string
          description: payment booking id
        emitterid:
          type: string
          description: emitter id
        channel:
          type: string
          description: channel
        user:
          type: string
          description: user
        status:
          type: string
          description: status
        claimtype:
          type: string
          description: claim type
        claimcode:
          type: string
          description: claim code
        claimjuscode:
          type: string
          description: claim justification code
        startdate:
          type: string
          description: start date
          format: date-time
        endate:
          type: string
          description: end date
          format: date-time
        requestcontext:
          $ref: '#/components/schemas/RequestContext'

    CommercialTracking:
      type: object
      properties:
        promocode:
          type: string
          description: Promo code used to fire some promotions. This information comes from the Gridbees prices valorization service
        externalpromocode:
          type: string
          description: If the promotion comes another prices valorization service, the code is stored in this field
        vouchernumid:
          type: string
          description: Promotion voucher codes are unique codes available only one time. This information comes from the Gridbees prices valorization service.
        isupselled:
          type: boolean

    ContentProperties:
      type: object
      properties:
        ispublic:
          type: string
        isonshelf:
          type: string
          description: is an advertising product ?
        platformcodes:
          type: array
          items:
            type: string
        allowedwatchplatforms:
          type: array
          items:
            type: string
        resolutions:
          type: array
          items:
            type: string
        subscriptiontiers:
          type: array
          items:
            type: string
        tvodtiers:
          type: array
          items:
            type: string
        studios:
          type: array
          items:
            type: string
        audio:
          type: array
          items:
            type: string
        subtitles:
          type: array
          items:
            type: string
          description: List of offer Id
        sequence:
          type: integer
        contentid:
          type: string
        contenttype:
          type: string
        contentcode:
          type: string
        maxccu:
          type: integer
        servicetype:
          type: string
        highlightshelfid:
          type: string
        displaychannelcontent_d:
          type: string
        privacypolicyid:
          type: string


    ContextDetails:
      type: object
      properties:
        externalbookingid:
          type: string
        user:
          type: string
          example: testuser
        status:
          type: string
        code:
          type: string
        message:
          type: string

    DeliveryDetail:
      type: object
      properties:
        deliverymode:
          type: string
          description: Delivery mode
        instruction:
          type: array
          items:
            $ref: '#/components/schemas/MetaData'
          description: Delivery instruction
        deliveryaddress:
          $ref: '#/components/schemas/Address'
          description: Delivery address
        otheraddresses:
          type: array
          items:
            $ref: '#/components/schemas/Address'
          description: Other addresses
        passengers:
          type: array
          items:
            $ref: '#/components/schemas/Person'
          description: Passengers list
        email:
          items:
            $ref: '#/components/schemas/Email'
            description: Email contact
        phone:
          items:
            $ref: '#/components/schemas/Phone'
            description: Phone contact

    DeliveryTime:
      type: object
      properties:
        applicabledays:
          type: array
          items:
            $ref: '#/components/schemas/ApplicableDay'
          description: Applicable days

    Email:
      type: object
      properties:
        uid:
          type: string
          description: unique identifier
          format: uuid
        Usage:
          type: string
          description: Usage for this email
          example: PRINCIPAL, PROFESIONNAL
        Isprincipal:
          type: boolean
          description: Is principal?
        emailvalue:
          type: string
          description: Email value
        quality:
          type: boolean
          description: email quality

    ExclusionDate:
      type: object
      properties:
        date:
          type: string
          format: date-time
          description: Exclusion Date
        departuretime:
          type: string
          description: Exclusion Departure time
        languages:
          type: array
          items:
            type: string
          description: Exclusion Languages

    Geoloc:
      type: object
      required:
        - x
        - y
      properties:
        x:
          type: number
        y:
          type: number
        h:
          type: number
        sector:
          type: string

    GroupedPayment:
      type: object
      properties:
        usage:
          type: string
          description: usage
        totalpaid:
          type: number
          format: double
          description: Total paid for this group
        orderids:
          type: array
          items:
            type: string
          description: List of orderid (primary keys) concerned by this group

    Identifier:
      required:
        - structure
      type: object
      properties:
        contactid:
          type: string
        externalnumid:
          type: string
          description: external identifier
        sponsorid:
          type: string
        structure:
          $ref: '#/components/schemas/Structure'
      description: structure


    IdentityDocument:
      type: object
      properties:
        uid:
          type: string
          description: unique identifier
        numid:
          type: string
          description: identifier number
        emittercitylocation:
          type: string
          description: issuer city
        emittercountrylocation:
          type: string
          description: issuer country
        isvalidated:
          type: string
          description: Is validated ?
        isexternal:
          type: string
          description: Is internal use ?
        issueddate:
          type: string
          format: date-time
          description: date of issue
        expirydate:
          type: string
          format: date-time
          description: expiration date
        createdate:
          type: string
          format: date-time
          description: creation date
        updatedate:
          type: string
          format: date-time
          description: update date


    Item:
      type: object
      required:
        - productcode
      properties:
        productcode:
          type: string
          description: Product code
        productgroup:
          type: string
        producttype:
          type: string
        title:
          type: string
          description: Product title (offerdescription/title should be used first)
        size:
          type: string
        quantity:
          type: integer
          default: 1
    Display:
      type: object
      required:
        - mdobject
        - mdaxis
      properties:
        displayid:
          type: string
        tenantid:
          type: string
        mdobject:
          type: string
        tabcode:
          type: string
        status:
          type: string
        mdtype:
          type: string
        parentcode:
          type: string
        code:
          type: string
        genericcode:
          type: string
        label:
          type: string
        priority:
          type: integer
        script:
          type: string
        backend:
          $ref: '#/components/schemas/BackendDisplay'
        displaytabs:
          type: array
          items:
            $ref: '#/components/schemas/DisplayTabs'
        translations:
          type: array
          items:
            $ref: '#/components/schemas/Translation'
        updatedate:
          type: string
          format: date-time

    DisplayRequest:
      type: object
      properties:
        displayid:
          type: string
        mdobject:
          type: string
        tabcode:
          type: string
        status:
          type: string
        mdtype:
          type: string
        parentcode:
          type: string
        code:
          type: string
        codes:
          type: array
          items:
            type: string
        genericcode:
          type: string
        requestcontext:
          $ref: '#/components/schemas/RequestContext'
          description: pagination and restricted fields to return

    Loyalty:
      type: object
      properties:
        loyaltyid:
          type: string
          description: technical key
        unicitykey:
          type: string
          description: business key
        externalnumid:
          type: string
          description: external number ID
        structure:
          $ref: '#/components/schemas/Structure'
        codification:
          $ref: '#/components/schemas/Codification'
        status:
          type: string
          description: status
          enum:
            - Created
            - Published
            - Unpublished
            - Active
        label:
          type: string
          description: label
        tiers:
          type: array
          items:
            $ref: '#/components/schemas/LoyaltyTier'
        tierduration:
          type: boolean
          description: Is tier upgrade or downgrade automatic ?
        isautomatic:
          type: string
          description: status
        welcometemplate:
          type: string
          description: welcome template name
        balancetemplate:
          type: string
          description: balance template name
        createdate:
          type: string
          format: date-time
          description: creation date
        updatedate:
          type: string
          format: date-time
          description: update date

    LoyaltyCard:
      type: object
      properties:
        externalnumid:
          type: string
          description: external number ID
        loyalties:
          type: array
          items:
            $ref: '#/components/schemas/Loyalty'
        points:
          type: array
          items:
            $ref: '#/components/schemas/WalletDetail'
        createdate:
          type: string
          format: date-time
          description: creation date
        updatedate:
          type: string
          format: date-time
          description: update date

    LoyaltyTier:
      type: object
      properties:
        uid:
          type: string
          description: technical key
        code:
          type: string
          description: business code
        label:
          type: string
          description: label
        level:
          type: string
          description: Tier level
        minvalue:
          type: number
          format: double
          description: minimum value to validate for this level
        maxvalue:
          type: number
          format: double
          description: maximum value before next upgrade
        startdate:
          type: string
          format: date-time
          description: Start publication date
        enddate:
          type: string
          format: date-time
          description: End publication date

    LegalEntity:
      type: object
      properties:
        legalentityid:
          type: string
          description: technical key
        languagecode:
          type: string
          description: language code
        countrycode:
          type: string
          description: country code
        legalstatus:
          type: string
          description: legal status
        commercialname:
          type: string
          description: Commercial name
        companyname:
          type: string
          description: company name
        vatcode:
          type: string
          description: VAT code
        vatidintracom:
          type: string
          description: VAT Intracom code
        siretcode:
          type: string
          description: siret code
        businesssector:
          type: string
          description: Business sector
        companytype:
          type: string
          description: Company type
        createdate:
          type: string
          description: creation date
          format: date-time
        updatedate:
          type: string
          description: update date
          format: date-time

    MasterData:
      type: object
      required:
        - mdobject
        - mdaxis
      properties:
        masterdataid:
          type: string
        mdobject:
          type: string
        mddatatype:
          type: string
        mdaxis:
          type: string
        mdtype:
          type: string
        parentcode:
          type: string
        code:
          type: string
        value:
          type: string
        genericcode:
          type: string
        externalref:
          type: string
        price:
          type: number
        backend:
          $ref: '#/components/schemas/Backend'
        translations:
          type: array
          items:
            $ref: '#/components/schemas/Translation'
        updatedate:
          type: string
          format: date-time

    MasterDataRequest:
      type: object
      properties:
        masterdataid:
          type: string
        mdobject:
          type: string
        mddatatype:
          type: string
        mdaxis:
          type: string
        mdtype:
          type: string
        parentcode:
          type: string
        code:
          type: string
        value:
          type: string
        genericcode:
          type: string
        externalref:
          type: string
        requestcontext:
          $ref: '#/components/schemas/RequestContext'
          description: restrict fields to return in the response

    Media:
      type: object
      required:
        - url
      properties:
        code:
          type: string
          description: media code
        url:
          type: string
          description: Url to download the media
        mediatype:
          type: string
          description: media type
        rank:
          type: integer
          description: media rank
        islocalisable:
          type: boolean
          description: This media is related to a language
        hashcode:
          type: string
          description: media hascode
        languagecode:
          type: string
          description: If localizable, the field stores the language code

    MetaData:
      type: object
      required:
        - attribute
      properties:
        attribute:
          type: string
        value:
          type: string

    MetaDataQuantityPercent:
      type: object
      required:
        - attribute
      properties:
        attribute:
          type: string
        value:
          type: string
        quantity:
          type: integer
          default: 1
        percent:
          type: number
    MetaDataCategorization:
      type: object
      required:
        - attribute
      properties:
        datatype:
          type: string
        attribute:
          type: string
        category:
          type: string
        quantity:
          type: integer
          default: 1
        ispercent:
          type: boolean
        value:
          type: number

    OrderLineProperties:
      type: object
      properties:
        canbecancelled:
          type: boolean
        canberefunded:
          type: boolean
        canopenincident:
          type: boolean
        canbeevaluated:
          type: boolean
        hasincident:
          type: boolean
        hascustomermessages:
          type: boolean
        hasinvoice:
          type: boolean
        options:
          type: array
          items:
            $ref: '#/components/schemas/OptionOffer'

    Offer:
      type: object
      properties:
        offerid:
          type: string
          description: Technical key (generated after an offer/set )
        unicitykey:
          type: string
          description: Unique business key
        unicitycode:
          type: string
          description: Offer code
        offertype:
          type: string
          enum:
            - Published
            - Unpublished
            - Created
          description: Offer type
        title:
          type: string
          description: Offer title
        offerdescription:
          type: string
          description: Offer description
        structure:
          $ref: '#/components/schemas/Structure'
          description: Offer structure, mainly used for promotional purposes
        codification:
          items:
            $ref: '#/components/schemas/Codification'
          description: Offer codification
        products:
          type: array
          items:
            $ref: '#/components/schemas/OfferProduct'
          description: Product's list

        subscription:
          description: Offer subsription details
          $ref: '#/components/schemas/OfferSubscription'

        properties:
          $ref: '#/components/schemas/OfferProperty'
          description: Offer properties
        pricing:
          $ref: '#/components/schemas/Pricing'
          description: Pricing
        medias:
          type: array
          items:
            $ref: '#/components/schemas/Media'
          description: Images list
        status:
          type: string
          description: Offer status
        startdate:
          type: string
          format: date-time
          description: Start publication date
        enddate:
          type: string
          format: date-time
          description: End publication date
        attributes:
          type: array
          items:
            $ref: '#/components/schemas/MasterData'
          description: Additional attributes data
        createdate:
          type: string
          format: date-time
          description: Technical creation date
        createdby:
          type: string
        updatedate:
          type: string
          format: date-time
          description: Technical modification date
        updatedby:
          type: string

    OfferBenefit:
      type: object
      properties:
        benefit1:
          $ref: '#/components/schemas/OfferBenefitLine'
        benefit2:
          $ref: '#/components/schemas/OfferBenefitLine'
        benefit3:
          $ref: '#/components/schemas/OfferBenefitLine'

    OfferBenefitLine:
      type: object
      properties:
        line1:
          type: string
        line2:
          type: string

    OfferCode:
      type: object
      required:
        - offercode
      properties:
        offerid:
          type: string
          description: technical key
        offercode:
          type: string
          description: Unique business key
        enddate:
          type: string
          format: date-time
        hour:
          type: string
          description: Activity hour
        totalquantity:
          type: integer
          description: total available quantity

    OfferContractPeriod:
      type: object
      properties:
        period:
          type: string
        type:
          type: string
        effectivedate:
          type: string
          format: date-time
        expiredate:
          type: string

    OfferEligibility:
      type: object
      properties:
        ischeckneeded:
          type: boolean
        condition:
          type: string

    OfferProduct:
      type: object
      properties:
        items:
          $ref: '#/components/schemas/Item'
          description: List of items

    OfferProperty:
      type: object
      properties:
        deliverytime:
          type: array
          items:
            $ref: '#/components/schemas/DeliveryTime'
          description: Opening days and hours
        customdata:
          type: array
          items:
            $ref: '#/components/schemas/MetaData'
          description: To use to store key/value list
        options:
          description: Offer Options
          $ref: '#/components/schemas/OptionOffer'
        conflict:
          description: Conflict Options
          $ref: '#/components/schemas/Conflict'
        channels:
          type: array
          items:
            type: string
          description: Channel list

    OfferRequest:
      type: object
      properties:
        offerid:
          type: string
          description: technical offer Identifier
        offerids:
          type: array
          items:
            type: string
          description: List of offer Id
        unicitykeys:
          type: array
          items:
            type: string
          description: List unicity keys
        unicitycodes:
          type: array
          items:
            type: string
          description: List offer codes
        offertype:
          type: string
        productcode:
          type: string
        productgroupcode:
          type: string
        blcode:
          type: string
        companycode:
          type: string
        countrycode:
          type: string
        platformcode:
          type: string
        vendorcode:
          type: string
        marketcode:
          type: string
        customdata:
          type: array
          items:
            $ref: '#/components/schemas/MetaData'
        startdate:
          type: string
          format: date-time
          description: Start date of the publication
        enddate:
          type: string
          format: date-time
          description: End date of the publication
        lastupdatedate:
          type: string
          format: date-time
          description: Retrieve offers updated since lastupdatedate
        requestcontext:
          $ref: '#/components/schemas/RequestContext'
          description: restrict fields to return in the response

    OfferService:
      type: object
      properties:
        servicetype:
          type: string
          description: Service type
        serviceincluded:
          type: boolean
          description: Mandatory or not
        servicecapacity:
          type: integer
          description: Capacity
        productcode:
          type: string
          description: Product code
        quantity:
          type: integer
          description: Quantity
        prices:
          type: array
          items:
            $ref: '#/components/schemas/Price'
          description: Price List

    OfferSubscription:
      type: object
      properties:
        ispublic:
          type: string
        isactive:
          type: string
        isaddon:
          type: string
        unicitykey:
          type: string
        eligibility:
          $ref: '#/components/schemas/OfferEligibility'
        autorenew:
          type: boolean
        renewplan:
          type: integer
        benefit:
          $ref: '#/components/schemas/OfferBenefit'
        contractperiod:
          $ref: '#/components/schemas/OfferContractPeriod'
        mincontractperiod:
          $ref: '#/components/schemas/OfferContractPeriod'
        trialperiod:
          $ref: '#/components/schemas/OfferContractPeriod'
        renewperiod:
          $ref: '#/components/schemas/OfferContractPeriod'
        accountingcode:
          type: string
          description: SAP Code
        sequence:
          type: integer
          description: Sequence Display
        allowedplatforms:
          type: array
          items:
            type: string
        applicationcodes:
          type: array
          items:
            type: string
        groupcode:
          type: string
        groupname:
          type: string
        partnercode:
          type: string
        contenttype:
          type: string
        contentid:
          type: string
        partnerproductcode:
          type: string
        maxtickets:
          type: integer
        serviceperiod:
          type: integer
          description: A service period of each the offer for accounting calculations
        billingperiod:
          type: integer
        waytowatch:
          type: string

    Order:
      required:
        - amount
        - ordertracking
        - billingaddress
        - lines
      type: object
      properties:
        orderid:
          type: string
          description: Internal Order Identifier
        orderrules:
          type: array
          description: Applied rules
          items:
            $ref: '#/components/schemas/BasketRule'
        identifier:
          $ref: '#/components/schemas/Identifier'
        ordertracking:
          $ref: '#/components/schemas/TrackingData'
          description: Order Tracking
        comtracking:
          $ref: '#/components/schemas/CommercialTracking'
          description: Commercial Tracking
        ordertype:
          type: string
          description: Order type
        amount:
          $ref: '#/components/schemas/Amount'
        billingaddress:
          $ref: '#/components/schemas/Address'
          description: Billing address
        deliverydetail:
          $ref: '#/components/schemas/DeliveryDetail'
          description: Delivery details
        payment:
          $ref: '#/components/schemas/Payment'
          description: Payment details
        cancellationdetail:
          $ref: '#/components/schemas/CancellationDetail'
          description: Details on the cancellation
        customdata:
          type: array
          items:
            $ref: '#/components/schemas/MetaData'
        lines:
          type: array
          items:
            $ref: '#/components/schemas/OrderLine'
          description: order lines
        statusdetail:
          $ref: '#/components/schemas/OrderStatusDetail'
          description: Order status
        businesscreationdate:
          type: string
          format: date-time
          description: Business creation date
        createdate:
          type: string
          format: date-time
          description: Technical creation date
        updatedate:
          type: string
          format: date-time
          description: Technical modification date

    OrderConfirm:
      required:
        - orderid
        - ordertracking
      type: object
      properties:
        orderid:
          type: string
          description: technical Identifier
        ordertracking:
          $ref: '#/components/schemas/TrackingData'
        payment:
          $ref: '#/components/schemas/Payment'
          description: Payment details

    OrderReservation:
      required:
        - amount
        - ordertracking
        - billingaddress
        - lines
      type: object
      properties:
        contact:
          $ref: '#/components/schemas/Contact'
        identifier:
          $ref: '#/components/schemas/Identifier'
        codification:
          items:
            $ref: '#/components/schemas/Codification'
          description: Offer codification
        ordertracking:
          $ref: '#/components/schemas/TrackingData'
          description: Order Tracking
        comtracking:
          $ref: '#/components/schemas/CommercialTracking'
          description: Commercial Tracking
        basketrules:
          type: array
          description: promotion rules applied on this order
        amount:
          $ref: '#/components/schemas/Amount'
        billingaddress:
          $ref: '#/components/schemas/Address'
          description: Billing address
        deliverydetail:
          $ref: '#/components/schemas/DeliveryDetail'
          description: Delivery details
        payment:
          $ref: '#/components/schemas/Payment'
          description: Payment details
        customdata:
          type: array
          items:
            $ref: '#/components/schemas/MetaData'
        lines:
          type: array
          items:
            $ref: '#/components/schemas/OrderLine'
          description: order lines
        businesscreationdate:
          type: string
          format: date-time
          description: Business creation date

    OrderRequest:
      type: object
      properties:
        order:
          $ref: '#/components/schemas/OrderReservation'
        ordercontext:
          $ref: '#/components/schemas/ContextDetails'
          description: Order Context

    OrderResponse:
      type: object
      properties:
        order:
          $ref: '#/components/schemas/Order'
        ordercontext:
          $ref: '#/components/schemas/ContextDetails'
          description: Order Context

    OrderCancel:
      type: object
      properties:
        orderid:
          type: string
          description: Internal Order Identifier
        amount:
          $ref: '#/components/schemas/Amount'
        cancellationdetail:
          $ref: '#/components/schemas/CancellationDetail'
          description: Details on the cancellation

    OrderLine:
      type: object
      properties:
        orderlineid:
          type: string
          description: order line identifier
        linenum:
          type: integer
          description: Line number
        referencecode:
          type: string
          description: Offer code
        processingmode:
          type: string
          description: Processing mode
        offerid:
          type: string
          description: Offer Identifier
        offercodification:
          $ref: '#/components/schemas/Codification'
          description: Offer codification
        quantity:
          type: integer
          description: Line quantity
        amount:
          $ref: '#/components/schemas/Amount'
        crossedoutprice:
          type: number
          format: double
          description: Crossed out price
        sellingprice:
          type: number
          format: double
          description: Selling price
        pricing:
          $ref: '#/components/schemas/MasterData'
          description: Additional info on prices
        productitems:
          type: array
          items:
            $ref: '#/components/schemas/ProductItem'
        taxdetails:
          type: array
          items:
            $ref: '#/components/schemas/TaxDetail'
        additionalservices:
          type: array
          items:
            $ref: '#/components/schemas/AdditionalService'
          description: Additional services
        offercancellations:
          type: array
          items:
            $ref: '#/components/schemas/Cancellation'
        properties:
          $ref: '#/components/schemas/OrderLineProperties'
        parcels:
          type: array
          items:
            $ref: '#/components/schemas/Parcel'
        tracking:
          type: array
          items:
            $ref: '#/components/schemas/TrackingData'
        cancellationdetail:
          $ref: '#/components/schemas/CancellationDetail'
        subscription:
          $ref: '#/components/schemas/UserSubscription'

    OrderStatus:
      type: object
      required:
        - statustype
        - code
      properties:
        statustype:
          type: string
          description: Status type (Operational, Payment, Filtering)
        code:
          type: string
          description: Code of the type (PENDING, PROCESSED, ..)
        cause:
          type: string
          description: Cause of the error
        message:
          type: string
          description: Status message
        source:
          type: string
          description: Status source
        user:
          type: string
          description: User

    OrderStatusDetail:
      type: object
      properties:
        latest:
          $ref: '#/components/schemas/OrderStatus'
          description: lastest status per statustype
        order:
          type: array
          items:
            $ref: '#/components/schemas/OrderStatus'
            description: order status history

    OrderStatusListUpdate:
      required:
        - orderid
        - transactionnumber
      type: object
      properties:
        orderid:
          type: string
          description: technical identifier
        latest:
          $ref: '#/components/schemas/OrderStatus'
          description: lastest status per statustype

    OrderUpdateRequest:
      type: object
      properties:
        order:
          $ref: '#/components/schemas/UpdateRequest'
        ordercontext:
          $ref: '#/components/schemas/ContextDetails'
          description: Order Context

    PaymentCancellation:
      type: object
      properties:
        accountid:
          type: string
        vendorcode:
          type: string
        isrefused:
          type: boolean
          description: if true then payment status equals to REFUSED else CANCELLED
        syncorderstatus:
          type: boolean
          description: if true then order status equals to CANCELLED else not modified
        cause:
          type: string
          description: optional description of this payment cancellation
        details:
          $ref: '#/components/schemas/PaymentCancellationDetail'
        user:
          type: string
          description: User

    PaymentConfirmation:
      type: object
      required:
        - totalpaid
      properties:
        accountid:
          type: string
        contactid:
          type: string
        vendorcode:
          type: string
        externalpaymentreference:
          type: string
        externaltransactionnumber:
          type: string
        details:
          $ref: '#/components/schemas/PaymentDetail'
        paymentdate:
          type: string
          format: date-time
        user:
          type: string
          description: User

    PaymentConfirmationRequest:
      type: object
      properties:
        payment:
          $ref: '#/components/schemas/PaymentConfirmation'
        paymentcontext:
          $ref: '#/components/schemas/ContextDetails'
          description: Order Context

    PaymentConfirmationResponse:
      type: object
      properties:
        orders:
          type: array
          items:
            $ref: '#/components/schemas/Order'
        reprocessingcontext:
          $ref: '#/components/schemas/ContextDetails'
          description: Order Context

    PaymentData:
      type: object
      properties:
        bank:
          $ref: '#/components/schemas/BankAccount'
        card:
          $ref: '#/components/schemas/Card'
        auth:
          $ref: '#/components/schemas/BankAuthorization'
        wallet:
          $ref: '#/components/schemas/Wallet'
        createdate:
          type: string
          format: date-time
          description: Creation date

    Parcel:
      type: object
      properties:
        code:
          type: string
          description: parcel code
        addressuid:
          type: string
        externaltransactionnumber:
          type: string
        deliverymode:
          type: string
        deliverymethod:
          type: string
        shopcode:
          type: string
        carriercode:
          type: string
        deliverydate:
          type: string
          format: date-time

    Payment:
      type: object
      properties:
        processingmode:
          type: string
          description: Processing mode
          enum:
            - BILLING
            - PREPAYMENT
        isprepaid:
          type: boolean
          description: Is pre-paid ?
        groupedpayment:
          $ref: '#/components/schemas/GroupedPayment'
          description: orders list concerned by this payment
        totalpaid:
          type: number
          format: double
          description: Amount paid by the customer
        totalrefunded:
          type: number
          format: double
          description: Last date of the payment
        details:
          type: array
          items:
            $ref: '#/components/schemas/PaymentDetail'
          description: Details on the payment
        customdata:
          type: array
          items:
            $ref: '#/components/schemas/MetaData'
        refunddate:
          type: string
          format: date-time
          description: Refunded date
        paymentdate:
          type: string
          format: date-time
          description: payment date
        createdate:
          type: string
          format: date-time
          description: Creation date
        updatedate:
          type: string
          format: date-time
          description: modification date

    PaymentCancellationDetail:
      type: object
      properties:
        paymentdetailid:
          type: string
        paymentmode:
          type: string
          description: payment mode
          example: BILLING, CHECK, CC, CASH
        paymentcode:
          type: string
          description: payment code
        externalpaymentreference:
          type: string
          description: external payment reference
        paymentdate:
          type: string
          format: date-time
          description: Last date of the payment

    PaymentDetail:
      type: object
      properties:
        paymentdetailid:
          type: string
        movementtype:
          type: string
          enum:
            - CASHING
            - REFUND
        status:
          type: string
          description: Status of this payment
        cause:
          type: string
          description: Cause
        paymenttype:
          type: string
        paymentmode:
          type: string
          description: payment mode
          example: BILLING, CHECK, CC, CASH
        paymentcode:
          type: string
          description: payment code
        Isprepaid:
          type: boolean
          description: Is pre-paid ?
        totalpaid:
          type: number
          format: double
          description: Total paid for this payment mode
        externalpaymentreference:
          type: string
          description: external payment reference
        externaltransactionnumber:
          type: string
          description: external payment reference
        paymentdate:
          type: string
          format: date-time
          description: Last date of the payment
        customdata:
          type: array
          items:
            $ref: '#/components/schemas/MetaData'

    Person:
      type: object
      required:
        - attribute
      properties:
        persontype:
          type: string
        countrycode:
          type: string
          description: country code
        languagecode:
          type: string
          description: language code
        civility:
          type: string
        firstname:
          type: string
        lastname:
          type: string
        sex:
          type: string
        patronym:
          type: string
        birthdate:
          type: string
        familysituation:
          type: string
        numberofchildren:
          type: integer
        identitydocuments:
          type: array
          items:
            $ref: '#/components/schemas/IdentityDocument'
        createdate:
          type: string
          description: creation date
          format: date-time
        updatedate:
          type: string
          description: update date
          format: date-time
    Phone:
      type: object
      properties:
        uid:
          type: string
          description: unique identifier
          format: uuid
        Usage:
          type: string
          description: Usage for this phone
          example: HOME, BUSINESS
        Isprincipal:
          type: boolean
          description: Is principal?
        phonevalue:
          type: string
          description: phone value
        quality:
          type: boolean
          description: phone quality
    Price:
      type: object
      properties:
        currencycode:
          type: string
          description: Currency code
        openingforsale:
          type: boolean
          description: If this price is opened for sales. If true, this price can be published
        startdate:
          type: string
          format: date-time
        enddate:
          type: string
          format: date-time
        crossedoutprice:
          type: number
          format: double
          description: Crossed-out price
        sellingprice:
          type: number
          format: double
          description: Selling price
        paymentcode:
          type: string
          description: Currency code
        paymentmode:
          type: string
          description: Currency code
        platformcode:
          type: string
          description: Currency code

    DiscountPrice:
      type: object
      properties:
        startdate:
          type: string
          format: date-time
          description: Start date of the publication
        enddate:
          type: string
          format: date-time
          description: End date of the publication
        crossedoutprice:
          type: number
          format: double
          description: The crossed-out price
        sellingprice:
          type: number
          format: double
          description: The selling price
        promotionids:
          type: array
          items:
            type: string
          description: List of all eligle promotions

    Pricing:
      type: object
      properties:
        currencycode:
          type: string
          description: Currency code
        crossedoutprice:
          type: number
          format: double
        sellingprice:
          type: number
          format: double
        prices:
          type: array
          items:
            $ref: '#/components/schemas/Price'


    PriorityRule:
      type: object
      properties:
        promotionid:
          type: string
        promotiontype:
          type: string
        promotionname:
          type: string
        startdate:
          type: string
          format: date-time
        enddate:
          type: string
          format: date-time
        combinablepromo:
          type: boolean
        haspromocode:
          type: boolean
        commissiondiscountprice:
          type: boolean
        isreverseprice:
          type: boolean
        isforwallet:
          type: boolean

    ProcessingMessage:
      type: object
      properties:
        processingtype:
          type: string
          description: Processing message type
        code:
          type: string
          description: Code of the processing message
        justification:
          type: string
          description: Justification of the processing message
        linenum:
          type: integer
          description: The basket line concerned by this message
        offerid:
          type: string
          description: The offer concerned by this processing message

    Product:
      type: object
      properties:
        productid:
          type: string
          description: Technical primary key
        unicitykey:
          type: string
          description: Unique business key
        unicitycode:
          type: string
          description: Product code
        title:
          type: string
          description: Product title
        description:
          type: string
          description: Description
        startdate:
          type: string
          format: date-time
          description: Start publication date
        enddate:
          type: string
          format: date-time
          description: End publication date
        status:
          type: string
          enum:
            - Published
            - Unpublished
            - Created
        structure:
          $ref: '#/components/schemas/Structure'
        codification:
          $ref: '#/components/schemas/Codification'
        items:
          type: array
          items:
            $ref: '#/components/schemas/Item'
          description: Items list
        content:
          description: Content details
          $ref: '#/components/schemas/ContentProperties'
        properties:
          $ref: '#/components/schemas/ProductProperties'
          description: Product properties
        medias:
          type: array
          items:
            $ref: '#/components/schemas/Media'
          description: Images list
        customdata:
          type: array
          items:
            $ref: '#/components/schemas/MetaData'
        attributes:
          type: array
          items:
            $ref: '#/components/schemas/MasterData'
          description: Additional attributes data
        variants:
          $ref: '#/components/schemas/ProductVariant'
        createdate:
          type: string
          format: date-time
          description: Technical creation date
        updatedate:
          type: string
          format: date-time
          description: Technical modification date

    ProductProperties:
      type: object
      properties:
        category:
          type: string
        family:
          type: string
        subfamily:
          type: string
        model:
          type: string
        design:
          type: string
        brand:
          type: string
        catalog:
          type: string
        collection:
          type: string
        vatnumcode:
          type: string
        shippingcode:
          type: string
        sequence:
          type: integer
        ranking:
          type: integer
        groupcode:
          type: string
        conflict:
          description: Conflict Options
          $ref: '#/components/schemas/Conflict'

    ProductRequest:
      type: object
      properties:
        productid:
          type: string
          description: technical product Identifier
        productids:
          type: array
          items:
            type: string
          description: List of product Id
        unicitykeys:
          type: array
          items:
            type: string
        typology:
          type: string
          description: technical product Identifier
          enum:
            - grouped
            - simple
        countrycode:
          type: string
        groupcode:
          type: string
        groupcodes:
          type: array
          items:
            type: string
          description: List of group codes
        requestcontext:
          $ref: '#/components/schemas/RequestContext'
          description: restrict fields to return in the response

        platformcodes:
          type: array
          items:
            type: string
        contentids:
          type: array
          items:
            type: string
        contenttypes:
          type: array
          items:
            type: string
        servicetypes:
          type: array
          items:
            type: string
        categories:
          type: array
          items:
            type: string
        studios:
          type: array
          items:
            type: string
        tvodtiers:
          type: array
          items:
            type: string
        subscriptiontiers:
          type: array
          items:
            type: string
        startupdatedate:
          type: string
          format: date-time
        endupdatedate:
          type: string
          format: date-time
        customdata:
          type: array
          items:
            $ref: '#/components/schemas/MetaData'
        attributes:
          type: array
          items:
            $ref: '#/components/schemas/MasterData'

    ProductVariant:
      type: object
      properties:
        code:
          type: string
        level:
          type: string
        values:
          type: array
          items:
            $ref: '#/components/schemas/MasterData'

    Promotion:
      type: object
      properties:
        promotionid:
          type: string
          description: technical key
        unicitykey:
          type: string
          description: business key
        structure:
          $ref: '#/components/schemas/Structure'
        usagelimit:
          type: string
          description: type of the promotion
          enum:
            - LimitedNumber
            - NoLimit
            - Voucher
        usagelimitDetails:
          type: integer
          description: mandatory if usagelimit set to LimitedNumber. Define in this case the max quantity used for this limit.
        promotioncodes:
          type: array
          items:
            type: string
          description: Optional promotion codes with semicolon separator
        startdate:
          type: string
          format: date-time
          description: start date of the promotion to be actived
        enddate:
          type: string
          format: date-time
          description: end date of the promotion.
        status:
          type: string
          description: status of the promotion
          enum:
            - Created
            - Published
            - Unpublished
        title:
          type: string
          description: short title of the promotion
        description:
          type: string
          description: promotion description
        rules:
          type: array
          items:
            $ref: '#/components/schemas/Rule'
          description: rules list.
        medias:
          type: array
          items:
            $ref: '#/components/schemas/Media'
        combinablepromo:
          type: boolean
          default: true
          description: If set to TRUE, that means, if no exclusive promotion is already applied to the input basket, this promotion can be applied. Otherwise, this promotion can't be applied.
        commissiondiscountprice:
          type: boolean
          default: false
          description: if set to TRUE, the calculation of the commission is done of the discounted price, otherise the calculation is done on the gross price.
        createdate:
          type: string
          format: date-time
          description: creation date set by the service
        updatedate:
          type: string
          format: date-time
          description: modification date set by the service
      example: {"promotionid":"b6939432d0494e588866ff89514a78e7", "structure":{"blcode":"GRIDBEES"}, "promotioncodes":["SUMMER2021;SPRING2021"], "startdate":"2021-04-01T14:27:00.000Z", "enddate":"2020-09-30T14:27:00.000Z", "status":"Created", "rules":[{"ruleID":"3062f860-f071-4242-893e-139d8d86106d", "conditions":[{"conditionid":"125473a9-cc66-4804-8f3e-8217109333b3", "conditionlabel":"10", "parameter1":"BasketLine", "parameter2":">=", "parameter3":"10"}], "behaviours":[{"behaviourid":"d8ca6f36-d919-488b-bef4-f9b452ceb501", "behaviourlabel":"10", "isreversedprice":false, "parameter1":"BasketDiscountAmount", "parameter2":"10", "parameter8":""}], "description":"My little promotion"}], "title":"promo of the year", "priority":1000, "combinablepromo":true, "commissiondiscountprice":false}
    PromotionCreate:
      type: object
      properties:
        unicitykey:
          type: string
          description: business key
        structure:
          $ref: '#/components/schemas/Structure'
        usagelimit:
          type: string
          description: type of the promotion
          enum:
            - LimitedNumber
            - NoLimit
            - Voucher
        usagelimitDetails:
          type: integer
          description: mandatory if usagelimit set to LimitedNumber. Define in this case the max quantity used for this limit.
        promotioncodes:
          type: array
          items:
            type: string
          description: Optional promotion codes with semicolon separator
        startdate:
          type: string
          format: date-time
          description: start date of the promotion to be actived
        enddate:
          type: string
          format: date-time
          description: end date of the promotion.
        status:
          type: string
          description: status of the promotion
          enum:
            - Created
            - Published
            - Unpublished
        title:
          type: string
          description: short title of the promotion
        description:
          type: string
          description: promotion description
        medias:
          type: array
          items:
            $ref: '#/components/schemas/Media'
        rules:
          type: array
          items:
            $ref: '#/components/schemas/Rule'
          description: rules list.
        combinablepromo:
          type: boolean
          default: true
          description: If set to TRUE, that means, if no exclusive promotion is already applied to the input basket, this promotion can be applied. Otherwise, this promotion can't be applied.
        commissiondiscountprice:
          type: boolean
          default: false
          description: if set to TRUE, the calculation of the commission is done of the discounted price, otherise the calculation is done on the gross price.
      example: {"structure":{"blcode":"GRIDBEES"}, "promotioncodes":["SUMMER2021;SPRING2021"], "startdate":"2021-04-01T14:27:00.000Z", "enddate":"2020-09-30T14:27:00.000Z", "status":"Created", "rules":[{"ruleID":"3062f860-f071-4242-893e-139d8d86106d", "conditions":[{"conditionid":"125473a9-cc66-4804-8f3e-8217109333b3", "conditionlabel":"10", "parameter1":"BasketLine", "parameter2":">=", "parameter3":"10"}], "behaviours":[{"behaviourid":"d8ca6f36-d919-488b-bef4-f9b452ceb501", "behaviourlabel":"10", "isreversedprice":false, "parameter1":"BasketDiscountAmount", "parameter2":"10", "parameter8":""}], "description":"My little promotion"}], "title":"promo of the year", "priority":1000, "combinablepromo":true, "commissiondiscountprice":false}
    PromotionRequest:
      type: object
      properties:
        promotionid:
          type: string
          description: technical key
        promotionids:
          type: array
          items:
            type: string
          description: technical identifiers
        businesslinecode:
          type: string
          description: Business line code
        countrycode:
          type: string
          description: Country code
        languagecode:
          type: string
          description: Language code
        haspromocode:
          type: boolean
          description: The promotion has a promocode
        marketcode:
          type: string
          description: Market code
        usagelimit:
          type: string
          description: type of the promotion
          enum:
            - LimitedNumber
            - NoLimit
            - Voucher
        startdate:
          type: string
          format: date-time
          description: start date date of the promotion.
        enddate:
          type: string
          format: date-time
          description: end date of the promotion.
        status:
          type: string
          description: status of the promotion
          enum:
            - Created
            - Published
            - Unpublished

    PromotionPublishRequest:
      type: object
      properties:
        businesslinecode:
          type: string
          description: Business line code
        countrycode:
          type: string
          description: Country code
        promotionid:
          type: string
          description: technical identifier
        haspromocode:
          type: boolean
          description: The promotion has a promocode
        marketcode:
          type: string
          description: Market code
        startdate:
          type: string
          format: date-time
          description: start date date of the promotion.
        enddate:
          type: string
          format: date-time
          description: end date of the promotion.
        conditionnames:
          description: list of condition's names
          type: array
          items:
            type: string
            enum:
              - Application
              - BasketAmount
              - BasketLine
              - Offer
              - Product
              - CustomData on Offers and Customers
              - Subscription (offers and/or products)
              - Vendor
              - Channel
        discountnames:
          description: list of discount's names
          type: array
          items:
            type: string
            enum:
              - BasketDiscountAmount
              - BasketDiscountPercent
              - LineDiscountAmount
              - LineDiscountPercent
              - SetDiscountLine
              - OfferDiscountAmount
              - OfferDiscountPercent
              - ProductDiscountAmount
              - ProductDiscountPercent
              - TheMostExpensive
              - TheCheapestPercent
              - FeeDiscountAmount
              - FeeDiscountPercent
              - SetFees
              - SetOffer
              - SubscriptionAmount
              - SubscriptionPercent
        businesskeys:
          description: list of business keys
          type: array
          items:
            type: string
        offertypes:
          description: list of offer types
          type: array
          items:
            type: string
        offercodes:
          description: list of offer codes
          type: array
          items:
            type: string
        productcodes:
          description: list of offer codes
          type: array
          items:
            type: string
        channelcodes:
          description: list of channel codes
          type: array
          items:
            type: string
        vendorcodes:
          description: list of vendor codes
          type: array
          items:
            type: string

    SuggestPromotion:
      type: object
      properties:
        promotionid:
          type: string
          description: Technical identifier of the promotion
        promotionname:
          type: string
        conditionid:
          type: integer
        conditiontype:
          type: string
          description: List of condition type (Enum)
        expected:
          type: string
          description: additional condition to satisfy
        combinable:
          type: boolean
          description: If this promotion can combine with the others
        priority:
          type: integer
          description: The highest priority is first applied
        issuccess:
          type: boolean
          description: If true, already applied, if false, it is suggestion
        comment:
          type: string

    PublishedPromotion:
      type: object
      properties:
        promotionid:
          type: string
          description: Technical identifier of the promotion
        businesscode:
          type: string
          description: Business Code
        haspromocode:
          type: boolean
          description: Promotion has a promocode
        discountsellingprice:
          type: boolean
          description: Is discount applied on intial selling price ?
        combinablepromo:
          type: boolean
          description: Is this promo combinable with others ?
        title:
          type: string
          description: Title
        description:
          type: string
          description: Description
        startdate:
          type: string
          format: date-time
          description: Promotion start date
        enddate:
          type: string
          format: date-time
          description: Promotion end date
        structure:
          $ref: '#/components/schemas/Structure'
        attributes:
          type: array
          items:
            $ref: '#/components/schemas/MasterData'
          description: Additional attributes data
        salience:
          type: integer
          description: Priority of the promotion
        medias:
          type: array
          items:
            $ref: '#/components/schemas/Media'
        rules:
          type: array
          items:
            $ref: '#/components/schemas/BookingRule'
          description: Promotion rules list
        createdate:
          type: string
          format: date-time
          description: Technical creation date
        updatedate:
          type: string
          format: date-time
          description: Technical modification date

    ProductItem:
      type: object
      properties:
        productid:
          type: string
        productcode:
          type: string
        itemnumid:
          type: string
        quantity:
          type: integer
        itemlabel:
          type: string
        promisedavailability:
          type: string
          format: date-time
        customdata:
          $ref: '#/components/schemas/MetaData'
        vatcode:
          type: string
        vatrate:
          type: string
        category:
          type: string
        family:
          type: string
        subfamily:
          type: string
        productgroup:
          type: string
        shippingrate:
          type: string
        segment1:
          type: string
        segment2:
          type: string
    Reservation:
      type: object
      properties:
        minquantity:
          type: integer
          description: Minimum quantity
        maxquantity:
          type: integer
          description: Maximum quantity
        reservationtype:
          type: string
          description: Reservation type
    ReservationType:
      type: object
      properties:
        minquantity:
          type: integer
          description: Minimum quantity
        maxquantity:
          type: integer
          description: Maximum quantity
        code:
          type: string
          description: Code
        value:
          type: string
          description: Value
    ResultCode:
      type: object
      properties:
        result:
          type: string
          description: Boolean return code
      example: {"result": true}

    RequestContext:
      type: object
      properties:
        queryprojection:
          description: list of fields to filter in the response
          type: array
          items:
            type: string
        limit:
          type: integer
          description: for pagination, total results to return
        skip:
          type: integer
          description: for pagination, total entries to skip
        withcount:
          type: integer
          description: parameter in the request header to inform the service to return in the response header the totalcount property. Available only for publish endpoints.
        islogicaloperation:
          type: boolean
          description: future use, for now used for logical deletion. Set the status = Deleted, instead of a hard DB deletion.
    Rule:
      type: object
      properties:
        ruleID:
          type: string
          description: auto-generated by the service
        salience:
          type: integer
          description: all eligible promotions are applied to the input basket. This priority property defines the order to apply the eligible promotions.  From the highest to the lowest.
        conditions:
          type: array
          items:
            $ref: '#/components/schemas/RuleCondition'
        behaviours:
          type: array
          items:
            $ref: '#/components/schemas/RuleBehaviour'
        description:
          type: string
          description: promotion description
    RuleCondition:
      type: object
      properties:
        conditionid:
          type: string
          description: auto-generated by the service
        conditionlabel:
          type: string
          description: description
        parameter1:
          type: string
          oneOf:
            - enum:
                - BasketAmount
                - BasketLine
                - ProdID
                - ProdCategory
                - ProdFamily
                - ProdSubFamily
                - PaymentDetail
                - DeliveryDetail
                - ProdCustomParam1
                - ProductFilters
                - BundleProductQuantity
                - OfferQuantity
                - Frequency
                - Shop
                - SynchronizeProduct
                - Canal
                - Reservation
                - Lang
                - Vendor
                - OfferType
                - PassengerType
                - ProductGroup
                - Offer
                - Application
                - SubscriptionPreference
                - SubscriptionType
                - CommissionAmount
                - CommissionPercent
    RuleBehaviour:
      type: object
      properties:
        behaviourid:
          type: string
          description: auto-generated by the service
        behaviourlabel:
          type: string
          description: description
        isreversedprice:
          type: boolean
        parameter1:
          type: string
          oneOf:
            - enum:
                - BasketDiscountPercent
                - BasketDiscountAmount
                - LineDiscountPercent
                - LineDiscountAmount
                - AddProd
                - SetFees
                - FeeDiscountAmount
                - FeeDiscountPercent
                - DeferredVoucher
                - DeferredEmailTemplate
                - CommissionAmount
                - CommissionPercent
                - TheCheapestPercent
                - GroupDiscountPercent
                - AddSynchronizedProduct
                - PaxDiscountAmount
                - PaxDiscountPercent
                - SubscriptionAmount
                - SubscriptionPercent
                - OfferDiscountPercent
                - OfferDiscountAmount
        parameter2:
          type: string
        paramter3:
          type: string
        paramter4:
          $ref: '#/components/schemas/BasketAddedProduct'
        paramter5:
          $ref: '#/components/schemas/MetaData'
        paramter6:
          $ref: '#/components/schemas/MetaData'
        parameter7:
          type: string
        paramter8:
          type: string
        paramter9:
          $ref: '#/components/schemas/MetaDataQuantityPercent'
        paramter10:
          $ref: '#/components/schemas/MetaDataCategorization'

    OrderSearchRequest:
      type: object
      properties:
        orderid:
          type: string
          description: Order Identifier
        contactid:
          type: string
          description: Contact Identifier
        orderids:
          type: array
          items:
            type: string
          description: Order Identifiers
        paymentmode:
          type: string
          description: Payment mode
        invoicenumber:
          type: string
          description: Invoice number
        ordertype:
          type: string
          description: order type
          example: BOOKING, ORDER, QUOTATION
        codification:
          $ref: '#/components/schemas/Codification'
          description: only on fields vendorcode, platformcode, categorycode
        structure:
          $ref: '#/components/schemas/Structure'
          description: only on fields marketcode, countrycode, shopcode
        user:
          type: string
          description: The user assigned to the booking
        booking:
          $ref: '#/components/schemas/BookingRequest'
          description: External references
        transactionnumber:
          type: string
          description: Business booking reference
        lastname:
          type: string
          description: Billing adrress lastname
        firstname:
          description: billing address first name
        paymentstatus:
          type: string
          description: Booking payment status
          example: PAID, PENDING
        orderstatus:
          type: string
          description: Booking status
          example: PROCESSED, PENDING
        startdate:
          type: string
          format: date-time
          description: Start creation date
        enddate:
          type: string
          format: date-time
          description: End creation date
        startexpirationdate:
          type: string
          format: date-time
          description: If it is a quotation, start  date of the expired delay
        endexpirationdate:
          type: string
          format: date-time
          description: If it is a quotation, end  date of the expired delay
        requestcontext:
          $ref: '#/components/schemas/RequestContext'
          description: restrict fields to return in the response

    ShippingFees:
      type: object
      properties:
        zone:
          type: string
          description: name of the delivery zone
        method:
          type: string
          description: name of the delivery method
        offerids:
          type: array
          items:
            type: string
          description: Offer Identifiers
        mindeliverytime:
          type: integer
          description: Min delivery time
        maxdeliverytime:
          type: integer
          description: Max delivery time
        price:
          type: number
          description: price of this shipping method

    Structure:
      type: object
      properties:
        blcode:
          type: string
          description: Business line code
        companycode:
          type: string
          description: Company code
        countrycode:
          type: string
          description: Country code
        marketcode:
          type: string
          description: Market code
        partnercode:
          type: string
          description: Partner code
        merchantcode:
          type: string
          description: Merchant code
        departmentcode:
          type: string
          description: Department code
        provincecode:
          type: string
          description: Province code
        languagecode:
          type: string
          description: Language code
        networkcode:
          type: string
          description: Network code
        networktype:
          type: string
          description: Network type
        shopcode:
          type: string
          description: Shop code

    TaxDetail:
      type: object
      properties:
        taxtype:
          type: string
        code:
          type: string
        reference:
          type: string
        label:
          type: string
        vatcode:
          type: string
        vatrate:
          type: number
          format: double
        price:
          type: number
          format: double
        quantity:
          type: integer
    Ticket:
      type: object
      properties:
        businesstype:
          type: string
          description: Type of ticket (VOUCHER or TICKET)
        transactionnumber:
          type: string
          description: Reference of the reservation
        categories:
          type: string
          description: category type concerned by the ticket/voucher.
        reservationdate:
          description: Reservation date
          type: string
          format: date-time
        formattype:
          type: string
          description: The format of the the ticket
          example: BARCODE, QROCODE
        subformattype:
          type: string
          description: The sub type of the format
          example: EAN128
        media:
          description: Info about the media
          $ref: '#/components/schemas/Media'
      example:
        {"businesstype":"VOUCHER", "suppliercode":"", "transactionnumber":"CJGD0000008538", "supplierbookingreference":"", "categories":{}, "reservationdate":"2020-02-18T13:00:00.000Z", "languagecode":"en", "formattype":"BARCODE", "subformattype":"QR", "media":{"url":"http://api-uat.gridbees.com/medias/tickets/02ba/68ac/02ba68ac5b8fc17bebdf4675e55dc0826d3a.pdf", "mediatype":"PDF", "size":15144, "languagecode":"en"}}
    TicketRequest:
      type: object
      properties:
        orderid:
          type: string
          description: Order Identifier
        orderids:
          type: array
          items:
            type: string
          description: Order Identifiers
        startdate:
          type: string
          format: date-time
          description: Start creation date
        enddate:
          type: string
          format: date-time
          description: End creation date

    UpdateRequest:
      type: object
      required:
        - orderid
        - ordertracking
        - billingaddress
        - lines
      properties:
        orderid:
          type: string
          description: Internal Order Identifier
        identifier:
          $ref: '#/components/schemas/Identifier'
        ordertracking:
          $ref: '#/components/schemas/TrackingDataUpdate'
          description: Order Tracking
        comtracking:
          $ref: '#/components/schemas/CommercialTracking'
          description: Commercial Tracking
        amount:
          $ref: '#/components/schemas/Amount'
        billingaddress:
          $ref: '#/components/schemas/Address'
          description: Billing address
        deliverydetail:
          $ref: '#/components/schemas/DeliveryDetail'
          description: Delivery details
        payment:
          $ref: '#/components/schemas/Payment'
          description: Payment details
        customdata:
          $ref: '#/components/schemas/MetaData'
          description: To use to store key/value list
        lines:
          type: array
          items:
            $ref: '#/components/schemas/OrderLine'
          description: order lines

    UserSubscription:
      type: object
      required:
        - unicitykey
      properties:
        subscriptionid:
          type: string
          description: Subscription Identifier
        subscriptiontype:
          type: string
          description: Subscription type (RECCURING, ONESHOT, FREE,...)
        unicitykey:
          type: string
          description: business key Identifier
        title:
          type: string
          description: Title
        offerid:
          type: string
          description: original offer ID subscription
        offercode:
          type: string
          description: original offer code subscription
        productcode:
          type: string
          description: original product code subscription
        orderid:
          type: string
          description: original order ID subscription
        amount:
          $ref: '#/components/schemas/Amount'
        dunninglevel:
          type: string
          description: Dunning level
        billingcycletype:
          type: string
          description: Billing cycle type
        interval:
          type: number
          description: Interval
        startdate:
          type: string
          format: date-time
        isactive:
          type: boolean
          description: Is active ?
        issupended:
          type: boolean
          description: Is suspended ?
        isblocked:
          type: boolean
          description: Is blocked ?
        isterminated:
          type: boolean
          description: Is terminated ?
        enddatesuspended:
          type: string
          format: date-time


    TrackingData:
      type: object
      properties:
        vendorcode:
          type: string
          description: vendor Identifier
        orderchannel:
          type: string
          description: Order Channel
        contactchannel:
          type: string
          description: Contact channel
        site:
          type: string
          description: Client site code
        agency:
          type: string
          description: Client agency code
        user:
          type: string
          description: User to assign the operation
        externalbookingid:
          type: string
          description: Client booking reference
        bookingid:
          type: string
          description: Gridbees Booking identifier
        externaltransactionnumber:
          type: string
          description: Client External business reference
        transactionnumber:
          type: string
          description: Gridbees business reference
        platformreferencenumber:
          type: string
          description: Other platform business reference
        supplierreferencenumber:
          type: string
          description: Other supplier business reference
        invoicenumber:
          type: string
          description: Invoice reference
        comments:
          type: array
          items:
            $ref: '#/components/schemas/Comment'
          description: List of comments

    TrackingDataUpdate:
      required:
        - transactionnumber
      type: object
      properties:
        vendorcode:
          type: string
          description: vendor Identifier
        orderchannel:
          type: string
          description: Order Channel
        contactchannel:
          type: string
          description: Contact channel
        site:
          type: string
          description: Client site code
        agency:
          type: string
          description: Client agency code
        user:
          type: string
          description: User to assign the operation
        externalbookingid:
          type: string
          description: Client booking reference
        bookingid:
          type: string
          description: Gridbees Booking identifier
        externaltransactionnumber:
          type: string
          description: Client External business reference
        transactionnumber:
          type: string
          description: Gridbees business reference
        platformreferencenumber:
          type: string
          description: Other platform business reference
        supplierreferencenumber:
          type: string
          description: Other supplier business reference
        invoicenumber:
          type: string
          description: Invoice reference
        comments:
          type: array
          items:
            $ref: '#/components/schemas/Comment'
          description: List of comments

    Translation:
      type: object
      properties:
        name:
          type: string
          description: property name to translate
        languagecode:
          type: string
          description: language code
        value:
          type: string
          description: property name translated
        segment:
          type: string
          description: categorisation (use for example to store the country code)

    DisplayTabs:
      type: object
      properties:
        tabcode:
          type: string
        tabindex:
          type: integer
        tabcolor:
          type: string
          description: future use
        label:
          type: string
        translations:
          type: array
          items:
            $ref: '#/components/schemas/Translation'

    Wallet:
      type: object
      properties:
        unicitykey:
          type: string
          description: unicity key
        externalreference:
          type: string
          description: external reference
        loyalties:
          $ref: '#/components/schemas/WalletLoyalty'
        details:
          $ref: '#/components/schemas/WalletDetail'
        customdata:
          $ref: '#/components/schemas/MetaData'
        subscriptiondate:
          type: string
          format: date-time
          description: subscription date
        renewaldate:
          type: string
          description: renewal date
        createdate:
          type: string
          format: date-time
          description: creation date
        updatedate:
          type: string
          format: date-time
          description: update date

    WalletDetail:
      type: object
      properties:
        walletid:
          type: string
          description: technical key
        contactid:
          type: string
          description: Contact identifier
        wallettype:
          type: string
          description: Wallet type
          enum:
            - LOYALTY
            - VOUCHER
            - REFERRAL

        code:
          type: string
        operationtype:
          type: string
          description: operation type
          enum:
            - CREDIT
            - DEBIT
        groupname:
          type: string
          description: group name
        vouchernumid:
          type: string
          description: voucher numid
        promotionid:
          type: string
          description: promotion ID
        isused:
          type: boolean
          description: Is used ?
        ordernums:
          type: array
          items:
            type: string
          description: List of order number
        amount:
          type: number
          format: double
          description: amount
        amountdetail:
          $ref: '#/components/schemas/WalletDetailAmount'
        properties:
          $ref: '#/components/schemas/WalletDetailProperties'
        user:
          type: string
        createdate:
          type: string
          format: date-time
          description: creation date
        updatedate:
          type: string
          format: date-time
          description: update date

    WalletDetailRequest:
      type: object
      properties:
        walletid:
          type: string
          description: technical key
        contactid:
          type: string
          description: Contact identifier
        walletids:
          type: array
          items:
            type: string
          description: List of wallet technical keys
        contactids:
          type: array
          items:
            type: string
          description: List of contact identifiers
        wallettype:
          type: string
          description: Wallet type
          enum:
            - LOYALTY
            - VOUCHER
            - REFERRAL
        loyaltycode:
          type: string
          description: loyalty code
        operationtype:
          type: string
          description: Operation type
          enum:
            - CREDIT
            - DEBIT
        status:
          type: string
          description: status
        ordernum:
          type: string
          description: order number
        ordernums:
          type: array
          items:
            type: string
          description: List of order numbers
        startdate:
          type: string
          format: date-time
          description: start date
        enddate:
          type: string
          format: date-time
          description: end date
        requestcontext:
          $ref: '#/components/schemas/RequestContext'



    WalletDetailAmount:
      type: object
      properties:
        currency:
          type: string
          description: currency code
        wallettype:
          type: string
          description: Wallet type
        isused:
          type: boolean
          description: Is used ?
        used:
          type: number
          format: double
          description: used amount
        expired:
          type: number
          format: double
          description: expired amount
        expiringsoon:
          type: number
          format: double
          description: expiringsoon amount
        validitydate:
          type: string
          format: date-time
          description: validitydate date

    WalletDetailProperties:
      type: object
      properties:
        cause:
          type: string
          description: cause
        burneddate:
          type: string
          format: date-time
          description: burned date
        validitydate:
          type: string
          format: date-time
          description: validitydate date
        businesscreationdate:
          type: string
          format: date-time
          description: business creation date
        customdata:
          type: array
          items:
            $ref: '#/components/schemas/MetaData'
          description: To use to store key/value list

    WalletLoyalty:
      type: object
      properties:
        loyaltycode:
          type: string
          description: loyalty code
        tiercode:
          type: string
          description: tier code
        tierduration:
          type: integer
          description: tier duration
        qualifiedamount:
          type: number
          format: double
          description: qualified amount
        createdate:
          type: string
          format: date-time
          description: creation date
        updatedate:
          type: string
          format: date-time
          description: update date

    WebAccount:
      type: object
      properties:
        webaccountid:
          type: string
          description: technical key
        identifier:
          $ref: '#/components/schemas/Identifier'
        login:
          type: string
          description: Login
        password:
          type: string
          description: password
        blocked:
          type: boolean
          description: Is blocked ?
        isactivated:
          type: boolean
          description: Is isactivated ?
        nickname:
          type: string
          description: nick name
        firstname:
          type: string
          description: first name
        lastname:
          type: string
          description: last name
        optinphone:
          type: boolean
          description: optin phone
        optinmail:
          type: boolean
          description: optin mail
        optinemail:
          type: boolean
          description: optin email
        partneroptinphone:
          type: boolean
          description: partner optin phone
        partneroptinmail:
          type: boolean
          description: partner optin mail
        partneroptinemail:
          type: boolean
          description: partner optin email
        createdate:
          type: string
          format: date-time
          description: creation date
        updatedate:
          type: string
          format: date-time
          description: update date

    WeekHour:
      type: object
      properties:
        date:
          type: string
          format: date-time
          description: Date
        departuretime:
          type: string
          description: Departure time
        languages:
          type: array
          items:
            type: string
          description: Languages

    Supplier:
      type: object
      properties:
        supplierid:
          type: string
          description: technical key
        tenantid:
          type: string
          description: tenant id
        unicitykey:
          type: string
          description: unicity key
        name:
          $ref: '#/components/schemas/Person'
        displayname:
          type: string
          description: name to display
        typology:
          type: string
          description: typology of supplier
        legalentity:
          $ref: '#/components/schemas/LegalEntity'
        identifier:
          $ref: '#/components/schemas/Identifier'
        blocked:
          type: boolean
          description: is blocked ?
        isconnected:
          type: boolean
          description: is connected ?
        emails:
          type: array
          items:
            $ref: '#/components/schemas/Email'
          description: Email contact
        phones:
          type: array
          items:
            $ref: '#/components/schemas/Phone'
          description: Phones contact
        addresses:
          type: array
          items:
            $ref: '#/components/schemas/Address'
          description: Adress contact
        products:
          type: array
          items:
            $ref: '#/components/schemas/SupplierProduct'
          description: LIst of products
        attributes:
          type: array
          items:
            $ref: '#/components/schemas/MasterData'
          description: Custom attributes
        createdate:
          type: string
          description: creation date
          format: date-time
        updatedate:
          type: string
          description: update date
          format: date-time

    SupplierProduct:
      type: object
      properties:
        productcode:
          type: string
          description: product code
        externalcode:
          type: string
          description: external product code
        isconnected:
          type: boolean
          description: is connected ?
        details:
          type: string
          description: details


paths:
  /contact/search:
    post:
      tags:
        - Customer Service
      operationId: Contact Search
      description: |
        This service is used to retrieve contacts. The total number of contacts in the response is a parameter of the service.
        Contact your administrator to know or modify this value.
      requestBody:
        content:
          application/json:
            examples:
              Retail:
                value: {"contactid":"b731a80266fe4244b740add6439eeb64", "requestcontext":{"queryprojection":["contactid", "trackingdata", "person", "customdata", "loyaltycards"]}}
            schema:
              $ref: '#/components/schemas/ContactRequest'
        required: true
      responses:
        "200":
          description: List contacts
          content:
            application/json:
              examples:
                Retail:
                  value: [{"contactid":"99a6da096155410c96fa972cb5b4c4b6", "tenantid":"a6ca93d74c284a1bad47c04191af1188", "unicitykey":"00000000125", "structure":{"blcode":"B2T", "marketcode":"EEMA"}, "identifier":{"externalnumid":"CE0015224437"}, "person":{"persontype":"PRIVATE", "countrycode":"FR", "languagecode":"fr", "civility":"MR", "lastname":"Alpha", "firstname":"Omega", "birthdate":"1971-05-16T00:00:00.000Z"}, "emails":[{"usage":"BIL", "uid":"e289e7ef5fd34afaa7512e81d539265d", "isprincipal":true, "emailvalue":"gridbees@gmail.com"}], "phones":[{"uid":"ffd711971aec4134ba945136b42cea19", "isprincipal":false, "prefix":"+33", "phonevalue":"75332939"}, {"usage":"BIL", "uid":"23495ce25dc34089906173fd4662693d", "isprincipal":true, "phonevalue":"+34658912939"}], "addresses":[{"usage":"BIL", "uid":"5e9b347270c44dddb66cf902e97bb90e", "externalnumid":"5644990042", "isactive":true, "streetname":"BD Marechaux N.2", "city":"Paris", "postalcode":"75012", "countrycode":"FR", "additionalinfo":[{"attribute":"CompanyName", "value":"My Little Company"}]}], "identitydocuments":[{"usage":"PASSPORT", "numid":"43358431A", "emittercountrylocation":"FR", "isvalidated":true, "isexternal":true}], "customdata":[{"attribute":"gdpr", "value":"1"}, {"attribute":"loyalty", "value":"1"}, {"attribute":"shoporigin", "value":"610"}], "loyaltycards":[{"externalnumid":"GB01536637", "loyalties":[{"loyaltyid":"56371334", "unicitykey":"Club Gridbees", "label":"Club Gridbees", "tiers":[{"code":"Entry Level", "label":"Entry Level (< 5 € Cash)", "level":"1.0"}, {"code":"Redeemable Level", "label":"Redeemable Level", "level":"2.0"}]}]}], "createdate":"2023-06-01T12:48:44.434Z"}]
              schema:
                $ref: '#/components/schemas/Contact'
        "401":
          description: The resource requires authentication, which was not supplied with the request
          content: {}

  /contact/stream:
    post:
      tags:
        - Customer Service
      operationId: Contact Stream
      description: |
        This service is used to retrieve contacts. The response is a stream.
      requestBody:
        content:
          application/json:
            examples:
              Retail:
                value: {"contactid":"b731a80266fe4244b740add6439eeb64", "requestcontext":{"queryprojection":["contactid", "trackingdata", "person", "customdata", "loyaltycards"]}}
            schema:
              $ref: '#/components/schemas/ContactRequest'
        required: true
      responses:
        "200":
          description: List Contacts (stream results)
          content:
            application/json:
              examples:
                Retail:
                  value: [{"contactid":"99a6da096155410c96fa972cb5b4c4b6", "tenantid":"a6ca93d74c284a1bad47c04191af1188", "unicitykey":"00000000125", "structure":{"blcode":"B2T", "marketcode":"EEMA"}, "identifier":{"externalnumid":"CE0015224437"}, "person":{"persontype":"PRIVATE", "countrycode":"FR", "languagecode":"fr", "civility":"MR", "lastname":"Alpha", "firstname":"Omega", "birthdate":"1971-05-16T00:00:00.000Z"}, "emails":[{"usage":"BIL", "uid":"e289e7ef5fd34afaa7512e81d539265d", "isprincipal":true, "emailvalue":"gridbees@gmail.com"}], "phones":[{"uid":"ffd711971aec4134ba945136b42cea19", "isprincipal":false, "prefix":"+33", "phonevalue":"75332939"}, {"usage":"BIL", "uid":"23495ce25dc34089906173fd4662693d", "isprincipal":true, "phonevalue":"+34658912939"}], "addresses":[{"usage":"BIL", "uid":"5e9b347270c44dddb66cf902e97bb90e", "externalnumid":"5644990042", "isactive":true, "streetname":"BD Marechaux N.2", "city":"Paris", "postalcode":"75012", "countrycode":"FR", "additionalinfo":[{"attribute":"CompanyName", "value":"My Little Company"}]}], "identitydocuments":[{"usage":"PASSPORT", "numid":"43358431A", "emittercountrylocation":"FR", "isvalidated":true, "isexternal":true}], "customdata":[{"attribute":"gdpr", "value":"1"}, {"attribute":"loyalty", "value":"1"}, {"attribute":"shoporigin", "value":"610"}], "loyaltycards":[{"externalnumid":"GB01536637", "loyalties":[{"loyaltyid":"56371334", "unicitykey":"Club Gridbees", "label":"Club Gridbees", "tiers":[{"code":"Entry Level", "label":"Entry Level (< 5 € Cash)", "level":"1.0"}, {"code":"Redeemable Level", "label":"Redeemable Level", "level":"2.0"}]}]}], "createdate":"2023-06-01T12:48:44.434Z"}]
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Contact'
        "401":
          description: The resource requires authentication, which was not supplied with the request
          content: {}

  /contact/set:
    post:
      tags:
        - Customer Service
      operationId: Contact Set
      description: |
        This service is used to create a new contact.
      requestBody:
        description: |
          Contact to create. Technical fields (contactid, uid, create and update date, ..) will be discarded if filled in the request body. unicitikey will be autotically generated, if not supplied.
          During the creation process, the service will check :
          - if structure is in the request body, blcode must be filled
          - if legalentity is in the request body,commercialname and companyname must be filled
          - for each address,countrycode, postalcode, streetname must be filled
          - if email is defined, emailvalue must be filled
          - if phone is defined, phonevalue must be filled
        content:
          application/json:
            examples:
              Retail:
                value: {"structure":{"blcode":"B2T", "marketcode":"EEMA"}, "identifier":{"externalnumid":"CE0015224437"}, "person":{"persontype":"PRIVATE", "countrycode":"FR", "languagecode":"fr", "civility":"MR", "lastname":"Alpha", "firstname":"Omega", "birthdate":"1971-05-16T00:00:00.000Z"}, "emails":[{"usage":"BIL", "isprincipal":true, "emailvalue":"gridbees@gmail.com"}], "phones":[{"isprincipal":false, "prefix":"+33", "phonevalue":"75332939"}, {"usage":"BIL", "isprincipal":true, "phonevalue":"+34658912939"}], "addresses":[{"usage":"BIL", "externalnumid":"5644990042", "isactive":true, "streetname":"BD Marechaux N.2", "city":"Paris", "postalcode":"75012", "countrycode":"FR", "additionalinfo":[{"attribute":"CompanyName", "value":"My Little Company"}]}], "identitydocuments":[{"usage":"PASSPORT", "numid":"43358431A", "emittercountrylocation":"FR", "isvalidated":true, "isexternal":true}], "customdata":[{"attribute":"gdpr", "value":"1"}, {"attribute":"loyalty", "value":"1"}, {"attribute":"shoporigin", "value":"610"}], "loyaltycards":[{"externalnumid":"GB01536637", "loyalties":[{"loyaltyid":"56371334", "unicitykey":"Club Gridbees", "label":"Club Gridbees", "tiers":[{"code":"Entry Level", "label":"Entry Level (< 5 € Cash)", "level":"1.0"}, {"code":"Redeemable Level", "label":"Redeemable Level", "level":"2.0"}]}]}]}
            schema:
              $ref: '#/components/schemas/Contact'
        required: true
      responses:
        "200":
          description: Contact created
          content:
            application/json:
              examples:
                Retail:
                  value: {"contactid":"99a6da096155410c96fa972cb5b4c4b6", "tenantid":"a6ca93d74c284a1bad47c04191af1188", "unicitykey":"00000000125", "structure":{"blcode":"B2T", "marketcode":"EEMA"}, "identifier":{"externalnumid":"CE0015224437"}, "person":{"persontype":"PRIVATE", "countrycode":"FR", "languagecode":"fr", "civility":"MR", "lastname":"Alpha", "firstname":"Omega", "birthdate":"1971-05-16T00:00:00.000Z"}, "emails":[{"usage":"BIL", "uid":"e289e7ef5fd34afaa7512e81d539265d", "isprincipal":true, "emailvalue":"gridbees@gmail.com"}], "phones":[{"uid":"ffd711971aec4134ba945136b42cea19", "isprincipal":false, "prefix":"+33", "phonevalue":"75332939"}, {"usage":"BIL", "uid":"23495ce25dc34089906173fd4662693d", "isprincipal":true, "phonevalue":"+34658912939"}], "addresses":[{"usage":"BIL", "uid":"5e9b347270c44dddb66cf902e97bb90e", "externalnumid":"5644990042", "isactive":true, "streetname":"BD Marechaux N.2", "city":"Paris", "postalcode":"75012", "countrycode":"FR", "additionalinfo":[{"attribute":"CompanyName", "value":"My Little Company"}]}], "identitydocuments":[{"usage":"PASSPORT", "numid":"43358431A", "emittercountrylocation":"FR", "isvalidated":true, "isexternal":true}], "customdata":[{"attribute":"gdpr", "value":"1"}, {"attribute":"loyalty", "value":"1"}, {"attribute":"shoporigin", "value":"610"}], "loyaltycards":[{"externalnumid":"GB01536637", "loyalties":[{"loyaltyid":"56371334", "unicitykey":"Club Gridbees", "label":"Club Gridbees", "tiers":[{"code":"Entry Level", "label":"Entry Level (< 5 € Cash)", "level":"1.0"}, {"code":"Redeemable Level", "label":"Redeemable Level", "level":"2.0"}]}]}], "createdate":"2023-06-01T12:48:44.434Z"}
              schema:
                $ref: '#/components/schemas/Contact'
        "401":
          description: The resource requires authentication, which was not supplied with the request
          content: {}

  /contact/upsert:
    post:
      tags:
        - Customer Service
      operationId: Contact Upsert
      description: |
        This service is used to create or modify a contact.
      requestBody:
        description: Contact to create or update. if contactid or unicikey is filled and exists, the contact will be updated otherwise created. For array lists, like address, email, phone, if uid field is given, the entry will be updated, otherwise created.
        content:
          application/json:
            examples:
              Retail:
                value: {"contactid":"99a6da096155410c96fa972cb5b4c4b6", "tenantid":"a6ca93d74c284a1bad47c04191af1188", "unicitykey":"00000000125", "structure":{"blcode":"B2T", "marketcode":"EEMA"}, "identifier":{"externalnumid":"CE0015224437"}, "person":{"persontype":"PRIVATE", "countrycode":"FR", "languagecode":"fr", "civility":"MR", "lastname":"Alpha", "firstname":"Omega", "birthdate":"1971-05-16T00:00:00.000Z"}, "emails":[{"usage":"BIL", "uid":"e289e7ef5fd34afaa7512e81d539265d", "isprincipal":true, "emailvalue":"gridbees@gmail.com"}], "phones":[{"uid":"ffd711971aec4134ba945136b42cea19", "isprincipal":false, "prefix":"+33", "phonevalue":"75332939"}, {"usage":"BIL", "uid":"23495ce25dc34089906173fd4662693d", "isprincipal":true, "phonevalue":"+34658912939"}], "addresses":[{"usage":"BIL", "uid":"5e9b347270c44dddb66cf902e97bb90e", "externalnumid":"5644990042", "isactive":true, "streetname":"BD Marechaux N.2", "city":"Paris", "postalcode":"75012", "countrycode":"FR", "additionalinfo":[{"attribute":"CompanyName", "value":"My Little Company"}]}], "identitydocuments":[{"usage":"PASSPORT", "numid":"43358431A", "emittercountrylocation":"FR", "isvalidated":true, "isexternal":true}], "customdata":[{"attribute":"gdpr", "value":"1"}, {"attribute":"loyalty", "value":"1"}, {"attribute":"shoporigin", "value":"610"}], "loyaltycards":[{"externalnumid":"GB01536637", "loyalties":[{"loyaltyid":"56371334", "unicitykey":"Club Gridbees", "label":"Club Gridbees", "tiers":[{"code":"Entry Level", "label":"Entry Level (< 5 € Cash)", "level":"1.0"}, {"code":"Redeemable Level", "label":"Redeemable Level", "level":"2.0"}]}]}], "createdate":"2023-06-01T12:48:44.434Z"}
            schema:
              $ref: '#/components/schemas/Contact'
        required: true
      responses:
        "200":
          description: Contact created
          content:
            application/json:
              examples:
                Retail:
                  value: {"contactid":"99a6da096155410c96fa972cb5b4c4b6", "tenantid":"a6ca93d74c284a1bad47c04191af1188", "unicitykey":"00000000125", "structure":{"blcode":"B2T", "marketcode":"EEMA"}, "identifier":{"externalnumid":"CE0015224437"}, "person":{"persontype":"PRIVATE", "countrycode":"FR", "languagecode":"fr", "civility":"MR", "lastname":"Alpha", "firstname":"Omega", "birthdate":"1971-05-16T00:00:00.000Z"}, "emails":[{"usage":"BIL", "uid":"e289e7ef5fd34afaa7512e81d539265d", "isprincipal":true, "emailvalue":"gridbees@gmail.com"}], "phones":[{"uid":"ffd711971aec4134ba945136b42cea19", "isprincipal":false, "prefix":"+33", "phonevalue":"75332939"}, {"usage":"BIL", "uid":"23495ce25dc34089906173fd4662693d", "isprincipal":true, "phonevalue":"+34658912939"}], "addresses":[{"usage":"BIL", "uid":"5e9b347270c44dddb66cf902e97bb90e", "externalnumid":"5644990042", "isactive":true, "streetname":"BD Marechaux N.2", "city":"Paris", "postalcode":"75012", "countrycode":"FR", "additionalinfo":[{"attribute":"CompanyName", "value":"My Little Company"}]}], "identitydocuments":[{"usage":"PASSPORT", "numid":"43358431A", "emittercountrylocation":"FR", "isvalidated":true, "isexternal":true}], "customdata":[{"attribute":"gdpr", "value":"1"}, {"attribute":"loyalty", "value":"1"}, {"attribute":"shoporigin", "value":"610"}], "loyaltycards":[{"externalnumid":"GB01536637", "loyalties":[{"loyaltyid":"56371334", "unicitykey":"Club Gridbees", "label":"Club Gridbees", "tiers":[{"code":"Entry Level", "label":"Entry Level (< 5 € Cash)", "level":"1.0"}, {"code":"Redeemable Level", "label":"Redeemable Level", "level":"2.0"}]}]}], "createdate":"2023-06-01T12:48:44.434Z"}
              schema:
                $ref: '#/components/schemas/Contact'
        "401":
          description: The resource requires authentication, which was not supplied with the request
          content: {}

  /contact/get/{contactid}:
    get:
      tags:
        - Customer Service
      operationId: Contact Get
      description: |
        This service is used to retrieve a given contact.
      responses:
        "200":
          description: Contact created
          content:
            application/json:
              examples:
                Retail:
                  value: {"contactid":"99a6da096155410c96fa972cb5b4c4b6", "tenantid":"a6ca93d74c284a1bad47c04191af1188", "unicitykey":"00000000125", "structure":{"blcode":"B2T", "marketcode":"EEMA"}, "identifier":{"externalnumid":"CE0015224437"}, "person":{"persontype":"PRIVATE", "countrycode":"FR", "languagecode":"fr", "civility":"MR", "lastname":"Alpha", "firstname":"Omega", "birthdate":"1971-05-16T00:00:00.000Z"}, "emails":[{"usage":"BIL", "uid":"e289e7ef5fd34afaa7512e81d539265d", "isprincipal":true, "emailvalue":"gridbees@gmail.com"}], "phones":[{"uid":"ffd711971aec4134ba945136b42cea19", "isprincipal":false, "prefix":"+33", "phonevalue":"75332939"}, {"usage":"BIL", "uid":"23495ce25dc34089906173fd4662693d", "isprincipal":true, "phonevalue":"+34658912939"}], "addresses":[{"usage":"BIL", "uid":"5e9b347270c44dddb66cf902e97bb90e", "externalnumid":"5644990042", "isactive":true, "streetname":"BD Marechaux N.2", "city":"Paris", "postalcode":"75012", "countrycode":"FR", "additionalinfo":[{"attribute":"CompanyName", "value":"My Little Company"}]}], "identitydocuments":[{"usage":"PASSPORT", "numid":"43358431A", "emittercountrylocation":"FR", "isvalidated":true, "isexternal":true}], "customdata":[{"attribute":"gdpr", "value":"1"}, {"attribute":"loyalty", "value":"1"}, {"attribute":"shoporigin", "value":"610"}], "loyaltycards":[{"externalnumid":"GB01536637", "loyalties":[{"loyaltyid":"56371334", "unicitykey":"Club Gridbees", "label":"Club Gridbees", "tiers":[{"code":"Entry Level", "label":"Entry Level (< 5 € Cash)", "level":"1.0"}, {"code":"Redeemable Level", "label":"Redeemable Level", "level":"2.0"}]}]}], "createdate":"2023-06-01T12:48:44.434Z"}
              schema:
                $ref: '#/components/schemas/Contact'
        "401":
          description: The resource requires authentication, which was not supplied with the request
          content: {}

  /contact/delete/{contactid}:
    delete:
      tags:
        - Customer Service
      description: |
        This service is used to delete a contact.
      operationId: Contact Delete
      responses:
        200:
          description:
            The request is correctly processed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResultCode'
        401:
          description: The resource requires authentication, which was not supplied
            with the request
          content: {}
      x-codegen-request-body-name: request

  /contact/addattributes:
    post:
      tags:
        - Customer Service
      description: |
        This service is used to add a custom attribute with its value to a contact.
      operationId: Contact AddAttributes
      requestBody:
        description: Adding an attribute to an existing contact is made using contact's unicitykey and attributes to add are a label/value pair contained in the customdata array. New attributes with an existing label on that contact will be inserted, unless that label allready contains the new value.
        content:
          application/json:
            examples:
              Retail:
                value: {"unicitykey":"00000626500","customdata":[{"attribute":"labelName","value":"aboutThisLabel"}]}
            schema:
              $ref: '#/components/schemas/ContactAttributeRequest'
        required: true
      responses:
        200:
          description:
            The request is correctly processed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResultCode'
        401:
          description: The resource requires authentication, which was not supplied
            with the request
          content: {}
      x-codegen-request-body-name: request

  /contact/deleteattributes:
    post:
      tags:
        - Customer Service
      description: |
        This service is used to delete a custom attribute with its value from a contact.
      operationId: Contact DeleteAttributes
      requestBody:
        description: Deleting an attribute of an existing contact is made using contact's unicitykey. Attributes are a label/value pair in the customdata array. Attributes of a contact will be deleted only if both the label and its value matches. No effect if no match.
        content:
          application/json:
            examples:
              Retail:
                value: {"unicitykey":"00000626500","customdata":[{"attribute":"labelName","value":"aboutThisLabel"}]}
            schema:
              $ref: '#/components/schemas/ContactAttributeRequest'
        required: true
      responses:
        200:
          description:
            The request is correctly processed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResultCode'
        401:
          description: The resource requires authentication, which was not supplied
            with the request
          content: {}
      x-codegen-request-body-name: request

  /webaccount/activate:
    post:
      tags:
        - Customer Service
      description: |
        This service is used to activate an user.
      operationId: Webaccount Activate
      requestBody:
        description: Activates an user using his login and an optionnal marketcode.
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/WebaccountRequest'
        required: true
      responses:
        200:
          description:
            The request is correctly processed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResultCode'
        401:
          description: The resource requires authentication, which was not supplied
            with the request
          content: {}
      x-codegen-request-body-name: request

  /webaccount/check:
    post:
      tags:
        - Customer Service
      description: |
        This service is used to check if an user exist.
      operationId: Webaccount Check
      requestBody:
        description: Checks if an user exist using his or her login and an optionnal marketcode.
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/WebaccountRequest'
        required: true
      responses:
        200:
          description:
            The request is correctly processed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResultCode'
        401:
          description: The resource requires authentication, which was not supplied
            with the request
          content: {}
      x-codegen-request-body-name: request

  /webaccount/delete:
    delete:
      tags:
        - Customer Service
      description: |
        This service is used to delete an web account.
      operationId: Webaccount Delete
      requestBody:
        description: Deletes a web account using his or her webaccountid and his contactid.
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/WebaccountDeleteRequest'
        required: true
      responses:
        200:
          description:
            The request is correctly processed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResultCode'
        401:
          description: The resource requires authentication, which was not supplied
            with the request
          content: {}
      x-codegen-request-body-name: request

  /webaccount/get/{webaccountid}:
    get:
      tags:
        - Customer Service
      description: |
        This service is used to get details of an web account.
      operationId: Webaccount Get
      responses:
        200:
          description:
            The request is correctly processed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WebAccount'
        401:
          description: The resource requires authentication, which was not supplied
            with the request
          content: {}
      x-codegen-request-body-name: request

  /webaccount/login:
    post:
      tags:
        - Customer Service
      description: |
        This service is used to log a web account.
      operationId: Webaccount Login
      requestBody:
        description: Logs a web account.
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/WebaccountLoginRequest'
        required: true
      responses:
        200:
          description:
            The request is correctly processed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResultCode'
        401:
          description: The resource requires authentication, which was not supplied
            with the request
          content: {}
      x-codegen-request-body-name: request

  /webaccount/resetpassword:
    post:
      tags:
        - Customer Service
      description: |
        This service is used to reset the password of a web account.
      operationId: Webaccount ResetPassword
      requestBody:
        description: Reset the password of a web account.
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/WebaccountResetPasswordRequest'
        required: true
      responses:
        200:
          description:
            The request is correctly processed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResultCode'
        401:
          description: The resource requires authentication, which was not supplied
            with the request
          content: {}
      x-codegen-request-body-name: request

  /webaccount/search:
    post:
      tags:
        - Customer Service
      description: |
        This service is used to search web accounts.
      operationId: Webaccount Search
      requestBody:
        description: Finds web accounts by various criterias.
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/WebAccount'
        required: true
      responses:
        200:
          description:
            The request is correctly processed.
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/WebAccount'
        401:
          description: The resource requires authentication, which was not supplied
            with the request
          content: {}
      x-codegen-request-body-name: request

  /webaccount/set:
    post:
      tags:
        - Customer Service
      description: |
        This service is used to create a web account.
      operationId: Webaccount Set
      requestBody:
        description: Creates a web account. Login and password in clear is mandatory.
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/WebAccount'
        required: true
      responses:
        200:
          description:
            The request is correctly processed.
          content:
            application/json:
              schema:
                items:
                  $ref: '#/components/schemas/WebAccount'
        401:
          description: The resource requires authentication, which was not supplied
            with the request
          content: {}
      x-codegen-request-body-name: request

  /webaccount/stream:
    post:
      tags:
        - Customer Service
      description: |
        This service is used to retrieve web accounts. The response is a stream.
      operationId: Webaccount Stream
      requestBody:
        description: Retrieves web accounts by various criterias.
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/WebAccount'
        required: true
      responses:
        200:
          description:
            The request is correctly processed.
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/WebAccount'
        401:
          description: The resource requires authentication, which was not supplied
            with the request
          content: {}
      x-codegen-request-body-name: request

  /webaccount/update:
    post:
      tags:
        - Customer Service
      description: |
        This service replaces a web account by the provided web account object.
      operationId: Webaccount Update
      requestBody:
        description: Replace a web account by the provided web account object. The login is mandatory.
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/WebAccount'
        required: true
      responses:
        200:
          description:
            The request is correctly processed.
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/WebAccount'
        401:
          description: The resource requires authentication, which was not supplied
            with the request
          content: {}
      x-codegen-request-body-name: request

  /supplier/delete:
    delete:
      tags:
        - Customer Service
      description: |
        This service is used to delete a supplier.
      operationId: Supplier Delete
      requestBody:
        description: Deletes a supplier using his supplier ID (mandatory).
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SupplierRequest'
        required: true
      responses:
        200:
          description:
            The request is correctly processed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResultCode'
        401:
          description: The resource requires authentication, which was not supplied
            with the request
          content: {}
      x-codegen-request-body-name: request

  /supplier/get/{supplierid}:
    get:
      tags:
        - Customer Service
      description: |
        This service is used to get details of a supplier.
      operationId: Supplier Get
      responses:
        200:
          description:
            The request is correctly processed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WebAccount'
        401:
          description: The resource requires authentication, which was not supplied
            with the request
          content: {}
      x-codegen-request-body-name: request

  /supplier/search:
    post:
      tags:
        - Customer Service
      description: |
        This service is used to search suppliers.
      operationId: Supplier Search
      requestBody:
        description: Finds suppliers by various criterias.
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Supplier'
        required: true
      responses:
        200:
          description:
            The request is correctly processed.
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Supplier'
        401:
          description: The resource requires authentication, which was not supplied
            with the request
          content: {}
      x-codegen-request-body-name: request

  /supplier/set:
    post:
      tags:
        - Customer Service
      operationId: Supplier Set
      description: |
        This service is used to create a new supplier.
      requestBody:
        description: Supplier to create
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Supplier'
        required: true
      responses:
        "200":
          description: Supplier created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Supplier'
        "401":
          description: The resource requires authentication, which was not supplied with the request
          content: {}

  /supplier/stream:
    post:
      tags:
        - Customer Service
      description: |
        This service is used to retrieve suppliers. The response is a stream.
      operationId: Supplier Stream
      requestBody:
        description: Retrieves suppliers by various criterias.
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Supplier'
        required: true
      responses:
        200:
          description:
            The request is correctly processed.
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Supplier'
        401:
          description: The resource requires authentication, which was not supplied
            with the request
          content: {}
      x-codegen-request-body-name: request

  /supplier/upsert:
    post:
      tags:
        - Customer Service
      operationId: Supplier Upsert
      description: |
        This service is used to modify a supplier.
      requestBody:
        description: Supplier to update. unicikey must be filled. For array lists, like address, email, phone, if uid field is given, the entry will be updated, otherwise created.
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Supplier'
        required: true
      responses:
        "200":
          description: Supplier upserted
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Supplier'
        "401":
          description: The resource requires authentication, which was not supplied with the request
          content: {}

  /mail/delete:
    delete:
      tags:
        - Customer Service
      description: |
        This service is used to delete a mail.
      operationId: Mail Delete
      requestBody:
        description: Deletes a mail using his mail ID and contact ID of recipients (mandatory).
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MailDeleteRequest'
        required: true
      responses:
        200:
          description:
            The request is correctly processed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResultCode'
        401:
          description: The resource requires authentication, which was not supplied
            with the request
          content: {}
      x-codegen-request-body-name: request

  /mail/get/{mailid}:
    get:
      tags:
        - Customer Service
      description: |
        This service is used to get details of a mail.
      operationId: Mail Get
      responses:
        200:
          description:
            The request is correctly processed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Mail'
        401:
          description: The resource requires authentication, which was not supplied
            with the request
          content: {}
      x-codegen-request-body-name: request

  /mail/receive:
    post:
      tags:
        - Customer Service
      operationId: Mail Receive
      description: |
        This service is used to get mails (...??? TODO).
      requestBody:
        description: (TODO)
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MailRequest'
        required: true
      responses:
        "200":
          description: Mail received
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Mail'
        "401":
          description: The resource requires authentication, which was not supplied with the request
          content: {}

  /mail/reprocess:
    post:
      tags:
        - Customer Service
      description: |
        This service is used to reprocess mails. The response is a stream.
      operationId: Mail Reprocess
      requestBody:
        description: Retrieves mails by various criterias and reprocesses them.
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MailRequest'
        required: true
      responses:
        200:
          description:
            The request is correctly processed.
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Mail'
        401:
          description: The resource requires authentication, which was not supplied
            with the request
          content: {}
      x-codegen-request-body-name: request

  /mail/search:
    post:
      tags:
        - Customer Service
      operationId: Mail Search
      description: |
        This service is used to search mails by various criterias.
      requestBody:
        description: Finds mails by various criterias.
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MailRequest'
        required: true
      responses:
        "200":
          description: Mail found
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Mail'
        "401":
          description: The resource requires authentication, which was not supplied with the request
          content: {}

  /mail/send:
    post:
      tags:
        - Customer Service
      operationId: Mail Send
      description: |
        This service is used to create and send a new mail.
      requestBody:
        description: Creates and send a mail. From, to and subject are mandatory fields.
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Mail'
        required: true
      responses:
        "200":
          description: Mail sent
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Mail'
        "401":
          description: The resource requires authentication, which was not supplied with the request
          content: {}

  /mail/set:
    post:
      tags:
        - Customer Service
      operationId: Mail Set
      description: |
        This service is used to create a new mail.
      requestBody:
        description: Creates a mail. From, to and subject are mandatory fields.
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Mail'
        required: true
      responses:
        "200":
          description: Mail set
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Mail'
        "401":
          description: The resource requires authentication, which was not supplied with the request
          content: {}

  /mail/stream:
    post:
      tags:
        - Customer Service
      description: |
        This service is used to retrieve mails. The response is a stream.
      operationId: Mail Stream
      requestBody:
        description: Retrieves mails by various criterias.
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Mail'
        required: true
      responses:
        200:
          description:
            The request is correctly processed.
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Mail'
        401:
          description: The resource requires authentication, which was not supplied
            with the request
          content: {}
      x-codegen-request-body-name: request

#  /mail/upload:
#    post:
#      tags:
#        - Customer Service
#      description: |
#        This service is used to upload files (for attachments to mails) and gives back a file reference.
#      operationId: Mail Upload
#      parameters:
#      requestBody:
#        description: Upload a file and gives back a file reference. (TODO)
#        content:
#          application/json:
#            schema:
#              $ref: '#/components/schemas/TODO
#              '
#        required: true
#      responses:
#        200:
#          description:
#            The request is correctly processed.
#          content:
#            application/json:
#              schema:
#                $ref: '#/components/schemas/Attachment'
#        401:
#          description: The resource requires authentication, which was not supplied
#            with the request
#          content: {}
#      x-codegen-request-body-name: request

  /mail/upsert:
    post:
      tags:
        - Customer Service
      operationId: Mail Upsert
      description: |
        This service is used to modify a mail.
      requestBody:
        description: Mail to update. mailid must be filled. For array lists, like address, email, phone, if uid field is given, the entry will be updated, otherwise created.
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Mail'
        required: true
      responses:
        "200":
          description: Mail upserted
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Mail'
        "401":
          description: The resource requires authentication, which was not supplied with the request
          content: {}

  /template/delete:
    delete:
      tags:
        - Customer Service
      description: |
        This service is used to delete a mail template.
      operationId: Template Delete
      requestBody:
        description: Deletes a mail template using his mailtemplateid (mandatory).
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MailTemplateRequest'
        required: true
      responses:
        200:
          description:
            The request is correctly processed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResultCode'
        401:
          description: The resource requires authentication, which was not supplied
            with the request
          content: {}
      x-codegen-request-body-name: request

  /template/get/{mailtemplateid}:
    get:
      tags:
        - Customer Service
      description: |
        This service is used to get details of a mail template.
      operationId: Template Get
      responses:
        200:
          description:
            The request is correctly processed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MailTemplate'
        401:
          description: The resource requires authentication, which was not supplied
            with the request
          content: {}
      x-codegen-request-body-name: request

  /template/search:
    post:
      tags:
        - Customer Service
      operationId: Template Search
      description: |
        This service is used to search templates of mail by various criterias.
      requestBody:
        description: Finds templates of mail by various criterias.
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MailTemplateRequest'
        required: true
      responses:
        "200":
          description: Template of mail found
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/MailTemplate'
        "401":
          description: The resource requires authentication, which was not supplied with the request
          content: {}

  /template/set:
    post:
      tags:
        - Customer Service
      operationId: Template Set
      description: |
        This service is used to create a new mail template.
      requestBody:
        description: Creates a template of mail.
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MailTemplate'
        required: true
      responses:
        "200":
          description: Mail template set
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MailTemplate'
        "401":
          description: The resource requires authentication, which was not supplied with the request
          content: {}

  /template/stream:
    post:
      tags:
        - Customer Service
      description: |
        This service is used to retrieve mail templates. The response is a stream.
      operationId: Template Stream
      requestBody:
        description: Retrieves mail templates by various criterias.
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MailTemplateRequest'
        required: true
      responses:
        200:
          description:
            The request is correctly processed.
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/MailTemplate'
        401:
          description: The resource requires authentication, which was not supplied
            with the request
          content: {}
      x-codegen-request-body-name: request

  /template/upsert:
    post:
      tags:
        - Customer Service
      operationId: Template upsert
      description: |
        This service is used to modify a mail template.
      requestBody:
        description: Modifies a template of mail. mailtemplateid is a mandatory field. For array lists, like address, email, phone, if uid field is given, the entry will be updated, otherwise created.
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MailTemplate'
        required: true
      responses:
        "200":
          description: Mail template set
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MailTemplate'
        "401":
          description: The resource requires authentication, which was not supplied with the request
          content: {}

  /notification/delete:
    delete:
      tags:
        - Customer Service
      description: |
        This service is used to delete a notification.
      operationId: Notification Delete
      requestBody:
        description: Deletes a notification using his notificationid (mandatory).
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/NotificationRequest'
        required: true
      responses:
        200:
          description:
            The request is correctly processed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResultCode'
        401:
          description: The resource requires authentication, which was not supplied
            with the request
          content: {}
      x-codegen-request-body-name: request

  /notification/get/{notificationid}:
    get:
      tags:
        - Customer Service
      description: |
        This service is used to get details of a notification.
      operationId: Notification Get
      responses:
        200:
          description:
            The request is correctly processed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Notification'
        401:
          description: The resource requires authentication, which was not supplied
            with the request
          content: {}
      x-codegen-request-body-name: request

  /notification/search:
    post:
      tags:
        - Customer Service
      operationId: Notification Search
      description: |
        This service is used to search notifications by various criterias.
      requestBody:
        description: Finds notifications by various criterias.
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/NotificationRequest'
        required: true
      responses:
        "200":
          description: Notification found
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Notification'
        "401":
          description: The resource requires authentication, which was not supplied with the request
          content: {}

  /notification/set:
    post:
      tags:
        - Customer Service
      operationId: Notification Set
      description: |
        This service is used to create a new notification.
      requestBody:
        description: Creates a notification.
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Notification'
        required: true
      responses:
        "200":
          description: Notification set
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Notification'
        "401":
          description: The resource requires authentication, which was not supplied with the request
          content: {}

  /notification/stream:
    post:
      tags:
        - Customer Service
      description: |
        This service is used to retrieve notifications. The response is a stream.
      operationId: Notification Stream
      requestBody:
        description: Retrieves notifications by various criterias.
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/NotificationRequest'
        required: true
      responses:
        200:
          description:
            The request is correctly processed.
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Notification'
        401:
          description: The resource requires authentication, which was not supplied
            with the request
          content: {}
      x-codegen-request-body-name: request

  /notification/upsert:
    post:
      tags:
        - Customer Service
      operationId: Notification upsert
      description: |
        This service is used to modify a notification.
      requestBody:
        description: Modifies a notification. unicitykey is a mandatory field. For array lists, like address, email, phone, if uid field is given, the entry will be updated, otherwise created.
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Notification'
        required: true
      responses:
        "200":
          description: Notification modified
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Notification'
        "401":
          description: The resource requires authentication, which was not supplied with the request
          content: {}

  /wallet/delete:
    delete:
      tags:
        - Customer Service
      description: |
        This service is used to delete a wallet.
      operationId: Wallet Delete
      requestBody:
        description: Deletes a wallet using his walletid (mandatory).
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/WalletDetailRequest'
        required: true
      responses:
        200:
          description:
            The request is correctly processed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResultCode'
        401:
          description: The resource requires authentication, which was not supplied
            with the request
          content: {}
      x-codegen-request-body-name: request

  /wallet/get/{walletid}:
    get:
      tags:
        - Customer Service
      description: |
        This service is used to get details of a wallet.
      operationId: Wallet Get
      responses:
        200:
          description:
            The request is correctly processed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WalletDetail'
        401:
          description: The resource requires authentication, which was not supplied
            with the request
          content: {}
      x-codegen-request-body-name: request

  /wallet/search:
    post:
      tags:
        - Customer Service
      operationId: Wallet Search
      description: |
        This service is used to search wallets by various criterias.
      requestBody:
        description: Finds wallets by various criterias.
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/WalletDetailRequest'
        required: true
      responses:
        "200":
          description: Wallets found
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/WalletDetail'
        "401":
          description: The resource requires authentication, which was not supplied with the request
          content: {}

  /wallet/set:
    post:
      tags:
        - Customer Service
      operationId: Wallet Set
      description: |
        This service is used to create a new wallet.
      requestBody:
        description: Creates a wallet.
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/WalletDetail'
        required: true
      responses:
        "200":
          description: Wallet set
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WalletDetail'
        "401":
          description: The resource requires authentication, which was not supplied with the request
          content: {}

  /wallet/stream:
    post:
      tags:
        - Customer Service
      description: |
        This service is used to retrieve wallets. The response is a stream.
      operationId: Wallet Stream
      requestBody:
        description: Retrieves wallets by various criterias.
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/WalletDetailRequest'
        required: true
      responses:
        200:
          description:
            The request is correctly processed.
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/WalletDetail'
        401:
          description: The resource requires authentication, which was not supplied
            with the request
          content: {}
      x-codegen-request-body-name: request

  /wallet/upsert:
    post:
      tags:
        - Customer Service
      operationId: Wallet upsert
      description: |
        This service is used to modify a wallet.
      requestBody:
        description: Modifies a wallet. walletid is a mandatory field. For array lists, like address, email, phone, if uid field is given, the entry will be updated, otherwise created.
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/WalletDetail'
        required: true
      responses:
        "200":
          description: Wallet modified
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WalletDetail'
        "401":
          description: The resource requires authentication, which was not supplied with the request
          content: {}

  /offer/set:
    post:
      tags:
        - Offer Service
      operationId: Offer Set
      description: |
        This service is used to create a new offer.
      requestBody:
        description: Offer to create
        content:
          application/json:
            examples:
              Minor:
                value: {"unicitykey":"577", "unicitycode":"1164", "offertype":"FOOD", "codification":{"vendorcode":"SW"}, "title":"Ice Cream Sandwich Chocolate Pack 4 pcs. 199.-", "structure":{"companycode":"TDG", "countrycode":"th"}, "products":[{"items":[{"productcode":"702871", "quantity":1}]}], "properties":{"customdata":[{"attribute":"tag", "value":"ICECREAM"}, {"attribute":"shop", "value":"456"}, {"attribute":"shop", "value":"906"}]}, "pricing":{"currencycode":"THB", "pricetype":"RETAIL", "sellingprice":199.0}, "medias":[{"url":"https://1112.minorcdn.com/1112one/public/images/products/SW/659115.jpg", "rank":1, "islocalisable":false}], "status":"Published"}

            schema:
              $ref: '#/components/schemas/Offer'
        required: true
      responses:
        "200":
          description: Offer created
          content:
            application/json:
              examples:
                Minor:
                  value: {"unicitykey":"577", "unicitycode":"1164", "offertype":"FOOD", "codification":{"vendorcode":"SW"}, "title":"Ice Cream Sandwich Chocolate Pack 4 pcs. 199.-", "structure":{"companycode":"TDG", "countrycode":"th"}, "products":[{"items":[{"productcode":"702871", "quantity":1}]}], "properties":{"customdata":[{"attribute":"tag", "value":"ICECREAM"}, {"attribute":"shop", "value":"456"}, {"attribute":"shop", "value":"906"}]}, "pricing":{"currencycode":"THB", "pricetype":"RETAIL", "sellingprice":199.0}, "medias":[{"url":"https://1112.minorcdn.com/1112one/public/images/products/SW/659115.jpg", "rank":1, "islocalisable":false}], "status":"Published"}

              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Offer'
        "401":
          description: The resource requires authentication, which was not supplied with the request
          content: {}

  /offer/upsert:
    post:
      tags:
        - Offer Service
      operationId: Offer Upsert
      description: |
        This service is used to create or update a new offer. Based on unicitykey, the service checks if the offer already exists or not.
        If exists, the offer is updated otherwise is created.
      requestBody:
        description: Offer to create
        content:
          application/json:
            examples:
              Minor:
                value: {"unicitykey":"577", "unicitycode":"1164", "offertype":"FOOD", "codification":{"vendorcode":"SW"}, "title":"Ice Cream Sandwich Chocolate Pack 4 pcs. 199.-", "structure":{"companycode":"TDG", "countrycode":"th"}, "products":[{"items":[{"productcode":"702871", "quantity":1}]}], "properties":{"customdata":[{"attribute":"tag", "value":"ICECREAM"}, {"attribute":"shop", "value":"456"}, {"attribute":"shop", "value":"906"}]}, "pricing":{"currencycode":"THB", "pricetype":"RETAIL", "sellingprice":199.0}, "medias":[{"url":"https://1112.minorcdn.com/1112one/public/images/products/SW/659115.jpg", "rank":1, "islocalisable":false}], "status":"Published"}
            schema:
              $ref: '#/components/schemas/Offer'
        required: true
      responses:
        "200":
          description: Offer created
          content:
            application/json:
              examples:
                Minor:
                  value: {"offerid":"1d3c922e67904d48a8bf7ff121b869ad", "unicitykey":"577", "unicitycode":"1164", "offertype":"FOOD", "codification":{"vendorcode":"SW"}, "title":"Ice Cream Sandwich Chocolate Pack 4 pcs. 199.-", "structure":{"companycode":"TDG", "countrycode":"th"}, "products":[{"items":[{"productcode":"702871", "quantity":1}]}], "properties":{"customdata":[{"attribute":"tag", "value":"ICECREAM"}, {"attribute":"shop", "value":"456"}, {"attribute":"shop", "value":"906"}]}, "pricing":{"currencycode":"THB", "pricetype":"RETAIL", "sellingprice":199.0}, "medias":[{"url":"https://1112.minorcdn.com/1112one/public/images/products/SW/659115.jpg", "rank":1, "islocalisable":false}], "status":"Published", "createdate":"2022-06-16T20:31:43.276Z", "updatedate":"2022-06-16T22:03:59.610Z"}

              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Offer'
        "401":
          description: The resource requires authentication, which was not supplied with the request
          content: {}

  /offer/publish:
    post:
      tags:
        - Offer Service
      operationId: Offer Publish
      description: |
        This service is used to pull offers to publish or unpublish.
      requestBody:
        description: Offer request object
        content:
          application/json:
            examples:
              Retail:
                value: {"offertype": "FOOD"}
              Streaming:
                value: {"offertype": "STREAMING"}
            schema:
              $ref: '#/components/schemas/OfferRequest'
        required: true
      responses:
        "200":
          description: List of published offers
          content:
            application/json:
              examples:
                Retail:
                  value: [{"offerid":"1abb93f0d5c3474480bd9781bc9d47f8", "unicitykey":"577", "unicitycode":"1164", "offertype":"FOOD", "structure":{"countrycode":"th", "companycode":"TDG"}, "codification":{"vendorcode":"SW", "platformcode":"OTT_APP"}, "products":[{"items":[{"productcode":"1164", "quantity":1}]}], "properties":{"options":[{"minquantity":1, "maxquantity":1, "rank":15332, "optiondetails":[{"unicitykey":"576", "unicitycode":"641081", "rank":1, "adjustedprice":0.0}]}]}, "pricing":{"currencycode":"THB", "pricetype":"RETAIL", "sellingprice":899.0}, "medias":[{"url":"https://1112.minorcdn.com/1112one/public/images/products/SW/651047_3.jpg", "rank":1, "islocalisable":false}], "status":"Published", "createdate":"2022-06-24T05:13:42.800Z", "updatedate":"2022-06-28T05:49:36.974Z", "title":{"en-US":"Mango Oak-Rong-Thong 3 lbs.", "th-TH":"ไอศกรีมเค้กมะม่วงอกร่องทอง 3 ปอนด์"}, "offerdescription":{"en-US":"Ice cream cake 3 lbs. with Mango Oak-Rong-Thong flavor decorated with pandan sticky rice, almond, white chocolate flakes and look choop.", "th-TH":"ไอศกรีมเค้ก 3 ปอนด์ รสมะม่วงอกร่องทอง ท็อปด้วยข้าวเหนียวใบเตยหอมและลูกชุบมะม่วงหอมกลิ่นอบควันเทียน พร้อมอร่อยกรุบกรอบกับอัลมอนด์และไวท์ช็อกโกแลต"}}]
                Streaming:
                  value: [{"unicitykey":"5GXCLUSIVE_TRIAL6M_BPN_RC_EVG_REG", "offertype":"STREAMING", "objecttype":"SUBSCRIPTION", "title":{"en":"True 5G Xclusive", "th":"ทรู 5G เอ็กซ์คลูซีฟ"}, "products":[{"items":[{"productcode":"5GXCLUSIVE_TRIAL6M_BPN_RC_EVG_REG", "productgroup":"5GXCLUSIVE"}]}], "pricing":{"prices":[{"currencycode":"THB", "crossedoutprice":0.0, "sellingprice":9900.0, "paymentmode":"dcb", "platformcode":"android"}, {"currencycode":"THB", "crossedoutprice":0.0, "sellingprice":9900.0, "paymentmode":"wallet", "platformcode":"android"}, {"currencycode":"THB", "crossedoutprice":0.0, "sellingprice":9900.0, "paymentmode":"card", "platformcode":"android"}]}, "medias":[{"url":"https://cms.dmpcdn.com/subscription/V1/5GXclusive3_L.jpg", "languagecode":"en"}, {"url":"https://cms.dmpcdn.com/subscription/V1/5GXclusive3_M.jpg", "languagecode":"en"}, {"url":"https://cms.dmpcdn.com/subscription/V1/5GXclusive3_S.jpg", "languagecode":"en"}, {"url":"https://cms.dmpcdn.com/subscription/V1/5GXclusive3_L.jpg", "languagecode":"th"}, {"url":"https://cms.dmpcdn.com/subscription/V1/5GXclusive3_M.jpg", "languagecode":"th"}, {"url":"https://cms.dmpcdn.com/subscription/V1/5GXclusive3_S.jpg", "languagecode":"th"}], "status":"Published", "startdate":"2022-03-02T03:20:19.000Z", "enddate":"2032-01-05T03:00:00.000Z", "createdate":"2022-10-20T18:42:33.924Z", "updatedate":"2022-10-20T18:42:33.924Z", "offerid":"1a1a1d89300f47bd90d2f04db4db4230", "subscription":{"ispublic":false, "isactive":true, "isaddon":false, "isautorenewable":false, "allowedplatforms":[], "applicationcodes":["HBTV", "LG_SMTV", "OTT_ANRDTV_APP", "OTT_APP", "PARTNER_ORDER", "SAMSUNG_SMTV", "TRUEID_APP", "TRUEID_IOS_APP", "TRUEID_WEB", "TRUEID_HARMONYOS_APP"], "contentid":"X4vlge8E2d95", "contenttype":"collection", "contentcode":"X4vlge8E2d95", "sequence":2, "mincontractperiod":{"period":"99", "typology":"Y"}, "trialperiod":{"period":"6", "typology":"M"}, "contractperiod":{"period":"99", "typology":"Y"}, "partnercode":"TDG", "groupname":"5GXCLUSIVE", "maxtickets":0, "serviceperiod":30, "billingperiod":"M", "customergroup":["all"], "category":"livetv", "benefits":[{"sequence":1, "lines":[{"line":{"th":"รับชมคอนเทนต์พิเศษมากมาย ราคาพิเศษ", "en":"Exclusive contents Special price"}}, {"line":{"th":"คอนเทนต์เอ็กซ์คลูซีฟหลากหลายจากศิลปินดัง", "en":"Famous stars and original contents"}}]}, {"sequence":2, "lines":[{"line":{"th":"ทรู 5G อิมเมอร์ซีฟ XR/VR 360°", "en":"True 5G Immersive XR/VR 360° View"}}, {"line":{"th":"ประสบการณ์รับชมใหม่บนทรูไอดีแอพพลิเคชั่นและเว็ปไซต์", "en":"Enjoy new experience on TrueID Application & Website"}}]}]}, "description":[{"lines":[{"line":{"th":"รายเดือน", "en":"Monthly"}}]}, {"lines":[{"line":{"th":"ตัดเงินอัตโนมัติ 99 บาท/เดือน สามารถยกเลิกได้ตลอดเวลา", "en":"You will be charged ฿99/month. Cancel anytime."}}]}]}]
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Offer'
        "401":
          description: The resource requires authentication, which was not supplied with the request
          content: {}

  /offer/delete/{offerid}:
    post:
      tags:
        - Offer Service
      description: |
        This service is used to delete an offer.
      operationId: Offer Delete
      parameters:
        - name: offerid
          in: path
          required: true
          description: Offer identifier
          schema:
            type: string
      responses:
        "200":
          description:
            The request is correctly processed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResultCode'
        "401":
          description: The resource requires authentication, which was not supplied
            with the request
          content: {}
      x-codegen-request-body-name: request

  /product/publish:
    post:
      tags:
        - Product Service
      operationId: Product Publish
      description: |
        This service is used to pull products to publish.
      requestBody:
        description: Product request object
        content:
          application/json:
            examples:
              Product Code:
                value: {"unicitykey": "TVSTID"}
              Simple Products:
                value: {"typology": "simple"}
              Group Products:
                value: {"typology": "grouped"}
              Studios:
                value: {"studios": ["Tiga"]}
            schema:
              $ref: '#/components/schemas/ProductRequest'
        required: true
      responses:
        "200":
          description: List of published product
          content:
            application/json:
              examples:
                Product:
                  value: [{"unicitykey":"TVSTID", "title":{"en":"TVS product subscriptkon", "th":"TVS product subscription"}, "description":{"en":"Level up your enjoy with cartoon,  variety show,  documentary"}, "status":"Published", "structure":{"countrycode":"TH", "partnercode":"TDG", "merchandcode":"TDG"}, "properties":{"collection":"ONLINE", "sequence":"2", "ranking":0, "groupcode":"EPL", "accountingcode":"0640000022"}, "content":{"maxccu":2, "ispublic":false, "sequence":2}, "productid":"b27a0b3a0e314eb0a38beb499683845a", "highlightshelf":{"image":"98isoejr", "trailer":"jfs9fjoi"}, "termcond":{"image":"https://cms.dmpcdn.com/subscription/V1/NowPre_S.jpg", "pdf":"https://cms.dmpcdn.com/subscription/V1/NowPre_L.jpg"}, "privatepolicy":"8si712ij", "banner":{"portrait":"https://cms.dmpcdn.com/subscription/V1/NowPre_S.jpg", "landscape":"https://cms.dmpcdn.com/subscription/V1/NowPre_L.jpg"}, "benfefits":[{"lines":[{"line":{"th":"Level up your enjoy"}}, {"line":{"en":"UCL/LaLiga/LIGUE"}}]}, {"lines":[{"line":{"en":"Enjoy EPL Matches"}}, {"line":{"en":"Level up your enjoy with cartoon,  variety show,  documentary"}}]}, {"lines":[{"line":{"en":"380"}}]}], "logo":{"sizes":"https://cms.dmpcdn.com/subscription/V1/NowPre_S.jpg", "sizel":"https://cms.dmpcdn.com/subscription/V1/NowPre_L.jpg"}, "ispublic":true}]
                Group:
                  value: [{"productid":"df8e91fd5c3b4b4e9313a2292b2e4cff", "unicitykey":"TVSNOW", "title":{"en":"True Visions Now", "th":"ทรูวิชันส์ นาว"}, "status":"Published", "codification":{"typology":"grouped"}, "properties":{"sequence":3, "baseprice":119.0}, "content":{"isactive":true}, "benefits":[{"lines":[{"line":{"th":"3 แพ็กเกจ: Lite/ Standard/ Premium", "en":"3 packages: Lite Standard Premium"}}]}, {"lines":[{"line":{"th":"ดูสด UCL Laliga หนัง ซีรีส์ การ์ตูน", "en":"Live UCL /Movies Series/ Cartoon"}}]}]}, {"productid":"e9bbcfd732714cbbb119f52731df17e8", "unicitykey":"TIDTVS", "title":{"en":"Combo", "th":"คอมโบ"}, "status":"Published", "codification":{"typology":"grouped"}, "properties":{"sequence":10}, "content":{"isactive":true}, "benefits":[{"lines":[{"line":{"th":"ช่องรายการดังและคอนเทนต์หลากหลาย", "en":"Live TV + On demand"}}]}, {"lines":[{"line":{"th":"มากกว่า 2, 000 โปรแกรมให้เลือกดู", "en":"+ 2, 000 Hit Content"}}]}]}]
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Product'
        "401":
          description: The resource requires authentication, which was not supplied with the request
          content: {}

  /promotion/upsert:
    post:
      tags:
        - Promotion Service
      description: |
        This service is used to create or update a promotion. If the promotionid field is filled, the service will search the concerned promotion and update it.

        In case of update, the promotion stored is the database is replaced by the input promotion is the request. No merge is done.

        If pomotionid is not filled or filled but not found, a new promotion is created.

      operationId: Promotion Upsert
      requestBody:
        description: Request query object
        content:
          application/json:
            examples:
              Telecom:
                description: |
                  Promotion for any basket having an offer EPL-LIVETV, will get a 20% Off on this offer.
                value: {"promotionid":"d6489a5bcd4b4ae69b80a23ff2a1886e", "unicitykey":"EPL Early birds", "usagelimit":"Voucher", "startdate":"2020-05-14T22:00:00.000Z", "enddate":"2020-06-30T21:59:00.000Z", "status":"Published", "rules":[{"ruleID":"47df9560-49be-4185-812b-9025b4cf82d3", "salience":6567, "conditions":[{"conditionid":"0d44bc4c-506a-43c1-bb68-019d5091f11a", "conditionlabel":"EPL Live", "parameter1":"Offer", "parameter8":[{"attribute":"offercode", "value":"EPL-LIVETV", "quantity":1}]}], "behaviours":[{"behaviourid":"7715175a-fa2e-4360-adaf-40e74fc86cd8", "behaviourlabel":"20OFF", "parameter1":"LineDiscountPercent", "parameter2":"20"}], "description":"EPLLive-Rule"}], "title":"EPL Early birds during ECL finals", "priority":140, "combinablepromo":false, "combinablecop":false, "commissiondiscountprice":false, "salience":6567}
              Retail:
                description: |
                  Promotion for a basket containing offer code = 2WS1, once the purchase is done, use the template EMAIL-FOODTHAI-VOUCHER to email a single-use code of the campaign FOOD33PERCENT
                value: {"promotionid":"0e173f52135f484a83f597f78332f87a", "tenantid":"a6ca93d74c284a1bad47c04191af1188", "voucherIdCode":"a4490432ba52412e910c8da50bd08a84", "startdate":"2019-10-31T23:00:00.000Z", "enddate":"2020-05-30T16:19:00.000Z", "status":"Published", "rules":[{"ruleID":"14e3b5ba-dff6-468a-9f6f-1b1d7db207de", "salience":3467, "conditions":[{"conditionid":"9744d16a-8885-4bd5-87bc-da07bc5f1424", "conditionlabel":"2WS1 Offer", "parameter1":"Offer", "parameter8":[{"attribute":"offercode", "value":"2WS1", "quantity":1}]}], "behaviours":[{"behaviourid":"e5aeff12-cf57-45a7-91be-fe4ec690a18e", "behaviourlabel":"Send Coupon", "parameter1":"DeferredEmailTemplate", "parameter2":"FOOD33PERCENT", "parameter3":"EMAIL-FOODTHAI-VOUCHER"}], "description":"YearlyPayment"}], "title":"Promotion - Send a coupon for 2WS1", "priority":1, "combinablepromo":true, "combinablecop":false, "commissiondiscountprice":false, "salience":3467}
            schema:
              $ref: '#/components/schemas/Promotion'
        required: true
      responses:
        200:
          description:
            .
          content:
            application/json:
              examples:
                Telecom:
                  description: |
                    Promotion for any basket having an offer EPL-LIVETV, will get a 20% Off on this offer.
                  value: {"promotionid":"d6489a5bcd4b4ae69b80a23ff2a1886e", "unicitykey":"EPL Early birds", "usagelimit":"Voucher", "startdate":"2020-05-14T22:00:00.000Z", "enddate":"2020-06-30T21:59:00.000Z", "status":"Published", "rules":[{"ruleID":"47df9560-49be-4185-812b-9025b4cf82d3", "salience":6567, "conditions":[{"conditionid":"0d44bc4c-506a-43c1-bb68-019d5091f11a", "conditionlabel":"EPL Live", "parameter1":"Offer", "parameter8":[{"attribute":"offercode", "value":"EPL-LIVETV", "quantity":1}]}], "behaviours":[{"behaviourid":"7715175a-fa2e-4360-adaf-40e74fc86cd8", "behaviourlabel":"20OFF", "parameter1":"LineDiscountPercent", "parameter2":"20"}], "description":"EPLLive-Rule"}], "title":"EPL Early birds during ECL finals", "priority":140, "combinablepromo":false, "combinablecop":false, "commissiondiscountprice":false, "salience":6567}
                Retail:
                  description: |
                    Promotion for a basket containing offer code = 2WS1, once the purchase is done, use the template EMAIL-FOODTHAI-VOUCHER to email a single-use code of the campaign FOOD33PERCENT
                  value: {"promotionid":"0e173f52135f484a83f597f78332f87a", "tenantid":"a6ca93d74c284a1bad47c04191af1188", "voucherIdCode":"a4490432ba52412e910c8da50bd08a84", "startdate":"2019-10-31T23:00:00.000Z", "enddate":"2020-05-30T16:19:00.000Z", "status":"Published", "rules":[{"ruleID":"14e3b5ba-dff6-468a-9f6f-1b1d7db207de", "salience":3467, "conditions":[{"conditionid":"9744d16a-8885-4bd5-87bc-da07bc5f1424", "conditionlabel":"2WS1 Offer", "parameter1":"Offer", "parameter8":[{"attribute":"offercode", "value":"2WS1", "quantity":1}]}], "behaviours":[{"behaviourid":"e5aeff12-cf57-45a7-91be-fe4ec690a18e", "behaviourlabel":"Send Coupon", "parameter1":"DeferredEmailTemplate", "parameter2":"FOOD33PERCENT", "parameter3":"EMAIL-FOODTHAI-VOUCHER"}], "description":"YearlyPayment"}], "title":"Promotion - Send a coupon for 2WS1", "priority":1, "combinablepromo":true, "combinablecop":false, "commissiondiscountprice":false, "salience":3467}
              schema:
                $ref: '#/components/schemas/Promotion'
        401:
          description: The resource requires authentication, which was not supplied
            with the request
          content: {}
      x-codegen-request-body-name: request

  /promotion/set:
    post:
      tags:
        - Promotion Service
      description: |
        This service is used to create a new promotion.
      operationId: Promotion Set
      requestBody:
        description: Request query object
        content:
          application/json:
            examples:
              Telecom:
                description: |
                  Promotion for any basket having an offer EPL-LIVETV, will get a 20% Off on this offer.
                value: {"unicitykey":"EPL Early birds", "usagelimit":"Voucher", "startdate":"2020-05-14T22:00:00.000Z", "enddate":"2020-06-30T21:59:00.000Z", "status":"Published", "rules":[{"ruleID":"47df9560-49be-4185-812b-9025b4cf82d3", "salience":6567, "conditions":[{"conditionid":"0d44bc4c-506a-43c1-bb68-019d5091f11a", "conditionlabel":"EPL Live", "parameter1":"Offer", "parameter8":[{"attribute":"offercode", "value":"EPL-LIVETV", "quantity":1}]}], "behaviours":[{"behaviourid":"7715175a-fa2e-4360-adaf-40e74fc86cd8", "behaviourlabel":"20OFF", "parameter1":"LineDiscountPercent", "parameter2":"20"}], "description":"EPLLive-Rule"}], "title":"EPL Early birds during ECL finals", "priority":140, "combinablepromo":false, "combinablecop":false, "commissiondiscountprice":false, "salience":6567}
              Retail:
                description: |
                  Promotion for a basket containing offer code = 2WS1, once the purchase is done, use the template EMAIL-FOODTHAI-VOUCHER to email a single-use code of the campaign FOOD33PERCENT
                value: {"startdate":"2019-10-31T23:00:00.000Z", "enddate":"2020-05-30T16:19:00.000Z", "status":"Published", "rules":[{"ruleID":"14e3b5ba-dff6-468a-9f6f-1b1d7db207de", "salience":3467, "conditions":[{"conditionid":"9744d16a-8885-4bd5-87bc-da07bc5f1424", "conditionlabel":"2WS1 Offer", "parameter1":"Offer", "parameter8":[{"attribute":"offercode", "value":"2WS1", "quantity":1}]}], "behaviours":[{"behaviourid":"e5aeff12-cf57-45a7-91be-fe4ec690a18e", "behaviourlabel":"Send Coupon", "parameter1":"DeferredEmailTemplate", "parameter2":"FOOD33PERCENT", "parameter3":"EMAIL-FOODTHAI-VOUCHER"}], "description":"YearlyPayment"}], "title":"Promotion - Send a coupon for 2WS1", "priority":1, "combinablepromo":true, "combinablecop":false, "commissiondiscountprice":false, "salience":3467}
            schema:
              $ref: '#/components/schemas/PromotionCreate'
        required: true
      responses:
        200:
          description:
            .
          content:
            application/json:
              examples:
                Telecom:
                  description: |
                    Promotion for any basket having an offer EPL-LIVETV, will get a 20% Off on this offer.
                  value: {"promotionid":"d6489a5bcd4b4ae69b80a23ff2a1886e", "unicitykey":"EPL Early birds", "usagelimit":"Voucher", "startdate":"2020-05-14T22:00:00.000Z", "enddate":"2020-06-30T21:59:00.000Z", "status":"Published", "rules":[{"ruleID":"47df9560-49be-4185-812b-9025b4cf82d3", "salience":6567, "conditions":[{"conditionid":"0d44bc4c-506a-43c1-bb68-019d5091f11a", "conditionlabel":"EPL Live", "parameter1":"Offer", "parameter8":[{"attribute":"offercode", "value":"EPL-LIVETV", "quantity":1}]}], "behaviours":[{"behaviourid":"7715175a-fa2e-4360-adaf-40e74fc86cd8", "behaviourlabel":"20OFF", "parameter1":"LineDiscountPercent", "parameter2":"20"}], "description":"EPLLive-Rule"}], "title":"EPL Early birds during ECL finals", "priority":140, "combinablepromo":false, "combinablecop":false, "commissiondiscountprice":false, "salience":6567}
                Retail:
                  description: |
                    Promotion for a basket containing offer code = 2WS1, once the purchase is done, use the template EMAIL-FOODTHAI-VOUCHER to email a single-use code of the campaign FOOD33PERCENT
                  value: {"promotionid":"0e173f52135f484a83f597f78332f87a", "tenantid":"a6ca93d74c284a1bad47c04191af1188", "voucherIdCode":"a4490432ba52412e910c8da50bd08a84", "startdate":"2019-10-31T23:00:00.000Z", "enddate":"2020-05-30T16:19:00.000Z", "status":"Published", "rules":[{"ruleID":"14e3b5ba-dff6-468a-9f6f-1b1d7db207de", "salience":3467, "conditions":[{"conditionid":"9744d16a-8885-4bd5-87bc-da07bc5f1424", "conditionlabel":"2WS1 Offer", "parameter1":"Offer", "parameter8":[{"attribute":"offercode", "value":"2WS1", "quantity":1}]}], "behaviours":[{"behaviourid":"e5aeff12-cf57-45a7-91be-fe4ec690a18e", "behaviourlabel":"Send Coupon", "parameter1":"DeferredEmailTemplate", "parameter2":"FOOD33PERCENT", "parameter3":"EMAIL-FOODTHAI-VOUCHER"}], "description":"YearlyPayment"}], "title":"Promotion - Send a coupon for 2WS1", "priority":1, "combinablepromo":true, "combinablecop":false, "commissiondiscountprice":false, "salience":3467}
              schema:
                $ref: '#/components/schemas/Promotion'
        401:
          description: The resource requires authentication, which was not supplied
            with the request
          content: {}
      x-codegen-request-body-name: request

  /promotion/search:
    post:
      tags:
        - Promotion Service
      description: |
        This service is used to search promotions.
      operationId: Promotion Search
      requestBody:
        description: Request query object
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PromotionRequest'
        required: true
      responses:
        200:
          description:
            .
          content:
            application/json:
              examples:
                Telecom:
                  description: |
                    Promotion for any basket having an offer EPL-LIVETV, will get a 20% Off on this offer.
                  value: [{"promotionid":"d6489a5bcd4b4ae69b80a23ff2a1886e", "unicitykey":"EPL Early birds", "usagelimit":"Voucher", "startdate":"2020-05-14T22:00:00.000Z", "enddate":"2020-06-30T21:59:00.000Z", "status":"Published", "rules":[{"ruleID":"47df9560-49be-4185-812b-9025b4cf82d3", "salience":6567, "conditions":[{"conditionid":"0d44bc4c-506a-43c1-bb68-019d5091f11a", "conditionlabel":"EPL Live", "parameter1":"Offer", "parameter8":[{"attribute":"offercode", "value":"EPL-LIVETV", "quantity":1}]}], "behaviours":[{"behaviourid":"7715175a-fa2e-4360-adaf-40e74fc86cd8", "behaviourlabel":"20OFF", "parameter1":"LineDiscountPercent", "parameter2":"20"}], "description":"EPLLive-Rule"}], "title":"EPL Early birds during ECL finals", "priority":140, "combinablepromo":false, "combinablecop":false, "commissiondiscountprice":false, "salience":6567}]
                Retail:
                  description: |
                    Promotion for a basket containing offer code = 2WS1, once the purchase is done, use the template EMAIL-FOODTHAI-VOUCHER to email a single-use code of the campaign FOOD33PERCENT
                  value: [{"promotionid":"0e173f52135f484a83f597f78332f87a", "tenantid":"a6ca93d74c284a1bad47c04191af1188", "voucherIdCode":"a4490432ba52412e910c8da50bd08a84", "startdate":"2019-10-31T23:00:00.000Z", "enddate":"2020-05-30T16:19:00.000Z", "status":"Published", "rules":[{"ruleID":"14e3b5ba-dff6-468a-9f6f-1b1d7db207de", "salience":3467, "conditions":[{"conditionid":"9744d16a-8885-4bd5-87bc-da07bc5f1424", "conditionlabel":"2WS1 Offer", "parameter1":"Offer", "parameter8":[{"attribute":"offercode", "value":"2WS1", "quantity":1}]}], "behaviours":[{"behaviourid":"e5aeff12-cf57-45a7-91be-fe4ec690a18e", "behaviourlabel":"Send Coupon", "parameter1":"DeferredEmailTemplate", "parameter2":"FOOD33PERCENT", "parameter3":"EMAIL-FOODTHAI-VOUCHER"}], "description":"YearlyPayment"}], "title":"Promotion - Send a coupon for 2WS1", "priority":1, "combinablepromo":true, "combinablecop":false, "commissiondiscountprice":false, "salience":3467}]
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Promotion'
        401:
          description: The resource requires authentication, which was not supplied
            with the request
          content: {}
      x-codegen-request-body-name: request

  /promotion/publish:
    post:
      tags:
        - Promotion Service
      operationId: Promotion Publish
      description: |
        This service informs the merchant about promontions (conditions and actions).
      requestBody:
        description: Request input
        content:
          application/json:
            examples:
              Offer Bundle:
                value: {"offercodes":["IQIYIVIP_0THB_TRIAL1M_NPN_RC_12M_ALA"]}
              Product Bundle:
                value: {"productcodes":["ITVSNOW"]}
              Business key:
                value: {"businesskeys":["OXFORD"]}
            schema:
              $ref: '#/components/schemas/PromotionPublishRequest'
        required: true
      responses:
        200:
          description: Response promotions list         .
          content:
            application/json:
              examples:
                Bundle of Subscriptions:
                  value: [{"promotionid":"14466c674f784ba7aaf7c509e74ce555", "haspromocode":false, "title":[{"languagecode":"en", "value":"Bundle of Subscription Discount 1"}], "startdate":"2022-08-09T14:51:00.000Z", "enddate":"2023-01-31T15:51:00.000Z", "rules":[{"conditions":{"subscriptions":[{"isinclusion":true, "attribute":"OFFER", "code":"IQIYIVIP_0THB_TRIAL1M_NPN_RC_12M_ALA", "subscriptiontype":"NEW"}, {"attribute":"OFFER", "code":"TRUEIDPLUS_BPN_RC_REG", "subscriptiontype":"ACTIVE"}]}, "behaviours":[{"discountname":"SubscriptionPercent", "isreverseprice":false, "offers":[{"attribute":"OFFER", "code":"TRUEIDPLUS_BPN_RC_REG", "ispercent":true, "discountvalue":5.0}, {"attribute":"OFFER", "code":"IQIYIVIP_0THB_TRIAL1M_NPN_RC_12M_ALA", "ispercent":true, "discountvalue":10.0}]}]}], "combinablepromo":true, "discountsellingprice":false}, {"promotionid":"0548b48918864e22898da41725c9fd4b", "haspromocode":false, "title":[{"languagecode":"en", "value":"Promotion Bundle of Offers"}], "startdate":"2020-12-27T15:08:00.000Z", "enddate":"2023-04-07T14:08:00.000Z", "rules":[{"conditions":{"offers":[{"offercode":"IQIYIVIP_0THB_NPN_RC_EVG_ALA", "quantity":1}, {"offercode":"EPLMINI_NPN_RC_EVG_REG", "quantity":1}]}, "behaviours":[{"discountname":"OfferDiscountPercent", "isreverseprice":false, "offers":[{"attribute":"IQIYIVIP_0THB_NPN_RC_EVG_ALA", "code":"OFFER", "ispercent":true, "discountvalue":20.0}]}]}], "combinablepromo":true, "discountsellingprice":false}]
                Bundle of Offers:
                  value: [{"promotionid":"0548b48918864e22898da41725c9fd4b", "haspromocode":false, "combinablepromo":true, "discountsellingprice":false, "title":[{"languagecode":"en", "value":"Promotion Bundle of Offers"}], "startdate":"2020-12-27T15:08:00.000Z", "enddate":"2023-04-07T14:08:00.000Z", "rules":[{"conditions":[{"offers":[{"offercode":"EPLMINI_NPN_RC_EVG_REG", "baseprice":4900.0, "quantity":1}, {"offercode":"IQIYIVIP_0THB_NPN_RC_EVG_ALA", "baseprice":45000.0, "quantity":1}]}], "behaviours":[{"discountname":"OfferDiscountPercent", "offers":[{"code":"IQIYIVIP_0THB_NPN_RC_EVG_ALA", "value":"OFFER", "ispercent":true, "discountvalue":20.0}]}]}]}]
                Bundle of Products:
                  value: [{"promotionid":"603e13757f33457990fd2b93ae681892", "businesscode":"OXFORD", "haspromocode":false, "combinablepromo":true, "discountsellingprice":false, "title":[{"segment":"FR", "languagecode":"fr", "value":"Composition de produits"}], "attributes":[], "startdate":"2022-10-01T22:00:00.000Z", "enddate":"2023-10-01T22:00:00.000Z", "rules":[{"conditions":[{"products":[{"productcode":"TVSNOW_TRIAL1M_BPN_RC_EVG_REG", "baseprice":11900.0, "quantity":1}, {"productcode":"ADKTVOD099_PNN_OC_30D_ALA", "baseprice":0.0, "quantity":1}]}], "behaviours":[{"discountname":"ProductDiscountAmount", "isreverseprice":false, "products":[{"datatype":"PRODUCT", "code":"TVSNOW", "ispercent":false, "quantity":1, "discountvalue":4000.0}, {"datatype":"PRODUCT", "code":"TVOD", "ispercent":false, "quantity":1, "discountvalue":3500.0}]}]}], "medias":[{"url":"https://api-dev.gridbees.com/medias/get?id=GDIH6000000001S", "rank":3, "originalname":"logo", "mediatype":"image", "languagecode":"th"}]}]
                Mixed example:
                  value: [{"promotionid":"14466c674f784ba7aaf7c509e74ce555", "title":{"en":"Bundle of Subscription Discount 1"}, "haspromocode":false, "combinablepromo":true, "discountsellingprice":false, "startdate":"2022-08-09T14:51:00.000Z", "enddate":"2023-01-31T15:51:00.000Z", "rules":[{"conditions":[{"subscriptions":[{"isinclusion":true, "datatype":"OFFER", "code":"IQIYIVIP_0THB_TRIAL1M_NPN_RC_12M_ALA", "subscriptiontype":"NEW", "baseprice":0.0}, {"isinclusion":true, "datatype":"OFFER", "code":"TRUEIDPLUS_BPN_RC_REG", "subscriptiontype":"ACTIVE", "baseprice":9900.0}]}], "behaviours":[{"discountname":"SubscriptionPercent", "offers":[{"code":"OFFER", "value":"TRUEIDPLUS_BPN_RC_REG", "ispercent":true, "discountvalue":5.0}, {"code":"OFFER", "value":"IQIYIVIP_0THB_TRIAL1M_NPN_RC_12M_ALA", "ispercent":true, "discountvalue":10.0}]}]}]}, {"promotionid":"0548b48918864e22898da41725c9fd4b", "title":{"en":"Bundle of Offers For Streaming and specific vendors"}, "haspromocode":false, "combinablepromo":true, "discountsellingprice":false, "startdate":"2020-12-27T15:08:00.000Z", "enddate":"2023-04-07T14:08:00.000Z", "rules":[{"conditions":[{"vendorcodes":["408TRCODE"], "offertypes":[{"offercode":"STREAMING", "quantity":2}], "offers":[{"offercode":"EPLMINI_NPN_RC_EVG_REG", "baseprice":4900.0, "quantity":1}, {"offercode":"IQIYIVIP_0THB_NPN_RC_EVG_ALA", "baseprice":0.0, "quantity":1}]}], "behaviours":[{"discountname":"OfferDiscountPercent", "offers":[{"code":"IQIYIVIP_0THB_NPN_RC_EVG_ALA", "value":"OFFER", "ispercent":true, "discountvalue":20.0}]}]}], "medias":[{"url":"https://api-dev.gridbees.com/medias/get?id=GDIH6000000001S", "rank":0, "originalname":"", "mediatype":"MOn nom", "languagecode":"ru"}]}, {"promotionid":"603e13757f33457990fd2b93ae681892", "title":{"fr":"Composition de produits", "en":"Bundle of offers"}, "businesskey":"OXFORD", "haspromocode":false, "combinablepromo":true, "discountsellingprice":false, "startdate":"2022-10-01T22:00:00.000Z", "enddate":"2023-10-01T22:00:00.000Z", "rules":[{"conditions":[{"products":[{"productcode":"TVSNOW_TRIAL1M_BPN_RC_EVG_REG", "quantity":1}, {"productcode":"ADKTVOD099_PNN_OC_30D_ALA", "quantity":1}]}], "behaviours":[{"discountname":"ProductDiscountAmount", "isreverseprice":false, "products":[{"datatype":"PRODUCT", "code":"TVSNOW", "ispercent":false, "quantity":1, "discountvalue":4000.0}, {"datatype":"PRODUCT", "code":"TVOD", "ispercent":false, "quantity":1, "discountvalue":3500.0}]}]}], "medias":[{"url":"https://api-dev.gridbees.com/medias/get?id=GDIH6000000001S", "rank":3, "originalname":"logo", "mediatype":"image", "languagecode":"th"}]}]
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/PublishedPromotion'
        401:
          description: The resource requires authentication, which was not supplied
            with the request
          content: {}
      x-codegen-request-body-name: request

  /promotion/delete/{promotionid}:
    get:
      tags:
        - Promotion Service
      description: |
        This service is used to delete a promotion. If the promotion was already loaded, the pricing service will unload the deleted promotion.
      operationId: Promotion Delete
      responses:
        200:
          description:
            The request is correctly processed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResultCode'
        401:
          description: The resource requires authentication, which was not supplied
            with the request
          content: {}
      x-codegen-request-body-name: request

  /valorization/valorize:
    post:
      tags:
        - Pricing Service
      description: |
        This service is used to calculate all prices of a basket.
        The service discards all input prices coming within the request and set all known prices inside the basket. If a price hasn’t been found, the service returns an error.
        The input basket is controlled before to be valorized. The checklist is:
        -  existence of at least one basket line
        -  each basket line must have a unique offer identifier, and the offer is published
        -  the requested quantity is a positive value
        -   if a vendor exists and not blocked
        -  Check the validity of the promocode if given

        The service set the price:
        -  for each offer of the basket
        -  for each additionnal services attached to the offers

        If for a basket line, many prices exist due to for example a typology of price (National price, local, advertising price, …), the service applies the business logic to find the good price.

        Once all prices and all checks are OK, the service applies all active promotions on the basket.
        An active promotion, is published promotion such as the period include the submission date of the basket.

        Promotions are divided into:
        -  a list of conditions (minimum of basket amount, a specific product, ..)
        -  a list of benefits (discount in percentage, added offer, discount on delivery fees, …)

        If for a given active promotion, the basket satisfies all the conditions, then all the benefits are applied to the basket.
        At the end, the service calculates some hash control to guaranty the prices won’t be altered.
        The hash is stored in the amount node of the basket and each lines.
        If you use Gridbees Booking service, those hash will be recalculated by the booking service.
        The value of the hash in the request will be compared with the value obtained by the booking service.

        The service uses these fields to create the hash:
        - amount.grossamount
        - amount.netamount
        - amount.commissionamount
        - amount.totaltopay
        - amount.totaltorefund
        - amount.discountamount
        - amount.additionalserviceamount
        - amount.additionalassemblyamount
        - amount.additionalrecoveryamount
        - amount.feesdiscountamount
        - amount.discountamount
        - amount.adjustedamount
        - amount.fees
        - ordertracking .vendorcode
        - line.offerid
        - line.quantity
        - line.offerbookingdate
        - line.offerbookinghour

        The service uses the algorithm SHA-256 to generate the hash by adding a secret key.

        <table id="t01">
        <caption>Pricing Error Codes</caption>
        <tr>
        <th>Error Code</th>
        <th>Description</th>
        </tr>
        <tr>
        <td>PROMONOTMARKET</td>
        <td>The promotion code doesn’t exist in the market</td>
        </tr>
        <tr>
        <td>PROMOEXPIRED</td>
        <td>Promotion code expired</td>
        </tr>
        <tr>
        <td>PROMONOTEXISTS</td>
        <td>Promotion code not exists</td>
        </tr>
        <tr>
        <td>PROMONOTPUPLISHED</td>
        <td>Promotion not published</td>
        </tr>
        <tr>
        <td>VOUCHEREXPIRED</td>
        <td>Coupon code is expired</td>
        </tr>
        <tr>
        <td>VOUCHERUSED</td>
        <td>Coupon code is already burned</td>
        </tr>
        <tr>
        <td>OFFERNOTEXIST</td>
        <td>Offer not exists</td>
        </tr>
        <tr>
        <td>PRICENOTFOUND</td>
        <td>Offer exists but the price isn’t found</td>
        </tr>
        <tr>
        <td>PROMOCODENOTSATISFIED</td>
        <td>Promotion code is valid, but not all the conditions are satisfied</td>
        </tr>
        <tr>
        <td>PAYMENTMODECHANGED</td>
        <td>The merchant payment mode has changed </td>
        </tr>
        <tr>
        <td>VENDORNOTEXIST</td>
        <td>Vendor not exists</td>
        </tr>
        <tr>
        <td>VENDORBLOCKED</td>
        <td>Vendor is blocked</td>
        </tr>

        <tr>
        <td>PAYMENTISPENDING</td>
        <td>Payment is pending</td>
        </tr>
        <tr>
        <td>ORDERNOTFOUND</td>
        <td>Order not found for the cancellation</td>
        </tr>
        </table>


      operationId: Valorization Valorize
      requestBody:
        description: Request basket
        content:
          application/json:
            examples:
              retail:
                value: {"identifier":{"structure":{"countrycode":"th", "companycode":"TDG"}}, "ordertracking":{"orderchannel":"TV"}, "amount":{"fees": 10.0}, "lines":[{"linenum":1, "offerid":"2b9e72d61cfe4d3387b445dba842cd60", "quantity":3, "amount":{"fees":10.0}, "offercodification":{"vendorcode":"SW", "platformcode":"OTT_APP"}, "options":[{"unicitykey":"15332", "optiondetails":[{"unicitykey":"576"}]}]}]}
              telecom:
                value: {"profile":{"usersubcriptions":[{"isactive":true, "startdate":"2021-12-13T16:03:33.646Z", "offercode":"TRUEIDPLUS_BPN_RC_REG", "productcode":"TRUEIDPLUS"}]}, "identifier":{"structure":{"countrycode":"TH"}}, "lines":[{"linenum":1, "offerid":"eeb9f4a6aa9348b48456ac55d3f1dc47", "offercode":"IQIYIVIP_0THB_TRIAL1M_NPN_RC_12M_ALA", "quantity":1}]}
            schema:
              $ref: '#/components/schemas/BasketRequest'
        required: true
      responses:
        "200":
          description:
            You need to check basketdetails.status to know if your request is successful or not.
          content:
            application/json:
              examples:
                retail:
                  value: {"identifier":{"structure":{"blcode":"TDG", "countrycode":"TH", "marketcode":"BANGKOK"}}, "ordertracking":{"emitterid":"GUI", "orderchannel":"CALLCENTER"}, "promotionenddate":[{"attribute":"EndDateDeliveryFees", "value":"2023-01-01T14:04:00.000Z"}, {"attribute":"EndDateBasketLine", "value":"2023-01-01T14:46:00.000Z"}], "basketrules":[{"linenum":0, "rulename":"FeesDiscountPercent", "discountamount":50, "priorityrule":{"promotionid":"b7d2a0714abf4758abb1b6b31acb9412", "promotiontype":"PROMO_FEES_LEVEL", "enddate":"2023-01-01T14:04:00.000Z", "combinablepromo":true, "discountsellingprice":false, "haspromocode":false, "commissiondiscountprice":false, "promotionname":"TDG - Free Shipping (basket > 410THB)", "isreverseprice":false, "isforwallet":false, "loyaltycode":"", "startdate":"2022-01-01T14:04:00.000Z"}}, {"linenum":0, "rulename":"FeesDiscountPercent", "discountamount":50, "priorityrule":{"promotionid":"7c21408780ea41f599105fa89a9319e3", "promotiontype":"PROMO_FEES_LEVEL", "enddate":"2023-10-09T12:36:00.000Z", "combinablepromo":true, "discountsellingprice":false, "haspromocode":false, "commissiondiscountprice":false, "promotionname":"TDG - Free shipping (shipping zone = BKK)", "isreverseprice":false, "isforwallet":false, "loyaltycode":"", "startdate":"2021-09-03T12:36:00.000Z"}}, {"linenum":0, "rulename":"BasketDiscountPercent", "discountamount":60, "priorityrule":{"promotionid":"961dc891bafa43bfa44e6c7803416848", "promotiontype":"PROMO_BASKET_LEVEL", "enddate":"2023-01-01T14:46:00.000Z", "combinablepromo":true, "discountsellingprice":false, "haspromocode":false, "commissiondiscountprice":false, "promotionname":"TDG - 10% off (basket > 300 THB)", "isreverseprice":false, "isforwallet":false, "loyaltycode":"", "startdate":"2022-01-01T14:46:00.000Z"}}, {"linenum":0, "rulename":"GlobalFeesAmount", "discountamount":50}, {"linenum":0, "rulename":"LineFeesAmount", "discountamount":50}], "amount":{"currency":"THB", "grossamount":600, "netamount":540, "totaltopay":600, "discountamount":60, "feesdiscountamount":50, "hashamount":"795e3acf78569f281981621c348470a7db250d30cd9487403184db39027c776e"}, "deliverydetail":{"deliverynetwork":"BANGKOK", "deliveryaddress":{"usage":"", "isactive":true, "city":"Phra Khanong", "postalcode":"10260"}}, "shippingdetails":[{"code":"7646bfbc66614e06a38fa6d2751b48ca", "offerids":["3efd3ccbe8e0454a9cd43fb55ea85f3b"], "fees":{"method":"EXPRESS", "price":50}, "availablemethods":[{"method":"EXPRESS", "price":50}, {"method":"OPTIMUM", "price":45}]}], "lines":[{"linenum":0, "referencecode":"HAA500", "offercode":"HAA500", "offerid":"3efd3ccbe8e0454a9cd43fb55ea85f3b", "linestatus":0, "quantity":5, "amount":{"currency":"THB", "grossamount":600, "netamount":600, "totaltopay":600, "additionalserviceamount":0, "additionalassemblyamount":0, "additionalrecoveryamount":0, "feesdiscountamount":50, "fees":0, "hashamount":"659d670fbd34a3448f163f1b3568d5001a2044acbc9dba32151237f8720acc51"}, "crossedoutprice":0, "sellingprice":120, "promotionenddate":[{"attribute":"EndDateDeliveryFees", "value":"2022-05-03T03:35:10.232Z"}], "additionalservices":[{"servicetype":"shipping", "code":"EXPRESS", "reference":"", "price":50, "quantity":1}, {"servicetype":"shipping", "code":"OPTIMUM", "reference":"", "price":45, "quantity":0}], "parcel":{"code":"7646bfbc66614e06a38fa6d2751b48ca", "deliverymethod":"EXPRESS"}, "productitems":[{"productcode":"200", "itemnumid":"200", "quantity":1}, {"productcode":"PACK_5G", "itemnumid":"PACK_5G", "quantity":0}]}], "basketdetails":{"status":"OK"}, "suggestions":[{"promotionid":"258ba5adead546659c0d97b6c03ddfcc", "promotionname":"TDG - Voucher discount - Serialized coupons", "conditionid":"21eda420-a63c-418e-a3e9-067c0f098b23", "conditiontype":"BasketAmount", "expected":">= 1000.00", "combinable":false, "priority":8213, "issuccess":false, "comment":">= 1000.00"}, {"promotionid":"22a4a8954c924ec6918e87ea1f9124eb", "promotionname":"TDG - Free Drink Coca Cola for Birthday", "conditionid":"c7b1dee9-0164-4f25-9101-d7f0be1d18e3", "conditiontype":"Birthday", "expected":"Birthday=yyyy-MM-dd", "combinable":true, "priority":8020, "issuccess":false, "comment":"Birthday=yyyy-MM-dd"}, {"promotionid":"098c9809bb0144f885f53c9444546c2f", "promotionname":"TDG - BOGO", "conditionid":"76eeabd5-6bc5-48a2-a04b-791892de96f0", "conditiontype":"Offer", "expected":"offercode=MARTDG", "combinable":true, "priority":5754, "issuccess":false, "comment":"offercode=MARTDG"}, {"promotionid":"961dc891bafa43bfa44e6c7803416848", "promotionname":"TDG - 10% off (basket > 300 THB)", "combinable":true, "priority":4934, "issuccess":true}, {"promotionid":"7c21408780ea41f599105fa89a9319e3", "promotionname":"TDG - Free shipping (shipping zone = BKK)", "combinable":true, "priority":3753, "issuccess":true}, {"promotionid":"9d6e049da9cf44e38e8438e65c8a3db3", "promotionname":"TDG - Free delivery - (previous purchase)", "conditionid":"17943203-83d9-43b2-bce8-2b6c3d02b933", "conditiontype":"LastPurchase", "expected":"LastPurchase <=   1 MONTH", "combinable":true, "priority":2033, "issuccess":false, "comment":"LastPurchase <=   1 MONTH"}, {"promotionid":"b7d2a0714abf4758abb1b6b31acb9412", "promotionname":"TDG - Free Shipping (basket > 410THB)", "combinable":true, "priority":1170, "issuccess":true}]}
                telecom:
                  value: {"profile":{"usersubcriptions":[{"startdate":"2021-12-13T16:03:33.646Z", "isactive":true, "offercode":"TRUEIDPLUS_BPN_RC_REG", "productcode":"TRUEIDPLUS"}]}, "identifier":{"structure":{"countrycode":"TH"}}, "basketrules":[{"linenum":1, "offerid":"eeb9f4a6aa9348b48456ac55d3f1dc47", "rulename":"SubscriptionPercent", "discountamount":4500.0, "priorityrule":{"promotionid":"14466c674f784ba7aaf7c509e74ce555", "promotiontype":"PROMO_LINE_LEVEL", "enddate":"2023-01-31T15:51:00.000Z", "combinablepromo":true, "discountsellingprice":true, "haspromocode":false, "commissiondiscountprice":false, "promotionname":"Bundle of Subscription Discount 1", "isreverseprice":false, "isforwallet":false, "loyaltycode":"", "startdate":"2022-08-09T14:51:00.000Z"}}, {"linenum":0, "rulename":"SubscriptionPercent", "discountamount":0.0, "priorityrule":{"promotionid":"14466c674f784ba7aaf7c509e74ce555", "promotiontype":"PROMO_LINE_LEVEL", "enddate":"2023-01-31T15:51:00.000Z", "combinablepromo":true, "discountsellingprice":true, "haspromocode":false, "commissiondiscountprice":false, "promotionname":"Bundle of Subscription Discount 1", "isreverseprice":false, "isforwallet":false, "loyaltycode":"", "startdate":"2022-08-09T14:51:00.000Z"}}, {"linenum":0, "rulename":"GlobalFeesAmount", "discountamount":0.0}], "amount":{"currency":"EUR", "grossamount":45000.0, "netamount":40500.0, "totaltopay":40500.0, "hashamount":"c13173c9f4a6d4cd4d10da79e5005c213fe2bfd5afc9e50e95e66b4109ea2739"}, "lines":[{"linenum":1, "referencecode":"IQIYIVIP_0THB_TRIAL1M_NPN_RC_12M_ALA", "offercode":"IQIYIVIP_0THB_TRIAL1M_NPN_RC_12M_ALA", "offerid":"eeb9f4a6aa9348b48456ac55d3f1dc47", "quantity":1, "amount":{"currency":"EUR", "grossamount":45000.0, "netamount":40500.0, "totaltopay":40500.0, "discountamount":4500.0, "additionalserviceamount":0.0, "additionalassemblyamount":0.0, "additionalrecoveryamount":0.0, "hashamount":"b9b61cb5733516d23acd6ab74658e4e784c293cf7f1a058d81ab8e0e1ad5141a"}, "crossedoutprice":0.0, "sellingprice":45000.0, "promotionenddate":[{"attribute":"EndDateBasketLine", "value":"2023-01-31T15:51:00.000Z"}], "additionalservices":[]}], "basketdetails":{"status":"OK"}, "suggestions":[{"promotionid":"0548b48918864e22898da41725c9fd4b", "promotionname":"Promotion Bundle of Offers", "conditionid":"75721a64-4eaf-4009-9ae8-d5126981d75c", "conditiontype":"Offer", "expected":"offercode=IQIYIVIP_0THB_NPN_RC_EVG_ALA, offercode=EPLMINI_NPN_RC_EVG_REG", "combinable":true, "priority":5001, "issuccess":false, "comment":"offercode=IQIYIVIP_0THB_NPN_RC_EVG_ALA, offercode=EPLMINI_NPN_RC_EVG_REG"}]}
              schema:
                $ref: '#/components/schemas/BasketResponse'
        "401":
          description: The resource requires authentication, which was not supplied
            with the request
          content: {}
      x-codegen-request-body-name: request

  /booking/availabilities:
    post:
      tags:
        - Booking Service
      description: |
        This service is used to refresh the theoretical stocks of the suppier for a given period

      operationId: Booking Availabilities
      requestBody:
        description:
          The period is defined by a stardate and an endate parameters. You an refine the request for a given list of offercode.
        content:
          application/json:
            examples:
              retail:
                value: {}

            schema:
              $ref: '#/components/schemas/AvailabilitiesRequest'
        required: true

      responses:
        "200":
          description: Availabilities response
          content:
            application/json:
              examples:
                retail:
                  value: {"availabilitylines":[{"offerid":"1f3d07b1647144ce999d5b0ab31ee385", "offercode":"369854", "resupplyingdelay": 14, "totalquantity": 10}, {"offerid": "71825be3a4d74cfe8d679d26c98980a8", "offercode":"569874", "totalquantity":10, "resupplyingdelay":5}, {"offerid":"71825be3a4d74cfe8d679d26c98980a8", "offercode":"3695236", "totalquantity":10, "resupplyingdelay":0}]}
              schema:
                $ref: '#/components/schemas/AvailabilitiesResponse'
        "401":
          description: The resource requires authentication, which was not supplied with the request
          content: {}
      x-codegen-request-body-name: request

  /booking/availability:
    post:
      tags:
        - Booking Service
      description: |
        This method is used to know the actual quantity of a given offer with refined detail in the call such as the travel date.

      operationId: Booking Availability
      requestBody:
        content:
          application/json:
            examples:
              retail:
                value: {"availability":{"origine":"WEB_B2C", "availabilityline":[{"quantity":5, "product":{"code":"351135"}}, {"quantity":3, "product":{"code":"965863"}}]}, "availabilitycontext":{"shop":{"structure":{"shopcode":"649"}, "typology":"SHOP"}}}
            schema:
              $ref: '#/components/schemas/AvailabilityRequest'
        required: true

      responses:
        "200":
          description: Availability response
          content:
            application/json:
              examples:
                retail:
                  value: {"availability":{"origine":"F", "site":"649", "isactual":true, "availabilityline":[{"quantity":1, "product":{"code":"351135", "unitpricesell":79.9900, "currency":"THB", "canbeordered":false}, "totalquantity":15, "exposedquantity":0}], "createdate":"2020-05-11T14:38:41.292Z"}, "availabilitycontext":{"shop":{"structure":{"shopcode":"649"}, "typology":"SHOP"}}}
              schema:
                $ref: '#/components/schemas/AvailabilityResponse'
        "401":
          description: The resource requires authentication, which was not supplied with the request
          content: {}
      x-codegen-request-body-name: request

  /booking/request:
    post:
      tags:
        - Booking Service
      description: |
        This method is used to reserve some offers. This action will block the stock of the requested quantity for each offer.
        Most of the time, this request is done to guaranty to the client the reservation is blocked for a duration (configuration parameter).

        During this duration, the merchant application will have time to process the payment of the reservation.

        All amount information comes from a [pricing service](#operation/ValorizationValorize).
        If you use the Gridbees price valorization service, the list of data coming for this valorization service are:
        -  All Amount nodes
        -  Marketing information such as promotion code,
        -  List of all rules applied to the orders
        - Hash control data to guaranty the quality of the data

        Once the payment has been made, the reservation must be confirmed, otherwise the system will un the reservation after the duration and unblock the stoks.

        The service applies some operations such as:
        -  If a vendor is filled, some controls on the vendor conditions
        -  All mandatory fields are present including passenger’s information
        -  Calculation on hash amounts to guaranty the non-alteration

        The service returns:
        - in case of success (ordercontext.status = OK), the order reference (ordertracking.transactionnumber) of the reservation
        - otherwise (ordercontext.status = KO), the business error code (ordercontext.code)

        <table id="t01">
        <caption>Booking Error Codes</caption>
        <tr>
        <th>Error Code</th>
        <th>Description</th>
        </tr>
        <tr>
        <td>HASHCONTROLERROR</td>
        <td>Hash control failed. Check the fields coming from Pricing service to fill in your request</td>
        </tr>
        <tr>
        <td>VENDORNOTEXISTORBLOCKED</td>
        <td>Merchant code not found or blocked</td>
        </tr>
        <tr>
        <td>ORDERNOTFOUND</td>
        <td>Order not found</td>
        </tr>
        <tr>
        <td>MAXPAIDNOTALLOWED</td>
        <td>Total paid is not allowed for this payment mode</td>
        </tr>
        <tr>
        <td>NOTIFICATIONNOTFOUND</td>
        <td>The terms of sales in the request have not been found</td>
        </tr>
        <tr>
        <td>OFFERNOTEXIST</td>
        <td>Offer not exists</td>
        </tr>
        <tr>
        <td>BOOKINGALREADYCONFIRMED</td>
        <td>this booking is already confirmed</td>
        </tr>
        <tr>
        <td>BOOKINGNOTFOUND</td>
        <td>Booking not found</td>
        </tr>
        <tr>
        <td>BOOKINGCANCELFAILED</td>
        <td>Failed to release the stock for this booking</td>
        </tr>
        <tr>
        <td>ERRORCANCELLED</td>
        <td>Order not paid or already cancelled</td>
        </tr>
        <tr>
        <td>NOTIFICATIONRETENTIONDELAYEXPIRED</td>
        <td>For cancellation request, if the delay to cancel is expired, this error code is sent</td>
        </tr>
        </table>

        <table id="t01">
        <caption>Order status</caption>
        <tr>
        <th>Status Type</th>
        <th>Status Code</th>
        <th>Description</th>
        </tr>
        <tr>
        <td>Operational</td>
        <td>PENDING</td>
        <td>The order is not confirmed and is waiting for the confirmation. The stock isn’t blocked for a pending order.</td>
        </tr>
        <tr>
        <td>Operational</td>
         <td>PROCESSED</td>
         <td>The order is confirmed. The stocks are reserved.</td>
        </tr>
        <tr>
        <td>Operational</td>
         <td>CANCELLED</td>
         <td>The order is cancelledand the stocks are released</td>
        </tr>
        <tr>
        <td>Payment</td>
         <td>PENDING</td>
         <td>The payment of this order isn’t completed</td>
        </tr>
        <tr>
        <td>Payment</td>
         <td>PAID</td>
         <td>The payment of the order is completed</td>
        </tr>
        <tr>
        <tr>
        <td>Payment</td>
         <td>CANCELLED</td>
         <td>The payment is cancelled</td>
        </tr>
        <tr>
        <td>Refund</td>
         <td>PENDING</td>
         <td>Refund is pending</td>
        </tr>
        <tr>
        <td>Refund</td>
         <td>REFUSED</td>
         <td>Reund is efused</td>
        </tr>
        <tr>
        <td>Refund</td>
         <td>CANCELLED</td>
         <td>The payment is cancelled</td>
        </tr>
        <tr>
        <td>Refund</td>
         <td>PAID</td>
         <td>Refuns is paid</td>
        </tr>
        <tr>
        <td>FILTERING</td>
         <td>TOREPROCESS</td>
         <td>Technical error. The order must be reprocessed</td>
        </tr>
        </table>

      operationId: Booking Request
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/OrderRequest'
            examples:
              retail:
                value: {"order":{"identifier":{"contactid":"ER740328727d8a009bbb7fc", "structure":{"companycode":"TDG", "countrycode":"TH"}}, "ordertracking":{"orderchannel":"TV", "externalbookingid":"c41e3-3737-4230-a9c4-2278934d5e", "platformreferencenumber":"c41e3536-3737-4280-a9c4-2278934da0ce", "user":"admintelecom"}, "amount":{"currency":"EUR", "grossamount":2697.0, "netamount":2697.0, "totaltopay":2697.0, "commissionamount":0.0, "fees":0.0, "hashamount":"5309fdc5e73b0fc2a5c905c3cdba5fddb54ba3553240332540bceed8eb440faa"}, "billingaddress":{"streetname":"159/37 Serm-mit Tower 23rd Floor,  Room 2301 Sukhumvit 21 road", "district":"Watthana", "postalcode":"10110", "province":"Bangkok", "countrycode":"TH", "geoloc":{"x":13.741394, "y":100.5615539}}, "deliverydetail":{"deliverymode":"HOME", "deliverynetwork":"D", "deliveryshop":"696", "deliveryaddress":{"streetname":"159/37 Serm-mit Tower 23rd Floor,  Room 2301 Sukhumvit 21 road", "district":"Watthana", "postalcode":"10110", "province":"Bangkok", "countrycode":"TH", "geoloc":{"x":13.741394, "y":100.5615539}}, "customdata":[{"attribute":"delivery_estimated_date", "value":"2022-06-24T05:33:42.800Z"}, {"attribute":"delivery_delivered_date", "value":"2022-06-24T05:28:42.800Z"}], "email":{"emailvalue":"bteplier@gridbees.com"}}, "payment":{"processingmode":"PREPAYMENT", "details":[{"movementtype":"CASHING", "paymentmode":"cod", "paymentcode":"123654", "prepaidamount":873.98, "externalpaymentreference":"chrg_xyjd7643386jfjgs"}]}, "lines":[{"linenum":1, "offercode":"1165", "offerid":"7897d72f9a0d43c88a951644d87c0328", "quantity":3, "amount":{"currency":"BHT", "grossamount":2697.0, "netamount":2697.0, "totaltopay":2697.0, "fees":0.0, "hashamount":"0640acd8be117139c94991753955fffc2dd959b1ca5edc0cc57803c521b9a8c5"}, "crossedoutprice":899.0, "sellingprice":899.0, "options":[]}]}, "ordercontext":{"externalbookingid":"c41e3536-3737-4230-a9c4-2278934d"}}
        #                value: {"order":{"identifier":{"contactid":"20898(# TDG SSOID)", "structure":{"companycode":"TDG", "countrycode":"th"}}, "codification":{"vendorcode":"SW", "platformcode":"OTT_APP"}, "payment":{"details":[{"externalpaymentreference":"payment_unique_reference(not charge id, can be generated)", "paymentcode":"sourceId on TDG", "movementtype":"CASHING", "paymentmode":"card(# TDG payment_method)", "totalpaid":2797.0}]}, "ordertracking":{"transactionnumber": "SNn3LF(short_id)", "externalbookingid":"c41e3536-3737-4230-a9c4-2278934da0ce(# Minor cart_id)"}, "amount":{"currency":"THB", "grossamount":2697.0, "netamount":2697.0, "totaltopay":2797.0, "fees":10.0, "hashamount":"5309fdc5e73b0fc2a5c905c3cdba5fddb54ba3553240332540bceed8eb440faa"}, "billingaddress":{"streetnumber":"159/37 Serm-mit Tower 23rd Floor,  Room 2301 Sukhumvit 21 road(# TDG SPF: address.AddressLine1 + address.AddressLine2)", "district":"Watthana(# TDG SPF: address.District)", "province":"Bangkok(# TDG SPF: address.Province)", "postalcode":"10110(# TDG SPF: address.PostCode)", "geoloc":{"x":13.741394, "y":100.5615539}}, "deliverydetail":{"instruction":[{"attribute":"note", "value":"Deposit lobby.(# TDG SPF: Note)"}], "deliveryaddress":{"streetnumber":"159/37 Serm-mit Tower 23rd Floor,  Room 2301 Sukhumvit 21 road(# TDG SPF: address.AddressLine1 + address.AddressLine2)", "district":"Watthana(# TDG SPF: address.District)", "province":"Bangkok(# TDG SPF: address.Province)", "postalcode":"10110(# TDG SPF: address.Province)", "geoloc":{"x":13.741394, "y":100.5615539}}}, "lines":[{"linenum":1, "offercode":"1164", "offerid":"2b9e72d61cfe4d3387b445dba842cd60", "quantity":3, "amount":{"currency":"THB", "grossamount":2697.0, "netamount":2697.0, "totaltopay":2797.0, "fees":0.0, "hashamount":"0640acd8be117139c94991753955fffc2dd959b1ca5edc0cc57803c521b9a8c5"}, "crossedoutprice":899.0, "sellingprice":899.0, "options":[]}]}, "ordercontext":{"externalbookingid":"c41e3536-3737-4230-a9c4-2278934da0ce(# Minor cart_id)"}}
        required: true
      responses:
        "200":
          description: Reservation response
          content:
            application/json:
              examples:
                retail:
                  value: {"order":{"orderid":"c49c5cac79da47a3bcf08202e54b65e0", "identifier":{"contactid":"8d408f1e24d740328727d8a009bbb7fc", "structure":{"companycode":"TDG", "countrycode":"th"}}, "codification":{"vendorcode":"SW", "platformcode":"OTT_APP"}, "ordertracking":{"orderchannel":"TV", "user":"admintelecom", "bookingid":"20452bc4e2a14d90bd8deb5fb8facd45", "externalbookingid":"c41e3536-3737-4230-a9c4-2278934da0ce", "transactionnumber":"E6VER000000009", "platformreferencenumber":"c41e3536-3737-4280-a9c4-2278934da0ce"}, "ordertype":"BOOKING", "amount":{"currency":"THB", "grossamount":2697.0, "netamount":2697.0, "totaltopay":2797.0, "fees": 10.0, "commissionamount":0.0, "hashamount":"5309fdc5e73b0fc2a5c905c3cdba5fddb54ba3553240332540bceed8eb440faa"}, "billingaddress":{"usage":"", "uid":"22193033437384710", "isactive":true}, "deliverydetail":{"addressuid":"22193033437384710"}, "payment":{"processingmode":"UNDEFINED", "updatedate":"2022-07-06T08:04:03.134+02:00"}, "businesscreationdate":"2022-07-06T08:04:03.133+02:00", "lines":[{"orderlineid":"c3b91c90c6674437b981115c24aa535d", "linenum":1, "offerid":"2b9e72d61cfe4d3387b445dba842cd60", "quantity":3, "amount":{"currency":"THB", "grossamount":2697.0, "netamount":2697.0, "fees": 10.0, "totaltopay":2797.0, "additionalserviceamount":0.0, "additionalassemblyamount":0.0, "additionalrecoveryamount":0.0, "hashamount":"0640acd8be117139c94991753955fffc2dd959b1ca5edc0cc57803c521b9a8c5"}, "crossedoutprice":899.0, "sellingprice":899.0}], "statusdetail":{"order":[{"statustype":"Operational", "code":"PENDING", "date":"2022-07-06T08:04:14.725+02:00", "user":"admintelecom"}, {"statustype":"PAYMENT", "code":"PENDING", "date":"2022-07-06T08:04:14.726+02:00", "user":"admintelecom"}], "latest":[{"statustype":"Operational", "code":"PENDING", "date":"2022-07-06T08:04:14.725+02:00", "user":"admintelecom"}, {"statustype":"PAYMENT", "code":"PENDING", "date":"2022-07-06T08:04:14.726+02:00", "user":"admintelecom"}], "lines":[]}, "createdate":"2022-07-06T08:04:14.737+02:00"}, "ordercontext":{"bookingid":"20452bc4e2a14d90bd8deb5fb8facd45", "externalbookingid":"c41e3536-3737-4230-a9c4-2278934da0ce", "status":"OK", "message":"", "endbookingdate":"2022-07-06T08:34:03.181+02:00"}}
              schema:
                $ref: '#/components/schemas/OrderResponse'
        "401":
          description: The resource requires authentication, which was not supplied with the request
          content: {}
      x-codegen-request-body-name: request

  /booking/confirm:
    post:
      tags:
        - Booking Service
      description: |
        This method is used to confirm an order done by a call to booking/request service. The request is the same than the booking request call, but complete by payment information.
        The service applies some operations such as:
        -  The existence of the bookig in Gridbees database (search based on the orderid field) and make some coherence controls.
        -  Overdue payment or not balanced payment
        -  Burns “one shot used” promotional vouchers
        -  Sends email to the customer in some conditions (deferred promotion detected, email template detected, ...)
        -  Stores and controls different payment modes used to pay the order

      operationId: Booking Confirm
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/OrderConfirm'
            examples:
              retail:
                value: {"order":{"orderid":"2fd50e8ee47e4d08a2fea592fda35cb0", "ordertracking":{"transactionnumber":"3AQHQ000000032"}}}
        #                value: {"order":{"orderid":"c49c5cac79da47a3bcf08202e54b65e0", "ordertracking":{"transactionnumber":"edFnty3(# TDG short_id)"}}}

        required: true

      responses:
        "200":
          description: Booking Confirmation response
          content:
            application/json:
              examples:
                retail:
                  value: {"order":{"orderid":"c49c5cac79da47a3bcf08202e54b65e0", "identifier":{"contactid":"8d408f1e24d740328727d8a009bbb7fc", "structure":{"companycode":"TDG", "countrycode":"th"}}, "codification":{"vendorcode":"SW", "platformcode":"OTT_APP"}, "ordertracking":{"orderchannel":"TV", "user":"admintelecom", "bookingid":"20452bc4e2a14d90bd8deb5fb8facd45", "externalbookingid":"c41e3536-3737-4230-a9c4-2278934da0ce", "transactionnumber":"E6VER000000009", "platformreferencenumber":"c41e3536-3737-4280-a9c4-2278934da0ce"}, "ordertype":"ORDER", "amount":{"currency":"THB", "grossamount":2697.0, "netamount":2697.0, "fees":10.0, "totaltopay":2797.0, "commissionamount":0.0, "hashamount":"5309fdc5e73b0fc2a5c905c3cdba5fddb54ba3553240332540bceed8eb440faa"}, "billingaddress":{"usage":"", "uid":"22193033437384710", "isactive":true}, "deliverydetail":{"addressuid":"22193033437384710"}, "payment":{"details":[{"paymentmode":"CASH", "paymentcode":"CREDITNOTE", "totalpaid":2797.0, "externalpaymentreference":"aa1e6ba23ff7414ab283e9d8ee5cd50a", "paymentdate":"2022-07-05T17:50:23.488Z"}]}, "businesscreationdate":"2022-07-06T06:04:03.133Z", "lines":[{"orderlineid":"c3b91c90c6674437b981115c24aa535d", "linenum":1, "offerid":"2b9e72d61cfe4d3387b445dba842cd60", "quantity":3, "amount":{"currency":"THB", "grossamount":2697.0, "netamount":2697.0, "fees":10.0, "totaltopay":2797.0, "additionalserviceamount":0.0, "additionalassemblyamount":0.0, "additionalrecoveryamount":0.0, "hashamount":"0640acd8be117139c94991753955fffc2dd959b1ca5edc0cc57803c521b9a8c5"}, "crossedoutprice":899.0, "sellingprice":899.0}], "statusdetail":{"order":[{"statustype":"Operational", "code":"PROCESSED", "date":"2022-07-06T20:12:02.482Z", "user":"admintelecom"}, {"statustype":"PAYMENT", "code":"PAID", "date":"2022-07-06T20:12:02.480Z", "user":"admintelecom"}, {"statustype":"Operational", "code":"PENDING", "date":"2022-07-06T06:04:14.725Z", "user":"admintelecom"}, {"statustype":"PAYMENT", "code":"PENDING", "date":"2022-07-06T06:04:14.726Z", "user":"admintelecom"}], "latest":[{"statustype":"Operational", "code":"PROCESSED", "date":"2022-07-06T20:12:02.482Z", "user":"admintelecom"}, {"statustype":"PAYMENT", "code":"PAID", "date":"2022-07-06T20:12:02.480Z", "user":"admintelecom"}]}, "createdate":"2022-07-06T06:04:14.737Z", "updatedate":"2022-07-06T20:12:02.487Z"}, "ordercontext":{"externalbookingid":"c41e3536-3737-4230-a9c4-2278934da0ce5", "status":"OK"}}
              schema:
                $ref: '#/components/schemas/OrderResponse'

        "401":
          description: The resource requires authentication, which was not supplied with the request
          content: {}
      x-codegen-request-body-name: request

  /booking/cancel:
    post:
      tags:
        - Booking Service
      description: |
        This service is used to cancel an order and release if needed the stock.
        An order can be cancelled if it has been already paid or not already cancelled.
        The service searches for the order and calculates the cancellation fees according to the terms of sales.

      operationId: Booking Cancel
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CancellationRequest'
        required: true
      responses:
        "200":
          description: Booking Cancellation response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CancellationBookingResponse'
        "401":
          description: The resource requires authentication, which was not supplied with the request
          content: {}
      x-codegen-request-body-name: request

  /booking/update:
    post:
      tags:
        - Booking Service
      description: |
        This method is used to updat an existing pending or confirmed order. Depending of the configuration, some changes are considered major and others minor. The list of major fields must be set during the configuration of a new client.
        For an input request, if there are major changes:
        - The order is reavaluated by the pricing service to check the new balance
        - The stock availability of the original order is released if the availability of the new order is confirmed.
        - The original order is replaced by the new order

        This service doesn't merge data from the original order with the new order. So you need to fill all necessary fields in the new order.

        If the original oder was already confirmed and paid, the requested changes may generate some cancellation fees depending of the cancellation terms.

      operationId: Booking Update
      requestBody:
        content:
          application/json:
            examples:
              retail:
                value: {"order":{"orderid": "6a768ded47334925a9f67a4721273884", "identifier":{"contactid":"b6e8fb8c6cc6430f854eaa64e17305dc", "legalentityid":"LegalEntity1", "structure":{"blcode":"B2T", "countrycode":"ES", "languagecode":"es", "marketcode":"CANARIES"}}, "ordertracking":{"emitterid":"00001", "orderchannel":"W", "site":"007", "bookingid":"f31UW9KGekcJ"}, "orderrules":[{"linenum":0, "rulename":"GlobalFeesAmount", "discountamount":19.0}, {"linenum":1, "rulename":"LineFeesAmount", "discountamount":19.0}], "amount":{"currency":"EUR", "grossamount":329.0, "netamount":329.0, "discountamount":0.0, "additionalserviceamount":0.0, "additionalassemblyamount":0.0, "additionalrecoveryamount":0.0, "feesdiscountamount":0.0, "fees":0.0}, "billingaddress":{"usage":"BIL", "actioncode":0, "isnormalized":false, "isactive":true, "streetnumber":"", "streetname":"Calle 56, piso 8", "city":"Poligon", "postalcode":"36918", "province":"Palmas De Gran Canaria, Las", "countrycode":"ES", "name":{"civility":"MRS", "lastname":"B2T", "firstname":"Gridbees", "identitydocuments":[{"usage":"NIF", "numid":"00000999"}]}}, "deliverydetail":{"deliverymode":"PICKUP", "deliverynetwork":"SHOP", "pickupshop":"007", "deliveryshop":"563", "email":{"usage":"BIL", "isprincipal":true, "emailvalue":"gridbees@gmail.com"}}, "businesscreationdate":"2020-05-11T15:24:08.148Z", "lines":[{"linenum":1, "referencecode":"ESESCAN000000396791PUB00690", "deliverycode":"0", "processingmode":"SYNCH", "offerid":"e7743586ff8d480bbc5f003003c875d5", "quantity":1, "amount":{"currency":"EUR", "grossamount":329.0, "netamount":329.0, "discountamount":750.0, "additionalserviceamount":0.0, "additionalassemblyamount":0.0, "additionalrecoveryamount":0.0, "feesdiscountamount":0.0, "fees":0.0, "vatrates":[]}, "crossedoutprice":1079.0, "sellingprice":329.0, "additionalservices":[], "productitems":[{"productid":"a350b63dc6c84a66a1ca0fa98aedcf39", "itemnumid":"396791", "quantity":1, "promisedavailability":"2020-06-02", "vatcode":"02", "vatrate":0.0, "category":"42", "family":"medias", "subfamily":"7", "productgroup":"1", "shippingrate":"1"}]}]}, "ordercontext":{"shop":{"structure":{"shopcode":"007"}, "typology":"Warehouse"}, "bookid":"f31UW9KGekcJ", "contactid":"b6e8fb8c6cc6430f854eaa64e17385dc"}}
            schema:
              $ref: '#/components/schemas/OrderUpdateRequest'
        required: true

      responses:
        "200":
          description: Booking Confirmation response
          content:
            application/json:
              examples:
                retail:
                  value: {"order":{"order":{"orderid":"c33c2fb801234f21bdc8df28636ed43d", "identifier":{"contactid":"b6e8fb8c6cc6430f854eaa64e17305dc", "legalentityid":"LegalEntity1", "structure":{"blcode":"B2T", "countrycode":"ES", "languagecode":"es", "marketcode":"CANARIES"}}, "ordertracking":{"emitterid":"00001", "orderchannel":"W", "site":"007", "bookingid":"f31UW9KGekcJ"}, "orderrules":[{"linenum":0, "rulename":"GlobalFeesAmount", "discountamount":19}, {"linenum":1, "rulename":"LineFeesAmount", "discountamount":19}], "amount":{"currency":"EUR", "grossamount":329, "netamount":329, "discountamount":0, "additionalserviceamount":0, "additionalassemblyamount":0, "additionalrecoveryamount":0, "feesdiscountamount":0, "fees":0}, "billingaddress":{"usage":"BIL", "actioncode":0, "isnormalized":false, "isactive":true, "streetnumber":"", "streetname":"Calle 56, piso 8", "city":"Poligon", "postalcode":"36918", "province":"Palmas De Gran Canaria, Las", "countrycode":"ES", "name":{"civility":"MRS", "lastname":"B2T", "firstname":"Gridbees", "identitydocuments":[{"usage":"NIF", "numid":"00000999"}]}}, "deliverydetail":{"deliverymode":"PICKUP", "deliverynetwork":"SHOP", "pickupshop":"007", "deliveryshop":"563", "email":{"usage":"BIL", "isprincipal":true, "emailvalue":"gridbees@gmail.com"}}, "businesscreationdate":"2020-05-11T15:24:08.148Z", "statusdetail":{"order":[{"statustype":"Operational", "code":"PENDING", "date":"2020-05-11T15:24:08.511Z"}, {"statustype":"PAYMENT", "code":"PENDING", "date":"2020-05-11T15:24:08.511Z"}], "latest":[{"statustype":"Operational", "code":"PENDING", "date":"2020-05-11T15:24:08.511Z"}, {"statustype":"PAYMENT", "code":"PENDING", "date":"2020-05-11T15:24:08.511Z"}]}, "lines":[{"linenum":1, "referencecode":"ESESCAN000000396791PUB00690", "deliverycode":"0", "processingmode":"SYNCH", "offerid":"e7743586ff8d480bbc5f003003c875d5", "quantity":1, "amount":{"currency":"EUR", "grossamount":329, "netamount":329, "discountamount":750, "additionalserviceamount":0, "additionalassemblyamount":0, "additionalrecoveryamount":0, "feesdiscountamount":0, "fees":0, "vatrates":[]}, "crossedoutprice":1079, "sellingprice":329, "additionalservices":[], "productitems":[{"productid":"a350b63dc6c84a66a1ca0fa98aedcf39", "itemnumid":"396791", "quantity":1, "promisedavailability":"2020-06-02", "vatcode":"02", "vatrate":0, "category":"42", "family":"medias", "subfamily":"7", "productgroup":"1", "shippingrate":"1"}]}]}, "ordercontext":{"status": "OK", "shop":{"structure":{"shopcode":"007"}, "typology":"Warehouse"}, "bookid":"f31UW9KGekcJ", "contactid":"b6e8fb8c6cc6430f854eaa64e17385dc"}}}
              schema:
                $ref: '#/components/schemas/OrderResponse'
        "401":
          description: The resource requires authentication, which was not supplied with the request
          content: {}
      x-codegen-request-body-name: request

  /booking/paymentconfirmation:
    post:
      tags:
        - Booking Service
      description: |
        This method is to confirm a payment based on a payment reference. The payment could be for one or many orders.
      operationId: Payment Confirmation
      requestBody:
        content:
          application/json:
            examples:
              retail:
                value: {"payment":{"details":{"paymentmode":"cod", "paymentcode":"123654", "totalpaid":2697.0, "externalpaymentreference":"chrg_xyjd7643386jfjgs"}}}
            schema:
              $ref: '#/components/schemas/PaymentConfirmationRequest'
        required: true

      responses:
        "200":
          description: Booking Confirmation response
          content:
            application/json:
              examples:
                retail:
                  value: {"orders":[{"order":{"orderid":"c49c5cac79da47a3bcf08202e54b65e0", "identifier":{"contactid":"8d408f1e24d740328727d8a009bbb7fc", "structure":{"companycode":"TDG", "countrycode":"th"}}, "codification":{"vendorcode":"SW", "platformcode":"OTT_APP"}, "ordertracking":{"orderchannel":"TV", "user":"admintelecom", "bookingid":"20452bc4e2a14d90bd8deb5fb8facd45", "externalbookingid":"c41e3536-3737-4230-a9c4-2278934da0ce", "transactionnumber":"E6VER000000009", "platformreferencenumber":"c41e3536-3737-4280-a9c4-2278934da0ce"}, "ordertype":"ORDER", "amount":{"currency":"THB", "grossamount":2697.0, "netamount":2697.0, "fees":10.0, "totaltopay":2797.0, "commissionamount":0.0, "hashamount":"5309fdc5e73b0fc2a5c905c3cdba5fddb54ba3553240332540bceed8eb440faa"}, "billingaddress":{"usage":"", "uid":"22193033437384710", "isactive":true}, "deliverydetail":{"addressuid":"22193033437384710"}, "payment":{"details":[{"paymentmode":"CASH", "paymentcode":"CREDITNOTE", "status":"PAID", "totalpaid":2797.0, "externalpaymentreference":"aa1e6ba23ff7414ab283e9d8ee5cd50a", "paymentdate":"2022-07-05T17:50:23.488Z"}]}, "businesscreationdate":"2022-07-06T06:04:03.133Z", "lines":[{"orderlineid":"c3b91c90c6674437b981115c24aa535d", "linenum":1, "offerid":"2b9e72d61cfe4d3387b445dba842cd60", "quantity":3, "amount":{"currency":"THB", "grossamount":2697.0, "netamount":2697.0, "fees":10.0, "totaltopay":2797.0, "additionalserviceamount":0.0, "additionalassemblyamount":0.0, "additionalrecoveryamount":0.0, "hashamount":"0640acd8be117139c94991753955fffc2dd959b1ca5edc0cc57803c521b9a8c5"}, "crossedoutprice":899.0, "sellingprice":899.0}], "statusdetail":{"order":[{"statustype":"Operational", "code":"PROCESSED", "date":"2022-07-06T20:12:02.482Z", "user":"admintelecom"}, {"statustype":"PAYMENT", "code":"PAID", "date":"2022-07-06T20:12:02.480Z", "user":"admintelecom"}, {"statustype":"Operational", "code":"PENDING", "date":"2022-07-06T06:04:14.725Z", "user":"admintelecom"}, {"statustype":"PAYMENT", "code":"PENDING", "date":"2022-07-06T06:04:14.726Z", "user":"admintelecom"}], "latest":[{"statustype":"Operational", "code":"PROCESSED", "date":"2022-07-06T20:12:02.482Z", "user":"admintelecom"}, {"statustype":"PAYMENT", "code":"PAID", "date":"2022-07-06T20:12:02.480Z", "user":"admintelecom"}]}, "createdate":"2022-07-06T06:04:14.737Z", "updatedate":"2022-07-06T20:12:02.487Z"}, "ordercontext":{"externalbookingid":"c41e3536-3737-4230-a9c4-2278934da0ce5", "status":"OK"}}], "reprocessingcontext":{"externalbookingid":"2492443457b343a0a1414656e1a77881", "code":"OK", "user":"s.lopez"}}
              schema:
                $ref: '#/components/schemas/PaymentConfirmationResponse'
        "401":
          description: The resource requires authentication, which was not supplied with the request
          content: {}
      x-codegen-request-body-name: request

  /booking/paymentcancellation:
    post:
      tags:
        - Booking Service
      description: |
        This method is to cancel a payment based on payment references. The payment could be for one or many orders.
        The system tries to find related orders by querying on these filters :
        - movementtype = CASHING
        - payment status = PENDING
        - paymentmode if filled
        - paymentcode if filled
        - externalpaymentreference if filled
        - paymentdetailid if filled
        - vendorcode if filled
        - accountid if filled
      operationId: Payment Cancellation
      requestBody:
        content:
          application/json:
            examples:
              Payment detail identifier:
                value: {"isrefused":true, "syncorderstatus":true, "details":{"cancellationdate":"2023-01-07T16:55:31.665Z", "paymentmode":"card", "paymentdetailid":"2278934da0ce556712"}, "cause":"Refused by PSP", "user":"system user"}
            schema:
              $ref: '#/components/schemas/PaymentCancellation'
        required: true

      responses:
        "200":
          description: Booking Cancellation response
          content:
            application/json:
              examples:
                Streaming:
                  value: {"orders":[{"orderid":"4b7340903a66421283c4140a4821606a", "tenantid":"aab5a2af8ad44b5d8f4e0f9b2bd2b663", "codification":{"platformcodes":["OTT_APP"]}, "identifier":{"contactid":"22015750", "structure":{"companycode":"TDG", "countrycode":"TH"}}, "ordertracking":{"vendorcode":"TDG", "bookingid":"b01ff82d6cb84027b8f01c6f616c02f2", "externalbookingid":"c41536-3737-4230-a9c4-2278934da0ce55672e", "transactionnumber":"Hyl6cv2Uvttfg78e", "platformreferencenumber":"c41e3536-3737-4280-a9c4-2278934d2a0cee"}, "ordertype":"BOOKING", "amount":{"currency":"THB", "grossamount":5900.0, "netamount":5900.0, "totaltopay":5900.0, "commissionamount":0.0, "hashamount":"e10ecb96b6b004d1c5ed4cfe57f2a56a1b627c48123fd0c1b9deca5249e35975"}, "billingaddress":{"streetnumber":"257,  Charoen Nakhon Rd, Samre", "district":"Thonburi", "postalcode":"10600", "province":"Bangkok", "geoloc":{"x":13.704964637756348, "y":100.4890365600586}}, "deliverydetail":{"deliveryaddress":{"streetnumber":"257,  Charoen Nakhon Rd, Samre", "district":"Thonburi", "postalcode":"10600", "province":"Bangkok", "geoloc":{"x":13.704964637756348, "y":100.4890365600586}}, "addressuid":"1235"}, "payment":{"processingmode":"PREPAYMENT", "paymentdate":"2023-01-08T18:47:04.561Z", "details":[{"paymentdetailid":"2278934da0ce556712", "movementtype":"CASHING", "status":"REFUSED", "paymentmode":"card", "prepaidamount":5900.0, "paymentdate":"2023-01-08T18:47:04.606Z", "updatedate":"2023-01-08T18:47:04.606Z"}], "updatedate":"2023-01-08T18:47:04.561Z"}, "businesscreationdate":"2023-01-08T18:46:13.740Z", "lines":[{"orderlineid":"f17f008da53c461587f444705aad3cba", "linenum":1, "referencecode":"TIDPLUS2_BPN_RC_EVG_REG", "offerid":"adc71155179c4dd4bcb8c80a2a7d6c9f", "offercodification":{"typology":"STREAMING"}, "quantity":1, "amount":{"currency":"THB", "grossamount":5900.0, "netamount":5900.0, "totaltopay":5900.0, "additionalserviceamount":0.0, "additionalassemblyamount":0.0, "additionalrecoveryamount":0.0, "hashamount":"dc09cabd150f65568e05f234c5ade0d640a5fea5580b800812e2ec6382e822b2"}, "sellingprice":5900.0, "productitems":[{"productcode":"TIDPLUS", "quantity":1, "productgroup":"TIDPLUS"}]}], "statusdetail":{"order":[{"statustype":"PAYMENT", "code":"REFUSED", "cause":"Refused by PSP", "date":"2023-01-08T18:47:04.606Z"}, {"statustype":"Operational", "code":"CANCELLED", "date":"2023-01-08T18:47:04.607Z"}, {"statustype":"Operational", "code":"PENDING", "date":"2023-01-08T18:46:14.593Z"}, {"statustype":"PAYMENT", "code":"PENDING", "date":"2023-01-08T18:46:14.593Z"}], "latest":[{"statustype":"PAYMENT", "code":"REFUSED", "cause":"Refused by PSP", "date":"2023-01-08T18:47:04.606Z"}, {"statustype":"Operational", "code":"CANCELLED", "date":"2023-01-08T18:47:04.607Z"}]}, "createdate":"2023-01-08T18:46:14.608Z"}], "reprocessingcontext":{"status":"OK"}}
              schema:
                $ref: '#/components/schemas/PaymentConfirmationResponse'
        "401":
          description: The resource requires authentication, which was not supplied with the request
          content: {}
      x-codegen-request-body-name: request

  /order/search:
    post:
      tags:
        - Booking Service
      description: |
        This method is used to search bookings. The total results of bookings in the response is limited by a parameter (default 100 results).

        You must refine your search criteria if you didn't find your order.

      operationId: Order Search
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/OrderSearchRequest'
        required: true

      responses:
        "200":
          description: Order Search response
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Order'
        "401":
          description: The resource requires authentication, which was not supplied with the request
          content: {}
      x-codegen-request-body-name: request

  /order/purchase:
    post:
      tags:
        - Booking Service
      description: |
        This method is used to directly confirm a purchase without having to call booking/request.
        This means that inventory management is unnecessary with this method since no stock will be blocked.
        The input request is supposed to be reliable, and the order will be stored as-is.
        If the order reference isn't filled (ordertracking.transactionnumber), the service will set this field with a unique internal reference.
      operationId: Order Purchase
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/OrderRequest'
            examples:
              retail:
                value: {"order":{"identifier":{"contactid":"8d408f1e24d740328727d8a009bbb7fc", "structure":{"companycode":"TDG", "countrycode":"th"}}, "codification":{"vendorcode":"SW", "platformcode":"OTT_APP"}, "ordertracking":{"orderchannel":"TV", "externalbookingid":"c41e3536-3737-4230-a9c4-2278934da0ce", "platformreferencenumber":"c41e3536-3737-4280-a9c4-2278934da0ce", "user":"admintelecom"}, "amount":{"currency":"THB", "grossamount":2697.0, "netamount":2697.0, "totaltopay":2797.0, "fees": 10.0, "commissionamount":0.0, "hashamount":"5309fdc5e73b0fc2a5c905c3cdba5fddb54ba3553240332540bceed8eb440faa"}, "billingaddress":{"uid":"22193033437384710"}, "deliverydetail":{"addressuid":"22193033437384710"}, "lines":[{"linenum":1, "offercode":"1164", "offerid":"2b9e72d61cfe4d3387b445dba842cd60", "quantity":3, "amount":{"currency":"THB", "grossamount":2697.0, "netamount":2697.0, "totaltopay":2797.0, "fees": 10.0, "additionalserviceamount":0.0, "additionalassemblyamount":0.0, "additionalrecoveryamount":0.0, "hashamount":"0640acd8be117139c94991753955fffc2dd959b1ca5edc0cc57803c521b9a8c5"}, "crossedoutprice":899.0, "sellingprice":899.0, "options":[{"unicitykey":"15332", "optiondetails":[{"unicitykey":"576"}]}]}]}, "ordercontext":{"externalbookingid":"c41e3536-3737-4230-a9c4-2278934da0ce"}}
        required: true
      responses:
        "200":
          description: Order response
          content:
            application/json:
              examples:
                retail:
                  value: {"order":{"orderid":"c49c5cac79da47a3bcf08202e54b65e0", "identifier":{"contactid":"8d408f1e24d740328727d8a009bbb7fc", "structure":{"companycode":"TDG", "countrycode":"th"}}, "codification":{"vendorcode":"SW", "platformcode":"OTT_APP"}, "ordertracking":{"orderchannel":"TV", "user":"admintelecom", "bookingid":"20452bc4e2a14d90bd8deb5fb8facd45", "externalbookingid":"c41e3536-3737-4230-a9c4-2278934da0ce", "transactionnumber":"E6VER000000009", "platformreferencenumber":"c41e3536-3737-4280-a9c4-2278934da0ce"}, "ordertype":"ORDER", "amount":{"currency":"THB", "grossamount":2697.0, "netamount":2697.0, "fees":10.0, "totaltopay":2797.0, "commissionamount":0.0, "hashamount":"5309fdc5e73b0fc2a5c905c3cdba5fddb54ba3553240332540bceed8eb440faa"}, "billingaddress":{"usage":"", "uid":"22193033437384710", "isactive":true}, "deliverydetail":{"addressuid":"22193033437384710"}, "payment":{"details":[{"paymentmode":"CASH", "paymentcode":"CREDITNOTE", "totalpaid":2797.0, "externalpaymentreference":"aa1e6ba23ff7414ab283e9d8ee5cd50a", "paymentdate":"2022-07-05T17:50:23.488Z"}]}, "businesscreationdate":"2022-07-06T06:04:03.133Z", "lines":[{"orderlineid":"c3b91c90c6674437b981115c24aa535d", "linenum":1, "offerid":"2b9e72d61cfe4d3387b445dba842cd60", "quantity":3, "amount":{"currency":"THB", "grossamount":2697.0, "netamount":2697.0, "fees":10.0, "totaltopay":2797.0, "additionalserviceamount":0.0, "additionalassemblyamount":0.0, "additionalrecoveryamount":0.0, "hashamount":"0640acd8be117139c94991753955fffc2dd959b1ca5edc0cc57803c521b9a8c5"}, "crossedoutprice":899.0, "sellingprice":899.0}], "statusdetail":{"order":[{"statustype":"Operational", "code":"PROCESSED", "date":"2022-07-06T20:12:02.482Z", "user":"admintelecom"}, {"statustype":"PAYMENT", "code":"PAID", "date":"2022-07-06T20:12:02.480Z", "user":"admintelecom"}, {"statustype":"Operational", "code":"PENDING", "date":"2022-07-06T06:04:14.725Z", "user":"admintelecom"}, {"statustype":"PAYMENT", "code":"PENDING", "date":"2022-07-06T06:04:14.726Z", "user":"admintelecom"}], "latest":[{"statustype":"Operational", "code":"PROCESSED", "date":"2022-07-06T20:12:02.482Z", "user":"admintelecom"}, {"statustype":"PAYMENT", "code":"PAID", "date":"2022-07-06T20:12:02.480Z", "user":"admintelecom"}]}, "createdate":"2022-07-06T06:04:14.737Z", "updatedate":"2022-07-06T20:12:02.487Z"}, "ordercontext":{"externalbookingid":"c41e3536-3737-4230-a9c4-2278934da0ce5", "status":"OK"}}
              schema:
                $ref: '#/components/schemas/OrderResponse'
        "401":
          description: The resource requires authentication, which was not supplied with the request
          content: {}
      x-codegen-request-body-name: request

  /order/updatestatus:
    post:
      tags:
        - Booking Service
      description: |
        This method is used to update the order statuses.

      operationId: Order UpdateStatus
      requestBody:
        content:
          application/json:
            examples:
              retail:
                value: {"orderid":"f6f1ba232fd34efba355a3020c72bd4b", "transactionnumber":"QZYRY000000014", "latest":[{"statustype":"Delivery", "code":"PENDING", "date":"2022-07-07T06:24:24.273+02:00", "user":"CallCenter"}]}
            schema:
              $ref: '#/components/schemas/OrderStatusListUpdate'
        required: true

      responses:
        "200":
          description: Update Status response
          content:
            application/json:
              examples:
                retail:
                  value: {"orderid":"f6f1ba232fd34efba355a3020c72bd4b", "tenantid":"134beb0f25ed41ca9d963973b3aea8ae", "identifier":{"contactid":"8d408f1e24d740328727d8a009bbb7fc", "structure":{"blcode":"TDG", "companycode":"SW", "countrycode":"TH", "marketcode":"FOOD"}}, "ordertracking":{"orderchannel":"TV", "user":"admintelecom", "bookingid":"2a3b31b089a54cf4a04e9194b72d266d", "externalbookingid":"c41e3536-3737-4230-a9c4-2278934da0c5e", "transactionnumber":"QZYRY000000014", "platformreferencenumber":"c41e3536-3737-4280-a9c4-2278934da0ce"}, "ordertype":"ORDER", "amount":{"currency":"EUR", "grossamount":2697.0, "netamount":2697.0, "totaltopay":2697.0, "commissionamount":0.0, "hashamount":"5309fdc5e73b0fc2a5c905c3cdba5fddb54ba3553240332540bceed8eb440faa"}, "billingaddress":{"usage":"", "uid":"22193033437384710", "isactive":true}, "payment":{"details":[{"paymentmode":"CASH", "paymentcode":"CREDITNOTE", "totalpaid":2697.0, "externalpaymentreference":"aa1e6ba23ff7414ab283e9d8ee5cd50a", "paymentdate":"2022-07-05T19:50:23.488+02:00"}]}, "businesscreationdate":"2022-07-07T06:22:30.764+02:00", "lines":[{"orderlineid":"2b6269aef4d444909fcec3ca15f372d9", "linenum":1, "offerid":"2b9e72d61cfe4d3387b445dba842cd60", "quantity":3, "amount":{"currency":"EUR", "grossamount":2697.0, "netamount":2697.0, "totaltopay":2697.0, "additionalserviceamount":0.0, "additionalassemblyamount":0.0, "additionalrecoveryamount":0.0, "hashamount":"0640acd8be117139c94991753955fffc2dd959b1ca5edc0cc57803c521b9a8c5"}, "crossedoutprice":899.0, "sellingprice":899.0, "additionalservices":[]}], "statusdetail":{"order":[{"statustype":"Delivery", "code":"PENDING", "date":"2022-07-07T06:24:24.273+02:00", "user":"CallCenter"}, {"statustype":"Operational", "code":"PROCESSED", "date":"2022-07-07T06:24:24.273+02:00", "user":"admintelecom"}, {"statustype":"PAYMENT", "code":"PAID", "date":"2022-07-07T06:24:24.272+02:00", "user":"admintelecom"}, {"statustype":"Operational", "code":"PENDING", "date":"2022-07-07T06:22:31.129+02:00", "user":"admintelecom"}, {"statustype":"PAYMENT", "code":"PENDING", "date":"2022-07-07T06:22:31.129+02:00", "user":"admintelecom"}], "latest":[{"statustype":"Delivery", "code":"PENDING", "date":"2022-07-07T06:24:24.273+02:00", "user":"CallCenter"}, {"statustype":"Operational", "code":"PROCESSED", "date":"2022-07-07T06:24:24.273+02:00", "user":"admintelecom"}, {"statustype":"PAYMENT", "code":"PAID", "date":"2022-07-07T06:24:24.272+02:00", "user":"admintelecom"}]}, "createdate":"2022-07-07T06:22:31.142+02:00", "updatedate":"2022-07-07T06:32:04.395+02:00"}
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Order'
        "401":
          description: The resource requires authentication, which was not supplied with the request
          content: {}
      x-codegen-request-body-name: request

  /masterdata/upsert:
    post:
      tags:
        - MasterData Service
      description: |
        This method is used to create or updata a master data

      operationId: MasterData Upsert
      requestBody:
        content:
          application/json:
            examples:
              retail:
                value: {"mdobject":"Minor", "mdtype":"ATTRIBUTE", "mdaxis":"Brand", "code":"22", "value":"Food Republic", "genericcode":"FR", "translations":[{"name":"title", "languagecode":"en", "value":"Food Republic"}, {"name":"title", "languagecode":"th", "value":"ฟู้ดรีพับลิค"}], "backend":{"backendtype":"String", "url":"https://1112.minorcdn.com/1112one/public/images/noimage.gif"}}
            schema:
              $ref: '#/components/schemas/MasterData'
        required: true

      responses:
        "200":
          description: The master data created or updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MasterData'
              examples:
                retail:
                  value: {"masterdataid":"4d80fdd63d8a4e77bd2c67e16f21ae21", "tenantid":"134beb0f25ed41ca9d963973b3aea8ae", "mdobject":"Minor", "mdtype":"ATTRIBUTE", "mdaxis":"Brand", "code":"22", "value":"Food Republic", "genericcode":"FR", "translations":[{"name":"title", "languagecode":"en", "value":"Food Republic"}, {"name":"title", "languagecode":"th", "value":"ฟู้ดรีพับลิค"}], "backend":{"backendtype":"String", "url":"https://1112.minorcdn.com/1112one/public/images/noimage.gif"}, "updatedate":"2022-07-07T05:36:11.521Z"}
        "401":
          description: The resource requires authentication, which was not supplied with the request
          content: {}
      x-codegen-request-body-name: request

  /masterdata/search:
    post:
      tags:
        - MasterData Service
      description: |
        This method is used to search master data

      operationId: MasterData Search
      requestBody:
        content:
          application/json:
            examples:
              retail:
                value: {"mdobject":"Minor"}
            schema:
              $ref: '#/components/schemas/MasterDataRequest'
        required: true

      responses:
        "200":
          description: Master data list
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/MasterData'
              examples:
                retail:
                  value: [{"masterdataid":"4d80fdd63d8a4e77bd2c67e16f21ae21", "tenantid":"134beb0f25ed41ca9d963973b3aea8ae", "mdobject":"Minor", "mdtype":"ATTRIBUTE", "mdaxis":"Brand", "code":"22", "value":"Food Republic", "genericcode":"FR", "translations":[{"name":"title", "languagecode":"en", "value":"Food Republic"}, {"name":"title", "languagecode":"th", "value":"ฟู้ดรีพับลิค"}], "backend":{"backendtype":"String", "url":"https://1112.minorcdn.com/1112one/public/images/noimage.gif"}, "updatedate":"2022-07-07T05:36:11.521Z"}, {"masterdataid":"c23f25709c7348c9baaab1479b240c30", "tenantid":"134beb0f25ed41ca9d963973b3aea8ae", "mdobject":"Minor", "mdtype":"ATTRIBUTE", "mdaxis":"Brand", "code":"18", "value":"John Bill", "genericcode":"JB", "translations":[{"name":"title", "languagecode":"en", "value":"John Bill"}, {"name":"title", "languagecode":"th", "value":"จอห์น บิล"}], "backend":{"backendtype":"String", "url":"https://1112.minorcdn.com/1112one/public/images/noimage.gif", "publishable":false}, "updatedate":"2022-07-05T08:32:15.631Z"}, {"masterdataid":"a442278180f040c2b4b068b4c321f922", "tenantid":"134beb0f25ed41ca9d963973b3aea8ae", "mdobject":"Minor", "mdtype":"ATTRIBUTE", "mdaxis":"Brand", "code":"19", "value":"Urban Pizza", "genericcode":"UB", "translations":[{"name":"title", "languagecode":"en", "value":"Urban Pizza"}, {"name":"title", "languagecode":"th", "value":"เออร์เบิน พิซซ่า"}], "backend":{"backendtype":"String", "url":"https://1112.minorcdn.com/1112one/public/images/noimage.gif", "publishable":true}, "updatedate":"2022-07-05T08:32:15.631Z"}, {"masterdataid":"5e098973a82b40e9bba6887978e028fb", "tenantid":"134beb0f25ed41ca9d963973b3aea8ae", "mdobject":"Minor", "mdtype":"ATTRIBUTE", "mdaxis":"Brand", "code":"3", "value":"Swensen's", "genericcode":"SW", "translations":[{"name":"title", "languagecode":"en", "value":"Swensen's"}, {"name":"title", "languagecode":"th", "value":"สเวนเซ่นส์"}], "backend":{"backendtype":"String", "url":"https://1112.minorcdn.com/1112one/public/images/brand_logo/MAR2019-2/SW.jpg", "publishable":true}, "updatedate":"2022-07-05T08:32:15.633Z"}, {"masterdataid":"574020ca0e824980913a3c1ae9b51170", "tenantid":"134beb0f25ed41ca9d963973b3aea8ae", "mdobject":"Minor", "mdtype":"ATTRIBUTE", "mdaxis":"Brand", "code":"12", "value":"Basil Thai Kitchen", "genericcode":"TE", "translations":[{"name":"title", "languagecode":"en", "value":"Basil Thai Kitchen"}, {"name":"title", "languagecode":"th", "value":"เบซิล ไทยคิทเช่น"}], "backend":{"backendtype":"String", "url":"https://1112.minorcdn.com/1112one/public/images/noimage.gif", "publishable":true}, "updatedate":"2022-07-05T08:32:15.632Z"}, {"masterdataid":"557d246fad9d4fd0a1dd867361bc803f", "tenantid":"134beb0f25ed41ca9d963973b3aea8ae", "mdobject":"Minor", "mdtype":"ATTRIBUTE", "mdaxis":"category", "parentcode":"2", "code":"12", "value":"Small Bites Ice Cream", "priority":8, "translations":[{"name":"title", "languagecode":"en", "value":"Small Bites Ice Cream"}, {"name":"title", "languagecode":"th", "value":"ไอศกรีมสมอลไบทส์"}], "description":"Strawberry Icy", "backend":{"backendtype":"String", "publishable":true}, "updatedate":"2022-07-05T08:32:16.217Z"}, {"masterdataid":"46552f1db27b4604b7cc4c477441fdab", "tenantid":"134beb0f25ed41ca9d963973b3aea8ae", "mdobject":"Minor", "mdtype":"ATTRIBUTE", "mdaxis":"category", "parentcode":"2", "code":"7", "value":"Ice Cream Bar", "priority":6, "translations":[{"name":"title", "languagecode":"en", "value":"Ice Cream Bar"}, {"name":"title", "languagecode":"th", "value":"ไอศกรีมบาร์"}], "description":" ", "backend":{"backendtype":"String", "publishable":true}, "updatedate":"2022-07-05T08:32:16.187Z"}, {"masterdataid":"63fb88ee6eeb4d588bb5aec184d8df48", "tenantid":"134beb0f25ed41ca9d963973b3aea8ae", "mdobject":"Minor", "mdtype":"ATTRIBUTE", "mdaxis":"category", "parentcode":"2", "code":"9", "value":"Topping", "priority":9, "translations":[{"name":"title", "languagecode":"en", "value":"Topping"}, {"name":"title", "languagecode":"th", "value":"ท้อปปิ้ง"}], "description":" ", "backend":{"backendtype":"String", "publishable":true}, "updatedate":"2022-07-05T08:32:16.217Z"}, {"masterdataid":"ecf46bcee9b6408d9601e6b6f1362f06", "tenantid":"134beb0f25ed41ca9d963973b3aea8ae", "mdobject":"Minor", "mdtype":"ATTRIBUTE", "mdaxis":"category", "parentcode":"2", "code":"8", "value":"Ice Cream Scoop", "priority":7, "translations":[{"name":"title", "languagecode":"en", "value":"Ice Cream Scoop"}, {"name":"title", "languagecode":"th", "value":"ไอศกรีมสกู๊ป"}], "description":" ", "backend":{"backendtype":"String", "publishable":true}, "updatedate":"2022-07-05T08:32:16.217Z"}]
        "401":
          description: The resource requires authentication, which was not supplied with the request
          content: {}
      x-codegen-request-body-name: request

  /display/upsert:
    post:
      tags:
        - MasterData Service
      description: |
        This method is used to create or updata a data model

      operationId: Display Upsert
      requestBody:
        content:
          application/json:
            examples:
              retail:
                value: {"mdobject":"GROUP", "displaytabs":[{"tabcode":"GENERAL", "tabindex":0, "label":"GENERAL"}, {"tabcode":"MEDIAS", "tabindex":1, "label":"MEDIAS"}], "mdtype":"OBJECT", "code":"GROUP", "genericcode":"PRODUCT", "label":"Product Group", "script":"", "backend":{"backendtype":"String", "attributes":[{"entity":"Constant", "code":"codification.typology", "value":"grouped"}, {"entity":"mdobject", "code":"mdobject", "value":"GROUP"}], "idname":"productid"}, "updatedate":"2022-12-26T20:05:37.035+01:00"}
            schema:
              $ref: '#/components/schemas/Display'
        required: true

      responses:
        "200":
          description: The data model created or updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Display'
              examples:
                retail:
                  value: {"displayid":"6e4bfc533ce84fc585ea4b692227f7b9", "tenantid":"134beb0f25ed41ca9d963973b3aea8ae", "mdobject":"GROUP", "displaytabs":[{"tabcode":"GENERAL", "tabindex":0, "label":"GENERAL"}, {"tabcode":"MEDIAS", "tabindex":1, "label":"MEDIAS"}], "mdtype":"OBJECT", "code":"GROUP", "genericcode":"PRODUCT", "label":"Product Group", "script":"", "backend":{"backendtype":"String", "attributes":[{"entity":"Constant", "code":"codification.typology", "value":"grouped"}, {"entity":"mdobject", "code":"mdobject", "value":"GROUP"}], "idname":"productid"}, "updatedate":"2022-12-26T20:05:37.035+01:00"}
        "401":
          description: The resource requires authentication, which was not supplied with the request
          content: {}
      x-codegen-request-body-name: request

  /display/search:
    post:
      tags:
        - MasterData Service
      description: |
        This method is used to search master data

      operationId: Display Search
      requestBody:
        content:
          application/json:
            examples:
              retail:
                value: {"mdtype":"OBJECT"}
            schema:
              $ref: '#/components/schemas/DisplayRequest'
        required: true

      responses:
        "200":
          description: Data model list
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Display'
              examples:
                retail:
                  value: [{"displayid":"ba60b1fb398f4904a123ba734da5206c", "tenantid":"134beb0f25ed41ca9d963973b3aea8ae", "mdobject":"OFFER_PRODUCT", "displaytabs":[{"tabcode":"GENERAL", "tabindex":0, "label":"GENERAL"}], "mdtype":"OBJECT", "code":"OFFER_PRODUCT", "backend":{"backendtype":"String", "attributes":[{"entity":"mdobject", "code":"mdobject", "value":"OFFER_PRODUCT"}], "idname":"offer_productid"}, "updatedate":"2022-12-26T20:05:36.925+01:00"}, {"displayid":"daa27e0df70f42c5b4d833235aa4967a", "tenantid":"134beb0f25ed41ca9d963973b3aea8ae", "mdobject":"CONTRACT_PERIOD", "displaytabs":[{"tabcode":"GENERAL", "tabindex":0, "label":"GENERAL"}], "mdtype":"OBJECT", "code":"CONTRACT_PERIOD", "script":"       ", "backend":{"backendtype":"String", "attributes":[{"entity":"mdobject", "code":"mdobject", "value":"CONTRACT_PERIOD"}], "idname":"contract_periodid"}, "updatedate":"2022-12-26T20:05:36.951+01:00"}, {"displayid":"4402d0a979e54406b755f07804e1d1c3", "tenantid":"134beb0f25ed41ca9d963973b3aea8ae", "mdobject":"PRODUCT_RETAIL", "displaytabs":[{"tabcode":"GENERAL", "tabindex":0, "label":"GENERAL"}], "mdtype":"OBJECT", "code":"PRODUCT_RETAIL", "backend":{"backendtype":"String", "attributes":[{"entity":"mdobject", "code":"mdobject", "value":"PRODUCT_RETAIL"}], "idname":"product_retailid"}, "updatedate":"2022-12-26T20:05:36.830+01:00"}]
        "401":
          description: The resource requires authentication, which was not supplied with the request
          content: {}
      x-codegen-request-body-name: request
