{"_id":"56cc52f08fa8b01b00b81e8b","editedParams2":true,"__v":2,"parentDoc":null,"project":"56cacb1bc675f50b00a4b619","category":{"_id":"56cc10aaca43550b0028125a","pages":["56cc1533ca43550b0028125d","56cc52f08fa8b01b00b81e8b","56cc55b994c8f00b00b83dda","56cc5664fcf2d013008474e1","56cc56f2b4cbcf0b004a5f88","56cc5823f1ee861500685f0f"],"project":"56cacb1bc675f50b00a4b619","__v":6,"version":"56cacb1cc675f50b00a4b61c","sync":{"url":"","isSync":false},"reference":true,"createdAt":"2016-02-23T07:56:26.898Z","from_sync":false,"order":6,"slug":"rest-api","title":"Loyalty REST API"},"editedParams":true,"user":"56caca84245b841300806def","version":{"_id":"56cacb1cc675f50b00a4b61c","project":"56cacb1bc675f50b00a4b619","__v":14,"createdAt":"2016-02-22T08:47:24.528Z","releaseDate":"2016-02-22T08:47:24.528Z","categories":["56cacb1dc675f50b00a4b61d","56cc10aaca43550b0028125a","56cc10b7b4cbcf0b004a5df9","56cc1bb2272aa4130002ccd2","56cc5834b4cbcf0b004a5f8b","56cda18bface161300dae13b","56d51f2873dcd20b00fb87bb","56fbe0610023171700b96105","57658310c176520e00ea9076","5772bdd48c48e00e00503638","577c1dfe87acf617003c3fcd","579525172979790e00771a15","582b4661cdfdc125000c8684","586365cedfe6cc3700a7be63"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"1.0.0","version":"1"},"updates":[],"next":{"pages":[],"description":""},"createdAt":"2016-02-23T12:39:12.482Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"examples":{"codes":[]},"method":"put","results":{"codes":[{"code":"{\n\t\"code\": 200,\n\t\"results\": {\n  \t\"id\": transaction_id,\n\t\t\"award\": points_to_be_awarded,\n  \t\"expires_in_days\": expires_in_days\n\t}\n}","language":"json","status":200,"name":""},{"status":400,"name":"","code":"{\n\t\"code\": 400,\n  \"status\": \"fail\",\n  \"results\": error_message\n}","language":"json"}]},"settings":"","auth":"required","params":[{"_id":"56cc52f08fa8b01b00b81e90","ref":"","in":"body","required":true,"desc":"Customer identifier to whom loyalty points are being added. This is for your reference so make sure you use a ID that makes sense to you.","default":"","type":"string","name":"customer_id"},{"_id":"56d29d0a5ad7ad0b00b7e854","ref":"","in":"body","required":true,"desc":"Transaction ID for this transaction","default":"","type":"string","name":"transaction_id"},{"_id":"56cc52f08fa8b01b00b81e8f","ref":"","in":"body","required":true,"desc":"Transaction value for which the Loyalty needs to be added","default":"","type":"int","name":"transaction"},{"_id":"56d2a20c5787df15006882ce","ref":"","in":"body","required":false,"desc":"Credit type in this transaction. Default is 0 for Promotional & 1 for Transactional. You can set any other custom type as well","default":"1","type":"int","name":"transaction_type"},{"_id":"56cc52f08fa8b01b00b81e8e","ref":"","in":"body","required":false,"desc":"Number of days after which the points should expire","default":"","type":"int","name":"expiry"},{"_id":"56cc52f08fa8b01b00b81e8d","ref":"","in":"body","required":false,"desc":"Platform ID you would have configured in the Codemojo dashboard.","default":"","type":"string","name":"platform"},{"_id":"56cc52f08fa8b01b00b81e8c","ref":"","in":"body","required":false,"desc":"Service ID you would have configured in the Codemojo dashboard","default":"","type":"string","name":"service"}],"url":"/v:version/services/loyalty"},"isReference":true,"order":1,"body":"[block:callout]\n{\n  \"type\": \"info\",\n  \"title\": \"Loyalty Tier Upgrade\",\n  \"body\": \"You will receive a **tier_upgrade** parameter when the user has been moved to a new loyalty tier\"\n}\n[/block]","excerpt":"Adding loyalty points to the Loyalty layer","slug":"add-loyalty-points","type":"endpoint","title":"Add Loyalty points"}

putAdd Loyalty points

Adding loyalty points to the Loyalty layer

Definition

{{ api_url }}{{ page_api_url }}

Parameters

Body Params

customer_id:
required
string
Customer identifier to whom loyalty points are being added. This is for your reference so make sure you use a ID that makes sense to you.
transaction_id:
required
string
Transaction ID for this transaction
transaction:
required
integer
Transaction value for which the Loyalty needs to be added
transaction_type:
integer1
Credit type in this transaction. Default is 0 for Promotional & 1 for Transactional. You can set any other custom type as well
expiry:
integer
Number of days after which the points should expire
platform:
string
Platform ID you would have configured in the Codemojo dashboard.
service:
string
Service ID you would have configured in the Codemojo dashboard

Result Format


Documentation

[block:callout] { "type": "info", "title": "Loyalty Tier Upgrade", "body": "You will receive a **tier_upgrade** parameter when the user has been moved to a new loyalty tier" } [/block]

User Information

Try It Out

put
{{ tryResults.results }}
Method{{ tryResults.method }}
Request Headers
{{ tryResults.requestHeaders }}
URL{{ tryResults.url }}
Request Data
{{ tryResults.data }}
Status
Response Headers
{{ tryResults.responseHeaders }}