{"info":{"_postman_id":"4c64b864-1cba-4887-9e1d-6ed99f51ad37","name":"Yourselv - Payment API","schema":"https://schema.getpostman.com/json/collection/v2.0.0/collection.json","toc":[],"description":"<html><head></head><body></body></html>","owner":"4184464","collectionId":"4c64b864-1cba-4887-9e1d-6ed99f51ad37","publishedId":"2s93eYVs6X","public":true,"customColor":{"top-bar":"FFFFFF","right-sidebar":"303030","highlight":"FF6C37"},"publishDate":"2023-05-08T13:25:56.000Z"},"item":[{"name":"Create","event":[{"listen":"test","script":{"id":"7e6a7ef9-4a82-4531-9e6d-2deb2962b3e5","exec":["var jsonData = JSON.parse(responseBody)","pm.collectionVariables.set(\"PAYMENTIDENTIFIER\",jsonData.data.identifier);"],"type":"text/javascript","packages":{},"requests":{}}}],"id":"976165d9-fa78-47e2-b94f-0269b8f4383f","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"Accept","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"{\n    \"trxId\": \"211\",\n    \"order\": {\n        \"c260d458-f7d8-4a77-a6f4-2086dd5583b9\": 1\n    }\n}","options":{"raw":{"language":"json"}}},"url":"https://api.yourselv.com/terminal/2/payment","description":"<p>This request will generate a new payment request and will instruct a Payter or Valina terminal to display the amount and ask the end-user to scan their card.</p>\n<p>There will be a 15 second timeout in which the end-user will have the time to offer his card; after 15 seconds the transaction will be cancelled automatically.</p>\n","auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"{{TOKEN}}"}]},"isInherited":true,"source":{"_postman_id":"4c64b864-1cba-4887-9e1d-6ed99f51ad37","id":"4c64b864-1cba-4887-9e1d-6ed99f51ad37","name":"Yourselv - Payment API","type":"collection"}},"urlObject":{"path":["terminal","2","payment"],"host":["https://api.yourselv.com"],"query":[],"variable":[]}},"response":[{"id":"260ee57a-d5fc-4249-90a4-58da5b9f45a0","name":"Success","originalRequest":{"method":"POST","header":[{"key":"Accept","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"{\n    \"trxId\": \"1\",\n    \"plu\": \"42\",\n    \"aount\": 1\n}","options":{"raw":{"language":"json"}}},"url":"https://api.yourselv.com/terminal/2/payment"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n    \"data\": {\n        \"identifier\": \"d2b3de8b-3e8a-4f82-a0f4-ae09bcf17d09\",\n        \"created_at\": \"2023-07-05T06:43:35+00:00\",\n        \"trxId\": \"1\",\n        \"amount\": 100,\n        \"status\": \"PENDING\",\n        \"committed\": null\n    },\n    \"status\": 200\n}"},{"id":"c263e48e-553b-4056-9ea6-12cd3aceac25","name":"404 - Not found","originalRequest":{"method":"POST","header":[{"key":"Accept","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"{\n    \"trxId\": \"1\",\n    \"plu\": \"42\",\n    \"aount\": 1\n}","options":{"raw":{"language":"json"}}},"url":"https://api.yourselv.com/terminal/2/payment"},"status":"Not Found","code":404,"_postman_previewlanguage":"json","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n    \"message\": \"Terminal P6X20214500249 not found or inactive\"\n}"}],"_postman_id":"976165d9-fa78-47e2-b94f-0269b8f4383f"},{"name":"Status","id":"4bfdba74-f24a-49ed-9574-4b5c3ad2352b","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[{"key":"Accept","value":"application/json","type":"text"}],"body":{"mode":"formdata","formdata":[{"key":"id","value":"8cebe9a3-2ff5-4535-ac11-d369be1deba5","type":"text","disabled":true}]},"url":"https://api.yourselv.com/terminal/2/payment/status?id=8cebe9a3-2ff5-4535-ac11-d369be1deba5","description":"<p>Will return the payment status based on the provided identifier.</p>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th><strong>Status</strong></th>\n<th></th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>PENDING</td>\n<td>This is the initial value of the payment; it means the payment was not autorised or failed yet.</td>\n</tr>\n<tr>\n<td>SUCCESS</td>\n<td>Payment was authorised successfully</td>\n</tr>\n<tr>\n<td>CANCELLED</td>\n<td>The payment was cancelled. This can be caused by calling the cancel url of if the user doesn't offer their card/QR code within 15 seconds from the start of the payment.</td>\n</tr>\n<tr>\n<td>FAILED</td>\n<td>Payment authorisation failed</td>\n</tr>\n</tbody>\n</table>\n</div><p>A checksum will be generated based on the identifier and trx_id with crc32b</p>\n","auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"{{TOKEN}}"}]},"isInherited":true,"source":{"_postman_id":"4c64b864-1cba-4887-9e1d-6ed99f51ad37","id":"4c64b864-1cba-4887-9e1d-6ed99f51ad37","name":"Yourselv - Payment API","type":"collection"}},"urlObject":{"path":["terminal","2","payment","status"],"host":["https://api.yourselv.com"],"query":[{"key":"id","value":"8cebe9a3-2ff5-4535-ac11-d369be1deba5"}],"variable":[]}},"response":[{"id":"5f8d3673-be86-4e37-a057-ec47c0e7515f","name":"Success","originalRequest":{"method":"GET","header":[{"key":"Accept","value":"application/json","type":"text"}],"url":{"raw":"https://api.yourselv.com/terminal/2/payment/status?id=8cebe9a3-2ff5-4535-ac11-d369be1deba5","host":["https://api.yourselv.com"],"path":["terminal","2","payment","status"],"query":[{"key":"id","value":"8cebe9a3-2ff5-4535-ac11-d369be1deba5"}]}},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n    \"data\": {\n        \"identifier\": \"a6682a28-405c-4ede-98d9-0b219842979e\",\n        \"created_at\": \"2023-07-05T06:43:08+00:00\",\n        \"trxId\": \"1\",\n        \"amount\": 100,\n        \"status\": \"CANCELLED\",\n        \"committed\": null,\n        \"checksum\": \"66eac5b7\"\n    },\n    \"status\": 200\n}"}],"_postman_id":"4bfdba74-f24a-49ed-9574-4b5c3ad2352b"},{"name":"Commit","id":"5a277606-ceec-42ed-94cd-62bdab926d51","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"PUT","header":[{"key":"Accept","value":"application/json","type":"text"}],"url":"https://api.yourselv.com/terminal/2/payment/commit?id=8cebe9a3-2ff5-4535-ac11-d369be1deba5","description":"<p>Will commit the transaction with the provided payment identifier.</p>\n<p>This endpoint is optional; if not called, we will automatically commit the payment (if it's not cancelled) after 30 seconds.</p>\n<p><em>Note: this endpoint may also be called with a POST request instead of a PUT request</em></p>\n","auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"{{TOKEN}}"}]},"isInherited":true,"source":{"_postman_id":"4c64b864-1cba-4887-9e1d-6ed99f51ad37","id":"4c64b864-1cba-4887-9e1d-6ed99f51ad37","name":"Yourselv - Payment API","type":"collection"}},"urlObject":{"path":["terminal","2","payment","commit"],"host":["https://api.yourselv.com"],"query":[{"key":"id","value":"8cebe9a3-2ff5-4535-ac11-d369be1deba5"}],"variable":[]}},"response":[{"id":"4451dbec-684e-498a-b3e0-a741c1037f5d","name":"Success","originalRequest":{"method":"PUT","header":[{"key":"Accept","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"{\n    \"data\": [],\n    \"status\": 200\n}","options":{"raw":{"language":"json"}}},"url":{"raw":"https://api.yourselv.com/terminal/2/payment/commit?id=8cebe9a3-2ff5-4535-ac11-d369be1deba5","host":["https://api.yourselv.com"],"path":["terminal","2","payment","commit"],"query":[{"key":"id","value":"8cebe9a3-2ff5-4535-ac11-d369be1deba5"}]}},"status":"OK","code":200,"_postman_previewlanguage":null,"header":null,"cookie":[],"responseTime":null,"body":null}],"_postman_id":"5a277606-ceec-42ed-94cd-62bdab926d51"},{"name":"Cancel","id":"a6bd867a-b9f2-467f-bba1-9fbc3f3de05f","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"PUT","header":[{"key":"Accept","value":"application/json","type":"text"}],"url":"https://api.yourselv.com/terminal/2/payment/cancel?id=8cebe9a3-2ff5-4535-ac11-d369be1deba5","description":"<p>Will cancel the transaction with the provided payment identifier if it wasn't committed already.</p>\n<p><em>Note: this endpoint may also be called with a POST request instead of a PUT request</em></p>\n","auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"{{TOKEN}}"}]},"isInherited":true,"source":{"_postman_id":"4c64b864-1cba-4887-9e1d-6ed99f51ad37","id":"4c64b864-1cba-4887-9e1d-6ed99f51ad37","name":"Yourselv - Payment API","type":"collection"}},"urlObject":{"path":["terminal","2","payment","cancel"],"host":["https://api.yourselv.com"],"query":[{"key":"id","value":"8cebe9a3-2ff5-4535-ac11-d369be1deba5"}],"variable":[]}},"response":[{"id":"9d6c4359-baba-4516-9c21-7185204712ac","name":"Success","originalRequest":{"method":"PUT","header":[{"key":"Accept","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"{\n    \"data\": [],\n    \"status\": 200\n}","options":{"raw":{"language":"json"}}},"url":{"raw":"https://api.yourselv.com/terminal/2/payment/commit?id=8cebe9a3-2ff5-4535-ac11-d369be1deba5","host":["https://api.yourselv.com"],"path":["terminal","2","payment","commit"],"query":[{"key":"id","value":"8cebe9a3-2ff5-4535-ac11-d369be1deba5"}]}},"status":"OK","code":200,"_postman_previewlanguage":null,"header":null,"cookie":[],"responseTime":null,"body":null}],"_postman_id":"a6bd867a-b9f2-467f-bba1-9fbc3f3de05f"},{"name":"Callback","id":"e66dca48-794f-4d8a-8db6-edff6eabd17c","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"noauth","isInherited":false},"method":"POST","header":[{"key":"Accept","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"{\n    \"aid\": \"080100\",\n    \"cardId\": \"7E49B380\",\n    \"ifd\": \"CONTACTLESS\",\n    \"serialNumber\": \"APO20243200158\",\n    \"sessions\": []\n}","options":{"raw":{"language":"json"}}},"url":"https://api.yourselv.com/terminal/2/payment/2612/callback","urlObject":{"path":["terminal","2","payment","2612","callback"],"host":["https://api.yourselv.com"],"query":[],"variable":[]}},"response":[],"_postman_id":"e66dca48-794f-4d8a-8db6-edff6eabd17c"}],"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"{{TOKEN}}"}]}},"event":[{"listen":"prerequest","script":{"id":"c5c8ff3a-3b53-4522-a2cf-44be09c83c82","type":"text/javascript","requests":{},"exec":[""]}},{"listen":"test","script":{"id":"82381a3d-eb93-4683-8567-94afa22b8baf","type":"text/javascript","requests":{},"exec":[""]}}],"variable":[{"key":"DOMAIN","value":"https://api.yourselv.com"},{"key":"TERMINALID","value":"2"},{"key":"TERMINALTOKEN","value":""},{"key":"PAYMENTIDENTIFIER","value":"8cebe9a3-2ff5-4535-ac11-d369be1deba5"}]}