Create a new product post

post

/swm/rs/v1/spaces/{spaceId}/products

Post a new product to a space.

The API user must be a member of the space and will "own" the content.

Any corresponding product image file for the post can be uploaded using the Media API.

Triggers an email notification if the space has other members who have opted-in to receive the notification.

All request parameters required, except as noted below:
  • productPrice and productSalePrice are free form character strings that are not limited
  • productSalePrice may be a blank value (i.e. empty string) to indicate no sale price
  • productDesiredQuantity is optional and maybe a blank value
  • productImageUrl is optional and may be a blank value, which will pass through as blank to the email notification
    • if not blank, then must be an absolute URL that includes the protocol (HTTP or HTTPS) with the store domain: &lthttp_or_https>://&ltcchost>/&ltwhatever>
  • productCurrencyCode is optional
    • if not included, the default value "USD" will be used
    • if included, it must be a three-character alphanumeric value; it can not be blank
  • notificationProductPrice is optional. If not included, it will result in blank price value in any email notification. If included,
    • value will pass through to include with any email notification,
    • it cannot be blank or empty,
    • must be text string,
    • minimum 2 characters,
    • maximum 30 characters,
    • supports Unicode-8 characters
    • Examples: A$14.89 or ?400
  • productVariantOptions is required text, but it can be a blank value. API does not enforce a text format, but client may require specific format (e.g. JSON).
    • maximum 1000 characters,
  • productLinkedProducts is optional text, and may be a blank value. API does not enforce a text format, but client may require specific format (e.g. JSON).
    • maximum 1000 characters,
The contentId value returned in the response is used to reference and identify the product post in the space.

The parameter emailConfigMissing will appear in the response if the system is not configured to send out email notifications.

Request

Supported Media Types
Path Parameters
Body ()
{
"productTitle":"string", - A title for the product post
"productCurrencyCode":"string", - A three-character alphanumeric value; default is "USD" (optional)
"productPrice":"string", - The list price of the product
"productSalePrice":"string", - The sale price of the product, if any
"productUrl":"string", - The URL to the product details page on the store
"productProductId":"string", - The product ID as identified in the store catalog
"productSkuId":"string", - The product SKU ID as identified in the store catalog
"productVariantOptions":"string", - The product variant options, if any. Limit 1000 characters.
"productLinkedProducts":"string", - The additional products linked to this product, if any. Limit 1000 characters.
"productDesiredQuantity":"number", - The user's desired quantity for the product (optional)
"productImageUrl":"string", - The URL of the product image on the store to use for the email notification (optional)
"notificationProductPrice":"string" - The product price to include with any email notification for post (optional)
}
Root Schema : schema
Type: string
Back to Top

Response

Supported Media Types

200 Response

successful operation
Body ()
Root Schema : JSONObject
Type: object

201 Response

product resource created

403 Response

not space member
Back to Top

Examples

Sample Request:

       {
        "productTitle":"Samsung - F90BN Camcorder",
        "productPrice":"699.99",
        "productSalePrice":"596.89",
        "productUrl":"http://mystore.example.com/products/samsung-f90bn-camcorder/camcorder_1",
        "productProductId":"camcorder_1",
        "productSkuId":"camcordersku_1_2",
        "productVariantOptions":"
         [
           {"optionName":"color",
            "optionValue":"Black",
            "optionId":"color",
            "optionValueId":0}
         ]",
        "productLinkedProducts":"
         [
           {"configurationOptions": [
              "repositoryId":"confOpt10006",
              "product": {"repositoryId":"xprod2536"},
              "sku": {"repositoryId":"xsku2536_1"}]}
         ]",
        "productCurrencyCode":"USD",
        "notificationProductPrice":"$596.00",
        "productImageUrl":"http://mystore.example.com/images/?source=Samsung_F90BN.jpg",
        "productDesiredQuantity":1
       }    

Sample Response:

       {"response":{"code":"201.0","developerMessage":"product resource created"},
        "contentId":"2269693"}    

Possible Error Codes:

       {
          "code":"403.1","developerMessage":"not space member",
          "code":"403.4","developerMessage":"max products reached"
       }    
Back to Top