Skip to main content

Subscription Service. (1.0.0)

Download OpenAPI specification:Download

This service provides subscription resources and actions:

Get all subscriptions

Get all subscriptions

Authorizations:
JWT
query Parameters
size
integer <int64>
Default: 50

Amount of items returned per pagination page

page
integer <int64>
Default: 0

Pagination page starting from 0

Responses

Response samples

Content type
application/json
{
  • "format": "short",
  • "items": [
    ],
  • "last": false,
  • "number": 41,
  • "size": 10,
  • "totalItems": 100523,
  • "totalPages": 10053
}

Get all subscriptions models

Get all subscriptions models

Authorizations:
JWT
query Parameters
size
integer <int64>
Default: 50

Amount of items returned per pagination page

page
integer <int64>
Default: 0

Pagination page starting from 0

Responses

Response samples

Content type
application/json
{
  • "format": "short",
  • "items": [
    ],
  • "last": false,
  • "number": 41,
  • "size": 10,
  • "totalItems": 100523,
  • "totalPages": 10053
}

Subscriptions

Create a subscription

Create a subscription

Authorizations:
JWT
Request Body schema: application/json
required
createDate
integer <int64>

Entity creation time. Value is auto generated upon creation and read only. Timestamp in milliseconds.

currency
string
customerId
string

Associates entity to certain customer.

dbVersion
integer <int64>

Concurrent operations check mechanism.

Used in update actions. Value is auto generated upon creation/update and read only.

Prevent for any issue during concurrent update transaction done by parallel applications. Upon spotted dbVersion incorrectness a 412 retry error is returned. Let's consider a scenario where two application are trying update same entity:

App 1: GET entity request at 00:00:00.000 Received dbVersion=0 change entity data PUT entity request at 00:00:00.009 updated automatically dbVersion=1

App 2: GET entity request with at 00:00:00.005 Received dbVersion=0 because update of App 1 haven't occurred yet change entity data update entity at 00:00:00.014 412 Error, because dbVersion=1 after update of App 1

object
object (DiscountPlan)
Array of objects (Email)
enduserId
string

Associates entity to certain end user.

externalContext
string
id
string

Entity id. Value is auto generated upon creation and read only.

imported
boolean
initialOrderId
string
layout
string
object
mandateValue
number <double>
migratedFromCustomerId
string
object (SubscriptionModel)
modelId
string
name
string
Array of objects (Product)
Array of objects (Product)
storeId
string
updateDate
integer <int64>

Entity update time. Value is auto generated upon creation/update and read only. Timestamp in milliseconds.

upgradable
boolean

Responses

Request samples

Content type
application/json
{
  • "createDate": 1593683684789,
  • "currency": "string",
  • "customerId": "e0436791-5866-406d-b0c8-3ba32ead438a",
  • "dbVersion": 0,
  • "decodedExternalContext": {
    },
  • "discountPlan": {
    },
  • "emails": [
    ],
  • "enduserId": "c84b801f-6f8d-4b32-8b8e-406e91a473d6",
  • "externalContext": "string",
  • "id": "d87e0973-980a-4485-a39d-682184a8988a",
  • "imported": true,
  • "initialOrderId": "string",
  • "layout": "string",
  • "lifecycle": {
    },
  • "mandateValue": 0.1,
  • "migratedFromCustomerId": "string",
  • "model": {
    },
  • "modelId": "string",
  • "name": "string",
  • "nextProducts": [
    ],
  • "products": [
    ],
  • "storeId": "string",
  • "updateDate": 1593685645385,
  • "upgradable": true
}

Response samples

Content type
application/json
{
  • "createDate": 1593683684789,
  • "currency": "string",
  • "customerId": "e0436791-5866-406d-b0c8-3ba32ead438a",
  • "dbVersion": 0,
  • "decodedExternalContext": {
    },
  • "discountPlan": {
    },
  • "emails": [
    ],
  • "enduserId": "c84b801f-6f8d-4b32-8b8e-406e91a473d6",
  • "externalContext": "string",
  • "id": "d87e0973-980a-4485-a39d-682184a8988a",
  • "imported": true,
  • "initialOrderId": "string",
  • "layout": "string",
  • "lifecycle": {
    },
  • "mandateValue": 0.1,
  • "migratedFromCustomerId": "string",
  • "model": {
    },
  • "modelId": "string",
  • "name": "string",
  • "nextProducts": [
    ],
  • "products": [
    ],
  • "storeId": "string",
  • "updateDate": 1593685645385,
  • "upgradable": true
}

Get a subscription model by name

Get a subscription model by name

Authorizations:
JWT
path Parameters
model
required
string

Model name

Responses

Response samples

Content type
application/json
{
  • "createDate": 1593683684789,
  • "currency": "string",
  • "customerId": "e0436791-5866-406d-b0c8-3ba32ead438a",
  • "dbVersion": 0,
  • "decodedExternalContext": {
    },
  • "discountPlan": {
    },
  • "emails": [
    ],
  • "enduserId": "c84b801f-6f8d-4b32-8b8e-406e91a473d6",
  • "externalContext": "string",
  • "id": "d87e0973-980a-4485-a39d-682184a8988a",
  • "imported": true,
  • "initialOrderId": "string",
  • "layout": "string",
  • "lifecycle": {
    },
  • "mandateValue": 0.1,
  • "migratedFromCustomerId": "string",
  • "model": {
    },
  • "modelId": "string",
  • "name": "string",
  • "nextProducts": [
    ],
  • "products": [
    ],
  • "storeId": "string",
  • "updateDate": 1593685645385,
  • "upgradable": true
}

Delete a subscription by id

Delete a subscription by id

Authorizations:
JWT
path Parameters
subscriptionId
required
string

ID of subscription

Responses

Response samples

Content type
application/json
{
  • "error": "Bad Request",
  • "message": "error: field can't be empty",
  • "path": "/service-name/resource/36a6d3ac-207f-4b64-be01-664c1edbd38b",
  • "status": 400,
  • "timestamp": 1593769514607
}

Get a subscription by id

Get a subscription by id

Authorizations:
JWT
path Parameters
subscriptionId
required
string

ID of subscription

Responses

Response samples

Content type
application/json
{
  • "createDate": 1593683684789,
  • "currency": "string",
  • "customerId": "e0436791-5866-406d-b0c8-3ba32ead438a",
  • "dbVersion": 0,
  • "decodedExternalContext": {
    },
  • "discountPlan": {
    },
  • "emails": [
    ],
  • "enduserId": "c84b801f-6f8d-4b32-8b8e-406e91a473d6",
  • "externalContext": "string",
  • "id": "d87e0973-980a-4485-a39d-682184a8988a",
  • "imported": true,
  • "initialOrderId": "string",
  • "layout": "string",
  • "lifecycle": {
    },
  • "mandateValue": 0.1,
  • "migratedFromCustomerId": "string",
  • "model": {
    },
  • "modelId": "string",
  • "name": "string",
  • "nextProducts": [
    ],
  • "products": [
    ],
  • "storeId": "string",
  • "updateDate": 1593685645385,
  • "upgradable": true
}

Update a subscription by id

Update a subscription by id

Authorizations:
JWT
path Parameters
subscriptionId
required
string

ID of subscription

Request Body schema: application/json
required
createDate
integer <int64>

Entity creation time. Value is auto generated upon creation and read only. Timestamp in milliseconds.

currency
string
customerId
string

Associates entity to certain customer.

dbVersion
integer <int64>

Concurrent operations check mechanism.

Used in update actions. Value is auto generated upon creation/update and read only.

Prevent for any issue during concurrent update transaction done by parallel applications. Upon spotted dbVersion incorrectness a 412 retry error is returned. Let's consider a scenario where two application are trying update same entity:

App 1: GET entity request at 00:00:00.000 Received dbVersion=0 change entity data PUT entity request at 00:00:00.009 updated automatically dbVersion=1

App 2: GET entity request with at 00:00:00.005 Received dbVersion=0 because update of App 1 haven't occurred yet change entity data update entity at 00:00:00.014 412 Error, because dbVersion=1 after update of App 1

object
object (DiscountPlan)
Array of objects (Email)
enduserId
string

Associates entity to certain end user.

externalContext
string
id
string

Entity id. Value is auto generated upon creation and read only.

imported
boolean
initialOrderId
string
layout
string
object
mandateValue
number <double>
migratedFromCustomerId
string
object (SubscriptionModel)
modelId
string
name
string
Array of objects (Product)
Array of objects (Product)
storeId
string
updateDate
integer <int64>

Entity update time. Value is auto generated upon creation/update and read only. Timestamp in milliseconds.

upgradable
boolean

Responses

Request samples

Content type
application/json
{
  • "createDate": 1593683684789,
  • "currency": "string",
  • "customerId": "e0436791-5866-406d-b0c8-3ba32ead438a",
  • "dbVersion": 0,
  • "decodedExternalContext": {
    },
  • "discountPlan": {
    },
  • "emails": [
    ],
  • "enduserId": "c84b801f-6f8d-4b32-8b8e-406e91a473d6",
  • "externalContext": "string",
  • "id": "d87e0973-980a-4485-a39d-682184a8988a",
  • "imported": true,
  • "initialOrderId": "string",
  • "layout": "string",
  • "lifecycle": {
    },
  • "mandateValue": 0.1,
  • "migratedFromCustomerId": "string",
  • "model": {
    },
  • "modelId": "string",
  • "name": "string",
  • "nextProducts": [
    ],
  • "products": [
    ],
  • "storeId": "string",
  • "updateDate": 1593685645385,
  • "upgradable": true
}

Response samples

Content type
application/json
{
  • "createDate": 1593683684789,
  • "currency": "string",
  • "customerId": "e0436791-5866-406d-b0c8-3ba32ead438a",
  • "dbVersion": 0,
  • "decodedExternalContext": {
    },
  • "discountPlan": {
    },
  • "emails": [
    ],
  • "enduserId": "c84b801f-6f8d-4b32-8b8e-406e91a473d6",
  • "externalContext": "string",
  • "id": "d87e0973-980a-4485-a39d-682184a8988a",
  • "imported": true,
  • "initialOrderId": "string",
  • "layout": "string",
  • "lifecycle": {
    },
  • "mandateValue": 0.1,
  • "migratedFromCustomerId": "string",
  • "model": {
    },
  • "modelId": "string",
  • "name": "string",
  • "nextProducts": [
    ],
  • "products": [
    ],
  • "storeId": "string",
  • "updateDate": 1593685645385,
  • "upgradable": true
}

Cancel subscription

Cancel subscription

Authorizations:
JWT
path Parameters
subscriptionId
required
string

ID of subscription

Responses

Response samples

Content type
application/json
{
  • "createDate": 1593683684789,
  • "currency": "string",
  • "customerId": "e0436791-5866-406d-b0c8-3ba32ead438a",
  • "dbVersion": 0,
  • "decodedExternalContext": {
    },
  • "discountPlan": {
    },
  • "emails": [
    ],
  • "enduserId": "c84b801f-6f8d-4b32-8b8e-406e91a473d6",
  • "externalContext": "string",
  • "id": "d87e0973-980a-4485-a39d-682184a8988a",
  • "imported": true,
  • "initialOrderId": "string",
  • "layout": "string",
  • "lifecycle": {
    },
  • "mandateValue": 0.1,
  • "migratedFromCustomerId": "string",
  • "model": {
    },
  • "modelId": "string",
  • "name": "string",
  • "nextProducts": [
    ],
  • "products": [
    ],
  • "storeId": "string",
  • "updateDate": 1593685645385,
  • "upgradable": true
}

Pre-bill a subscription

This endpoint is used for creating pre-billed orders when pre-billings don't exist. For example, it is used for orders when discount source is OFFER

This endpoint may be used in the case of a discount OFFER process to pre-bill a subscription when pre-billing does not exist.

Authorizations:
JWT

Responses

Response samples

Content type
application/json
{
  • "id": "string",
  • "lineItems": [
    ]
}

Reactivate subscription

Reactivate subscription

Authorizations:
JWT
path Parameters
subscriptionId
required
string

ID of subscription

Responses

Response samples

Content type
application/json
{
  • "createDate": 1593683684789,
  • "currency": "string",
  • "customerId": "e0436791-5866-406d-b0c8-3ba32ead438a",
  • "dbVersion": 0,
  • "decodedExternalContext": {
    },
  • "discountPlan": {
    },
  • "emails": [
    ],
  • "enduserId": "c84b801f-6f8d-4b32-8b8e-406e91a473d6",
  • "externalContext": "string",
  • "id": "d87e0973-980a-4485-a39d-682184a8988a",
  • "imported": true,
  • "initialOrderId": "string",
  • "layout": "string",
  • "lifecycle": {
    },
  • "mandateValue": 0.1,
  • "migratedFromCustomerId": "string",
  • "model": {
    },
  • "modelId": "string",
  • "name": "string",
  • "nextProducts": [
    ],
  • "products": [
    ],
  • "storeId": "string",
  • "updateDate": 1593685645385,
  • "upgradable": true
}

Suspend subscription

Suspend subscription

Authorizations:
JWT
path Parameters
subscriptionId
required
string

ID of subscription

Responses

Response samples

Content type
application/json
{
  • "createDate": 1593683684789,
  • "currency": "string",
  • "customerId": "e0436791-5866-406d-b0c8-3ba32ead438a",
  • "dbVersion": 0,
  • "decodedExternalContext": {
    },
  • "discountPlan": {
    },
  • "emails": [
    ],
  • "enduserId": "c84b801f-6f8d-4b32-8b8e-406e91a473d6",
  • "externalContext": "string",
  • "id": "d87e0973-980a-4485-a39d-682184a8988a",
  • "imported": true,
  • "initialOrderId": "string",
  • "layout": "string",
  • "lifecycle": {
    },
  • "mandateValue": 0.1,
  • "migratedFromCustomerId": "string",
  • "model": {
    },
  • "modelId": "string",
  • "name": "string",
  • "nextProducts": [
    ],
  • "products": [
    ],
  • "storeId": "string",
  • "updateDate": 1593685645385,
  • "upgradable": true
}

Upgrade subscription

Upgrade subscription

Authorizations:
JWT
path Parameters
subscriptionId
required
string

ID of subscription

Request Body schema: application/json
required
createDate
integer <int64>

Entity creation time. Value is auto generated upon creation and read only. Timestamp in milliseconds.

currency
string
customerId
string

Associates entity to certain customer.

dbVersion
integer <int64>

Concurrent operations check mechanism.

Used in update actions. Value is auto generated upon creation/update and read only.

Prevent for any issue during concurrent update transaction done by parallel applications. Upon spotted dbVersion incorrectness a 412 retry error is returned. Let's consider a scenario where two application are trying update same entity:

App 1: GET entity request at 00:00:00.000 Received dbVersion=0 change entity data PUT entity request at 00:00:00.009 updated automatically dbVersion=1

App 2: GET entity request with at 00:00:00.005 Received dbVersion=0 because update of App 1 haven't occurred yet change entity data update entity at 00:00:00.014 412 Error, because dbVersion=1 after update of App 1

object
object (DiscountPlan)
Array of objects (Email)
enduserId
string

Associates entity to certain end user.

externalContext
string
id
string

Entity id. Value is auto generated upon creation and read only.

imported
boolean
initialOrderId
string
layout
string
object
mandateValue
number <double>
migratedFromCustomerId
string
object (SubscriptionModel)
modelId
string
name
string
Array of objects (Product)
Array of objects (Product)
storeId
string
updateDate
integer <int64>

Entity update time. Value is auto generated upon creation/update and read only. Timestamp in milliseconds.

upgradable
boolean

Responses

Request samples

Content type
application/json
{
  • "createDate": 1593683684789,
  • "currency": "string",
  • "customerId": "e0436791-5866-406d-b0c8-3ba32ead438a",
  • "dbVersion": 0,
  • "decodedExternalContext": {
    },
  • "discountPlan": {
    },
  • "emails": [
    ],
  • "enduserId": "c84b801f-6f8d-4b32-8b8e-406e91a473d6",
  • "externalContext": "string",
  • "id": "d87e0973-980a-4485-a39d-682184a8988a",
  • "imported": true,
  • "initialOrderId": "string",
  • "layout": "string",
  • "lifecycle": {
    },
  • "mandateValue": 0.1,
  • "migratedFromCustomerId": "string",
  • "model": {
    },
  • "modelId": "string",
  • "name": "string",
  • "nextProducts": [
    ],
  • "products": [
    ],
  • "storeId": "string",
  • "updateDate": 1593685645385,
  • "upgradable": true
}

Response samples

Content type
application/json
{
  • "createDate": 1593683684789,
  • "currency": "string",
  • "customerId": "e0436791-5866-406d-b0c8-3ba32ead438a",
  • "dbVersion": 0,
  • "decodedExternalContext": {
    },
  • "discountPlan": {
    },
  • "emails": [
    ],
  • "enduserId": "c84b801f-6f8d-4b32-8b8e-406e91a473d6",
  • "externalContext": "string",
  • "id": "d87e0973-980a-4485-a39d-682184a8988a",
  • "imported": true,
  • "initialOrderId": "string",
  • "layout": "string",
  • "lifecycle": {
    },
  • "mandateValue": 0.1,
  • "migratedFromCustomerId": "string",
  • "model": {
    },
  • "modelId": "string",
  • "name": "string",
  • "nextProducts": [
    ],
  • "products": [
    ],
  • "storeId": "string",
  • "updateDate": 1593685645385,
  • "upgradable": true
}