{"openapi":"3.1.0","info":{"title":"loyalty","description":"","version":"1.0.0"},"servers":[{"url":"https://yourwebhook.com/"}],"components":{"schemas":{"Customer":{"type":"object","description":"Details about the customer placing the order.","properties":{"email":{"type":["string","null"],"description":"The customer's email address."},"phoneNumber":{"type":["string","null"],"description":"The customer's phone number."},"loyaltyProviderCustomerId":{"type":["string","null"],"description":"The customer's unique identifier within the loyalty provider's system."},"name":{"type":["string","null"],"description":"The customer's full name."}}},"Item":{"type":"object","description":"Details for an individual item within the order. This schema is recursive, supporting nested items (e.g., modifiers).","properties":{"plu":{"type":"string","description":"The Product Look-Up code for the item."},"name":{"type":"string","description":"The display name of the item."},"price":{"type":"number","description":"The base price of the item (before any item-specific discounts). It will be sent as an integer with 2 decimal digits, e.g. 1 euro would be sent as 100."},"quantity":{"type":"number","description":"The quantity of the item in the order."},"subItems":{"type":"array","description":"A list of child items or modifiers (recursive Item structure).","items":{"$ref":"#/components/schemas/Item"}}},"required":["plu","name","price","quantity","subItems"]},"Discount":{"type":"object","description":"Details for a discount applied to the entire order or to specific items.","properties":{"name":{"type":"string","description":"The name or title of the discount for display purposes."},"programId":{"type":"string","description":"The ID of the loyalty program that generated this discount."},"type":{"type":"string","description":"The classification of the discount.","enum":["order_percent_off","order_flat_off","item_percent_off","item_flat_off","item_bogof","item_free","wallet_cash","compensation_card"],"x-enum-descriptions":{"order_percent_off":"Order Percentage Off (Order-Level): A percentage discount applied to the subtotal of the entire order.","order_flat_off":"Order Flat Off (Order-Level): A fixed monetary amount discount applied to the subtotal of the entire order.","item_percent_off":"Item Percentage Off (Item-Level): A percentage discount applied to a specific item or group of items in the basket.","item_flat_off":"Item Flat Off (Item-Level): A fixed monetary amount discount applied to a specific item or group of items in the basket.","item_bogof":"Item Buy One Get One Free (Item-Level, Promotional): A promotional discount where the price of one or more items is reduced, typically to zero, based on the purchase of other items.","item_free":"Item Free (Item-Level, Promotional): A discount used to set the price of a specific item to zero (a free item).","wallet_cash":"Wallet Cash (Source-Specific): A discount generated by redeeming the customer's cash or stored value balance from their loyalty wallet.","compensation_card":"Compensation Card (Source-Specific): A discount generated from a compensation, gift, or store credit card."}},"amount":{"type":["number","null"],"description":"The monetary value of the discount (in the smallest currency unit). For percentage discounts, the value 3033 represents a percent discount of 30.33%."}},"required":["name","programId","type"]}}},"paths":{"/loyalty/registration":{"post":{"summary":"Register Loyalty Partner","description":"","operationId":"loyalty_registration","parameters":[{"name":"Content-Type","in":"header","description":"application/json","schema":{"type":"string","default":"application/json"}},{"name":"Accept","in":"header","description":"application/json","schema":{"type":"string","default":"application/json"}},{"name":"User-Agent","in":"header","description":"Deliverect/{version}","schema":{"type":"string","default":"Deliverect/{version}"}},{"name":"X-Server-Authorization-HMAC-SHA256","in":"header","description":"{signature}","schema":{"type":"string","default":"{signature}"}}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"apiKey":{"type":"string","description":"A unique identifier, typically a string of characters, used to authenticate and authorize a user, application, or project when interacting with an API."},"loyaltyProfileId":{"type":"string","description":"The Id of the profile where the response configuration was stored"},"accountId":{"type":"string","description":"The Deliverect's account id of the customer."}}},"examples":{"Registration Example":{"value":{"accountId":"6401c934c43f86ebfedaeb9c","loyaltyProfileId":"67acb1893b57bab8866dfa4c","apiKey":"123***890"},"summary":"Registration Example"}}}}},"responses":{"200":{"description":"200","content":{"application/json":{"examples":{"Result":{"value":{"customerURL":"https://yourserver.com/customer","customerWalletURL":"https://yourserver.com/customerWallet","validateWalletURL":"https://yourserver.com/validateWallet","loyaltyProgramsURL":"https://yourserver.com/programs","loyaltyValidateProgramsURL":"https://yourserver.com/validatePrograms","orderURL":"https://yourserver.com/orders","tiersURL":"https://yourserver.com/tiers"}},"Result with SSO":{"value":{"customerURL":"https://yourserver.com/customer","customerWalletURL":"https://yourserver.com/customerWallet","validateWalletURL":"https://yourserver.com/validateWallet","loyaltyProgramsURL":"https://yourserver.com/programs","loyaltyValidateProgramsURL":"https://yourserver.com/validatePrograms","orderURL":"https://yourserver.com/orders","tiersURL":"https://yourserver.com/tiers","oauthUrl":"https://yourserver.com/oauth","oauthClientId":"myClientId","oauthClientSecret":"zxcv1323"}}},"schema":{"type":"object","properties":{"customerURL":{"type":"string","example":"https://yourserver.com/customer"},"customerWalletURL":{"type":"string","example":"https://yourserver.com/customerWallet"},"validateWalletURL":{"type":"string","example":"https://yourserver.com/validateWallet"},"loyaltyProgramsURL":{"type":"string","example":"https://yourserver.com/programs"},"loyaltyValidateProgramsURL":{"type":"string","example":"https://yourserver.com/validatePrograms"},"orderURL":{"type":"string","example":"https://yourserver.com/orders"},"tiersURL":{"type":"string","example":"https://yourserver.com/tiers"},"oauthUrl":{"type":"string","example":"https://yourserver.com/oauth"},"oauthClientId":{"type":"string","example":"myClientId"},"oauthClientSecret":{"type":"string","example":"zxcv1323"}}}}}},"400":{"description":"400","content":{"application/json":{"examples":{"Result":{"value":""}}}}}},"deprecated":false}},"/loyalty/customer":{"post":{"summary":"Create Loyalty Customer","description":"","operationId":"loyalty_customer","parameters":[{"name":"Content-Type","in":"header","schema":{"type":"string","default":"application/json"}},{"name":"Accept","in":"header","description":"application/json","schema":{"type":"string","default":"application/json"}},{"name":"User-Agent","in":"header","schema":{"type":"string","default":"Deliverect/{version}"}},{"name":"X-Server-Authorization-HMAC-SHA256","in":"header","schema":{"type":"string","default":"{signature}"}}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["email"],"properties":{"email":{"type":"string","description":"email of the end customer"},"phoneNumber":{"type":"string","description":"phone number of the end customer in E164 format."},"firstName":{"type":"string","description":"first name of the end customer"},"lastName":{"type":"string","description":"last name of the end customer"},"dateOfBirth":{"type":"string","description":"date of birth of the end customer in ISO format","format":"date"},"accountId":{"type":"string","description":"The deliverect customer account id"},"loyaltyProfileId":{"type":"string","description":"The Id of the profile where the response configuration was stored"},"locationId":{"type":"string","description":"The location ID related to the merchant's account in Deliverect"},"channelLinkId":{"type":"string","description":"The channel link ID related to the location of the merchant's account in Deliverect"},"marketingConsent":{"type":"object","properties":{"SMS":{"type":"boolean","description":"Indicates whether the customer has given consent to receive marketing communications via SMS."},"email":{"type":"boolean","description":"Indicates whether the customer has given consent to receive marketing communications via email."}}}}}}}},"responses":{"201":{"description":"201","content":{"application/json":{"examples":{"Result":{"value":{"firstName":"John","lastName":"Doe","email":"mr.doe@email.com","phoneNumber":"32111111111","dateOfBirth":"1970-01-01T00:00:00+00:00","balance":2197,"acceptedTCAt":"1970-01-01T00:00:00+00:00","tier":{"name":"Gold","description":"For premium members","media":{"url":"https://image.png","mediaType":"image"}},"lifetimePointsBalance":7837,"providerId":"123","marketingConsent":{"SMS":true,"email":false}}}},"schema":{"type":"object","properties":{"firstName":{"type":"string","example":"John"},"lastName":{"type":"string","example":"Doe"},"email":{"type":"string","example":"mr.doe@email.com"},"phoneNumber":{"type":"string","example":"32111111111"},"dateOfBirth":{"type":"string","example":"1970-01-01T00:00:00+00:00"},"balance":{"type":"integer","example":2197,"default":0},"acceptedTCAt":{"type":"string","example":"1970-01-01T00:00:00+00:00"},"tier":{"type":"object","properties":{"name":{"type":"string","example":"Gold"},"description":{"type":"string","example":"For premium members"},"media":{"type":"object","properties":{"url":{"type":"string","example":"https://image.png"},"mediaType":{"type":"string","example":"image"}}}}},"lifetimePointsBalance":{"type":"integer","example":7837,"default":0},"providerId":{"type":"string","example":"123"}}}}}},"409":{"description":"409","content":{"text/plain":{"examples":{"Result":{"value":""}}}}}},"deprecated":false}},"/loyalty/customer/":{"get":{"summary":"Get Loyalty Customer","description":"","operationId":"loyalty_get_customer","parameters":[{"name":"email","in":"query","description":"Email of the end customer. The requirement of this field will depend on the loyalty integration configured on the customer's account","schema":{"type":"string"}},{"name":"phoneNumber","in":"query","description":"Phone number of the end customer in E164 format. The requirement of this field will depend on the loyalty integration configured on the customer's account","schema":{"type":"string"}},{"name":"accountId","in":"query","description":"The merchant's account ID in Deliverect","schema":{"type":"string"}},{"name":"loyaltyProfileId","in":"query","description":"The Id of the profile where the response configuration was stored","schema":{"type":"string"}},{"name":"Content-Type","in":"header","description":"application/json","schema":{"type":"string","default":"application/json"}},{"name":"Accept","in":"header","description":"application/json","schema":{"type":"string","default":"application/json"}},{"name":"User-Agent","in":"header","description":"Deliverect/{version}","schema":{"type":"string","default":"Deliverect/{version}"}},{"name":"X-Server-Authorization-HMAC-SHA256","in":"header","description":"{signature}","schema":{"type":"string","default":"{signature}"}},{"in":"query","name":"locationId","schema":{"type":"string"},"description":"The location ID related to the merchant's account in Deliverect"},{"in":"query","name":"channelLinkId","schema":{"type":"string"},"description":"The channel link ID related to the location of the merchant's account in Deliverect"}],"responses":{"200":{"description":"200","content":{"application/json":{"examples":{"Result":{"value":{"providerId":"partner-customer-id-1234","firstName":"John","lastName":"Doe","email":"john.doe@acme.com","phoneNumber":"+32111111111","dateOfBirth":"1970-01-01T00:00:00+00:00","status":"active","acceptedTCAt":"1970-01-01T00:00:00+00:00","lifetimePointsBalance":7837,"tier":{"name":"Gold","description":"For premium members","media":{"url":"https://image.png","mediaType":"image"}},"marketingConsent":{"SMS":true,"email":false}}}},"schema":{"type":"object","properties":{"providerId":{"type":"string","example":"partner-customer-id-1234"},"firstName":{"type":"string","example":"John"},"lastName":{"type":"string","example":"Doe"},"email":{"type":"string","example":"john.doe@acme.com"},"phoneNumber":{"type":"string","example":"+32111111111"},"dateOfBirth":{"type":"string","example":"1970-01-01T00:00:00+00:00"},"status":{"type":"string","example":"active"},"acceptedTCAt":{"type":"string","example":"1970-01-01T00:00:00+00:00"},"lifetimePointsBalance":{"type":"integer","example":7837,"default":0},"tier":{"type":"object","properties":{"name":{"type":"string","example":"Gold"},"description":{"type":"string","example":"For premium members"},"media":{"type":"object","properties":{"url":{"type":"string","example":"https://image.png"},"mediaType":{"type":"string","example":"image"}}}}},"marketingConsent":{"type":"object","properties":{"SMS":{"type":"boolean","example":true},"email":{"type":"boolean","example":false}}}}}}}},"404":{"description":"404","content":{"text/plain":{"examples":{"Result":{"value":"Not Found"}}}}}},"deprecated":false}},"/loyalty/tiers":{"get":{"summary":"Get Loyalty Tiers","description":"","operationId":"loyalty_tiers","parameters":[{"name":"accountId","in":"query","description":"The merchant's account Id in Deliverect","schema":{"type":"string"}},{"name":"loyaltyProfileId","in":"query","description":"The Id of the profile where the response configuration was stored","schema":{"type":"string"}},{"name":"Content-Type","in":"header","schema":{"type":"string","default":"application/json"}},{"name":"Accept","in":"header","schema":{"type":"string","default":"application/json"}},{"name":"User-Agent","in":"header","schema":{"type":"string","default":"Deliverect/{version}"}},{"name":"X-Server-Authorization-HMAC-SHA256","in":"header","schema":{"type":"string","default":"{signature}"}},{"in":"query","name":"locationId","schema":{"type":"string"},"description":"The location ID related to the merchant's account in Deliverect"},{"in":"query","name":"channelLinkId","schema":{"type":"string"},"description":"The channel link ID related to the location of the merchant's account in Deliverect"}],"responses":{"200":{"description":"200","content":{"application/json":{"examples":{"Result":{"value":"[\n   {\n       \"name\": \"Bronze\",\n       \"description\": \"Way to go!\",\n       \"media\": {\n           \"url\": \"https://deliverect.com/icon1.png\",\n           \"mediaType\": \"image\"\n       }\n   },\n   {\n       \"name\": \"Silver\",\n       \"description\": \"This is a higher tier!\",\n       \"media\": {\n           \"url\": \"https://deliverect.com/icon2.png\",\n           \"mediaType\": \"image\"\n       }\n   }\n]"}},"schema":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","example":"Bronze"},"description":{"type":"string","example":"Way to go!"},"media":{"type":"object","properties":{"url":{"type":"string","example":"https://deliverect.com/icon1.png"},"mediaType":{"type":"string","example":"image"}}}}}}}}},"400":{"description":"400","content":{"application/json":{"examples":{"Result":{"value":"{}"}},"schema":{"type":"object","properties":{}}}}}},"deprecated":false}},"/auth/token":{"post":{"summary":"Loyalty SSO - OAuth token exchange","description":"","operationId":"loyalty_token","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"grant_type":{"type":"string","default":"authorization_code"},"client_id":{"type":"string"},"client_secret":{"type":"string"},"code":{"type":"string"},"accountId":{"type":"string","description":"The deliverect customer account id"},"loyaltyProfileId":{"type":"string","description":"The loyalty profile id being use"}},"required":["client_secret","code","client_id","grant_type"]},"examples":{"New Example":{"summary":"New Example","value":{"grant_type":"authorization_code","client_id":"string","client_secret":"string","code":"string","accountId":"string","loyaltyProfileId":"string"}}}}}},"responses":{"200":{"description":"200","content":{"application/json":{"examples":{"Result":{"value":"{\n    \"token_type\": \"Bearer\",\n    \"scope\": \"passwordless\",\n    \"created_at\": \"1709743524\",\n    \"access_token\": \"test-access-token\",\n    \"refresh_token\": \"test-refresh-token\"\n}"}},"schema":{"type":"object","properties":{"token_type":{"type":"string","example":"Bearer"},"scope":{"type":"string","example":"passwordless"},"created_at":{"type":"string","example":"1709743524"},"access_token":{"type":"string","example":"test-access-token"},"refresh_token":{"type":"string","example":"test-refresh-token"}}}}}},"400":{"description":"400","content":{"application/json":{"examples":{"Result":{"value":"{}"}},"schema":{"type":"object","properties":{}}}}}},"deprecated":false,"parameters":[{"name":"Content-Type","in":"header","description":"application/json","schema":{"type":"string","default":"application/json"}},{"name":"Accept","in":"header","description":"application/json","schema":{"type":"string","default":"application/json"}},{"name":"User-Agent","in":"header","description":"Deliverect/{version}","schema":{"type":"string","default":"Deliverect/{version}"}},{"name":"X-Server-Authorization-HMAC-SHA256","in":"header","description":"{signature}","schema":{"type":"string","default":"{signature}"}}]}},"/loyalty/order":{"post":{"summary":"Loyalty Order Notification","description":"","operationId":"loyalty_order","parameters":[{"name":"Content-Type","in":"header","schema":{"type":"string","default":"application/json"}},{"name":"Accept","in":"header","schema":{"type":"string","default":"application/json"}},{"name":"User-Agent","in":"header","schema":{"type":"string","default":"Deliverect/{version}"}},{"name":"X-Server-Authorization-HMAC-SHA256","in":"header","schema":{"type":"string","default":"{signature}"}}],"responses":{"200":{"description":"200","content":{"application/json":{"examples":{"Result":{"value":"{}"}},"schema":{"type":"object","properties":{}}}}},"400":{"description":"400","content":{"application/json":{"examples":{"Result":{"value":"{}"}},"schema":{"type":"object","properties":{}}}}}},"deprecated":false,"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"accountId":{"type":"string","description":"The unique identifier for the merchant account."},"account":{"type":"string","deprecated":true,"description":"(DEPRECATED) Use `accountId` instead."},"channelLinkId":{"type":"string","description":"The unique identifier linking the channel to the account/location."},"locationId":{"type":"string","description":"The unique identifier for the specific location/store where the order was placed."},"location":{"type":"string","deprecated":true,"description":"(DEPRECATED) Use `locationId` instead."},"orderType":{"type":"integer","description":"The type of delivery.","enum":[0,1,2,3,4],"x-enum-descriptions":{"0":"Unknown","1":"Pickup","2":"Delivery","3":"EatIn","4":"Curbside"}},"paymentAmount":{"type":"number","description":"The final amount paid by the customer."},"customer":{"allOf":[{"$ref":"#/components/schemas/Customer"}],"description":"Details about the customer who placed the order."},"created":{"type":["string","null"],"format":"date-time","description":"Timestamp of when the order was created. May be `null` in some initial API calls (e.g., `get programs`)."},"channelOrderDisplayId":{"type":["string","null"],"description":"The order ID displayed to the customer on the channel."},"orderId":{"type":["string","null"],"description":"The system's unique identifier for the order."},"items":{"type":"array","description":"A list of all items included in the order.","items":{"$ref":"#/components/schemas/Item"}},"subTotal":{"type":["number","null"],"description":"The total price of all items before taxes and discounts."},"taxTotal":{"type":["number","null"],"description":"The total tax applied to the order."},"discountTotal":{"type":["number","null"],"description":"The total value of all discounts applied to the order."},"discounts":{"type":"array","description":"A list of all applied discounts.","items":{"$ref":"#/components/schemas/Discount"}},"decimalDigits":{"type":"number","description":"The number of decimal places used for currency precision. Default is 2.","default":2},"serviceCharge":{"type":["number","null"],"description":"Any service fee applied to the order."},"deliveryCost":{"type":["number","null"],"description":"The cost of delivery."},"bagFee":{"type":["number","null"],"description":"Any fee applied for packaging or bags."},"tip":{"type":["number","null"],"description":"The customer-provided tip."},"driverTip":{"type":["number","null"],"description":"The tip specifically allocated for the driver."},"smallOrderFee":{"type":["number","null"],"description":"Any fee applied for not meeting a minimum order threshold."}},"required":["accountId","channelLinkId","locationId","orderType","paymentAmount","customer","items","decimalDigits"],"description":"This schema defines the comprehensive structure of an order used for loyalty operations (such as program validation or redemption)."},"examples":{"Loyalty Order Example":{"summary":"Loyalty Order Example","value":{"accountId":"65********************e9","locationId":"65********************a4","channelLinkId":"65********************e2","loyaltyProfileId":"63********************a7","orderType":1,"paymentAmount":899,"customer":{"email":"email@email.com","phoeNumber":"+32111111111","name":"Jane Doe","loyaltyProviderCustomerId":"123"},"created":"YYYY-MM-DDTHH:mm:ss.SSSSSSZ","channelOrderDisplayId":"T**4206","orderId":"TEST******4206","items":[{"plu":"P-0009","name":"Two Tub Bundle","price":1399,"quantity":1,"subItems":[{"plu":"M-0007","name":"Chocolate Ice Cream","price":0,"quantity":1,"subItems":[]},{"plu":"M-0008","name":"Cherry Sorbet","price":0,"quantity":1,"subItems":[]}]}],"subTotal":1399,"taxTotal":null,"discountTotal":500,"discounts":[{"name":"$5 off any order","programId":"1","type":"order_flat_off","amount":500}],"decimalDigits":2,"serviceCharge":0,"deliveryCost":0,"bagFee":0,"tip":0,"driverTip":0,"smallOrderFee":0}}}}}}}},"/loyalty-programs":{"post":{"summary":"Get Loyalty Programs","description":"","operationId":"loyalty_programs_loyalty","parameters":[{"name":"Content-Type","in":"header","schema":{"type":"string","default":"application/json"}},{"name":"Accept","in":"header","schema":{"type":"string","default":"application/json"}},{"name":"User-Agent","in":"header","schema":{"type":"string","default":"Deliverect/{version}"}},{"name":"X-Server-Authorization-HMAC-SHA256","in":"header","schema":{"type":"string","default":"{signature}"}}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["sessionId","order"],"properties":{"sessionId":{"type":"string","description":"A unique session identifier."},"order":{"type":"object","description":"See Order schema: https://developers.deliverect.com/update/reference/loyalty-order-schema/","properties":{"items":{"type":"array","description":"Items included in the order.","items":{"type":"object","properties":{"plu":{"type":"string"},"name":{"type":"string"},"price":{"type":"integer"},"quantity":{"type":"integer"},"subItems":{"type":"array","items":{"type":"object","properties":{"plu":{"type":"string"},"name":{"type":"string"},"price":{"type":"integer"},"quantity":{"type":"integer"},"subItems":{"type":"array","items":{"type":"object","properties":{"plu":{"type":"string"},"name":{"type":"string"},"price":{"type":"integer"},"quantity":{"type":"integer"},"subItems":{"type":"array","items":{"type":"object"}}}}}}}}}}},"discounts":{"type":"array","description":"Discounts already applied to the order.","items":{"type":"object","properties":{"name":{"type":"string"},"programId":{"type":"string"},"type":{"type":"string"},"amount":{"type":"integer"}}}}}}}},"examples":{"Loyalty Program Request Example":{"summary":"Loyalty Program Request Example","value":{"order":{"account":"6403c0b9ea6956b6f6970c5b","location":"6403c0baea6956b6f6970c5c","channelLinkId":"6403c0baea6956b6f6970c5c","orderType":3,"customer":{"email":"loyalty@customer.com","phoneNumber":"+31201234567","name":"John Doe"},"items":[{"plu":"CMB-02","name":"Vegetarian Rames","price":1700,"quantity":1,"subItems":[{"plu":"VEG-01","name":"Vegetables Sayur Lodeh","price":0,"quantity":1,"subItems":[]},{"plu":"VEG-02","name":"Vegetables Mix Tumisan","price":0,"quantity":1,"subItems":[]}]}],"discounts":[{"name":"Amount discount","programId":"1234","type":"discount_amount","amount":100}],"subTotal":1700,"discountTotal":-100,"paymentAmount":1600,"decimalDigits":2}}}}}}},"responses":{"200":{"description":"200","content":{"application/json":{"examples":{"Result":{"value":[{"programId":"1","title":"Discount","description":"Discount amount for the order.","cost":100,"type":"discount_amount","discount":100,"applicable":true},{"programId":"2","title":"Free item","description":"Get an item for free.","cost":500,"type":"free_item","itemPLU":"DRN-01","media":{"url":"https://program.media/image","mediaType":"image"},"applicable":false},{"programId":"3","title":"Buy one get one for free","description":"Order an item and get another one for free.","cost":100,"type":"buy_one_get_one_free","itemPLU":"DRN-02","media":{"url":"https://program.media/image","mediaType":"image"},"applicable":true},{"programId":"4","title":"50% Order percent off","type":"discount_percentage","applicable":true,"description":"Get 50% OFF the order","cost":200,"media":{"url":"https://res.cloudinary.com/punchh/image/upload/c_limit,f_auto,fl_lossy,g_center,q_auto/v1/punchhstatic-mothership2/redeemables/redeemable_images/000/036/785/original/dd4c98899742473e80ac703670279794ead73e36.png","mediaType":"image"},"expiresAt":null,"discount":100},{"programId":"5","title":"Coke $10 off","type":"item_discount_amount","applicable":true,"description":"To quench your thirst!","cost":150,"media":{"url":"https://image.npg","mediaType":"image"},"expiresAt":null,"discount":1000,"itemPLU":"1282933778"},{"programId":"6","title":"Coke 50% off","type":"item_discount_percentage","applicable":true,"description":"To quench your thirst!","cost":150,"media":{"url":"https://image.npg","mediaType":"image"},"expiresAt":null,"discount":5000,"itemPLU":"1282933778"}]}},"schema":{"type":"array","items":{"type":"object","properties":{"programId":{"type":"string","example":"1"},"title":{"type":"string","example":"Discount"},"description":{"type":"string","example":"Discount amount for the order."},"cost":{"type":"integer","example":100,"default":0},"type":{"type":"string","example":"discount_amount"},"discount":{"type":"integer","example":100,"default":0},"applicable":{"type":"boolean","example":true,"default":true}}}}}}},"400":{"description":"400","content":{"application/json":{"examples":{"Result":{"value":"{}"}},"schema":{"type":"object","properties":{}}}}}},"deprecated":false}},"/validate_program":{"post":{"description":"","responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"programId":{"type":"string","example":"1"},"validationErrors":{"type":"array","items":{"type":"object","properties":{}}},"discounts":{"type":"array","items":{"type":"object","properties":{"provider":{"type":"string","example":"loyalty"},"externalId":{"type":"string","example":"program_123"},"offer":{"type":"object","properties":{"type":{"type":"string","example":"flat_off"},"value":{"type":"integer","example":200,"default":0}}},"scope":{"type":"object","properties":{"type":{"type":"string","example":"order"}}}}}}}}},"examples":{"OK":{"summary":"OK","value":[{"programId":"1","validationErrors":[],"discounts":[{"provider":"loyalty","externalId":"program_123","offer":{"type":"flat_off","value":200},"scope":{"type":"order"}}]}]}}}}}},"parameters":[{"name":"Content-Type","in":"header","description":"application/json","schema":{"type":"string","default":"application/json"}},{"name":"Accept","in":"header","description":"application/json","schema":{"type":"string","default":"application/json"}},{"name":"User-Agent","in":"header","description":"Deliverect/{version}","schema":{"type":"string","default":"Deliverect/{version}"}},{"name":"X-Server-Authorization-HMAC-SHA256","in":"header","description":"{signature}","schema":{"type":"string","default":"{signature}"}}],"operationId":"loyalty_validateprogram","summary":"Validate Programs","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{}},"examples":{"Validate Program Example":{"summary":"Validate Program Example","value":{"sessionId":"test","accountId":"6798b2b2a030bcf7dd6c1ee0","loyaltyProfileId":"68fa15d0ab58f558a01a77de","locationId":"684940131579e410c7792348","channelLinkId":"684940251579e410c7792352","programIds":["1"],"order":{"items":[{"plu":"1324882025","name":"Coke","price":500,"quantity":2}],"customer":{"email":"john.doe@test.com","phoneNumber":"+32121212121","loyaltyProviderCustomerId":"abc123"},"decimalDigits":0,"deliveryCost":0,"serviceCharge":0,"orderType":1,"tip":0}}}}}}}}},"/loyalty/cancelOrder":{"post":{"summary":"Cancel Loyalty Order","description":"","operationId":"loyalty_cancelorder","parameters":[{"name":"Content-Type","in":"header","schema":{"type":"string","default":"application/json"}},{"name":"Accept","in":"header","schema":{"type":"string","default":"application/json"}},{"name":"User-Agent","in":"header","schema":{"type":"string","default":"Deliverect/{version}"}},{"name":"X-Server-Authorization-HMAC-SHA256","in":"header","schema":{"type":"string","default":"{signature}"}}],"responses":{"200":{"description":"200","content":{"application/json":{"examples":{"Result":{"value":"{}"}},"schema":{"type":"object","properties":{}}}}},"400":{"description":"400","content":{"application/json":{"examples":{"Result":{"value":"{}"}},"schema":{"type":"object","properties":{}}}}}},"deprecated":false,"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{}},"examples":{"Cancel Loyalty Order Example":{"summary":"Cancel Loyalty Order Example","value":{"orderId":"63********************a7","loyaltyProfileId":"63********************a7","accountId":"6403c0b9ea6956b6f6970c5b","locationId":"61********************b4","channelLinkId":"61********************c3","channelOrderDisplayId":"TESTORDER1234","isCancelled":true,"cancellationReason":"Customer cancelled.","customer":{"email":"email@email.com","phoneNumber":"+32111111111","loyaltyProviderCustomerId":"123","name":"John Doe"}}}}}}}}},"/loyalty/get/wallet":{"get":{"description":"","operationId":"loyalty_get_wallet","responses":{"200":{"description":"","content":{"application/json":{"examples":{"OK":{"summary":"OK","value":{"points":{"balance":150,"expirations":[{"amount":500,"date":"YYYY-MM-DD"}]},"cash":{"balanceAmount":1000,"expirations":[{"amount":150,"date":"YYYY-MM-DD"}]}}}},"schema":{"type":"object","properties":{"points":{"type":"object","properties":{"balance":{"type":"integer","example":150,"default":0},"expirations":{"type":"array","items":{"type":"object","properties":{"amount":{"type":"integer","example":500,"default":0},"date":{"type":"string","example":"YYYY-MM-DD"}}}}}},"cash":{"type":"object","properties":{"balanceAmount":{"type":"integer","example":1000,"default":0},"expirations":{"type":"array","items":{"type":"object","properties":{"amount":{"type":"integer","example":150,"default":0},"date":{"type":"string","example":"YYYY-MM-DD"}}}}}}}}}}}},"parameters":[{"name":"Content-Type","in":"header","description":"application/json","schema":{"type":"string","default":"application/json"}},{"name":"Accept","in":"header","description":"application/json","schema":{"type":"string","default":"application/json"}},{"name":"User-Agent","in":"header","description":"Deliverect/{version}","schema":{"type":"string","default":"Deliverect/{version}"}},{"name":"X-Server-Authorization-HMAC-SHA256","in":"header","description":"{signature}","schema":{"type":"string","default":"{signature}"}}],"x-readme":{},"summary":"Get Loyalty Customer Wallet"}}}}