# Add a Company

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

#### Query Parameters

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

#### Headers

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

{% tabs %}
{% tab title="200: OK Success" %}

```javascript
{
    "company": {
        "id": 474719,
        "name": "importir.co",
        "industry": "digital tech",
        "address": "Jalan Panjang",
        "shipping_address": "Jalan Pendek",
        "shipping_sale": null,
        "shipping_purchase": null,
        "phone": "056734",
        "fax": "345678",
        "company_tax_number": null,
        "tag": null,
        "use_multi_currency": false,
        "currency_format_view": "1000,1",
        "show_logo_report": false,
        "company_website": "test.com",
        "enable_monthly_performance_email": true,
        "product_image": null,
        "product_category": null,
        "show_stock": null,
        "company_email": "codebayu22@gmail.com",
        "defult_invoice_message": null,
        "defult_delivery_slip_message": null,
        "disable_sell_on_no_product": null,
        "use_profit_margin": null,
        "defult_purchase_order_message": null,
        "discount_lines_sale": null,
        "discount_sale": null,
        "deposit_sale": null,
        "discount_lines_purchase": null,
        "discount_purchase": null,
        "deposit_purchase": null,
        "language": {
            "id": "1",
            "name": "English"
        },
        "default_invoice_message": null,
        "default_purchase_order_message": null,
        "default_delivery_slip_message": null,
        "feature": null,
        "last_closing_the_book_date": "",
        "logo": "",
        "roles": [
            "ultimate"
        ],
        "is_owner": true,
        "company_expired": false,
        "sales_shipping_account_changeable": true,
        "purchases_shipping_account_changeable": true,
        "has_sales_transaction_with_shipping": false,
        "has_purchase_transaction_with_shipping": false,
        "has_purchase_with_discount_lines": false,
        "has_sale_with_discount_lines": false,
        "has_sales_transaction_with_discount": false,
        "has_purchase_transaction_with_discount": false,
        "has_sales_transaction_with_deposit": false,
        "has_purchase_transaction_with_deposit": false,
        "preferred_invoice_term": {
            "id": 2253908,
            "name": "Net 30",
            "longetivity": 30
        },
        "preferred_purchase_term": {
            "id": 2253908,
            "name": "Net 30",
            "longetivity": 30
        },
        "sale_shipping_account": {
            "id": 62053080,
            "name": "Other Income",
            "number": "7-70099"
        },
        "draft_cash_transaction_feature": false,
        "purchase_shipping_account": {
            "id": 62053082,
            "name": "Shipping/Freight & Delivery",
            "number": "5-50300"
        },
        "company_bank_detail": {
            "id": 444781,
            "bank_name": null,
            "bank_branch": null,
            "bank_address": null,
            "account_number": null,
            "account_name": null,
            "swift_code": null
        },
        "total_accounts": 124,
        "company_currency": {
            "id": 3,
            "country": "United States",
            "code": "USD",
            "symbol": "(US)$",
            "separator": ".",
            "delimiter": ",",
            "currency_in_words": "dollar"
        },
        "use_tax_inclusive": false,
        "company_billing_details": {
            "id": 474719,
            "name": "importir.co",
            "expired_day": null,
            "next_bill": null,
            "billing_end_period": null,
            "billing_package": null,
            "jurnal_touch_devices": null,
            "connection_quota_moka": null,
            "connection_quota_generic": null
        },
        "default_accounts": null
    }
}
```

{% endtab %}
{% endtabs %}

<details>

<summary>Body JSON</summary>

```
{
  "company": {
    "name": "importir.co",
    "language_name": "English",
    "industry": "digital tech",
    "address": "Jalan Panjang",
    "shipping_address": "Jalan Pendek",
    "phone": "056734",
    "currency_format_view": "1000,1",
    "fax": "345678",
    "show_logo_report": false,
    "company_website": "test.com",
    "enable_monthly_performance_email": true,
    "company_currency_country": "United States"
  }
}
```

</details>

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

```shell
curl --location --request POST 'https://us-central1-appgregator.cloudfunctions.net/jurnalID/companies?name=ft-4&connection_name=intrapreneur-jurnalid-1' \
--header 'x-api-key: U2Fsd...' \
--header 'Content-Type: application/json' \
--data-raw '{
  "company": {
    "name": "importir.co",
    "language_name": "English",
    "industry": "digital tech",
    "address": "Jalan Panjang",
    "shipping_address": "Jalan Pendek",
    "phone": "056734",
    "currency_format_view": "1000,1",
    "fax": "345678",
    "show_logo_report": false,
    "company_website": "test.com",
    "enable_monthly_performance_email": true,
    "company_currency_country": "United States"
  }
}'
```

{% endtab %}

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

```javascript
var axios = require('axios');
var data = JSON.stringify({
  "company": {
    "name": "importir.co",
    "language_name": "English",
    "industry": "digital tech",
    "address": "Jalan Panjang",
    "shipping_address": "Jalan Pendek",
    "phone": "056734",
    "currency_format_view": "1000,1",
    "fax": "345678",
    "show_logo_report": false,
    "company_website": "test.com",
    "enable_monthly_performance_email": true,
    "company_currency_country": "United States"
  }
});

var config = {
  method: 'post',
  url: 'https://us-central1-appgregator.cloudfunctions.net/jurnalID/companies?name=ft-4&connection_name=intrapreneur-jurnalid-1',
  headers: { 
    'x-api-key': 'U2Fsd...', 
    'Content-Type': 'application/json'
  },
  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/jurnalID/companies?name=ft-4&connection_name=intrapreneur-jurnalid-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 =>'{
  "company": {
    "name": "importir.co",
    "language_name": "English",
    "industry": "digital tech",
    "address": "Jalan Panjang",
    "shipping_address": "Jalan Pendek",
    "phone": "056734",
    "currency_format_view": "1000,1",
    "fax": "345678",
    "show_logo_report": false,
    "company_website": "test.com",
    "enable_monthly_performance_email": true,
    "company_currency_country": "United States"
  }
}',
  CURLOPT_HTTPHEADER => array(
    'x-api-key: U2Fsd...',
    'Content-Type: application/json'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;

```

{% endtab %}
{% endtabs %}
