> For the complete documentation index, see [llms.txt](https://edrus.gitbook.io/appgregator-api-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://edrus.gitbook.io/appgregator-api-docs/appgregators/payment-gateway/stripe/api/products/create-a-product.md).

# Create a product

<mark style="color:green;">`POST`</mark> `https://us-central1-appgregator.cloudfunctions.net/stripe/products/`

#### Query Parameters

| Name                                               | Type   | Description |
| -------------------------------------------------- | ------ | ----------- |
| name<mark style="color:red;">\*</mark>             | String | ft-4        |
| connection\_name<mark style="color:red;">\*</mark> | String | stripe-1    |

#### Headers

| Name                                        | Type   | Description |
| ------------------------------------------- | ------ | ----------- |
| x-api-key<mark style="color:red;">\*</mark> | String | XXX         |

#### Request Body

| Name                                   | Type    | Description     |
| -------------------------------------- | ------- | --------------- |
| name<mark style="color:red;">\*</mark> | String  | sepatu adidas   |
| id                                     | String  | 012             |
| description                            | String  | sepatu olahraga |
| active                                 | Boolean | true            |

{% tabs %}
{% tab title="201: Created " %}

```javascript
{
    "id": "012",
    "object": "product",
    "active": true,
    "attributes": [],
    "created": 1675823585,
    "default_price": null,
    "description": "sepatu olahraga",
    "images": [],
    "livemode": false,
    "metadata": {},
    "name": "sepatu adidas",
    "package_dimensions": null,
    "shippable": null,
    "statement_descriptor": null,
    "tax_code": null,
    "type": "service",
    "unit_label": null,
    "updated": 1675823585,
    "url": null
}
```

{% endtab %}
{% endtabs %}

{% tabs %}
{% tab title="cURL" %}

```shell
curl --location --request POST 'https://us-central1-appgregator.cloudfunctions.net/stripe/products?name=ft-4&connection_name=stripe-1' \
--header 'x-api-key: XXX' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'name=sepatu adidas' \
--data-urlencode 'active=true' \
--data-urlencode 'description=sepatu olahraga' \
--data-urlencode 'id=012'
```

{% endtab %}

{% tab title="NodeJS - Axios" %}

```javascript
var axios = require('axios');
var qs = require('qs');
var data = qs.stringify({
  'name': 'sepatu adidas',
  'active': 'true',
  'description': 'sepatu olahraga',
  'id': '012' 
});
var config = {
  method: 'post',
  url: 'https://us-central1-appgregator.cloudfunctions.net/stripe/products?name=ft-4&connection_name=stripe-1',
  headers: { 
    'x-api-key': 'XXX', 
    'Content-Type': 'application/x-www-form-urlencoded'
  },
  data : data
};

axios(config)
.then(function (response) {
  console.log(JSON.stringify(response.data));
})
.catch(function (error) {
  console.log(error);
});
```

{% endtab %}

{% tab title="PHP - cURL" %}

```php
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://us-central1-appgregator.cloudfunctions.net/stripe/products?name=ft-4&connection_name=stripe-1',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_POSTFIELDS => 'name=sepatu%20adidas&active=true&description=sepatu%20olahraga&id=012',
  CURLOPT_HTTPHEADER => array(
    'x-api-key: XXX',
    'Content-Type: application/x-www-form-urlencoded'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
```

{% endtab %}
{% endtabs %}
