{"info":{"_postman_id":"0bda4daa-c8ee-4639-bab6-28b9796d0460","name":"Pesapay Payment Gateway API","description":"<html><head></head><body><h3 id=\"payment-gateway-api-documentation\"><strong>Payment Gateway API Documentation</strong></h3>\n<p><strong>Live End Point:</strong> https://pesapay.co.ke/payment/initiate</p>\n<p><strong>Test End Point:</strong> https://pesapay.co.ke/test/payment/initiate</p>\n<h3 id=\"ipn-webhook\">IPN WEBHOOK</h3>\n<p><strong>End Point IPN URL:</strong> {{ipn_url)</p>\n<p><strong>Request Method:</strong> POST</p>\n<p><strong>Signature Validation:</strong></p>\n<p>uppercase(HMAC SHA256 (amount+identified,secretkey))</p>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Name</th>\n<th>Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>status</td>\n<td>Payment status.  <br>Payment status with 3 statuses “initiated”, “success”, “canceled”.  <br>  <br><strong>initiated</strong> – This status indicates that a transaction has been initiated and is either pending or in progress.  <br>  <br><strong>success</strong> – This status indicates that a transaction has been successfully completed.  <br>  <br><strong>canceled</strong> – This status indicates that a transaction has been rejected or canceled.</td>\n</tr>\n<tr>\n<td>identifier</td>\n<td>Identifier</td>\n</tr>\n<tr>\n<td>signature</td>\n<td>A hash signature</td>\n</tr>\n<tr>\n<td>data</td>\n<td>Payment Related Information</td>\n</tr>\n</tbody>\n</table>\n</div><pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"status\": \"success\",\n    \"signature\": \"signature\",\n    \"identifier\": \"identifier\",\n    \"data\": {\n        \"payment_trx\":  \"Trx ID\",\n        \"amount\": \"amount\",\n        \"payment_type\": \"checkout\",\n        \"payment_timestamp\": \"date\",\n        \"currency\": \"currency\"\n    }\n}\n\n</code></pre>\n</body></html>","schema":"https://schema.getpostman.com/json/collection/v2.0.0/collection.json","toc":[],"owner":"31030890","collectionId":"0bda4daa-c8ee-4639-bab6-28b9796d0460","publishedId":"2sA2r6XPpQ","public":true,"customColor":{"top-bar":"FFFFFF","right-sidebar":"303030","highlight":"FF6C37"},"publishDate":"2024-02-15T12:14:21.000Z"},"item":[{"name":"Payment Request","id":"f63c8985-4846-45ba-8054-66195f4d4e69","protocolProfileBehavior":{"disableBodyPruning":true,"disabledSystemHeaders":{}},"request":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\r\n    \"public_key\": \"test_j19v6spn66a5nty374sk1pkmul2rlk9k1akws43zd6la3dcr5g2\",\r\n    \"amount\": 50.00,\r\n    \"currency\": \"USD\",\r\n    \"ipn_url\": \"https://example.com\",\r\n    \"cancel_url\": \"https://example.com\",\r\n    \"success_url\": \"https://example.com\",\r\n    \"site_name\": \"MyWebStore\",\r\n    \"identifier\": \"12312\",\r\n    \"details\": \"Payment For Product 1\",\r\n    \"customer\": {\r\n        \"first_name\": \"Jon\",\r\n        \"last_name\": \"Doe\",\r\n        \"email\": \"mail@example.com\",\r\n        \"mobile\": \"+2547xxxx\",\r\n    },\r\n    \"shipping_info\": {\r\n        \"address_one\": \"string\",\r\n        \"address_two\": \"string\",\r\n        \"area\": \"string\",\r\n        \"city\": \"string\",\r\n        \"sub_city\": \"string\",\r\n        \"state\": \"string\",\r\n        \"postcode\": \"string\",\r\n        \"country\": \"string\",\r\n        \"others\": \"string\"\r\n    },\r\n    \"billing_info\": {\r\n        \"address_one\": \"string\",\r\n        \"address_two\": \"string\",\r\n        \"area\": \"string\",\r\n        \"city\": \"string\",\r\n        \"sub_city\": \"string\",\r\n        \"state\": \"string\",\r\n        \"postcode\": \"string\",\r\n        \"country\": \"string\",\r\n        \"others\": \"string\"\r\n    }\r\n}","options":{"raw":{"language":"json"}}},"url":"https://pesapay.co.ke/test/payment/initiate","description":"<p>StartFragment</p>\n<h3 id=\"request-payment\">Request Payment</h3>\n<p>StartFragment</p>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Name</th>\n<th>Type</th>\n<th>Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>public_key</td>\n<td>string (50)</td>\n<td>Required Public API key</td>\n</tr>\n<tr>\n<td>identifier</td>\n<td>string (20)</td>\n<td>Required Identifier unique to identify your payment on webhook</td>\n</tr>\n<tr>\n<td>currency</td>\n<td>string (4)  <br />ISO 4217 three-letter</td>\n<td>Required Currency Code, Must be in Upper Case.</td>\n</tr>\n<tr>\n<td>amount</td>\n<td>decimal</td>\n<td>Required  <br />Payment amount in 2 decimal places.  <br /><strong>Mpesa &amp; Mobile money</strong> payment only accepts whole numbers</td>\n</tr>\n<tr>\n<td>details</td>\n<td>string (100)</td>\n<td>Required Transaction Details</td>\n</tr>\n<tr>\n<td>ipn_url</td>\n<td>string/url</td>\n<td>Required Instant payment notification</td>\n</tr>\n<tr>\n<td>success_url</td>\n<td>string/url</td>\n<td>Required Success redirect</td>\n</tr>\n<tr>\n<td>cancel_url</td>\n<td>string/url</td>\n<td>Required Cancel redirect</td>\n</tr>\n<tr>\n<td>site_name</td>\n<td>string</td>\n<td>Required Site name</td>\n</tr>\n<tr>\n<td>site_logo</td>\n<td>string/url</td>\n<td>Optional Logo Image url</td>\n</tr>\n<tr>\n<td><strong>Customer</strong></td>\n<td></td>\n<td></td>\n</tr>\n<tr>\n<td>first_name</td>\n<td>string</td>\n<td>Required first name</td>\n</tr>\n<tr>\n<td>last_name</td>\n<td>string</td>\n<td>Required last name</td>\n</tr>\n<tr>\n<td>email</td>\n<td>string</td>\n<td>Required email</td>\n</tr>\n<tr>\n<td>mobile</td>\n<td>string</td>\n<td>International format valid mobile</td>\n</tr>\n<tr>\n<td><strong>Shipping</strong></td>\n<td></td>\n<td></td>\n</tr>\n<tr>\n<td>address_one</td>\n<td>string</td>\n<td>Optional</td>\n</tr>\n<tr>\n<td>address_two</td>\n<td>string</td>\n<td>Optional</td>\n</tr>\n<tr>\n<td>area</td>\n<td>string</td>\n<td>Optional</td>\n</tr>\n<tr>\n<td>city</td>\n<td>string</td>\n<td>Optional</td>\n</tr>\n<tr>\n<td>sub_city</td>\n<td>string</td>\n<td>Optional</td>\n</tr>\n<tr>\n<td>state</td>\n<td>string</td>\n<td>Optional</td>\n</tr>\n<tr>\n<td>postcode</td>\n<td>string</td>\n<td>Optional</td>\n</tr>\n<tr>\n<td>country</td>\n<td>string</td>\n<td>Optional</td>\n</tr>\n<tr>\n<td>others</td>\n<td>string</td>\n<td>Optional</td>\n</tr>\n<tr>\n<td><strong>Billing</strong></td>\n<td></td>\n<td></td>\n</tr>\n<tr>\n<td>address_one</td>\n<td>string</td>\n<td>Optional</td>\n</tr>\n<tr>\n<td>address_two</td>\n<td>string</td>\n<td>Optional</td>\n</tr>\n<tr>\n<td>area</td>\n<td>string</td>\n<td>Optional</td>\n</tr>\n<tr>\n<td>city</td>\n<td>string</td>\n<td>Optional</td>\n</tr>\n<tr>\n<td>sub_city</td>\n<td>string</td>\n<td>Optional</td>\n</tr>\n<tr>\n<td>state</td>\n<td>string</td>\n<td>Optional</td>\n</tr>\n<tr>\n<td>postcode</td>\n<td>string</td>\n<td>Optional</td>\n</tr>\n<tr>\n<td>country</td>\n<td>string</td>\n<td>Optional</td>\n</tr>\n<tr>\n<td>others</td>\n<td>string</td>\n<td>Optional</td>\n</tr>\n</tbody>\n</table>\n</div><p>EndFragment</p>\n","urlObject":{"path":["test","payment","initiate"],"host":["https://pesapay.co.ke"],"query":[],"variable":[]}},"response":[{"id":"7727eb64-0d5a-41da-b040-116a75a5b126","name":"Payment Request - Success","originalRequest":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\r\n    \"public_key\": \"test_j19v6spn66a5nty374sk1pkmul2rlk9k1akws43zd6la3dcr5g2\",\r\n    \"amount\": 50.00,\r\n    \"currency\": \"USD\",\r\n    \"ipn_url\": \"https://example.com\",\r\n    \"cancel_url\": \"https://example.com\",\r\n    \"success_url\": \"https://example.com\",\r\n    \"site_name\": \"MyWebStore\",\r\n    \"identifier\": \"12312\",\r\n    \"details\": \"Payment For Product 1\",\r\n    \"customer\": {\r\n        \"first_name\": \"Jon\",\r\n        \"last_name\": \"Doe\",\r\n        \"email\": \"mail@example.com\",\r\n        \"mobile\": \"+91000000000\"\r\n    },\r\n    \"shipping_info\": {\r\n        \"address_one\": \"string\",\r\n        \"address_two\": \"string\",\r\n        \"area\": \"string\",\r\n        \"city\": \"string\",\r\n        \"sub_city\": \"string\",\r\n        \"state\": \"string\",\r\n        \"postcode\": \"string\",\r\n        \"country\": \"string\",\r\n        \"others\": \"string\"\r\n    },\r\n    \"billing_info\": {\r\n        \"address_one\": \"string\",\r\n        \"address_two\": \"string\",\r\n        \"area\": \"string\",\r\n        \"city\": \"string\",\r\n        \"sub_city\": \"string\",\r\n        \"state\": \"string\",\r\n        \"postcode\": \"string\",\r\n        \"country\": \"string\",\r\n        \"others\": \"string\"\r\n    }\r\n}","options":{"raw":{"language":"json"}}},"url":"https://dev.pesapay.co.ke/test/payment/initiate"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Connection","value":"Keep-Alive"},{"key":"Keep-Alive","value":"timeout=5, max=100"},{"key":"x-powered-by","value":"PHP/8.1.18"},{"key":"cache-control","value":"no-cache, private"},{"key":"content-type","value":"application/json"},{"key":"set-cookie","value":"XSRF-TOKEN=eyJpdiI6IjUzd1UxVGlZV1ZjQWd4ODFla0FGZFE9PSIsInZhbHVlIjoiT2xxSjFPOE9PNmNGdSt2TG9vSndVMnFLb0xCelFLeUtJQ1Q4SldWTWtaK1FFS1pLYW5UYVV3b29CRkQzbG8rUHVna1JZZ0FIR0NiY2t2NDI2SFhIaW53UERkK1F2SnlwRmJ4UWtKOWpjaUJEV25JOHBzeWdMZnVyd09OT0tCa28iLCJtYWMiOiI4YWQxMGQ0ZjAwNGE5MTZmNzY2NmI1OWIzZjgzZGNmZGE2NTgyMGVjMmQ0OGE4NDBlNGI3MDVkOTE4NTcxOWExIiwidGFnIjoiIn0%3D; expires=Wed, 24 May 2023 14:46:06 GMT; Max-Age=7200; path=/; samesite=lax; secure"},{"key":"set-cookie","value":"omnigateway_session=eyJpdiI6Ijg4SUNIZ1FvZ1hsdS8vaVA1M3JiZVE9PSIsInZhbHVlIjoiVVJkSS9CY282RWw5YXpUMEl5N0dwRWF4S3ZIcmxOV1BEaFBzSzZTdi8xVWYrRWJLNkhvRGcyWkx5Z1BsbFQ2SGRLblpTcTFDeHp2V2xIVFVyQWxLTXlPNUVzZHVjNmxUeW56SDBobUlueTdOQXlKR1BUMXR1cGdFV1RTak0weVQiLCJtYWMiOiI4N2Y1NjdlOTQzOGYxNGE2MTMwZGI1ZTQyMzM2NGIzNTMzM2E3M2YzNzM0ZTMyNTY5MDI2NjAwYWQzY2UxZDVlIiwidGFnIjoiIn0%3D; expires=Wed, 24 May 2023 14:46:06 GMT; Max-Age=7200; path=/; httponly; samesite=lax; secure"},{"key":"content-length","value":"333"},{"key":"content-encoding","value":"br"},{"key":"vary","value":"Accept-Encoding"},{"key":"date","value":"Wed, 24 May 2023 12:46:06 GMT"},{"key":"server","value":"LiteSpeed"},{"key":"platform","value":"hostinger"},{"key":"content-security-policy","value":"upgrade-insecure-requests"},{"key":"alt-svc","value":"h3=\":443\"; ma=2592000, h3-29=\":443\"; ma=2592000, h3-Q050=\":443\"; ma=2592000, h3-Q046=\":443\"; ma=2592000, h3-Q043=\":443\"; ma=2592000, quic=\":443\"; ma=2592000; v=\"43,46\""}],"cookie":[],"responseTime":null,"body":"{\n    \"status\": \"success\",\n    \"message\": [\n        \"Payment initiated\"\n    ],\n    \"redirect_url\": \"https://pesapay.co.ke/test/payment/checkout?payment_trx=eyJpdiI6Ijk0MDEwNUxkeU5OUDF1UFZScXhaSHc9PSIsInZhbHVlIjoielBkOFdia2lzYk45UGVyWXlCcmR6VC8vUUJER2JHcitpVEFpN0YvMVNWTT0iLCJtYWMiOiIyYjM5MjgyZGViYjYwODcwMTJjNjU5MzY4M2RjMDM1NDdhMjBiYmFkMDM1ZmFkNGQyMDU2Y2YxMTUyYjA1ODEzIiwidGFnIjoiIn0%3D\"\n}"}],"_postman_id":"f63c8985-4846-45ba-8054-66195f4d4e69"}],"event":[{"listen":"prerequest","script":{"id":"2c5dcca6-178d-4511-8488-e040f92854d6","type":"text/javascript","exec":[""]}},{"listen":"test","script":{"id":"6376b4bf-46bc-4d6a-8da2-1a164fc58f33","type":"text/javascript","exec":[""]}}],"variable":[{"key":"url","value":"https://pesapay.co.ke","type":"string"},{"key":"ipn_url","value":"https://example.com/ipn","type":"string"},{"key":"cancel_url","value":"https://example.com/cancel","type":"string"},{"key":"success_url","value":"https://example.com/success","type":"string"},{"key":"public_key","value":"test_j19v6spn66a5nty374sk1pkmul2rlk9k1akws43zd6la3dcr5g2","type":"string"}]}