Payment Services

GET /paylink/{paylinkId}

Requires authentication with server access token.

Retrieve paylink by ID.

Request

GET /api/2/paylink/{paylinkId}

paylinkId

required path parameter

ID or UUID of the paylink to retrieve. UUID will be introduced on 1st of September 2017.

Example request

cURL
curl https://login.schibsted.com/api/2/paylink/777 -G \
   -d "oauth_token=[access token]"
Java
SpidOAuthToken token = spidClient.getServerToken();
String responseJSON = spidClient.
    GET(token, "/paylink/777").
    getResponseBody();

This example is an excerpt, see a full example

PHP
<?php
$client->auth();
echo var_dump($client->api("/paylink/777"));

This example is an excerpt, see a full example

Clojure
(ns example
  (:require [spid-client-clojure.core :as spid]))

(let [client (spid/create-client "[client-id]" "[secret]")
      token (spid/create-server-token client)]
  (spid/GET client token "/paylink/777"))

Response

This endpoint supports the JSON and JSON-P response formats.

Success: 200 OK

The paylink object

paylinkId

integer (as string)

Paylink ID Although the typical format is as an integer we recommend using 36 character length string so the client ensures to be compatible for future possible changes

clientId

string

ID of the client that gets paid (seller client ID). Defaults to the authenticated client

code

string

Paylink code

shortUrl

string

Paylink short URL

sellerUserId

integer (as string)

ID of the user that gets paid. If set, will connect this paylink to the user as seller and receiver of payment

buyerUserId

integer (as string)

ID of the user that can pay. If set, will lock this paylink to this user

clientReference

string

Client's custom reference

title

string

The title shown to the user in the payment flow. Will also be shown on Payex' "new credit card" page

purchaseFlow

Purchase flow

Defaults to DIRECT (1 phase payment, no authorization)

paymentOptions

Payment options

Payment options can be returned in two formats (depending on format provided in Paylink create request): as a bit mask or as a JSON array of objects (this format allows providing data for external payment methods).

redirectUri

string

The URL the user is redirected to after payment. Can also be overridden by the client in the payment flow

cancelUri

string

The URL the user is redirected to if the user aborts the payment or login flow. Can also be overridden by the client in payment flow

expires

string

When the paylink will expire. A unix timestamp or a datetime. Defaults to 24 hours from creation

status

Paylink status

updated

datetime

When the paylink was last updated

updatedBy

string

ID of the person/client who last updated the paylink

created

datetime

When the paylink was created

createdBy

string

ID of the person/client who created the paylink

items

collection of Paylink items, as an object with paylinkItemId for property names, and Paylink items for values

Purchase flow

An enum, with the following possible values:

"DIRECT"

Direct purchase flow

"AUTHORIZE"

Authorize/Capture purchase flow

An enum, with the following possible values:

"-1"

Deleted

"0"

Not available

"1"

Available

"2"

Used

Payment options

Payment options can be provided as a bit mask.

Bitmask format is the default format. If payment options are not provided, the default value is 2 (bank card with PayEx).

Examples: 2 means credit card, 4 means SMS, while 6 means both credit card and SMS.

An enum, with the following possible values:

"1"

Masterpass

"2"

Credit card

"4"

SMS

"8"

PayEx Invoice

"16"

Voucher

"32"

Klarna Invoice

"64"

Klarna Mobile

"128"

Wallet

Payment options - array format

This format allows providing data for provided payment methods. See the provided payment methods specification for further details.

type

Payment option type

Required. Example: PAYEX_CC, STREX, PROVIDED

subType

string

Required when type is PROVIDED. A subtype used to distinguish between various types of provided payment methods.

url

string

Required when type is PROVIDED. User is redirected to this URL after choosing payment with provided payment method.

name

string

Required when type is PROVIDED. Provided payment method name.

imageUrl

string

Required when type is PROVIDED. Provided payment method image url.

description

string

Required when type is PROVIDED. Provided payment method description.

paylinkItemId

integer (as string)

paylinkId

integer (as string)

clientId

string

ID of the client that gets paid (seller client_id)

productId

integer (as string)

ID of an existing product in SPiD

clientItemReference

string

Client's custom reference for this item

type

Paylink item type

name

string

Control receipt item name, optional, uses Paylink title if not set

description

string

Control cart item description

ogpUri

string

Open Graph Protocol enabled URI representing the product being purchased

price

integer (as string)

Price (including VAT amount), in "cents". 0 or a positive integer.

vat

integer (as string)

VAT, fraction × 10000. For instance, 25% would be 2500

currency

string

Currency. Ex. NOK. Defaults to the to platform currency

quantity

integer (as string)

The quantity of this item. Defaults to 1, the total cost is price multiplied by quantity

updated

string

When the paylink was last changed

updatedBy

string

ID of the user/client who last updated the paylink item

created

string

When the paylink item was created

createdBy

string

ID of the user/client who created the paylink item

Failure cases

Some HTTP response codes are used for multiple error situations. There is no consistent way to tell these apart, but the error object will contain a textual explanation of the reason for the error. For explanation on OAuth related failures and errors see OAuth authentication failures.

  • 401 Unauthorized You don't have administration rights for this client.
  • 401 Unauthorized Your client doesn't have administration rights for this client.
  • 403 Forbidden Client is not authorized to access this API endpoint. Contact SPiD to request access.
  • 403 Forbidden Requesting IP is not whitelisted
  • 403 Forbidden Access token rejected
  • 404 Not Found Unknown client ID
  • 404 Not Found Client ID mismatch. The client making the request is no the owner of this resource, and does not have administrative privileges for it.
  • 404 Not Found Paylink not found
  • 420 Request Ratelimit exceeded

Sample response

JSON
{
  "sellerUserId": null,
  "updatedBy": "52f8e3d9efd04bb749000000",
  "status": "1",
  "clientReference": "Order number #3242",
  "items": {
    "6199": {
      "updatedBy": null,
      "vat": "1917",
      "clientId": "[Your client ID]",
      "currency": "NOK",
      "paylinkId": "4638",
      "createdBy": "[ID of admin user, or client]",
      "quantity": "1",
      "ogpUri": null,
      "productId": null,
      "clientItemReference": null,
      "created": "2014-08-06 08:16:36",
      "updated": "2014-08-06 08:16:36",
      "type": "0",
      "paylinkItemId": "6199",
      "price": "7983",
      "description": "Star Wars IV"
    }
  },
  "clientId": "[Your client ID]",
  "paylinkId": "4638",
  "cancelUri": "http://localhost:8000/cancel",
  "createdBy": "[ID of admin user, or client]",
  "expires": "2014-08-07 08:16:36",
  "buyerUserId": null,
  "title": "Star Wars Movies",
  "code": "4638",
  "created": "2014-08-06 08:16:36",
  "updated": "2014-08-06 08:16:36",
  "shortUrl": "https://identity-pre.schibsted.com/auth/start?paylink\u003d4638",
  "paymentOptions": "2",
  "purchaseFlow": "DIRECT",
  "redirectUri": "http://localhost:8000/callback"
}
JSON-P
callback({
  "sellerUserId": null,
  "updatedBy": "52f8e3d9efd04bb749000000",
  "status": "1",
  "clientReference": "Order number #3242",
  "items": {
    "6199": {
      "updatedBy": null,
      "vat": "1917",
      "clientId": "[Your client ID]",
      "currency": "NOK",
      "paylinkId": "4638",
      "createdBy": "[ID of admin user, or client]",
      "quantity": "1",
      "ogpUri": null,
      "productId": null,
      "clientItemReference": null,
      "created": "2014-08-06 08:16:36",
      "updated": "2014-08-06 08:16:36",
      "type": "0",
      "paylinkItemId": "6199",
      "price": "7983",
      "description": "Star Wars IV"
    }
  },
  "clientId": "[Your client ID]",
  "paylinkId": "4638",
  "cancelUri": "http://localhost:8000/cancel",
  "createdBy": "[ID of admin user, or client]",
  "expires": "2014-08-07 08:16:36",
  "buyerUserId": null,
  "title": "Star Wars Movies",
  "code": "4638",
  "created": "2014-08-06 08:16:36",
  "updated": "2014-08-06 08:16:36",
  "shortUrl": "https://identity-pre.schibsted.com/auth/start?paylink\u003d4638",
  "paymentOptions": "2",
  "purchaseFlow": "DIRECT",
  "redirectUri": "http://localhost:8000/callback"
});

Comments/feedback

Do you have questions, or just want to contribute some newly gained insight? Want to share an example? Please leave a comment. SPiD reads and responds to every question. Additionally, your experience can help others using SPiD, and it can help us continuously improve our documentation.