To use our OrderAPI you have to authenticate. See our Authentication document for instructions on how authentication works.
OrderAPI is a REST service and has the following capabilities:
- Submit order
- Used to submit a pending order
HTTP Verb: POST
Schema:
Name
Data Type
Required
Description
Example
MerchantId
Integer
Yes
A unique ID that Greiðslumiðlun provides
55879
Amount Numeric Yes TotalAmount of purchase 9990 Reference String No A reference in Order in your own system REF1566 SuccessReturnUrl
String
No
A URL that the buyer will be redirected to when he finishes the purchase. If no URL is provided then the buyer will be redirected to a receipt page.
CancelReturnUrl
String
No
A URL that the buyer will be redirected to if he cancels the purchase. If there is no URL provided then the cancel button will not be displayed to the buyer.
PostbackUrl String No A URL that the Order ID will be posted to when the Order becomes confirmed. http://someshop.com/Confirm Buyer
Buyer
Encapsulation of the buyers information. See documentation below.
SubscriptionOptions SubscriptionOptions Used if Order is a subscription. See documentation below Items[n].Name String Yes Name of Item Helicopter Items[n].Code String No Code for the item bought in Merchant system. SUB555 Items[n].Quantity Numeric No Quantity of item 3 Items[n].Unit String No Mesuring unit of item Kg. Items[n].UnitPrice Numeric No Price of single item 1500 Items[n].Amount Numeric No Total price of item 4500 Buyer:
Name
Data Type
Required
Description
Example
Buyer.Name
String
Yes
Name of buyer
John Johnson
Buyer.Ssn
String
No
Ssn of buyer
0102882849
Buyer.Email
String
Yes
Email of buyer
Buyer.MobileNumber
String
No
Cellphone of buyer
1234567
SubscriptionOptions: Only required if Order is a subscription
Name
Data Type
Required
Description
Example
SubscriptionOptions.StartDate
String
Yes
Subscription start date. Format: dd-mm-yyyy
28.6.2015
SubscriptionOptions.Frequency
String
Yes
'Week' for weekly subscriptions 'Month' for montly subscriptions
Week
SubscriptionOptions.FrequencyInterval
Integer
Yes
Number of weeks/months between due dates
5
SubscriptionOptions.Cycles
String
Yes
How many due dates there should be in the subscription
7
Example input:
{ "merchantId": 0, "buyer": { "name": "Jack Johnson", "ssn": "0000000009", "email": "example@example.com", "mobileNumber": "1234567" }, "amount": 15000, "reference": "REF155", "subscriptionOptions": { "startDate": "2016-05-12", "frequencyInterval": 2, "frequency": "Week", "cycles": 5 }, "successReturnUrl": "http://www.zombo.com", "cancelReturnUrl": "http://www.google.com", "postbackUrl": "http://www.msn.com/", "items": [ { "code": "SUB555", "name": "TV subscription", "quantity": 1, "unit": "stk.", "unitPrice": 5000, "amount": 5000 } ] }
Example output:
{ "orderId": "fdfQQ33gdgWfgGoP642" }
Demo Environment
- MerchantId: 1
- Url: https://externalapistaging.pei.is/api/orders
- Production Environment
- Contact customer support for information about the production environment
- Get orders by date
- Used to get all orders on a specific date
- HTTP Verb: GET
- URL: https://externalapistaging.pei.is/api/orders?merchantId=1&date=2016-01-20
Example output:
[ { "orderId": "adf153j1kjkjgdg", "merchantId": 1, "buyer": { "name": "John", "ssn": "0000000001", "email": "example@example.com", "mobileNumber": "1234567" }, "amount": 10000, "reference": "abc123", "subscriptionOptions": { "startDate": "2016-06-21", "frequencyInterval": 1, "frequency": "Week", "cycles": 5 }, "successReturnUrl": "http://www.example.com", "cancelReturnUrl": "http://www.example.com", "postbackUrl": "http://www.example.com", "items": [ { "code": "123abc", "name": "Some Item", "quantity": 1, "unit": "KG", "unitPrice": 300, "amount": 1000 } ], "isConfirmed": true } ]
Get Order
- Used to get a specific Order
- HTTP Verb: GET
- URL: https://externalapistaging.pei.is/api/orders/ffmPoSnWFUjs0W9u45es0elUKBnpFRSf
Example output:
{ "orderId": "adf153j1kjkjgdg", "merchantId": 1, "buyer": { "name": "John", "ssn": "0000000001", "email": "example@example.com", "mobileNumber": "1234567" }, "amount": 10000, "reference": "abc123", "subscriptionOptions": { "startDate": "2016-06-21", "frequencyInterval": 1, "frequency": "Week", "cycles": 5 }, "successReturnUrl": "http://www.example.com", "cancelReturnUrl": "http://www.example.com", "postbackUrl": "http://www.example.com", "items": [ { "code": "123abc", "name": "Some Item", "quantity": 1, "unit": "KG", "unitPrice": 300, "amount": 1000 } ], "isConfirmed": true }