Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

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.

Table of Contents
minLevel1
maxLevel1

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

  1. Authenticate user to get bearer token, see Authentication

  2. Send offer with Offers endpoint POST: https://api.pei.is/api/offers

    1.  an order gets created

    2. the buyer gets a message sent to the mobile number and/or email listed in the order that was created

  3. 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.

https://api.pei.is/api/offers

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

IntegerYes

Status
colourGreen
titletrue

A unique ID that Greiðslumiðlun provides

4

Amount

NumericYes

Status
colourGreen
titletrue

Total amount of purchase

9990

Reference

StringNo

Status
titlefalse

A reference in Order in the merchant's system

REF1566

Buyer

BuyerYes

Status
colourGreen
titletrue

Encapsulation of the buyers information. See documentation below.

CustomMessage

String

Status
title
No
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

StringYes

Status
colourGreen
titletrue

Name of Item

Helicopter

Items[n].Code

StringNo

Status
titlefalse

Code for the item bought in Merchant system.

SUB555

Items[n].Quantity

Numeric

Status
No
titlefalse

Quantity of item

3000

Items[n].Unit

String

Status
title
No
false

Measuring unit of item

Kg

Items[n].UnitPrice

NumericNo

Status
titlefalse

Price of single item

1500

Items[n].Amount

NumericNo

Status
titlefalse

Total price of item

4500

Items[n].GroupName

String

Status
No
titlefalse

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

BooleanNo

Status
titlefalse

When set to true the item becomes optional, default not optional. This has no effect on items with group names.

false

Items[n].IsDefaultSelected

BooleanNo

Status
titlefalse

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 https://greidslumidlun.atlassian.net/wiki/spaces/LEIB/pages/2998534165/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

Status
No
titlefalse

Ssn of buyer

0102882849

Buyer.Email

String

Status
title
No
false

Email of buyer

someemail@somedomain.com

Buyer.MobileNumber

String

Status
title
No
false

Cellphone number of buyer

1234567

Example

Input

Code Block
languagejson
{
  "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

Code Block
languagejson
{
  "orderId": "fdfQQ33gdgWfgGoP642"
}