> For the complete documentation index, see [llms.txt](https://fez-delivery-co.gitbook.io/fezcorporate-api-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://fez-delivery-co.gitbook.io/fezcorporate-api-docs/api-endpoints/international-orders/create-import-order.md).

# Create Import Order

{% hint style="info" %}
This endpoint can be used for single or multiple request. It takes an array object(s).
{% endhint %}

Create Order

## Endpoint => /orders/import

<mark style="color:green;">`POST`</mark> `/orders/import`

#### Headers

| Name                                             | Type   | Description       |
| ------------------------------------------------ | ------ | ----------------- |
| Authorization <mark style="color:red;">\*</mark> | String | Your Bearer Token |
| secret-key<mark style="color:red;">\*</mark>     | String | Your Secret Key   |

#### Request Body

| Name                                               | Type            | Description                                                                                                                          |
| -------------------------------------------------- | --------------- | ------------------------------------------------------------------------------------------------------------------------------------ |
| recipientAddress<mark style="color:red;">\*</mark> | String          | Recipient Address (Delivery destination)                                                                                             |
| recipientState<mark style="color:red;">\*</mark>   | String          | Must be any of the 36 states or FCT                                                                                                  |
| recipientName<mark style="color:red;">\*</mark>    | String          | Recipient Name                                                                                                                       |
| recipientPhone<mark style="color:red;">\*</mark>   | String          | Recipient Phone or Mobile number                                                                                                     |
| uniqueID<mark style="color:red;">\*</mark>         | String          | Any value that uniquely identifies a delivery request                                                                                |
| BatchID<mark style="color:red;">\*</mark>          | String          | Any value that identifies the request. i.e all the delivery requests in an API call should have the same Batch ID.                   |
| CustToken                                          | String          | if your organization sends a token to recipient for confirmation of receipt purpose, please include the token here.                  |
| itemDescription                                    | String          | Description of the order                                                                                                             |
| additionalDetails                                  | String          | Any additional details you want us to know about the order. You can add additional recipient phone numbers or address landmark here. |
| valueOfItem<mark style="color:red;">\*</mark>      | String          | The value of items                                                                                                                   |
| weight<mark style="color:red;">\*</mark>           | Integer         | Weight of item in Kg (Kilogram)                                                                                                      |
| importLocationId<mark style="color:red;">\*</mark> | integer         | Fez's ID for the international location you are importing from. Check import location API                                            |
| itemCategory<mark style="color:red;">\*</mark>     | integer         | Fez's ID for the item Category you are importing. Check import items category API                                                    |
| businessName<mark style="color:red;">\*</mark>     | string          | Business / Vendor  name the import is been picked from.                                                                              |
| trackingId                                         | string\|integer | Personal (user defined) tracking ID of the order to be imported                                                                      |
| orderId                                            | string\|integer | Personal (user defined)  order ID of the order to be imported                                                                        |
| quantity                                           | string\|integer | quantity of the item to be imported                                                                                                  |

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

```json
{
  "status": "Success",
  "description": "Order Successfully Created",
  "orderNos": {
    "KingOne-1234": "ASAC27012319",
    "KingOne-1235": "JHAZ27012319"
  }
}
```

{% endtab %}

{% tab title="401 Unauthorized" %}

```json
{
    "status": "Error",
    "description": "Organization Secret Key is Required"
}
```

{% endtab %}
{% endtabs %}

<pre class="language-php"><code class="lang-php">&#x3C;?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://apisandbox.fezdelivery.co/v1/orders/import',
  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 =>'[{
    "recipientAddress":"Idumota",
    "recipientState":"Kano",
    "recipientName":"Femi",
    "recipientPhone":"08000000000000",
    "uniqueID":"KingOne-1234",
    "BatchID":"KingOne-1",
    "valueOfItem": "20000",
<strong>    "importLocationId":2,
</strong>    "weight":10,
    "itemCategory": 4,
    "businessName": "Johnson&#x26;Sons",
    "orderId": "xyz001",
    "trackingId": "tsu001",
    "qunatity": 5
},{
    "recipientAddress":"Idumota3",
    "recipientState":"Lagos",
    "recipientName":"Femi2",
    "recipientPhone":"08000000000000",
    "uniqueID":"KingOne-1235",
    "BatchID":"KingOne-1",
    "valueOfItem": "90000",
    "importLocationId":2,
    "weight":10,
    "itemCategory": 8,
    "businessName": "Femi&#x26;Sons",
    "orderId": "xyz002",
    "trackingId": "tsu002",
    "qunatity": 5
}]',
  CURLOPT_HTTPHEADER => array(
    'secret_key: {{Your Secret Key}}'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
// Some code
</code></pre>

{% hint style="info" %}
**Good to know:** By default, the name, address and phone number of your organization as set during the onboarding process is captured as the sender's name, sender's address, sender's phone number respectively. However, if you want to specify a different senders Name, senders Address and phone number, please add the following field in the request parameter

* thirdparty: Please set to "true" i.e "thirdparty": "true".
* senderName: The name of the sender.
* senderAddress: The address of the sender.
* senderPhone: The phone number of the sender.

Upon successfully creating the order, the API returns an array object that consist of the orderNo for each request.
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://fez-delivery-co.gitbook.io/fezcorporate-api-docs/api-endpoints/international-orders/create-import-order.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
