Payment Services

GET /products

Requires authentication with server or user access token.

Retrieve all products within this client.

See also

Help us improve

Did you spot an error? Or maybe you just have a suggestion for how we can improve? Leave us a comment.

Request

GET /api/2/products

productId

optional

Only list this particular product

name

optional

Search for exact matches of this name

code

optional

Search for exact matches of this code

price

optional

Search for exact matches of this price

parentProductId

optional

List all products with this parent product

sort

optional

filters

optional
content
Return products of type digital content
subscriptions
Return products of type subscriptions
deleted
Filter by items with a deleted status
unavailable
Return all items with status unavailable
invisible
Return all products with status invisible - products that may be purchased via a direct link, but are not listed in normal product listings
unselectable
Return all products with status unselectable
available
Return all items with status available
bundle
Return product as a bundle, including its bundle items

The pagination parameters limit, offset, since, and until are also supported.

Example request

cURL
Minimal example
curl https://login.schibsted.com/api/2/products -G \
   -d "oauth_token=[access token]"
With all parameters
curl https://login.schibsted.com/api/2/products -G \
   -d "oauth_token=[access token]" \
   -d "productId=1337" \
   -d "name=John Doe" \
   -d "code=ipad" \
   -d "price=400" \
   -d "parentProductId=44" \
   -d "sort=userId"
Java
Minimal example
SpidOAuthToken token = spidClient.getUserToken(code);
String responseJSON = spidClient.
    GET(token, "/products").
    getResponseBody();
With all parameters
Map<String, String> params = new HashMap<>() {{
    put("productId", "1337");,
    put("name", "John Doe");,
    put("code", "ipad");,
    put("price", "400");,
    put("parentProductId", "44");,
    put("sort", "userId");
}};

SpidOAuthToken token = spidClient.getUserToken(code);
String responseJSON = spidClient.
    GET(token, "/products", params).
    getResponseBody();

This example is an excerpt, see a full example

PHP
Minimal example
<?php
$client->auth();
echo var_dump($client->api("/products"));
With all parameters
<?php
$params = array(
    "productId" => "1337",
    "name" => "John Doe",
    "code" => "ipad",
    "price" => "400",
    "parentProductId" => "44",
    "sort" => "userId"
);

$client->auth();
echo var_dump($client->api("/products", $params));

This example is an excerpt, see a full example

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

(let [client (spid/create-client "[client-id]" "[secret]")
      token (spid/create-user-token client "[code]")]
  (spid/GET client token "/products"))
With all parameters
(ns example
  (:require [spid-client-clojure.core :as spid]))

(let [client (spid/create-client "[client-id]" "[secret]")
      token (spid/create-user-token client "[code]")]
  (spid/GET client token "/products" {"productId" "1337"
                                      "name" "John Doe"
                                      "code" "ipad"
                                      "price" "400"
                                      "parentProductId" "44"
                                      "sort" "userId"}))

Response

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

Success: 200 OK

Returns a list of products.

Product

productId

integer (as string)

Unique product ID

parentProductId

integer (as string)

ID of the parent product, if any

clientId

string

Your client ID

type

Product type

bundle

Bundle type

code

string

name

string

Product display name

description

string

A detailed description of the product

url

URL (string)

price

price

vat

integer (as string)

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

currency

string

Price and VAT currency

paymentOptions

Payment options

Available payment options for this product

quantityLimit

integer (as string)

Maximum available sales for this product.

quantityCount

integer (as string)

Number of sales for this product so far

saleStart

datetime

Start of a sale for this product (i.e. reduced price or with additional benefits)

saleStop

datetime

End of a sale

availableStart

datetime

When this product is available for purchase

availableStop

datetime

When this product is no longer available for purchase

subscriptionPeriod

timestamp, in seconds

The subscription period

subscriptionRenewPrice

price

Price of subscription renewal

subscriptionRenewPeriod

timestamp, in seconds

For how long a renewal is valid

subscriptionAutoRenew

string, "1" (true) or "0" (false)

If "1", the subscription automatically renews

subscriptionAutoRenewLockPeriod

timestamp, in seconds

The initial period during which auto renew cannot be changed

subscriptionAutoRenewDisabled

string, "1" (true) or "0" (false)

If "1", auto renew is not available

subscriptionGracePeriod

integer (as string)

The period after a failed renewal charge the subscription will stay active

subscriptionEmailReceiptLimit

integer (as string)

The maximum number of email receipts

subscriptionFinalEndDate

datetime

By this date, the subscription is no longer for sale

allowMultiSales

string, "1" (true) or "0" (false)

If "1", users can purchase this product multiple times

status

Product status

changedBy

integer (as string)

ID of the user that made the last change

changed

datetime

createdBy

integer (as string)

ID of the user that created this product

created

datetime

purchaseUri

URL (string)

A URI where the product may be purchased

The check mark indicates that the field always contains a valid non-empty value.

Product status

An enum, with the following possible values:

"-1"

Deleted

"0"

Not available

"1"

Available, but not visible

"2"

Available, but not selectable

"3"

Available

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

Bundle type

An enum, with the following possible values:

"0"

Not a bundle

"1"

Dynamic bundle

"2"

Onetime bundle

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 No products found
  • 420 Request Ratelimit exceeded

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.