Skip to navigation

Update Components

View as Markdown

Creates, updates and deletes a subscription’s new bundle components in one atomic request. The changes apply to the subscription’s unsent order and to orders generated later.

A subscription can’t have two components for the same product. The request returns 400 and changes nothing if it:

  • Creates a component for a product already on the subscription
  • Repeats a product across create and update
  • Would leave the subscription with no components
  • Repeats a component public_id across update and delete
  • Sends a quantity that isn’t an integer of at least 1
  • References a product that doesn’t exist for the merchant
  • Updates or deletes a component that isn’t on this subscription

created, updated and deleted are empty lists when the matching input is omitted.

Authentication

x-api-keystring

Application API Scope — server-to-server, sent in the x-api-key header. See Authentication.

OR
authorizationstring

Storefront API Scope — client-side, scoped to one customer, sent as a signature in the authorization header. See Authentication.

Path parameters

subscription_public_IdstringRequired
Unique subscription ID

Request

This endpoint expects an object.
createlist of objectsOptional
Bundle Components to create with product and its quantity
updatelist of objectsOptional
Bundle Components to be updated with fields to change
deletelist of stringsOptional

Bundle components public ids to be deleted [“85eae83c245111eeb185acde48001122”,“b3928a0c3c4211eeac2bacde48001122”]

Response

200
createdlist of objectsOptional
updatedlist of objectsOptional
deletedlist of objectsOptional

Errors

400
Bad Request Error
404
Not Found Error