{"info":{"_postman_id":"9a6c51b4-6ccb-4e9b-ba57-640674dd60cd","name":"Loyalty Program API","description":"<html><head></head><body><p>API collection for Loyalty Program operations</p>\n</body></html>","schema":"https://schema.getpostman.com/json/collection/v2.0.0/collection.json","toc":[],"owner":"20096944","collectionId":"9a6c51b4-6ccb-4e9b-ba57-640674dd60cd","publishedId":"2sA3Qy5UT3","public":true,"customColor":{"top-bar":"FFFFFF","right-sidebar":"303030","highlight":"00a9e0"},"publishDate":"2024-06-04T02:36:38.000Z"},"item":[{"name":"Get Authentication Token","id":"573848e1-c027-41da-aa3e-00681e4fc6f4","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"Content-Type","value":"application/json"},{"key":"API-Key","value":"your_api_key_here"}],"body":{"mode":"raw","raw":"{\n  \"username\": \"user\",\n  \"password\": \"pass\"\n}"},"url":"http://api.example.com/auth/token","description":"<p>To interact with the API, you first need to obtain an authentication token using your API key and credentials. This token must be included in the Authorization header for all subsequent requests. The authentication endpoint is used to validate user credentials and return a token along with its expiration time.</p>\n","urlObject":{"path":["auth","token"],"host":["http://api.example.com"],"query":[],"variable":[]}},"response":[{"id":"834b8681-db82-40de-aa10-c9e47438c921","name":"Success","originalRequest":{"method":"GET","header":[],"url":""},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Content-Type","name":"Content-Type","value":"application/json","description":"","type":"text"}],"cookie":[],"responseTime":null,"body":"{\n    \"token\": \"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...\",\n    \"expires_in\": 3600\n}"},{"id":"b4fa080e-a441-4af4-9808-2122a18669f9","name":"Invalid Credentials","originalRequest":{"method":"GET","header":[],"url":""},"status":"Unauthorized","code":401,"_postman_previewlanguage":"json","header":[{"key":"Content-Type","name":"Content-Type","value":"application/json","description":"","type":"text"}],"cookie":[],"responseTime":null,"body":"{\n    \"error\": \"Invalid username or password\"\n}"}],"_postman_id":"573848e1-c027-41da-aa3e-00681e4fc6f4"},{"name":"Get Customer Information","id":"aef4aa5a-9584-4e20-b560-aed53b3b4e87","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[{"key":"Authorization","value":"Bearer "},{"key":"Content-Type","value":"application/json"},{"key":"API-Key","value":"your_api_key_here"}],"url":"http://api.example.com/customers?type=nationalId&id=123456789","description":"<p>Once authenticated, you can retrieve a customer's information by specifying the ID type and customer ID. This endpoint returns details such as the customer's first name, last name, available points, and email address. The authentication token must be included in the request header.</p>\n","urlObject":{"path":["customers"],"host":["http://api.example.com"],"query":[{"key":"type","value":"nationalId"},{"key":"id","value":"123456789"}],"variable":[]}},"response":[{"id":"e8decd57-a4c1-47c3-bcd3-e4d307bd7aef","name":"Success","originalRequest":{"method":"GET","header":[],"url":""},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Content-Type","name":"Content-Type","value":"application/json","description":"","type":"text"}],"cookie":[],"responseTime":null,"body":"{\n    \"idType\": \"nationalId\",\n    \"id\": \"123456789\",\n    \"name\": \"John\",\n    \"lastname\": \"Doe\",\n    \"points\": 1000,\n    \"email\": \"john.doe@example.com\"\n}"},{"id":"b10e2a94-2e8e-41ce-9229-8ba58c428bcb","name":"Customer Not Found","originalRequest":{"method":"GET","header":[],"url":""},"status":"Not Found","code":404,"_postman_previewlanguage":"json","header":[{"key":"Content-Type","name":"Content-Type","value":"application/json","description":"","type":"text"}],"cookie":[],"responseTime":null,"body":"{\n    \"error\": \"Customer not found\"\n}"}],"_postman_id":"aef4aa5a-9584-4e20-b560-aed53b3b4e87"},{"name":"Redeem Points","id":"bd2e2460-21c0-444f-8548-7e814dac16ab","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"Authorization","value":"Bearer "},{"key":"Content-Type","value":"application/json"},{"key":"API-Key","value":"your_api_key_here"}],"body":{"mode":"raw","raw":"{\n  \"idType\": \"nationalId\",\n  \"id\": \"123456789\",\n  \"points\": 100\n}"},"url":"http://api.example.com/redeem","description":"<p>To redeem points for a customer, you need to provide the ID type, customer ID, and the number of points to be redeemed. This endpoint processes the points redemption and returns a transaction code. The authentication token must be included in the request header.</p>\n","urlObject":{"path":["redeem"],"host":["http://api.example.com"],"query":[],"variable":[]}},"response":[{"id":"96d671f4-f7d6-4c1a-b7c7-c5cb53708d09","name":"Success","originalRequest":{"method":"GET","header":[],"url":""},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Content-Type","name":"Content-Type","value":"application/json","description":"","type":"text"}],"cookie":[],"responseTime":null,"body":"{\n    \"transactionCode\": \"TRX123456\"\n}"},{"id":"c8144301-9b9d-4d67-ba01-4ecb9d20603d","name":"Invalid Token","originalRequest":{"method":"GET","header":[],"url":""},"status":"Unauthorized","code":401,"_postman_previewlanguage":"json","header":[{"key":"Content-Type","name":"Content-Type","value":"application/json","description":"","type":"text"}],"cookie":[],"responseTime":null,"body":"{\n    \"error\": \"Invalid token\"\n}"},{"id":"84c114a7-7a8b-4b49-9f11-661b36c34f39","name":"Insufficient Points","originalRequest":{"method":"GET","header":[],"url":""},"status":"Bad Request","code":400,"_postman_previewlanguage":"json","header":[{"key":"Content-Type","name":"Content-Type","value":"application/json","description":"","type":"text"}],"cookie":[],"responseTime":null,"body":"{\n    \"error\": \"Insufficient points\"\n}"}],"_postman_id":"bd2e2460-21c0-444f-8548-7e814dac16ab"},{"name":"Refund Points","id":"bf63c047-0e7e-4c1f-93c5-0b89c5b29782","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"Authorization","value":"Bearer "},{"key":"Content-Type","value":"application/json"},{"key":"API-Key","value":"your_api_key_here"}],"body":{"mode":"raw","raw":"{\n  \"idType\": \"nationalId\",\n  \"id\": \"123456789\",\n  \"transactionCode\": \"TRX123456\",\n  \"points\": 100\n}"},"url":"http://api.example.com/refund","description":"<p>In case the redemption was executed incorrectly, you can reverse the transaction by providing the ID type, customer ID, transaction code, and the number of points to be refunded. This endpoint allows you to refund the previously redeemed points. The authentication token must be included in the request header.</p>\n","urlObject":{"path":["refund"],"host":["http://api.example.com"],"query":[],"variable":[]}},"response":[{"id":"ec77d105-2525-4706-b9e1-73fba2d0ab1a","name":"Success","originalRequest":{"header":[],"url":""},"status":"OK","code":200,"_postman_previewlanguage":"Text","header":[],"cookie":[],"responseTime":null,"body":"{\n  \"message\": \"Points refunded successfully\"\n}"},{"id":"c4a422b5-b694-420f-80d1-b10098d98dd1","name":"Invalid Token","originalRequest":{"header":[],"url":""},"status":"Unauthorized","code":401,"_postman_previewlanguage":"Text","header":[],"cookie":[],"responseTime":null,"body":"{\n  \"error\": \"Invalid token\"\n}"},{"id":"01628acb-3ca5-4248-b48f-7ae72cd00528","name":"Transaction Not Found","originalRequest":{"header":[],"url":""},"status":"Not Found","code":404,"_postman_previewlanguage":"Text","header":[],"cookie":[],"responseTime":null,"body":"{\n  \"error\": \"Transaction not found\"\n}"}],"_postman_id":"bf63c047-0e7e-4c1f-93c5-0b89c5b29782"}],"variable":[{"key":"base_url","value":"http://api.example.com"},{"key":"api_key","value":"your_api_key_here"},{"key":"username","value":"user"},{"key":"password","value":"pass"},{"key":"token","value":""},{"key":"idType","value":"nationalId"},{"key":"id","value":"123456789"}]}