Update a subscription

Updates a Subscription. The TemplateBasket will be ignored. Use regular API-methods for baskets to change the TemplateBasket.

Request
query Parameters
updatedBy
required
integer <int32>

Account internal id of current user.

pricelistSeed
string

A comma separated list of internal pricelist ids to use, if any. PriceLists supplied must be valid, either from the application's public priceList or any customer or company priceLists or any valid client priceLists. For clients configured to use priceListSeed exclusively in the API only the supplied priceLists will be used. If this is not configured, the supplied priceLists will be appended to the valid priceLists. If none is supplied, the default value for the application will be used in combination with any customer or company priceLists. This applies to both configurations.

cultureCode
string

Specifies in which language to display culture specific information. If none is supplied, value is resolved from Application.

currencyId
string

Internal id that specifies in which currency to display prices. If none is supplied, value is resolved from Application.

Request Body schema:

The subscription to update. Only the Name, StatusId, HoldUntilDate, StartDate and Schedules can be changed. StatusId can only be changed between Active and Paused.

Id
integer or null <int32>

A unique internal id for this Subscription. When creating new Subscription this should be left as null and will be ignored.

Name
string

The name of the Subscription. This will also be the name of the template basket. Can be used to distinguish Subscriptions from each other. MaxLength: 50

object <Basket> (Basket)
object <SubscriptionType> (SubscriptionType)
StatusId
integer <int32>

The internal status id for this Subscription. When a Subscription is created the status will be 0 (Inactive) and ignored. To activate a Subscription it must pass through the Checkout process. See ListSubscriptionStatus for valid values. Can only be changed between Active and Paused. To delete a Subscription use DeleteSubscription.

HoldUntilDate
string or null <date-time>

A date used to temporarily pause the Subscription and automatically activate it again on the specified date. If no HoldFromDate is specified the pause will start immediately.

StartDate
string or null <date-time>

An optional start date for the Subscription. The Subscription can be activated but no orders will be processed before this date if specified. Can only be changed if a specified date has not passed or if the Subscription is still inactive. If no StartDate is specified when activating the Subscription this will be set to the activation date.

EndDate
string or null <date-time>

An optional end date for the Subscription. The Subscription will be deleted after this date if specified. See DeleteSubscription for details about deleting subscriptions.

Array of objects <SubscriptionSchedule> (SubscriptionSchedule)

The schedules for this Subscription. Any Subscription must have at least one schedule when activated.

HoldFromDate
string or null <date-time>

A date used to temporarily pause the Subscription from the specified date and automatically activate it again on HoldUtilDate. If this is specified HoldUntilDate must also be specified.

NextRun
string or null <date-time>

Calculated date for next time an order will be created by this subscription

Responses
200

Success

400

Bad Request

Key: InvalidCompanyOnBasket. Gets raised when the basket has an invalid company. The customer does not exist in this company.

Key: SubscriptionMissing. Gets raised when the recurring order is invalid.

Key: SubscriptionNotEditable. Gets raised when the basket is not editable or already paid for. Or if the subscription is deleted.

500

Internal Server Error

post/ShoppingService.svc/rest/UpdateSubscription
Request samples
{
  • "Id": 0,
  • "Name": "string",
  • "TemplateBasket": {
    },
  • "Type": {
    },
  • "StatusId": 0,
  • "HoldUntilDate": "2019-08-24T14:15:22Z",
  • "StartDate": "2019-08-24T14:15:22Z",
  • "EndDate": "2019-08-24T14:15:22Z",
  • "Schedules": [
    ],
  • "HoldFromDate": "2019-08-24T14:15:22Z",
  • "NextRun": "2019-08-24T14:15:22Z"
}
Response samples
{
  • "Id": 0,
  • "Name": "string",
  • "TemplateBasket": {
    },
  • "Type": {
    },
  • "StatusId": 0,
  • "HoldUntilDate": "2019-08-24T14:15:22Z",
  • "StartDate": "2019-08-24T14:15:22Z",
  • "EndDate": "2019-08-24T14:15:22Z",
  • "Schedules": [
    ],
  • "HoldFromDate": "2019-08-24T14:15:22Z",
  • "NextRun": "2019-08-24T14:15:22Z"
}