Skip to main content

Attach a product

POST 

/subscriptions/offerings/:offering_uuid/products/attach

After saving an offering, you can attach new products to it at any time.

Adding new products does not affect any existing active subscriptions. The changes take effect on all new subscriptions that are created.

Request

Path Parameters

    offering_uuid UUIDrequired

    The unique identifier of the offering.

Body

    data OfferingProductAttachrequired

    A list of product IDs to attach to the offering. See List Products.

    products UUID (string)[]required

    Possible values: >= 1

Responses

Success. The subscription product is attached with the offering.

Schema
    data OfferingProduct[]
  • Array [
  • id UUID (string)

    The unique identifier.

    type SubscriptionOfferingProductType (string)required

    Possible values: [subscription_offering_product]

    attributes ProductAttributesrequired
    external_ref ExternalRef (string)

    Possible values: <= 2048 characters

    A unique attribute that you could use to contain information from another company system, for example. The maximum length is 2048 characters.

    name stringrequired

    Possible values: >= 3 characters and <= 1024 characters

    The name of the product.

    description string

    Possible values: <= 1024 characters

    The product or service description to display to customers.

    sku string

    Possible values: <= 1024 characters

    A stock keeping unit for the product, if appropriate.

    main_image uri

    Possible values: <= 1024 characters

    A URL from which an image or file for the product can be fetched. You can either upload your images and files to Commerce using the Commerce Files API or you can use your own content delivery network. If you are using the Commerce Files API, use Create a File to upload your file and return an HREF link in the response. An extensive range of media and file extensions are supported.

    price Price
    property name* object

    The base price.

    amount int64required

    The value as a whole number of the currency's smallest subdivision.

    includes_tax boolean

    Indicates whether the amount includes any taxes.

    price_units object

    The timeframe during which the product price is applicable. For example, for a streaming service, the price is $12.99 and the unit is months and the amount is 1. In other words, the streaming service is available for $12.99 a month. You may want to specify a unit price if you have many products that all have different prices. Rather than having to create separate plans for each product, you can specify the timeframe during which the product price is applicable and then create one plan that determines the billing frequency for those products.

    unit stringrequired

    Possible values: [day, month]

    A unit of time.

    amount integerrequired

    Possible values: >= 1

    The number of days or months the period covers.

    updated_at stringrequired

    The date and time a resource was updated.

    created_at stringrequired

    The date and time a resource was created.

    relationships Relationships

    Relationships are established between different subscription entities. For example, a product and a plan are related to an offering, as both are attached to it.

    anyOf
    title
    meta ProductMetarequired
    display_price DisplayPrice
    without_tax PriceFormatting
    amount int64required

    The unformatted amount for the objects.

    currency stringrequired

    The three-letter ISO currency code in uppercase, associated with a price.

    formatted stringrequired

    The formatted amount for the objects.

    with_tax PriceFormatting
    amount int64required

    The unformatted amount for the objects.

    currency stringrequired

    The three-letter ISO currency code in uppercase, associated with a price.

    formatted stringrequired

    The formatted amount for the objects.

    owner stringrequired

    The owner of a resource, either store or organization.

    timestamps Timestampsrequired
    updated_at stringrequired

    The date and time a resource was updated.

    created_at stringrequired

    The date and time a resource was created.

  • ]
Loading...