{"activeVersionTag":"latest","latestAvailableVersionTag":"latest","collection":{"info":{"_postman_id":"bf6c8795-a81f-427a-b990-18f9c78ea8bc","name":"Loyalty and Promotion","description":"## Note on Terminology:\n\nThis documentation page reflects the internal terminology used in YouTap systems. With external integrations, some of the terms will inevitably be different.\n\nHere are two of the most notable comparisons:\n\n- \"Coupons\" are also called \"offers\"\n    \n- \"Customers\" are also \"wallets\"\n    \n\n## Description\n\nThe aim of \"Loyalty and Promotion\" is to reward customers in as many ways as possible - to encourage loyalty, in response to loyalty, and to guide them towards desirable behaviour.\n\nThe primary way to set up rewards for customers is with campaigns - sets of rules that define the requirements to qualify for a certain reward, a description of the campaign for the customer to see, and parameters for when the campaign is active.\n\nWhile a campaign runs virtual coupons will be created and allocated to customers who meet the criteria, and the value of the coupons that have been accrued, as well as the balance history and the descriptions of the campaigns that they are eligible for but have not yet met the requirements to be awarded a coupon from.\n\n### Coupon Statuses\n\nNote: For ELIGIBLE, ASSIGNED, and ELIGIBLE_AS_ASSIGNED it is possible for the customer's to regress to a previous status if the customer takes certain actions such as changing to a changing to a cheaper plan, thereby changing their metadata scores so they don't match the criteria for that campaign any more.\n\n- ELIGIBLE: The customer has matched the eligibility criteria, but not the assignment criteria for this campaign.\n    \n- ASSIGNED: The customer has earned the value of the coupon - it has been added to their usable balance.\n    \n- ELIGIBLE_AS_ASSIGNED: A technical distinction between the \"assigned\" usable balance and an amount that the user should see as usable. This is so that backend integrations can ignore highly volatile such as those given for trading in old devices and only see the concrete numbers, while the customer sees the amount that they can probably rely on, but will be adjusted slightly at POS.\n    \n- REDEEMED: The customer has fully redeemed the value of this coupon.\n    \n- EXPIRED: The customer did not redeem the coupon before its expiry date. Its value has been removed from their wallet.\n    \n\n## General Errors\n\n#### Problem response:\n\n| **Parameter** | **Meaning** | **Example** |\n| --- | --- | --- |\n| Type | URL reference to a description of the error | \"[https://www.youtap.com/problems/resource-not-found\"](https://www.youtap.com/problems/resource-not-found) |\n| Title | Name of the error | \"Resource not found\" |\n| Detail | Specific explanation of the error | \"Customer not found\" |\n| Status | HTTP status of the response | 404 |\n| Instance | _Unused_ | \"\" |\n| Error Key | Key representation of the error | resource_not_found |\n| Error Code | _Unused_ | null |\n| Error Description | _Unused_ | null |\n\n- **401:** Missing/expired/invalid authorization header. No response body.\n    \n- **403:** Authorization header not accepted for this resource. No response body.\n    \n- **404:** Resource not found. Either no response body, or a Problem.\n    \n\nOther HTTP status codes, such as 500, are unexpected, but will usually have \"title\", \"path\", and \"status\" parameters.","schema":"https://schema.getpostman.com/json/collection/v2.0.0/collection.json","isPublicCollection":false,"owner":"15470766","team":2919620,"collectionId":"bf6c8795-a81f-427a-b990-18f9c78ea8bc","publishedId":"2s8YzWSgAR","public":true,"publicUrl":"https://promotion.api.youtap.com","privateUrl":"https://go.postman.co/documentation/15470766-bf6c8795-a81f-427a-b990-18f9c78ea8bc","customColor":{"top-bar":"FFFFFF","right-sidebar":"303030","highlight":"00aeef"},"documentationLayout":"classic-double-column","customisation":null,"version":"8.10.1","publishDate":"2023-01-24T21:16:55.000Z","activeVersionTag":"latest","documentationTheme":"light","metaTags":{},"logos":{}},"statusCode":200},"environments":[],"user":{"authenticated":false,"permissions":{"publish":false}},"run":{"button":{"js":"https://run.pstmn.io/button.js","css":"https://run.pstmn.io/button.css"}},"web":"https://www.getpostman.com/","team":{"logo":"https://res.cloudinary.com/postman/image/upload/t_team_logo_pubdoc/v1/team/5e33f9ad2642aac9a985e25d3345dea0ea57b2e16c23c03ceb44e312bd55bb72","favicon":"https://youtap.com/favicon.ico"},"isEnvFetchError":false,"languages":"[{\"key\":\"csharp\",\"label\":\"C#\",\"variant\":\"HttpClient\"},{\"key\":\"csharp\",\"label\":\"C#\",\"variant\":\"RestSharp\"},{\"key\":\"curl\",\"label\":\"cURL\",\"variant\":\"cURL\"},{\"key\":\"dart\",\"label\":\"Dart\",\"variant\":\"http\"},{\"key\":\"go\",\"label\":\"Go\",\"variant\":\"Native\"},{\"key\":\"http\",\"label\":\"HTTP\",\"variant\":\"HTTP\"},{\"key\":\"java\",\"label\":\"Java\",\"variant\":\"OkHttp\"},{\"key\":\"java\",\"label\":\"Java\",\"variant\":\"Unirest\"},{\"key\":\"javascript\",\"label\":\"JavaScript\",\"variant\":\"Fetch\"},{\"key\":\"javascript\",\"label\":\"JavaScript\",\"variant\":\"jQuery\"},{\"key\":\"javascript\",\"label\":\"JavaScript\",\"variant\":\"XHR\"},{\"key\":\"c\",\"label\":\"C\",\"variant\":\"libcurl\"},{\"key\":\"nodejs\",\"label\":\"NodeJs\",\"variant\":\"Axios\"},{\"key\":\"nodejs\",\"label\":\"NodeJs\",\"variant\":\"Native\"},{\"key\":\"nodejs\",\"label\":\"NodeJs\",\"variant\":\"Request\"},{\"key\":\"nodejs\",\"label\":\"NodeJs\",\"variant\":\"Unirest\"},{\"key\":\"objective-c\",\"label\":\"Objective-C\",\"variant\":\"NSURLSession\"},{\"key\":\"ocaml\",\"label\":\"OCaml\",\"variant\":\"Cohttp\"},{\"key\":\"php\",\"label\":\"PHP\",\"variant\":\"cURL\"},{\"key\":\"php\",\"label\":\"PHP\",\"variant\":\"Guzzle\"},{\"key\":\"php\",\"label\":\"PHP\",\"variant\":\"HTTP_Request2\"},{\"key\":\"php\",\"label\":\"PHP\",\"variant\":\"pecl_http\"},{\"key\":\"powershell\",\"label\":\"PowerShell\",\"variant\":\"RestMethod\"},{\"key\":\"python\",\"label\":\"Python\",\"variant\":\"http.client\"},{\"key\":\"python\",\"label\":\"Python\",\"variant\":\"Requests\"},{\"key\":\"r\",\"label\":\"R\",\"variant\":\"httr\"},{\"key\":\"r\",\"label\":\"R\",\"variant\":\"RCurl\"},{\"key\":\"ruby\",\"label\":\"Ruby\",\"variant\":\"Net::HTTP\"},{\"key\":\"shell\",\"label\":\"Shell\",\"variant\":\"Httpie\"},{\"key\":\"shell\",\"label\":\"Shell\",\"variant\":\"wget\"},{\"key\":\"swift\",\"label\":\"Swift\",\"variant\":\"URLSession\"}]","languageSettings":[{"key":"csharp","label":"C#","variant":"HttpClient"},{"key":"csharp","label":"C#","variant":"RestSharp"},{"key":"curl","label":"cURL","variant":"cURL"},{"key":"dart","label":"Dart","variant":"http"},{"key":"go","label":"Go","variant":"Native"},{"key":"http","label":"HTTP","variant":"HTTP"},{"key":"java","label":"Java","variant":"OkHttp"},{"key":"java","label":"Java","variant":"Unirest"},{"key":"javascript","label":"JavaScript","variant":"Fetch"},{"key":"javascript","label":"JavaScript","variant":"jQuery"},{"key":"javascript","label":"JavaScript","variant":"XHR"},{"key":"c","label":"C","variant":"libcurl"},{"key":"nodejs","label":"NodeJs","variant":"Axios"},{"key":"nodejs","label":"NodeJs","variant":"Native"},{"key":"nodejs","label":"NodeJs","variant":"Request"},{"key":"nodejs","label":"NodeJs","variant":"Unirest"},{"key":"objective-c","label":"Objective-C","variant":"NSURLSession"},{"key":"ocaml","label":"OCaml","variant":"Cohttp"},{"key":"php","label":"PHP","variant":"cURL"},{"key":"php","label":"PHP","variant":"Guzzle"},{"key":"php","label":"PHP","variant":"HTTP_Request2"},{"key":"php","label":"PHP","variant":"pecl_http"},{"key":"powershell","label":"PowerShell","variant":"RestMethod"},{"key":"python","label":"Python","variant":"http.client"},{"key":"python","label":"Python","variant":"Requests"},{"key":"r","label":"R","variant":"httr"},{"key":"r","label":"R","variant":"RCurl"},{"key":"ruby","label":"Ruby","variant":"Net::HTTP"},{"key":"shell","label":"Shell","variant":"Httpie"},{"key":"shell","label":"Shell","variant":"wget"},{"key":"swift","label":"Swift","variant":"URLSession"}],"languageOptions":[{"label":"C# - HttpClient","value":"csharp - HttpClient - C#"},{"label":"C# - RestSharp","value":"csharp - RestSharp - C#"},{"label":"cURL - cURL","value":"curl - cURL - cURL"},{"label":"Dart - http","value":"dart - http - Dart"},{"label":"Go - Native","value":"go - Native - Go"},{"label":"HTTP - HTTP","value":"http - HTTP - HTTP"},{"label":"Java - OkHttp","value":"java - OkHttp - Java"},{"label":"Java - Unirest","value":"java - Unirest - Java"},{"label":"JavaScript - Fetch","value":"javascript - Fetch - JavaScript"},{"label":"JavaScript - jQuery","value":"javascript - jQuery - JavaScript"},{"label":"JavaScript - XHR","value":"javascript - XHR - JavaScript"},{"label":"C - libcurl","value":"c - libcurl - C"},{"label":"NodeJs - Axios","value":"nodejs - Axios - NodeJs"},{"label":"NodeJs - Native","value":"nodejs - Native - NodeJs"},{"label":"NodeJs - Request","value":"nodejs - Request - NodeJs"},{"label":"NodeJs - Unirest","value":"nodejs - Unirest - NodeJs"},{"label":"Objective-C - NSURLSession","value":"objective-c - NSURLSession - Objective-C"},{"label":"OCaml - Cohttp","value":"ocaml - Cohttp - OCaml"},{"label":"PHP - cURL","value":"php - cURL - PHP"},{"label":"PHP - Guzzle","value":"php - Guzzle - PHP"},{"label":"PHP - HTTP_Request2","value":"php - HTTP_Request2 - PHP"},{"label":"PHP - pecl_http","value":"php - pecl_http - PHP"},{"label":"PowerShell - RestMethod","value":"powershell - RestMethod - PowerShell"},{"label":"Python - http.client","value":"python - http.client - Python"},{"label":"Python - Requests","value":"python - Requests - Python"},{"label":"R - httr","value":"r - httr - R"},{"label":"R - RCurl","value":"r - RCurl - R"},{"label":"Ruby - Net::HTTP","value":"ruby - Net::HTTP - Ruby"},{"label":"Shell - Httpie","value":"shell - Httpie - Shell"},{"label":"Shell - wget","value":"shell - wget - Shell"},{"label":"Swift - URLSession","value":"swift - URLSession - Swift"}],"layoutOptions":[{"value":"classic-single-column","label":"Single Column"},{"value":"classic-double-column","label":"Double Column"}],"versionOptions":[],"environmentOptions":[{"value":"0","label":"No Environment"}],"canonicalUrl":"https://promotion.api.youtap.com/view/metadata/2s8YzWSgAR"}