/products

Last modified November 8, 2016

Products

Use this endpoint to created or update products.  Read more about Products, Bundles and Subscriptions.

Get one or multiple products

GET /products/{id1}[,{id2},{id3},...]

Get products by id response
{
  "products": [
    {
      "product": "product-1",
      "parent": null,           // The main product's path if it's a variation
      "display": {
        "en": "String",
        "es": "String",
        ...
      },
      "description": {
        "summary": {
          "en": "String",
          "fr": "String",
          ...
        },
        "action": {
          "en": "String",
          "de": "String",
          ...
        },
        "full": {
          "en": "String",
          "es": "String",
          ...
        }
      },
      "fulfillments": {
        "instructions": {
          "en": "English instruction",
          "fr": "French instruction",
          ...
        }
        "product-1_email_0": {
          "name": "Email (Your #{orderItem.display} Deli...)",
          "applicability": "ALWAYS"
        },
        "product-1_file_0": {
          "name": "File Download (1.avi)",
          "applicability": "NON_REBILL_ONLY",
          "customKey": "",
          "fileName": "1.avi",
          "fileUrl": "https://dl.dropboxusercontent.com/1/view/dimgzrsrv7sdf3p/1.avi",
          "fileSize": 224572572,
          "updating": false,
          "lastModified": 1459458979686,
          "versionBehavior": "CURRENT/REQUIRE_EXPLICIT/PREFER_EXPLICIT"
        },
        "product-1_license_0": {
          "name": "License Generator (Pre-defined List)",
          "applicability": "NON_REBILL_ONLY"
        },
        "product-1_license_1": {
          "name": "License Generator (JavaScript Script)",
          "applicability": "REBILL_ONLY",
          "customKey": "license_one"
        },
        "product-1_license_2": {
          "name": "License Generator (Remote: http://fas...)",
          "applicability": "NON_REBILL_ONLY"
        }
      },
      "image": "http://..",
      "format": "digital",
      "attributes": {
        "String": "String",
        "String": "String",
        ...
      },
      "pricing": {
        "trial": 2,
        "interval": "month",
        "intervalLength": 1,
        "quantityBehavior": "allow",
        "quantityDefault": 1,
        "price": {
          "USD": 14.95,
          "EUR": 10.99,
          ...
        },
        "quantityDiscounts": {
          10: 25.00,
          20: 35.00,
          ...
        },
        "discountReason": {
          "en": "The Reason",
          "fr": "Le Reason",
          ...
        },
        "discountDuration": 1
      }
      "action": "product.get",
      "result": "success",
    },
    {      
      "action": "product.get",
      "product": "product-none",      
      "result": "error",
      "error":
        {
          "product": "Not found"
        }
    },
    ...
  ]
}

Get the list of all product id

GET /products
Get all products
{
  "action": "products.getall",
  "result": "success",
  "products": [
    "product-1",
    "product-2",
    ...
  ]
}

Create or update one or more products

POST /products
Request Example
{

  "products": [
    {
      "product": "product-one", // Required. Must be a valid product path/ID: alphanumeric, all lower-case, no special characters except dash "-"
      "display": { // Required at least in English
        "en": "String" // Language must be enabled in the Store Settings
      },
      "description": {
        "summary": {
          "en": "String" // Language must be enabled in the Store Settings. This field also supports Markdown.
        },
        "action": {
          "en": "String" // Language must be enabled in the Store Settings
        },
        "full": {
          "en": "String" // Language must be enabled in the Store Settings. This field also supports Markdown.
        }
      },
      "fulfillment": { 
        "instructions": {
          "en": "String", // Language must be enabled in the Store Settings. This field also supports Markdown.
          "es": "String"
        }
      },
      "image": "http://..", //product icon image
      "format": "digital", // or "physical" or "digital-and-physical"
      "attributes": { // custom key/value attributes which will be passed back once this product is purchased (aggregate limit of approximately 400,000 characters total)
        "String": "String",
        "String": "String",
        ...
      }, 
      "pricing": {
        "trial": 2, // days, only needed if you are creating a subscription
        "interval": "month", // or "adhoc", "day", "week", "year", only needed if you are creating a subscription
        "intervalLength": 1, // required if "interval" is specified and is not "adhoc"

        "quantityBehavior": "allow", // or "lock" or "hide"
        "quantityDefault": 1,
        "price": {
          "USD": 14.95, // Currency must be enabled in the Store Settings
          "EUR": 10.99
        },
        "quantityDiscounts": { // "Volume Discounts". Support perentage or "amount off". Mixed values are not supported. 
          10: 25.00, // quantity: percentage off. Everything more than 10 units will be discounted by 25%.
          30: {"USD": 25.00, "EUR": 15} // quantity: amount off in each supported currency. This value will be subtracted from the product price.
        },
        "discountReason": {
          "en": "The Reason" // Language must be enabled in the Store Settings
        },
        "discountDuration": 1
      }
    },
    {
      ...next product definition...
    }
  ]
}
Response Example
{
  "errors": [
    {
      "product": "product-id",
      "error": {
        "product": "product is required", // "product" is required when creating a new product
        "display": "display is required", // "display" is required when creating a new product
        "interval": "intervalLength must be specified", // "intervalLength" is required if "interval" is specified
        "intervalLength": "interval must be specified", // "interval" is required if "intervalLength" is specified
        "renew": "interval must be specified", // or "intervalLength must be specified" or "interval and intervalLength must be specified"
        "trial": "interval must be specified", // or "intervalLength must be specified" or "interval and intervalLength must be specified"
        "discountDuration": "interval must be specified", // or "intervalLength must be specified" or "interval and intervalLength must be specified"
        "discountDuration": "quantityDiscounts must be specified",
        "discountReason": "quantityDiscounts must be specified"
      }
    }
  ],
  "items": [
    {
      // Minimum return JSON:
      "product": "product-one",
      "display": {
        "en": "String"
      },
      "format": "digital"
    },
    {
      // Maximum return JSON:
      "product": "product-two",
      "display": {
        "en": "String",
        "es": "String",
        ...
      },
      "description": {
        "summary": {
          "en": "String",
          "fr": "String",
          ...
        },
        "action": {
          "en": "String",
          "de": "String",
          ...
        },
        "full": {
          "en": "String",
          "es": "String",
          ...
        }
      },
      "fulfillment": { 
        "instructions": {
          "en": "String",
          "fr": "String",
          ...
        }
      },
      "image": "http://..",
      "format": "digital",
      "attributes": {
        "String": "String",
        "String": "String",
        ...
      },
      "pricing": {
        "trial": 2,
        "interval": "month",
        "intervalLength": 1,
        "quantityBehavior": "allow",
        "quantityDefault": 1,
        "price": {
          "USD": 14.95,
          "EUR": 10.99,
          ...
        },
        "quantityDiscounts": {
          10: 25.00,
          20: 35.00,
          ...
        },
        "discountReason": {
          "en": "The Reason",
          "fr": "Le Reason",
          ...
        },
        "discountDuration": 1
      }
    },
    ...
  ]
}