# Create a product

Endpoint: POST /products
Security: ClientKey, SecretKey

## Security:

  - `ClientKey` (unknown)
    apiKey in header X-Dime-Client

  - `SecretKey` (unknown)
    http bearer

## Request fields (application/json):

  - `name` (string, required)
    Example: Shampoo

  - `description` (string, required)
    Example: 500ml, sulfate free.

  - `status` (string, required)
    Enum: "PUBLISHED", "DRAFT"

  - `visible` (string)
    Enum: "PUBLIC", "PRIVATE"

  - `price` (number, required)
    Example: 1200

  - `sale_price` (number)

  - `currency` (string, required)
    Enum: "USD", "JMD", "GBP", "EUR", "TTD", "BBD", "XCD", "GYD", "SRD"

  - `quantity` (integer)
    Units in stock.

  - `sell_out_of_stock` (boolean)

  - `show_quantity_selector` (boolean)

  - `image_url` (string | null)

  - `additional_images` (array)

  - `sku` (string | null)

  - `external_id` (string | null)
    Your own reference for the product.

  - `tags` (array)

  - `variation` (object | null)
    Variant attributes, for example
`{ "enabled": true, "attributes": [{ "name": "Size", "value": ["S", "M"] }] }`.

  - `supplier` (object | array | null)

  - `enable_shipping` (boolean)

  - `shipping` (number)

  - `shipping_text` (string | null)

  - `enable_tax` (boolean)

  - `tax` (number)

  - `is_sale_price_inc_tax` (boolean)

  - `is_tax_exemptable` (boolean)

  - `enable_notes` (boolean)

  - `enable_reviews` (boolean)

  - `enable_return` (boolean)

  - `return_text` (string | null)

  - `enable_recurring` (boolean)

  - `recurring_frequency` (string | null)
    Required when `enable_recurring` is true.

  - `recurring_billing_cycle` (integer | null)

  - `recurring_start_date` (string | null)

  - `recurring_end_date` (string | null)

  - `recurring_end_type` (string | null)
    Enum: "DATE", "CYCLE", "CANCEL", "null"

  - `trial_period_days` (integer | null)

  - `categories` (array)
    Category tokens to put the product in. Each must be one of your categories.
    Example: ["cat_OwnPgze7_HExqHIKA_LjAgZ9oA_ThPBbj3"]

## Response 201:

  - `201` (unknown)
    The product was created.

## Response 201 fields (application/json):

  - `name` (string, required)
    Example: Shampoo

  - `description` (string, required)
    Example: 500ml, sulfate free.

  - `status` (string, required)
    Enum: "PUBLISHED", "DRAFT"

  - `visible` (string)
    Enum: "PUBLIC", "PRIVATE"

  - `price` (number, required)
    Example: 1200

  - `sale_price` (number)

  - `currency` (string, required)
    Enum: "USD", "JMD", "GBP", "EUR", "TTD", "BBD", "XCD", "GYD", "SRD"

  - `quantity` (integer)
    Units in stock.

  - `sell_out_of_stock` (boolean)

  - `show_quantity_selector` (boolean)

  - `image_url` (string | null)

  - `additional_images` (array)

  - `sku` (string | null)

  - `external_id` (string | null)
    Your own reference for the product.

  - `tags` (array)

  - `variation` (object | null)
    Variant attributes, for example
`{ "enabled": true, "attributes": [{ "name": "Size", "value": ["S", "M"] }] }`.

  - `supplier` (object | array | null)

  - `enable_shipping` (boolean)

  - `shipping` (number)

  - `shipping_text` (string | null)

  - `enable_tax` (boolean)

  - `tax` (number)

  - `is_sale_price_inc_tax` (boolean)

  - `is_tax_exemptable` (boolean)

  - `enable_notes` (boolean)

  - `enable_reviews` (boolean)

  - `enable_return` (boolean)

  - `return_text` (string | null)

  - `enable_recurring` (boolean)

  - `recurring_frequency` (string | null)
    Required when `enable_recurring` is true.

  - `recurring_billing_cycle` (integer | null)

  - `recurring_start_date` (string | null)

  - `recurring_end_date` (string | null)

  - `recurring_end_type` (string | null)
    Enum: "DATE", "CYCLE", "CANCEL", "null"

  - `trial_period_days` (integer | null)

  - `object` (string)
    Enum: "product"

  - `token` (string)
    Identifies the product. Use it in URLs and wherever a request refers to the product.
    Example: prd_DbCYbcS3_OcTRL1Cd_e9nJdatU_HYypKhE

  - `original_price` (number | null)

  - `discount_percentage` (number | null)

  - `categories` (array)

  - `categories.token` (string)
    Example: cat_OwnPgze7_HExqHIKA_LjAgZ9oA_ThPBbj3

  - `categories.name` (string)

  - `created_at` (string)

  - `updated_at` (string)

## Response 400:

  - `400` (unknown)
    The request was rejected.

## Response 400 fields (application/json):

  - `error` (object, required)

  - `error.type` (string, required)
    Which kind of failure occurred. Always one of four values, so
a client can branch on `type` before reading `code`.
    Enum: "invalid_request_error", "card_error", "idempotency_error", "api_error"

  - `error.code` (string, required)
    Example: parameter_missing

  - `error.message` (string, required)
    Example: Order ID is required.

  - `error.param` (string)
    The field that caused the failure, when applicable.
    Example: id

## Response 401:

  - `401` (unknown)
    The client key or secret key was missing, not recognized, or the two do not belong to the same key.

## Response 401 fields (application/json):

  - `error` (object, required)

  - `error.type` (string, required)
    Which kind of failure occurred. Always one of four values, so
a client can branch on `type` before reading `code`.
    Enum: "invalid_request_error", "card_error", "idempotency_error", "api_error"

  - `error.code` (string, required)
    Example: parameter_missing

  - `error.message` (string, required)
    Example: Order ID is required.

  - `error.param` (string)
    The field that caused the failure, when applicable.
    Example: id

## Response 409:

  - `409` (unknown)
    You already have a product with this name in this currency.

## Response 409 fields (application/json):

  - `error` (object, required)

  - `error.type` (string, required)
    Which kind of failure occurred. Always one of four values, so
a client can branch on `type` before reading `code`.
    Enum: "invalid_request_error", "card_error", "idempotency_error", "api_error"

  - `error.code` (string, required)
    Example: parameter_missing

  - `error.message` (string, required)
    Example: Order ID is required.

  - `error.param` (string)
    The field that caused the failure, when applicable.
    Example: id

## Response 201 examples:

  - `A new product in one category` (unknown)

## Response 400 examples:

  - `A required field was absent` (unknown)

## Response 401 examples:

  - `unauthorized` (unknown)

  - `Client key sent without its secret key` (unknown)

