Purchase Access flow
To use our API for PurchaseAccess you need to authenticate and have a special permission to use. See our Authentication document for instructions on how authentication works.
This API is a REST service. Further documentation can be found at api.pei.is.
Example usage of the purchase access service:
Checking the access to a buyer
Returns a boolean of whether the merchant with the ID has access to purchasing order for the buyer with that SSN.
GET /api/purchaseaccess?merchantId=4&buyerSsn=1234567890
Example output:
false
If new recurring Pei customer then create and confirm purchase access
Requesting purchase access to a buyer
Send a PIN to a buyer in a text message to be used to confirm the purchase access later
POST /api/purchaseaccess/request
Example POST body:
{ "merchantId" : 4, "buyerSsn" : "1234567890", "mobileNumber" : "1234567" }
Confirming purchase access for a buyer
Using a PIN from the buyer, confirm purchase access
POST /api/purchaseaccess
Example post body:
{ "merchantId" : 4, "buyerSsn" : "1234567890", "pin" : "000000" }
Recurring Pei customer
Now that the merchant has access to the buyer, construct a
PurchaseAccessOrderForm
and use this service to purchase orders for the buyerPOST /api/orders/pay
Example post body:
{ "merchantId": 4, "buyer": { "name": "Jack Johnson", "ssn": "1234567890", "email": "example@example.com", "mobileNumber": "1234567" }, "amount": 15000, "reference": "REF155", "postbackUrl": "http://www.msn.com/", "items": [ { "code": "SUB555", "name": "TV subscription", "quantity": 1, "unit": "stk.", "unitPrice": 5000, "amount": 5000 }, { "code": "SNOW99", "name": "Snow", "quantity": 20000, "unit": "stk.", "unitPrice": 0.5, "amount": 10000 } ] }
Example output: