# Create a product

> Creates a product and its plans in one call. A product created here is the same product the v1 endpoints read, update and delete.

Source: https://help.boltapp.com/api-reference/subscriptions/products-v2/createproductv2

`POST /v2/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": {
    "/v2/subscriptions/products": {
      "post": {
        "operationId": "createProductV2",
        "summary": "Create a product",
        "description": "Creates a product and its plans in one call. A product created here is the same product the v1 endpoints read, update and delete.",
        "tags": [
          "Products v2"
        ],
        "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": {
                "$ref": "#/components/schemas/CreateProductV2Request"
              },
              "examples": {
                "product": {
                  "summary": "Bolt Cart division, product block",
                  "value": {
                    "product": {
                      "name": "Canvas AI Pro",
                      "description": "Professional plan for Canvas AI.",
                      "sku": "CANVAS-AI-PRO",
                      "brand": "Canvas",
                      "images": [
                        "https://example.com/canvas-ai-pro.png"
                      ],
                      "unit_price": 2900,
                      "currency": "USD",
                      "taxable": true,
                      "tax_behavior": "exclusive"
                    },
                    "plans": [
                      {
                        "name": "Monthly",
                        "sku": "CANVAS-AI-PRO-MONTHLY",
                        "frequency": 1,
                        "frequency_unit": "month",
                        "trial": {
                          "trial_days": 14
                        }
                      },
                      {
                        "name": "Yearly",
                        "sku": "CANVAS-AI-PRO-YEARLY",
                        "frequency": 1,
                        "frequency_unit": "year"
                      }
                    ]
                  }
                },
                "product_reference": {
                  "summary": "Physical or payment-only division, product_reference block",
                  "value": {
                    "product_reference": {
                      "product_id": "37",
                      "variant_id": "67"
                    },
                    "plans": [
                      {
                        "name": "Monthly",
                        "frequency": 1,
                        "frequency_unit": "month",
                        "initial_period": {
                          "frequency": 2,
                          "frequency_unit": "week"
                        }
                      }
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Product created successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProductV2"
                }
              }
            }
          },
          "400": {
            "description": "Bad request. The body breaks one of the rules for your division kind, or your division is a DGAS division and must use `/v1/subscriptions/products`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "examples": {
                  "default": {
                    "value": {
                      "result": {
                        "success": false
                      },
                      "errors": [
                        {
                          "code": 50,
                          "message": "taxable is required",
                          "field": "product.taxable"
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized - Invalid or missing API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "examples": {
                  "default": {
                    "value": {
                      "result": {
                        "success": false
                      },
                      "errors": [
                        {
                          "code": 1005,
                          "message": "X-API-Key header is missing, invalid, or associated with a merchant that is no longer active."
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Conflict. A live product on the division already has this `sku`, or a product already exists for this `product_reference`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "examples": {
                  "default": {
                    "value": {
                      "result": {
                        "success": false
                      },
                      "errors": [
                        {
                          "code": 34,
                          "message": "The entity already exists. A live product on this division already has this SKU.",
                          "field": "product.sku"
                        }
                      ]
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "X-API-Key": []
          },
          {
            "X-Publishable-Key": []
          }
        ]
      }
    }
  },
  "components": {
    "schemas": {
      "CreateProductV2Request": {
        "type": "object",
        "description": "Send exactly one of `product` or `product_reference`. A body with both, or with neither, is rejected. Which one you send depends on your division's subscription type, which Bolt sets for your account:\n\n- **Bolt Cart:** send `product`. Bolt creates the product in your Bolt Cart catalog. `product_reference` is rejected.\n- **Physical and payment-only:** send `product_reference`, which points at a product in your own catalog. `product` is rejected. v2 does not create global products, so `product_reference.product_id` is required.\n- **Digital goods and subscriptions (DGAS):** not supported. Use `POST /v1/subscriptions/products`.\n\nA Bolt Cart product is always created `active`. Three keys that `POST /v1/subscriptions/products` accepts are rejected here with a `400`:\n\n- `status` and `product.status`: a v2 product is always created active.\n- `promotions`: create promotions through the product promotions endpoint after the product exists.\n\nPlan rules also depend on the division:\n\n- **Bolt Cart:** `plans` may be empty. Every plan needs a `sku`. A plan may have a `trial`. `initial_period` and the `one_time` frequency unit are rejected. A plan's `currency`, when sent, must be the product's currency.\n- **Physical and payment-only:** at least one plan is required. A plan may have an `initial_period`. `trial` is rejected.\n\n`metadata` is accepted only with `product`. A non-empty `metadata` sent with `product_reference` is rejected.\n\nThe product and all of its plans are written together. If any plan is rejected, nothing is created. A duplicate returns `409`: on a Bolt Cart division when a live product already has the same `sku`, and on other divisions when a product already exists for the same `product_reference`.\n",
        "required": [
          "plans"
        ],
        "properties": {
          "product": {
            "$ref": "#/components/schemas/ProductV2Details"
          },
          "product_reference": {
            "$ref": "#/components/schemas/ProductV2Reference"
          },
          "plans": {
            "type": "array",
            "description": "Plans for the product. May be empty on a Bolt Cart division. At least one is required on other divisions.",
            "items": {
              "$ref": "#/components/schemas/PlanInput"
            }
          },
          "metadata": {
            "type": "object",
            "additionalProperties": true,
            "description": "Free-form metadata stored on the Bolt Cart product. Accepted only with `product`.",
            "examples": [
              {
                "team": "growth"
              }
            ]
          }
        }
      },
      "ProductV2Details": {
        "type": "object",
        "description": "Product in your Bolt Cart catalog. Bolt Cart divisions only.",
        "required": [
          "name",
          "description",
          "sku",
          "currency",
          "taxable"
        ],
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 250,
            "description": "Name of the product.",
            "examples": [
              "Canvas AI Pro"
            ]
          },
          "description": {
            "type": "string",
            "description": "Description of the product.",
            "examples": [
              "Professional plan for Canvas AI."
            ]
          },
          "sku": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "SKU of the product. Unique among the division's live products.",
            "examples": [
              "CANVAS-AI-PRO"
            ]
          },
          "brand": {
            "type": [
              "string",
              "null"
            ],
            "description": "Brand of the product.",
            "examples": [
              "Canvas"
            ]
          },
          "images": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "URL"
            },
            "description": "Array of image URLs for the product.",
            "examples": [
              [
                "https://example.com/canvas-ai-pro.png"
              ]
            ]
          },
          "marketing_features": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Marketing feature statements for the product.",
            "examples": [
              [
                "Unlimited projects",
                "Priority support"
              ]
            ]
          },
          "unit_price": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "minimum": 0,
            "description": "Unit price of the product in cents.",
            "examples": [
              2900
            ]
          },
          "currency": {
            "type": "string",
            "pattern": "^[A-Z]{3}$",
            "description": "ISO4217 currency code, three upper-case letters.",
            "examples": [
              "USD"
            ]
          },
          "taxable": {
            "type": "boolean",
            "description": "Whether the product is taxable.",
            "examples": [
              true
            ]
          },
          "tax_behavior": {
            "type": "string",
            "enum": [
              "exclusive",
              "inclusive"
            ],
            "default": "exclusive",
            "description": "Whether `unit_price` excludes or includes tax.",
            "examples": [
              "exclusive"
            ]
          },
          "tax_code": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 32,
            "description": "Tax code of the product. A code Bolt does not list is rejected. Without one, the product is taxed at the standard rate.",
            "examples": [
              "31000"
            ]
          },
          "family": {
            "type": [
              "string",
              "null"
            ],
            "minLength": 1,
            "maxLength": 100,
            "description": "Family the product belongs to.",
            "examples": [
              "Canvas AI"
            ]
          },
          "unit_label": {
            "type": [
              "string",
              "null"
            ],
            "description": "Label for one unit of the product.",
            "examples": [
              "seat"
            ]
          }
        }
      },
      "ProductV2Reference": {
        "type": "object",
        "description": "Reference to a product in your own catalog. Physical and payment-only divisions only.",
        "required": [
          "product_id"
        ],
        "properties": {
          "product_id": {
            "type": "string",
            "minLength": 1,
            "description": "Your ID for the product.",
            "examples": [
              "37"
            ]
          },
          "variant_id": {
            "type": "string",
            "minLength": 1,
            "description": "Your ID for the product variant. Optional, but not empty when sent.",
            "examples": [
              "67"
            ]
          }
        }
      },
      "PlanInput": {
        "type": "object",
        "required": [
          "name",
          "frequency",
          "frequency_unit"
        ],
        "properties": {
          "name": {
            "type": "string",
            "description": "Name of the plan.",
            "examples": [
              "Monthly"
            ]
          },
          "sku": {
            "type": "string",
            "description": "SKU of the plan. Required on a Bolt Cart division, where it is unique within the product.",
            "examples": [
              "CANVAS-AI-PRO-MONTHLY"
            ]
          },
          "frequency": {
            "type": "integer",
            "minimum": 1,
            "maximum": 52,
            "description": "Number of `frequency_unit` periods between renewals.",
            "examples": [
              1
            ]
          },
          "frequency_unit": {
            "type": "string",
            "enum": [
              "day",
              "week",
              "month",
              "year",
              "one_time"
            ],
            "description": "Unit of frequency. `one_time` is rejected on a Bolt Cart division.",
            "examples": [
              "month"
            ]
          },
          "initial_period": {
            "allOf": [
              {
                "$ref": "#/components/schemas/PlanInitialPeriod"
              }
            ],
            "description": "Physical and payment-only divisions only. Rejected on a Bolt Cart division, where you use `trial` instead."
          },
          "trial": {
            "allOf": [
              {
                "$ref": "#/components/schemas/PlanTrial"
              }
            ],
            "description": "Bolt Cart divisions only. Rejected on other divisions."
          },
          "currency": {
            "type": "string",
            "description": "ISO4217 currency code of the plan. On a Bolt Cart division it must be the product's currency, which is also the default. On other divisions it defaults to `USD`.",
            "examples": [
              "USD"
            ]
          }
        }
      },
      "PlanInitialPeriod": {
        "type": "object",
        "description": "Duration of the initial period before the subscription moves to the plan's regular frequency.",
        "required": [
          "frequency",
          "frequency_unit"
        ],
        "properties": {
          "frequency": {
            "type": "integer",
            "format": "int64",
            "minimum": 1,
            "maximum": 32767,
            "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.",
            "examples": [
              "week"
            ]
          }
        }
      },
      "PlanTrial": {
        "type": "object",
        "description": "Free trial on a plan. Bolt Cart divisions only.",
        "required": [
          "trial_days"
        ],
        "properties": {
          "trial_days": {
            "type": "integer",
            "format": "int64",
            "minimum": 1,
            "maximum": 730,
            "description": "Length of the trial in days.",
            "examples": [
              14
            ]
          }
        }
      },
      "ProductV2": {
        "type": "object",
        "description": "Product object returned by the v2 product endpoints. `product` and `product_reference` are always present, and at most one of them is not `null`.",
        "properties": {
          "id": {
            "type": "string",
            "description": "Unique identifier for the product.",
            "examples": [
              "sp_Tlj0Osm0N76T"
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "draft",
              "active",
              "archived"
            ],
            "description": "Bolt Cart divisions only. Read-only. Absent on other divisions.",
            "examples": [
              "active"
            ]
          },
          "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"
            ]
          },
          "activated_at": {
            "type": "string",
            "format": "date-time",
            "description": "Bolt Cart divisions only. When the product became active. Absent on a product that was never activated.",
            "examples": [
              "2023-10-01T12:00:00Z"
            ]
          },
          "archived_at": {
            "type": "string",
            "format": "date-time",
            "description": "Bolt Cart divisions only. When the product was archived. Absent on a product that is not archived.",
            "examples": [
              "2024-02-01T12:00:00Z"
            ]
          },
          "product": {
            "description": "The Bolt Cart catalog product. `null` on physical and payment-only divisions.",
            "anyOf": [
              {
                "$ref": "#/components/schemas/ProductV2Details"
              },
              {
                "type": "null"
              }
            ]
          },
          "product_reference": {
            "description": "The reference to your own catalog. `null` on a Bolt Cart division, and on a global product created through v1.",
            "anyOf": [
              {
                "$ref": "#/components/schemas/ProductV2Reference"
              },
              {
                "type": "null"
              }
            ]
          },
          "plans": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PlanV2"
            }
          },
          "metadata": {
            "type": "object",
            "additionalProperties": true,
            "description": "Metadata stored on the Bolt Cart product.",
            "examples": [
              {
                "team": "growth"
              }
            ]
          },
          "name": {
            "type": "string",
            "readOnly": true,
            "description": "Name stored for a product that was created and named through a v1 endpoint. Absent on products created through v2."
          }
        }
      },
      "PlanV2": {
        "type": "object",
        "description": "Plan object returned by the v2 product endpoints. It has no `checkout_link`. `GET /v1/subscriptions/plans` returns the checkout link of a plan.",
        "properties": {
          "id": {
            "type": "string",
            "description": "Unique identifier for the plan.",
            "examples": [
              "spl_ba_PpkW16oIW"
            ]
          },
          "name": {
            "type": "string",
            "description": "Name of the plan.",
            "examples": [
              "Monthly"
            ]
          },
          "sku": {
            "type": "string",
            "description": "SKU of the plan.",
            "examples": [
              "CANVAS-AI-PRO-MONTHLY"
            ]
          },
          "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",
            "description": "Number of `frequency_unit` periods between renewals.",
            "examples": [
              1
            ]
          },
          "frequency_unit": {
            "type": "string",
            "description": "Unit of frequency.",
            "enum": [
              "day",
              "week",
              "month",
              "year",
              "one_time"
            ],
            "examples": [
              "month"
            ]
          },
          "base_price": {
            "type": "integer",
            "format": "int64",
            "description": "Base price stored on the plan, as an integer in minor units of `currency`. `0` on a plan with no base price. Renewals are not billed from this field.",
            "examples": [
              0
            ]
          },
          "product_id": {
            "type": "string",
            "description": "ID of the product associated with the plan.",
            "examples": [
              "sp_Tlj0Osm0N76T"
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "active",
              "archived"
            ],
            "description": "Status of the plan.",
            "examples": [
              "active"
            ]
          },
          "currency": {
            "type": "string",
            "description": "ISO4217 currency code of the plan. Absent on a plan that stores no currency.",
            "examples": [
              "USD"
            ]
          },
          "initial_period": {
            "allOf": [
              {
                "$ref": "#/components/schemas/PlanInitialPeriod"
              }
            ],
            "description": "Present only when the plan has an initial period."
          },
          "trial": {
            "description": "Bolt Cart divisions only. `null` when the plan has no trial. Absent on other divisions.",
            "anyOf": [
              {
                "$ref": "#/components/schemas/PlanTrial"
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "ApiErrorResponse": {
        "type": "object",
        "description": "Standard error envelope returned by every non-2xx response.",
        "required": [
          "result",
          "errors"
        ],
        "properties": {
          "result": {
            "type": "object",
            "properties": {
              "success": {
                "type": "boolean",
                "description": "Always `false` on an error.",
                "examples": [
                  false
                ]
              }
            }
          },
          "errors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiError"
            }
          }
        },
        "examples": [
          {
            "result": {
              "success": false
            },
            "errors": [
              {
                "code": 15,
                "message": "A valid value must be provided.",
                "field": "frequency"
              }
            ]
          }
        ]
      },
      "ApiError": {
        "type": "object",
        "description": "One error of a failed request.",
        "required": [
          "code",
          "message"
        ],
        "properties": {
          "code": {
            "type": "integer",
            "description": "Bolt error code.",
            "examples": [
              15
            ]
          },
          "message": {
            "type": "string",
            "description": "What went wrong.",
            "examples": [
              "A valid value must be provided."
            ]
          },
          "field": {
            "type": "string",
            "description": "Path of the request field the error is about, such as `product.taxable` or `plans[1].sku`. Absent when the error is not about one field.",
            "examples": [
              "frequency"
            ]
          }
        }
      }
    },
    "securitySchemes": {
      "X-API-Key": {
        "type": "apiKey",
        "in": "header",
        "name": "X-API-Key",
        "description": "Admins and Developers can obtain their Bolt API key from the Bolt Merchant Dashboard. Send it together with `X-Publishable-Key`."
      },
      "X-Publishable-Key": {
        "type": "apiKey",
        "in": "header",
        "name": "X-Publishable-Key",
        "description": "The publicly viewable identifier used to identify a merchant division. This key is found in the Developer > API section of the Bolt Merchant Dashboard. Required. Send it together with `X-API-Key`."
      }
    }
  }
}
```
