Offers
This endpoint creates an order and sends an offer message to a buyer with a link to Greiðslugátt Pei to confirm the newly created order.
An offer is a wrapper around the Order resource and includes customer engagement via SMS/email.
To use our API for Offers 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.
Workflow
Authenticate user to get bearer token, see Authentication
Send offer with Offers endpoint POST: https://api.pei.is/api/offers
an order gets created
the buyer gets a message sent to the mobile number and/or email listed in the order that was created
Buyer completes the offer/order using the Greiðslugátt Pei.
Environments
Demo
Use merchantId: 4 and URL endpoint https://externalapistaging.pei.is/api/offers
Production
Contact customer support for information about he production environment.
Send offer
Creates an order and sends the customer an offer to complete the order.
POST /api/offers
Schema
Offer
Name | Data Type | Required | Description | Example |
---|---|---|---|---|
MerchantId | Integer | true | A unique ID that Greiðslumiðlun provides | 4 |
Amount | Numeric | true | Total amount of purchase | 9990 |
Reference | String | false | A reference in Order in the merchant's system | REF1566 |
Buyer | Buyer | true | Encapsulation of the buyers information. See documentation below. |
|
CustomMessage | String | false | Custom message made by you to be sent alongside the payment gateway link. If not set, a default message will be sent. If set, the format of the message will be: "{CustomMessage} https://gattin.pei.is/fdfQQ33gdgWfgGoP642" | Here's an offer: |
Items[n].Name | String | true | Name of Item | Helicopter |
Items[n].Code | String | false | Code for the item bought in Merchant system. | SUB555 |
Items[n].Quantity | Numeric | false | Quantity of item | 3000 |
Items[n].Unit | String | false | Measuring unit of item | Kg |
Items[n].UnitPrice | Numeric | false | Price of single item | 1500 |
Items[n].Amount | Numeric | false | Total price of item | 4500 |
Items[n].GroupName | String | false | Optional group name, for when certain items need to be grouped together and only one of them selected by the buyer. | Flying vehicles |
Items[n].IsOptional | Boolean | false | When set to true the item becomes optional, default not optional. This has no effect on items with group names. | false |
Items[n].IsDefaultSelected | Boolean | false | When set to true, group items and optional items become selected when the order is created. Only one group item can be default selected. | true |
Buyer
Neither email or mobileNumber are required, since in some cases you might just know one of them but you should submit at least one or the other.
If you really want to send an offer to a buyer with no information about the buyer, you can, but in that case you should probably just use Orders | Submit order, since that is basically what happens; no emails, no text messages, just an order.
Name | Data Type | Required | Description | Example |
---|---|---|---|---|
Buyer.Ssn | String | false | Ssn of buyer | 0102882849 |
Buyer.Email | String | false | Email of buyer | |
Buyer.MobileNumber | String | false | Cellphone number of buyer | 1234567 |
Example
Input
{
"merchantId": 4,
"buyer": {
"ssn": "1333371337",
"email": "example@example.com",
"mobileNumber": "1234567"
},
"amount": 15000,
"reference": "REF155",
"customMessage": "We here at Better TechDocs inc. would like to offer you this fantastic deal:",
"items": [
{
"code": "SUB555",
"name": "TV subscription",
"quantity": 1,
"unit": "stk.",
"unitPrice": 5000,
"amount": 5000
}
]
}
Output
{
"orderId": "fdfQQ33gdgWfgGoP642"
}