Subscription API - Get subscriptions

Get subscriptions

GET *base*/subscription/subscriptions?customerEmail=*email* Authentication : API Key

Receive a list of all subscriptions for the customer.

Parameters

customerEmail
string
required

Customer email address

Request example

POST <base>/subscription/order HTTP/1.1
Content-Type: application/x-www-form-urlencoded

GET <base>/subscription?customerEmail=example@centra.com HTTP/1.1

Response

200 Content-type: application/json

status
string
required

ok if success, else no.

subscriptions
array
required

List of subscriptions

status
string
required

The status of the subscription.

id
int
required

The ID of the subscription.

amount
decimal2 (0.00)
required

The total value of the subscription.

shipping
decimal2 (0.00)
optional

The shipping value of the subscription.

itemCount
int
optional

The total amount of products in the subscription.

currency
string
optional

The currency that the subscription was registered with, SEK, USD, EUR, etc.

address
object
optional

An address object with the customer information.

firstName lastName
string
optional

The name of the customer.

address coaddress city state zipcode phoneNumber
string
optional

The customer's address information.

country
string
optional

The country of the customer. ISO-Alpha-2 (SE, US, GB etc)

createdAt
string
optional

The date in Y-m-d H-i-s format when the subscription was created.

startDate
string
optional

The date in Y-m-d format when the subscription starts.

nextOrderDate
string
optional

The date in Y-m-d format when the subscription has next shipping.

interval
int
optional

The interval between each subscription. Depending on intervaltype it will be months or days.

intervalType
string
optional

The type of interval for the subscription

  • Month interval is in months.
  • Day interval is in days.
pricelist
string
optional

Subscription price list id.

packages
array
optional

List of subscription packages. Contains packages IDs.

customer
string
optional

Subscription customer id

Response examples

HTTP/1.1 200 OK
Content-type: application/json

{
  "status": "ok",
  "subscriptions": [
    {
      "status": "active",
      "id": 3,
      "amount": "900.00",
      "shipping": "20.00",
      "itemCount": 2,
      "currency": "SEK",
      "createdAt": "2020-05-05 15:00:00",
      "startDate": "2020-05-05",
      "nextOrderDate": "2020-05-06",
      "interval": 14,
      "intervalType": "Day",
      "pricelist": "19",
      "packages": ["1"],
      "address": {
        "firstName": "Kalle",
        "lastName": "Anka",
        "phoneNumber": "+4687203333",
        "address1": "Malarvarvsbacken 8",
        "address2": "c/o Young Skilled AB",
        "zipCode": "11733",
        "city": "Stockholm",
        "state": "",
        "country": "SE"
      },
      "customer": "132"
    },
    {
      "status": "paused",
      "id": 4,
      "amount": "500.00",
      "shipping": "20.00",
      "itemCount": 1,
      "currency": "SEK",
      "createdAt": "2020-04-03 12:00:00",
      "startDate": "2020-04-03",
      "nextOrderDate": "2020-04-04",
      "interval": 14,
      "intervalType": "Day",
      "pricelist": "19",
      "packages": ["1"],
      "address": {
        "firstName": "Kalle",
        "lastName": "Anka",
        "phoneNumber": "+4687203333",
        "address1": "Malarvarvsbacken 8",
        "address2": "c/o Young Skilled AB",
        "zipCode": "11733",
        "city": "Stockholm",
        "state": "",
        "country": "SE"
      },
      "customer": "132"
    }
  ]
}