Payment API

Payment card

This section describes how to handle payment with a payment card.

We support 3-D-Secure payment by NAS Payment Service Providers, Pre-Authentication by third parties or non-3D-Secure payments.

For more information on each alternative, see:

API flow

Flow overview

The sequence diagram above describes how to shop for flights, services and seats. These are combined into one offer by requesting a OfferPrice.

POST /tokens

Before you can charge a payment card, you must create a card token. The token can then be used to create charges to the payment card.

The first step is to POST the payment card information to the /tokens endpoint.

The Payment API can be accessed from the following URLs:

Development: https://services.sdev.norwegian.com/payment
Production: https://services.sprod.norwegian.com/payment
POST

/payment/tokens

Request
POST /payment/tokens HTTP/1.1
Accept: application/json
Content-Type: application/json; charset=UTF-8
Host: services.norwegian.com
Content-Length: 442

{
  "expiryDateTimeUTC" : "2019-06-19T00:00:00",
  "card" : {
    "number" : "4444333322221111",
    "name" : "Homer Simpson",
    "address" : {
      "addressLine1" : "742 Evergreen Terrace",
      "addressLine2" : "",
      "postalCode" : "62703",
      "cityName" : "Springfield",
      "stateOrProvince" : "IL",
      "countryCode" : "US"
    },
    "expirationYear" : 2017,
    "expirationMonth" : 5,
    "verificationCode" : "321"
  }
}
Path Type Description

expiryDateTimeUTC

String

The date and time the token will expire

card.number

String

The payment card number

card.name

String

The name of the card holder

card.address.addressLine1

String

Address line 1

card.address.addressLine2

String

(Optional) Address line 2

card.address.postalCode

String

Postal code

card.address.cityName

String

City name

card.address.stateOrProvince

String

(Optional) State or province

card.address.countryCode

String

2 letter ISO country code

card.expirationYear

Number

The year the card expires

card.expirationMonth

Number

The month of year the card expires

card.verificationCode

String

The verification code

Response
HTTP/1.1 201 Created
Location: https://services.norwegian.com/payment/tokens/e2b208f83ada4997bf1f7063b5a51027
Content-Type: application/json;charset=UTF-8
Content-Length: 275
Date: Wed, 12 Jun 2019 10:00:36 GMT

{
  "id" : "e2b208f83ada4997bf1f7063b5a51027",
  "links" : [ {
    "rel" : "self",
    "href" : "https://services.norwegian.com/payment/tokens/e2b208f83ada4997bf1f7063b5a51027"
  }, {
    "rel" : "charge",
    "href" : "https://services.norwegian.com/payment/charges"
  } ]
}
Path Type Description

id

String

The id of the created token

Relation Description

self

URI to the created token resource

charge

URI to create a charge using the created token (not to be used)

Example error response
HTTP/1.1 400 Bad Request
Content-Type: application/json;charset=UTF-8
Content-Length: 72
Date: Wed, 12 Jun 2019 10:00:36 GMT
Connection: close

{
  "code" : 400,
  "description" : "Bad Request: Invalid card number"
}
Path Type Description

code

Number

An error code

description

String

Textual description of the error

Payment card - surcharges

Additional surcharges will apply to bookings made with certain credit cards. This charge covers the extra cost associated with credit card bookings. If you pay with a card where surcharges apply you have to do a final offer price request and include the token you got from the payment endpoint. The new offer will include the surcharge as a service and can be used as basis for the order creation. This will ensure that the credit card surcharge is added and that all amounts match.

If you pay with a card that is exempt the credit card surcharge, for example a debit card or a Bank Norwegian Visa, you can skip the final call to OfferPriceRQ.

Example - supply token in OfferPrice
[show]

This schema contains augmentations added to NDC.

1. Request: OfferPriceRQ
HTTP Request
[show]
2. Response: OfferPriceRS
HTTP Response
[show]
3. Request: OrderCreateRQ
HTTP Request
[show]
4. Response: OrderViewRS
HTTP Response
[show]
Important
You will get a price mismatch if you pay with a credit card where surcharges apply and you do not make a final request for an offer with the token.

Payment card - exempt surcharges

If you are paying with a card without a surcharge you can skip the extra OfferPriceRQ where you include the token.

1. Request: OrderCreateRQ
HTTP Request
[show]
2. Response: OrderViewRS
HTTP Response
[show]