---
title: "Create Product"
source_url: https://docs.rapyd.net/en/create-product.html
lang: en
---

# Create Product

Create goods or services.

If the product is goods, use [Create SKU](https://docs.rapyd.net/en/create-sku.md "Create SKU") to add a SKU to the product.

This method triggers the **Product Created** webhook. This webhook contains the same information as the response.

> **Note:**
>
> - The code samples include successful requests (200) and bad requests (400).
>
>   - For error messages that appear due to bad requests (400), see:
>
>     - [General Errors](https://docs.rapyd.net/en/general-errors.md "General Errors")
>     - [Product Errors](https://docs.rapyd.net/en/product-errors.md "Product Errors")
>   - For information about unauthorized request (401) and other authentication errors, see [Troubleshooting Authentication and Authorization Errors](https://docs.rapyd.net/en/troubleshooting-authentication-and-authorization-errors.md "Troubleshooting Authentication and Authorization Errors").

### Parameters

### Request Header Parameters

- - access_key
  - Unique access key provided by Rapyd for each authorized user.

    See [Developers](https://docs.rapyd.net/en/developers.md "Developers").
- - Content-Type
  - Indicates that the data appears in JSON format. Set to **application/json**.
- - idempotency
  - A unique key that prevents the platform from creating the same object twice.

    See [Idempotency](https://docs.rapyd.net/en/idempotency.md "Idempotency").
- - salt
  - Random string. Recommended length: 8-16 characters.
- - signature
  - Signature calculated for each request individually.

    See [Request Signatures](https://docs.rapyd.net/en/request-signatures.md "Request Signatures").
- - timestamp
  - Timestamp for the request, in [Unix time](https://docs.rapyd.net/en/glossary.md#UUID-945d98cf-adae-e1cf-2606-c7fae8b4a7e1_unix_time "Unix time") (seconds).

### Request Body Parameters

- - active
  - Indicates whether the product is currently available for purchase.

    true
- - attributes
  - Array of up to 5 alphanumeric strings defined by the merchant. Each string defines the key in a key-value pair in the `attributes` object in the corresponding `sku` objects.
- - description
  - Full text description of the product.
- - id
  - Unique string for identification of the product. Legal input includes all the English alphanumeric characters and the underscore (_) character. If the merchant does not define an ID, Rapyd generates it with a string that starts with **product_**.
- - images
  - Array of Base64-encoded images.
- - metadata
  - A JSON object defined by the client. See [Metadata](https://docs.rapyd.net/en/metadata.md "Metadata").
- - name
  - The name of the product or service that is displayed to the customer.
- - package_dimensions
  - Physical attributes of the SKU item. Object containing the following fields. These fields are represented as numbers, but it is the responsibility of the merchant to define and interpret the relevant units of length and weight.

    - - height
      - Height of the package, in units defined by the client.
    - - length
      - Length of the package, in units defined by the client.
    - - weight
      - Weight of the package, in units defined by the client.
    - - width
      - Width of the package, in units defined by the client.
- - shippable
  - Indicates whether the product is physically shipped to the customer. Relevant when `type` is **goods**.

    false
- - statement_descriptor
  - A text description that appears in the customer's invoice. Limited to 22 characters. Relevant when `type` is **service**.
- - type
  - One of the following:

    - **services**
    - **goods**
- - unit_label
  - A label that represents units of this product on customers’ invoices, such as views or downloads. Relevant when `type` is **service**.

### Response Parameters

- - active
  - Indicates whether the product is currently available for purchase.
- - attributes
  - Array of strings. Up to 5 unique alphanumeric strings defined by the merchant. Each string defines the key in a key-value pair in the `attributes` object in the corresponding `sku` objects.
- - created_at
  - Time of creation of this product, in [Unix time](https://docs.rapyd.net/en/glossary.md#UUID-945d98cf-adae-e1cf-2606-c7fae8b4a7e1_unix_time "Unix time").
- - description
  - Full text description of the product.
- - id
  - Unique string for identification of the product.
- - images
  - Array of Base64-encoded images.
- - metadata
  - A JSON object defined by the client. See [Metadata](https://docs.rapyd.net/en/metadata.md "Metadata").
- - name
  - The name of the product or service that appears in the line items in invoices.
- - package_dimensions
  - Physical attributes of the SKU item. Object containing the following fields. These fields are represented as numbers, but it is the responsibility of the merchant to define and interpret the relevant units of length and weight.

    - - height
      - Height of the package, in units defined by the client.
    - - length
      - Length of the package, in units defined by the client.
    - - weight
      - Weight of the package, in units defined by the client.
    - - width
      - Width of the package, in units defined by the client.
- - shippable
  - Indicates whether the product can be shipped.
- - skus
  - Array of objects. An array of SKUs associated with this product. Relevant when `type` is **goods**. For more information about the 'sku' object, see [Create SKU](https://docs.rapyd.net/en/create-sku.md "Create SKU").
- - statement_descriptor
  - Description that is suitable for a customer's statement. Limited to 22 characters.

    Relevant when `type` is **service**. Must be null when `type` is **goods**.
- - type
  - One of the following:

    - **services** - Relevant to subscriptions and plans.
    - **goods** - Relevant to orders and SKUs.
- - unit_label
  - Determines what one unit of this product is called on customers’ receipts and invoices, such as minutes, viewings, kilometers or packages.

    Relevant when `type` is **service**. Must be null when `type` is **goods**.
- - updated_at
  - Time that this product was last updated, in [Unix time](https://docs.rapyd.net/en/glossary.md#UUID-945d98cf-adae-e1cf-2606-c7fae8b4a7e1_unix_time "Unix time").

### Code Samples

- - .NET

    - ```csharp
      using System;
      using System.Text.Json;

      namespace RapydApiRequestSample
      {
          class Program
          {
              static void Main(string[] args)
              {
                  try
                  {
                      var metadata = new
                      {
                          merchant_defined = true
                      };

                      var attributes = new string[] { "location", "size" };
                      var requestObj = new
                      {
                          id = "",
                          name = "Monthly parking",
                          type = "services",
                          active = true,
                          attributes,
                          description = "Monthly parking - covered area, compact car",
                          metadata,
                          shippable = false,
                          statement_descriptor = "",
                          unit_label = "",
                      };

                      string request = JsonSerializer.Serialize(requestObj);

                      string result = RapydApiRequestSample.Utilities.MakeRequest("POST", "/v1/products", request);

                      Console.WriteLine(result);
                  }
                  catch (Exception e)
                  {
                      Console.WriteLine("Error completing request: " + e.Message);
                  }
              }
          }
      }
      ```
- - JavaScript

    - ```javascript
      const makeRequest = require('<path-to-your-utility-file>/utilities').makeRequest;

      async function main() {
        try {
          const body = {
            id: '',
            name: 'Monthly parking',
            type: 'services',
            active: true,
            attributes: ['location', 'size'],
            description: 'Monthly parking - covered area, compact car',
            metadata: {
              merchant_defined: true
            },
            shippable: false,
            statement_descriptor: '',
            unit_label: ''
          };
          const result = await makeRequest('POST', '/v1/products', body);

          console.log(result);
        } catch (error) {
          console.error('Error completing request', error);
        }
      }
      ```
- - PHP

    - ```php
      <?php
      $path = $_SERVER['DOCUMENT_ROOT'];
      $path .= "/<path-to-your-utility-file>/utilities.php";
      include($path);

      $body = [
        "id" =>  "",
        "name" =>  "Monthly parking",
        "type" =>  "services",
        "active" =>  true,
        "attributes"  => [
          "location",
          "size"
          ],
        "description" =>  "Monthly parking - covered area, compact car",
        "shippable" =>  false,
        "statement_descriptor" =>  "",
        "unit_label" =>  ""
      ];

      try {
          $object = make_request('post', '/v1/products', $body);
          var_dump($object);
      } catch(Exception $e) {
          echo "Error: $e";
      }
      ?>
      ```
- - Python

    - ```python
      product = {
          "id": "",
          "name": "Monthly parking",
          "type": "services",
          "active": True,
          "attributes": [
              "location",
              "size"
          ],
          "description": "Monthly parking - covered area, compact car",
          "metadata": {
              "merchant_defined": True
          },
          "shippable": False,
          "statement_descriptor": "monthly_parking",
          "unit_label": "",
      }
      result = make_request(method='post', path='/v1/products', body=product)
      pprint(result)
      ```

- /v1/products

- Create Services
- ```curl
  curl -X post 'https://sandboxapi.rapyd.net/v1/products' \
  -H 'access_key: your-access-key-here' \
  -H 'Content-Type: application/json' \
  -H 'idempotency: your-idempotency-parameter-here' \
  -H 'salt: your-random-string-here' \
  -H 'signature: your-calculated-signature-here' \
  -H 'timestamp: your-unix-timestamp-here' \
  --data-raw '{
      "name": "Monthly parking",
      "type": "services",
      "active": true,
      "attributes": [
          "location",
          "size"
      ],
      "description": "Monthly parking - covered area, compact car"
  }'
  ```
- ```json
  {
      "status": {
          "error_code": "",
          "status": "SUCCESS",
          "message": "",
          "response_code": "",
          "operation_id": "57404a17-a32c-4409-b000-5a2e9ad1d7af"
      },
      "data": {
          "id": "product_fdbe0fa3c6c7aec44d1b7cca7736486e",
          "active": true,
          "attributes": [
              "location",
              "size"
          ],
          "created_at": 1756283215,
          "description": "Monthly parking - covered area, compact car",
          "images": [],
          "metadata": {},
          "name": "Monthly parking",
          "package_dimensions": {
              "height": 0,
              "length": 0,
              "weight": 0,
              "width": 0
          },
          "shippable": false,
          "skus": [],
          "statement_descriptor": "",
          "type": "services",
          "unit_label": "",
          "updated_at": 1756283215
      }
  }
  ```

- Create Goods
- ```curl
  curl -X post  'https://sandboxapi.rapyd.net/v1/products' \
  -H 'access_key: your-access-key-here' \
  -H 'Content-Type: application/json' \
  -H 'idempotency: your-idempotency-parameter-here' \
  -H 'salt: your-random-string-here' \
  -H 'signature: your-calculated-signature-here' \
  -H 'timestamp: your-unix-timestamp-here' \
  --data-raw '{
      "id": "",
      "name": "Gamer's Chair",
      "type": "goods",
      "attributes": [
          "color",
          "arm_rest"
      ],
      "description": "The ultimate in comfort for the dedicated gamer.",
      "images": [
          "64bit-encoded-image-1",
          "64bit-encoded-image-2"
      ],
      "package_dimensions": {
          "height": 10,
          "length": 20,
          "weight": 30,
          "width": 40
      },
      "shippable": true
  }'
  ```
- ```json
  {
      "status": {
          "error_code": "",
          "status": "SUCCESS",
          "message": "",
          "response_code": "",
          "operation_id": "b662a2c3-5be2-4c4c-931e-87b39e80302b"
      },
      "data": {
          "id": "product_94f575fe0c11a26723f91db5ceef2c25",
          "active": true,
          "attributes": [
              "arm_rest",
              "color"
          ],
          "created_at": 1761206928,
          "description": "The ultimate in comfort for the dedicated gamer.",
          "images": [],
          "metadata": {},
          "name": "Gamer's Chair",
          "package_dimensions": {
              "height": 10,
              "length": 20,
              "weight": 30,
              "width": 40
          },
          "shippable": true,
          "skus": [],
          "statement_descriptor": "",
          "type": "goods",
          "unit_label": "",
          "updated_at": 1761206928
      }
  }
  ```

- Bad Request - Invalid Product Type
- ```curl
  curl -X post  'https://sandboxapi.rapyd.net/v1/products' \
  -H 'access_key: your-access-key-here' \
  -H 'Content-Type: application/json' \
  -H 'idempotency: your-idempotency-parameter-here' \
  -H 'salt: your-random-string-here' \
  -H 'signature: your-calculated-signature-here' \
  -H 'timestamp: your-unix-timestamp-here' \
  --data-raw '
  {
      "name": "Monthly parking",
      "type": "parking",
      "active": true,
      "attributes": [
          "location",
          "size"
      ],
      "description": "Monthly parking - covered area, compact car"
  }'
  ```
- ```json
  {
      "status": {
          "error_code": "INVALID_PRODUCT_TYPE",
          "status": "ERROR",
          "message": "The request tried to create a product, but the value for the 'type' body parameter was not recognized. The request was rejected. Corrective action: Define the 'type' body parameter as 'service' or 'goods'.",
          "response_code": "INVALID_PRODUCT_TYPE",
          "operation_id": "5016cc10-1977-4b25-8d36-c04dc926ef17"
      }
  }
  ```
