Versions Compared

Key

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

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:

  1. Submit order
    1. Used to submit a pending order
    2. HTTP Verb: POST

      1. Schema:

        Name

        Data Type

        Required

        Description

        Example

        MerchantId

        Integer

        Yes

        A unique ID that Greiðslumiðlun provides

        55879

        AmountNumericYesTotalAmount of purchase9990
        ReferenceStringNoA reference in Order in your own systemREF1566

        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.

        http://someshop.com/Success

        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.

        http://someshop.com/Cancel

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


        SubscriptionOptionsSubscriptionOptions
        Used if Order is a subscription. See documentation below
        Items[n].NameStringYesName of ItemHelicopter
        Items[n].CodeStringNoCode for the item bought in Merchant system.SUB555
        Items[n].QuantityNumericNoQuantity of item3
        Items[n].UnitStringNoMesuring unit of itemKg.
        Items[n].UnitPriceNumericNoPrice of single item1500
        Items[n].AmountNumericNoTotal price of item4500


        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

        someemail@somedomain.com

        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

    3. Example input:

      Code Block
      languagejava
      themeConfluence
      {
        "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
          }
        ]
      }
    4. Example output:

      Code Block
      languagejs
      {
        "orderId": "fdfQQ33gdgWfgGoP642"
      }
    5. Demo Environment

      1. MerchantId: 1
      2. Url: https://externalapistaging.pei.is/api/orders
    6. Production Environment
      1. Contact customer support for information about the production environment
  2. Get orders by date
    1. Used to get all orders on a specific date
    2. HTTP Verb: GET
    3. URL: https://externalapistaging.pei.is/api/orders?merchantId=1&date=2016-01-20
    4. Example output:

      Code Block
      languagejs
      [
        {
          "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
        }
      ]




  3. Get Order

    1. Used to get a specific Order
    2. HTTP Verb: GET
    3. URL: https://externalapistaging.pei.is/api/orders/ffmPoSnWFUjs0W9u45es0elUKBnpFRSf
  4. Example output:

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