# Create a product

> Creates a new product with associated plans.

Source: https://help.boltapp.com/api-reference/subscriptions/subscriptions/createproduct

`POST /v1/subscriptions/products`

## OpenAPI definition

This endpoint as it appears in the OpenAPI document, with every schema it references included.

```json
{
  "openapi": "3.2.0",
  "info": {
    "title": "Subscriptions API",
    "version": "v1",
    "description": "API for managing subscriptions and products."
  },
  "servers": [
    {
      "url": "https://api.boltapp.com",
      "description": "The Production URL (Live Data)."
    },
    {
      "url": "https://api-sandbox.boltapp.com",
      "description": "The Sandbox URL (Test Data)."
    },
    {
      "url": "https://api-staging.boltapp.com",
      "description": "The Staging URL (Staged Data)."
    }
  ],
  "security": [
    {
      "X-API-Key": []
    },
    {
      "X-Publishable-Key": []
    }
  ],
  "paths": {
    "/v1/subscriptions/products": {
      "post": {
        "operationId": "createProduct",
        "summary": "Create a product",
        "description": "Creates a new product with associated plans.",
        "tags": [
          "Subscriptions"
        ],
        "parameters": [
          {
            "in": "header",
            "name": "X-Bolt-Connect-Seller-Id",
            "schema": {
              "type": "string"
            },
            "required": false,
            "description": "Seller ID for Connect marketplace operations. Allows creating products on behalf of a seller."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "description": "Which product fields are allowed depends on your division's subscription type, which Bolt sets for your account:\n\n- **Payment-only:** send only `merchant_product_id` and `merchant_variant_id`. `name`, `description`, `brand`, `sku`, `unit_price` and `images` are rejected. Without a `merchant_product_id`, Bolt creates a global product, which cannot have a `merchant_variant_id`.\n- **Digital goods and subscriptions (DGAS):** `merchant_product_id` is required (global products are not supported). `name`, `description` (up to 2048 characters), `brand`, `sku` (each up to 255 characters), `unit_price` (1 to 10,000,000,000 cents) and at least one image are required. Every plan needs a `sku`, and plan SKUs must be unique.\n- **Physical (all other divisions):** with a `merchant_product_id`, the same fields as DGAS are required. Without one, Bolt creates a global product, and `name`, `description`, `brand`, `sku`, `unit_price` and `merchant_variant_id` must be omitted.\n\nEvery product needs at least one plan.\n",
                "required": [
                  "plans"
                ],
                "properties": {
                  "name": {
                    "type": "string",
                    "description": "Name of the product.",
                    "examples": [
                      "Bolt Subscription Product"
                    ]
                  },
                  "description": {
                    "type": "string",
                    "description": "Description of the product.",
                    "examples": [
                      "This is a subscription product."
                    ]
                  },
                  "brand": {
                    "type": "string",
                    "description": "Brand of the product.",
                    "examples": [
                      "Bolt"
                    ]
                  },
                  "sku": {
                    "type": "string",
                    "description": "SKU of the product.",
                    "examples": [
                      "BOLT-12345"
                    ]
                  },
                  "merchant_product_id": {
                    "type": "string",
                    "description": "ID for the product; if missing, global plans are created"
                  },
                  "merchant_variant_id": {
                    "type": "string",
                    "description": "ID for the product variant"
                  },
                  "unit_price": {
                    "type": "integer",
                    "description": "Unit price of the product in cents.",
                    "examples": [
                      1999
                    ]
                  },
                  "images": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "format": "URL"
                    },
                    "description": "Array of image URLs for the product.",
                    "examples": [
                      [
                        "https://example.com/image1.jpg",
                        "https://example.com/image2.jpg"
                      ]
                    ]
                  },
                  "plans": {
                    "type": "array",
                    "description": "Plans for the product (at least one). Plans take no `unit_price`.",
                    "items": {
                      "type": "object",
                      "required": [
                        "name",
                        "frequency",
                        "frequency_unit"
                      ],
                      "properties": {
                        "sku": {
                          "type": "string",
                          "description": "SKU of the plan. Required, and unique within the product, for DGAS divisions.",
                          "examples": [
                            "BOLT-PLAN-12345"
                          ]
                        },
                        "name": {
                          "type": "string",
                          "description": "Name of the plan.",
                          "examples": [
                            "Monthly Subscription"
                          ]
                        },
                        "frequency": {
                          "type": "integer",
                          "description": "Frequency of the plan.",
                          "examples": [
                            1
                          ]
                        },
                        "frequency_unit": {
                          "type": "string",
                          "enum": [
                            "day",
                            "week",
                            "month",
                            "year"
                          ],
                          "description": "Unit of frequency (e.g., day, week, month).",
                          "examples": [
                            "month"
                          ]
                        },
                        "initial_period": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "description": "Duration of the initial period before the subscription transitions to the regular plan.",
                          "properties": {
                            "frequency": {
                              "type": "integer",
                              "description": "Number of units the initial period lasts.",
                              "examples": [
                                2
                              ]
                            },
                            "frequency_unit": {
                              "type": "string",
                              "enum": [
                                "day",
                                "week",
                                "month",
                                "year"
                              ],
                              "description": "Unit of the initial period (e.g. week, month).",
                              "examples": [
                                "week"
                              ]
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Product created successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Product"
                }
              }
            }
          },
          "400": {
            "description": "Bad request."
          },
          "401": {
            "description": "Unauthorized - Invalid or missing API key."
          }
        },
        "security": [
          {
            "X-API-Key": []
          },
          {
            "X-Publishable-Key": []
          }
        ]
      }
    }
  },
  "components": {
    "schemas": {
      "Product": {
        "type": "object",
        "description": "Product object.",
        "properties": {
          "id": {
            "type": "string",
            "description": "unique identifier for the product.",
            "examples": [
              "sp_Tlj0Osm0N76T"
            ]
          },
          "name": {
            "type": "string",
            "description": "Name of the product.",
            "examples": [
              "Bolt Subscription Product"
            ]
          },
          "description": {
            "type": "string",
            "description": "Description of the product.",
            "examples": [
              "This is a subscription product."
            ]
          },
          "merchant_product_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "merchant's ID for the product"
          },
          "merchant_variant_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "merchant's ID for the product variant"
          },
          "sku": {
            "type": "string",
            "description": "SKU of the product.",
            "examples": [
              "BOLT-12345"
            ]
          },
          "unit_price": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "Unit price of the product in cents.",
            "examples": [
              1999
            ]
          },
          "currency": {
            "type": [
              "string",
              "null"
            ],
            "description": "ISO4217 compatible currency code",
            "examples": [
              "USD"
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "examples": [
              "2023-10-01T12:00:00Z"
            ]
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "examples": [
              "2023-10-01T12:00:00Z"
            ]
          },
          "plans": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Plan"
            }
          },
          "images": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "URL"
            },
            "description": "Array of image URLs for the product.",
            "examples": [
              [
                "https://example.com/image1.jpg",
                "https://example.com/image2.jpg"
              ]
            ]
          }
        }
      },
      "Plan": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "unique identifier for the plan.",
            "examples": [
              "spl_ba_PpkW16oIW"
            ]
          },
          "name": {
            "type": "string",
            "description": "Name of the plan.",
            "examples": [
              "Monthly Subscription"
            ]
          },
          "sku": {
            "type": "string",
            "description": "SKU of the product.",
            "examples": [
              "BOLT-12345"
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "examples": [
              "2023-10-01T12:00:00Z"
            ]
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "examples": [
              "2023-10-01T12:00:00Z"
            ]
          },
          "frequency": {
            "type": "integer",
            "format": "int64",
            "examples": [
              1
            ]
          },
          "product_id": {
            "type": "string",
            "description": "ID of the product associated with the plan.",
            "examples": [
              "sp_Tlj0Osm0N76T"
            ]
          },
          "frequency_unit": {
            "type": "string",
            "description": "Unit of frequency (e.g., week, month).",
            "enum": [
              "day",
              "week",
              "month",
              "year"
            ],
            "examples": [
              "month"
            ]
          },
          "initial_period": {
            "type": [
              "object",
              "null"
            ],
            "description": "How long the initial period lasts before we move over to the regular plan.",
            "properties": {
              "frequency": {
                "type": "integer",
                "format": "int64",
                "description": "Number of units the initial period lasts.",
                "examples": [
                  2
                ]
              },
              "frequency_unit": {
                "type": "string",
                "enum": [
                  "day",
                  "week",
                  "month",
                  "year"
                ],
                "description": "Unit of the initial period (e.g. week, month).",
                "examples": [
                  "week"
                ]
              }
            }
          },
          "checkout_link": {
            "type": "string",
            "description": "Checkout link for the plan.",
            "examples": [
              "https://your_site.c.boltapp.com/g?merchant_product_id=37&merchant_variant_id=67&publishable_key=BQ9PKQksUGtj.Q9LwVLfV3WF4.32122926f7b9651a416a5099dc92dc2b4c87c8b922c114229f83b345d65f1195"
            ]
          }
        }
      }
    },
    "securitySchemes": {
      "X-API-Key": {
        "type": "apiKey",
        "in": "header",
        "name": "X-API-Key"
      },
      "X-Publishable-Key": {
        "type": "apiKey",
        "in": "header",
        "name": "X-Publishable-Key"
      }
    }
  }
}
```
