> ## Documentation Index
> Fetch the complete documentation index at: https://adyen-preview.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Order Terminals

> Use our Management API to order payment terminals and accessories.

The Management API lets you order terminals and accessories for delivery to a location of your choice using API requests instead of the Customer Area.

## Requirements

Before you begin, take into account the following requirements and limitations.

| Requirement | Description |
| - | - |
| **Integration type** | A point-of-sale integration with Adyen. |
| **[API credentials](https://adyen-preview.mintlify.site/development-resources/api-credentials.md)** | You must have an API credential with an API key and the following [roles](https://adyen-preview.mintlify.site/development-resources/api-credentials.md#manage-api-permissions): Management API—Terminal ordering read Management API—Terminal ordering read and write If you have a Terminal API integration with [cloud-based communications](https://adyen-preview.mintlify.site/point-of-sale/design-your-integration/choose-your-architecture#cloud-communications), you can use the existing API key that you use for Terminal API requests. |
| **[Webhooks](https://adyen-preview.mintlify.site/development-resources/webhooks.md)** | Optionally subscribe to [Terminal order update](https://adyen-preview.mintlify.site/point-of-sale/managing-terminals/order-terminals.md#terminal-order-notifications) webhooks. |
| **Limitations** | Note the following: You can only create orders for live terminals using the Management API. To order test terminals, you need to [submit a sales order](https://adyen-preview.mintlify.site/point-of-sale/managing-terminals/order-terminals.md#sales-order-steps) in your [test Customer Area](https://ca-test.adyen.com/). Requests to live Management API endpoints related to terminal orders are subject to [rate limits](https://adyen-preview.mintlify.site/point-of-sale/automating-terminal-management#rate-limits-in-the-live-environment). Familiarize yourself with the [limitations for hardware kits](https://adyen-preview.mintlify.site/point-of-sale/managing-terminals/order-terminals.md#hardware-kits). |
| **Setup steps** | To order [hardware kits](#order-hardware-kits), contact your Adyen contact to: Enable the hardware kit order feature. Create custom packaging for your hardware kit. You receive an onboarding form that you need to complete and return at least three months before go-live. |

## Products and orders

You can order products for a company account or a merchant account. A product can be:

* A box containing a payment terminal and default items like a power cable.
* An accessory, like a privacy shield, a stylus pen, or a replacement power cable.
* A [hardware kit](https://adyen-preview.mintlify.site/point-of-sale/managing-terminals/order-terminals.md#hardware-kits) combining terminals, accessories, and setup instructions in a custom package.

Apart from the products, an order includes:

* A **billing entity** for the company or merchant account. This is where we charge the order to. We create billing entities for you based on the details you provided when you applied for the accounts.
* A **shipping location** for the company or merchant account. This is where we send the order. A shipping location is linked to a company account or a merchant account. You create shipping locations yourself.

### Regional compatibility

You can only use the terminals in the country or region where you ordered them for. This is because the wireless communications modem inside the terminals is specific to the region. The terminals will not work in a different country or region, even with a region-specific power cord.

For example, if you ordered a European terminal having delivered them to the US, it would not work even with a US power cord.

## Order hardware kits

You can use the Management API to order [hardware kits](https://adyen-preview.mintlify.site/point-of-sale/managing-terminals/order-terminals.md#hardware-kits). After your hardware kit is set up, it appears as a product in the [terminal products response](#get-product-id) with:

* A product `id` prefixed with `KIT-`.
* An `itemsIncluded` array listing the bundled contents.

You order kits the same way as other products, but an order cannot contain both kit and non-kit products.

## Get the product ID

An order for terminal products must contain the IDs of the products you want to order. To retrieve those IDs and decide what to order:

1. Get the ID of the account you want to order products for. You need to specify that ID in the URL of later requests.

   * For the company ID, make a GET [/companies](https://docs.adyen.com/api-explorer/Management/latest/get/companies) request.
   * For the merchant ID, make a GET [/merchants](https://docs.adyen.com/api-explorer/Management/latest/get/merchants) request.

2. Get a list of payment terminal models you can order for your company or merchant account. Use the following endpoints:

   * GET [/companies/\{companyId}/terminalModels](https://docs.adyen.com/api-explorer/Management/latest/get/companies/\(companyId\)/terminalModels)
   * GET [/merchants/\{merchantId}/terminalModels](https://docs.adyen.com/api-explorer/Management/latest/get/merchants/\(merchantId\)/terminalModels)

   **Get model list for a merchant account**

   #### curl

   ```bash theme={null}
   curl https://management-test.adyen.com/v3/merchants/{merchantId}/terminalModels \
   -H 'x-API-key: ADYEN_API_KEY' \
   -X GET
   ```

   #### Java

   ```java theme={null}
   // Adyen Java API Library v25.0.0
   import com.adyen.Client;
   import com.adyen.enums.Environment;
   import com.adyen.service.management.*;

   Client client = new Client("ADYEN_API_KEY", Environment.TEST);
   // Make the request
   TerminalOrdersMerchantLevelApi service = new TerminalOrdersMerchantLevelApi(client);
   TerminalModelsResponse response = service.listTerminalModels("merchantId", null);
   ```

   #### PHP

   ```php theme={null}
   // Adyen PHP API Library v17.4.0
   use Adyen\Client;
   use Adyen\Environment;
   use Adyen\Service\Management\TerminalOrdersMerchantLevelApi;

   $client = new Client();
   $client->setXApiKey("ADYEN_API_KEY");
   $client->setEnvironment(Environment::TEST);

   // Make the request
   $service = new TerminalOrdersMerchantLevelApi($client);
   $response = $service->listTerminalModels('merchantId');
   ```

   #### C\#

   ```cs theme={null}
   // Adyen .net API Library v14.3.0
   using Adyen;
   using Environment = Adyen.Model.Environment;
   using Adyen.Service.Management;

   var config = new Config()
   {
       XApiKey = "ADYEN_API_KEY",
       Environment = Environment.Test
   };
   var client = new Client(config);

   // Make the request
   var service = new TerminalOrdersMerchantLevelService(client);
   var response = service.ListTerminalModels("merchantId");
   ```

   #### NodeJS (JavaScript)

   ```js theme={null}
   // Adyen Node API Library v16.2.0
   // Require the parts of the module you want to use
   const { Client, ManagementAPI } = require('@adyen/api-library');

   // Initialize the client object
   const client = new Client({apiKey: "ADYEN_API_KEY", environment: "TEST"});

   // Make the request
   const managementAPI = new ManagementAPI(client);
   const response = managementAPI.TerminalOrdersMerchantLevelApi.listTerminalModels("merchantId");
   ```

   #### Go

   ```go theme={null}
   // Adyen Go API Library v9.2.0
   import (
   	"context"
   	"github.com/adyen/adyen-go-api-library/v9/src/common"
   	"github.com/adyen/adyen-go-api-library/v9/src/adyen"
   	"github.com/adyen/adyen-go-api-library/v9/src/management"
   )

   client := adyen.NewClient(&common.Config{
       ApiKey:      "ADYEN_API_KEY",
       Environment: common.TestEnv,
   })

   // Make the request
   service := client.Management()
   req := service.TerminalOrdersMerchantLevelApi.ListTerminalModelsInput("merchantId")
   res, httpRes, err := service.TerminalOrdersMerchantLevelApi.ListTerminalModels(context.Background(), req)
   ```

   #### Python

   ```py theme={null}
   # Adyen Python API Library v12.2.0
   import Adyen

   adyen = Adyen.Adyen()
   adyen.client.xapikey = "ADYEN_API_KEY"
   adyen.client.platform = "test" # The environment to use library in.

   result = adyen.management.terminal_orders_merchant_level_api.list_terminal_models(merchantId="merchantId")
   ```

   #### Ruby

   ```rb theme={null}
   # Adyen Ruby API Library v9.2.0
   require "adyen-ruby-api-library"

   adyen = Adyen::Client.new
   adyen.api_key = 'ADYEN_API_KEY'
   adyen.env = :test # Set to "live" for live environment

   result = adyen.management.terminal_orders_merchant_level_api.list_terminal_models('merchantId')
   ```

   #### NodeJS (TypeScript)

   ```ts theme={null}
   // Adyen Node API Library v16.2.0
   // Require the parts of the module you want to use
   import { Client, ManagementAPI, Types } from "@adyen/api-library";

   // Initialize the client object
   const client = new Client({apiKey: "ADYEN_API_KEY", environment: "TEST"});

   // Make the request
   const managementAPI = new ManagementAPI(client);
   const response = managementAPI.TerminalOrdersMerchantLevelApi.listTerminalModels("merchantId");
   ```

   The response returns the `id` and `name` of the various models. You can use the `id` as a query parameter to filter the product list in the next step.

   **Model list**

   ```json theme={null}
   {
      "data": [
         {
            "id": "Verifone.V400m",
            "name": "Verifone V400m"
         },
         ...
         {
            "id": "Castles.S1F2",
            "name": "Castles S1F2"
         }
      ]
   }
   ```

3. Get a list of products you can order for your company or merchant account. Use the following endpoints, with the `country` as a query parameter:

   * GET [/companies/\{companyId}/terminalProducts](https://docs.adyen.com/api-explorer/Management/latest/get/companies/\(companyId\)/terminalProducts)
   * GET [/merchants/\{merchantId}/terminalProducts](https://docs.adyen.com/api-explorer/Management/latest/get/merchants/\(merchantId\)/terminalProducts)

   These are the query parameters to filter the paginated response:

   | Query parameter | Required | Description |
   | - | - | - |
   | [country](https://docs.adyen.com/api-explorer/Management/latest/get/companies/\(companyId\)/terminalProducts#query-country) | ![-white\_check\_mark-](https://docs.adyen.com/user/data/smileys/emoji/white_check_mark.png) | Returns products for the country/region specified by a two-letter country code in [ISO 3166-1 alpha-2 format](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2). |
   | [terminalModelId](https://docs.adyen.com/api-explorer/Management/latest/get/companies/\(companyId\)/terminalProducts#query-terminalModelId) | | Returns products for the terminal model specified by its ID. This is the [id](https://docs.adyen.com/api-explorer/Management/latest/get/companies/\(companyId\)/terminalModels#responses-200-data-id) returned in the `/terminalModels` response. The product list will show the details of the box containing the terminal and all accessories you can order for that terminal model. |
   | [offset](https://docs.adyen.com/api-explorer/Management/latest/get/companies/\(companyId\)/terminalProducts#query-offset) | | Returns products shown on the specified page. |
   | [limit](https://docs.adyen.com/api-explorer/Management/latest/get/companies/\(companyId\)/terminalProducts#query-limit) | | The number of products to have on a page. |

   The following example retrieves a list of all products related to the V400m payment terminal that can be ordered for a merchant account in France.

   **Get product list by terminal model for a French merchant account**

   #### curl

   ```bash theme={null}
   curl https://management-test.adyen.com/v3/merchants/{merchantId}/terminalProducts?country=FR&terminalModelId=Verifone.V400m \
   -H 'x-API-key: ADYEN_API_KEY' \
   -X GET
   ```

   #### Java

   ```java theme={null}
   // Adyen Java API Library v25.0.0
   import com.adyen.Client;
   import com.adyen.enums.Environment;
   import com.adyen.service.management.*;

   Client client = new Client("ADYEN_API_KEY", Environment.TEST);
   // Make the request
   TerminalOrdersMerchantLevelApi service = new TerminalOrdersMerchantLevelApi(client);
   TerminalProductsResponse response = service.listTerminalProducts("merchantId", "String", "String", 1, 1, null);
   ```

   #### PHP

   ```php theme={null}
   // Adyen PHP API Library v17.4.0
   use Adyen\Client;
   use Adyen\Environment;
   use Adyen\Service\Management\TerminalOrdersMerchantLevelApi;

   $client = new Client();
   $client->setXApiKey("ADYEN_API_KEY");
   $client->setEnvironment(Environment::TEST);

   $requestOptions['queryParams'] = array('country' => 'string', 'terminalModelId' => 'string', 'offset' => 'integer', 'limit' => 'integer');

   // Make the request
   $service = new TerminalOrdersMerchantLevelApi($client);
   $response = $service->listTerminalProducts('merchantId', $requestOptions);
   ```

   #### C\#

   ```cs theme={null}
   // Adyen .net API Library v14.3.0
   using Adyen;
   using Environment = Adyen.Model.Environment;
   using Adyen.Service.Management;

   var config = new Config()
   {
       XApiKey = "ADYEN_API_KEY",
       Environment = Environment.Test
   };
   var client = new Client(config);

   // Make the request
   var service = new TerminalOrdersMerchantLevelService(client);
   var response = service.ListTerminalProducts("merchantId", country: "string", terminalModelId: "string", offset: 1, limit: 1);
   ```

   #### NodeJS (JavaScript)

   ```js theme={null}
   // Adyen Node API Library v16.2.0
   // Require the parts of the module you want to use
   const { Client, ManagementAPI } = require('@adyen/api-library');

   // Initialize the client object
   const client = new Client({apiKey: "ADYEN_API_KEY", environment: "TEST"});

   // Make the request
   const managementAPI = new ManagementAPI(client);
   const response = managementAPI.TerminalOrdersMerchantLevelApi.listTerminalProducts("merchantId", "string", "string", 1, 1);
   ```

   #### Go

   ```go theme={null}
   // Adyen Go API Library v9.2.0
   import (
   	"context"
   	"github.com/adyen/adyen-go-api-library/v9/src/common"
   	"github.com/adyen/adyen-go-api-library/v9/src/adyen"
   	"github.com/adyen/adyen-go-api-library/v9/src/management"
   )

   client := adyen.NewClient(&common.Config{
       ApiKey:      "ADYEN_API_KEY",
       Environment: common.TestEnv,
   })

   // Make the request
   service := client.Management()
   req := service.TerminalOrdersMerchantLevelApi.ListTerminalProductsInput("merchantId")
   req = req.Country("string").TerminalModelId("string").Offset(1).Limit(1)res, httpRes, err := service.TerminalOrdersMerchantLevelApi.ListTerminalProducts(context.Background(), req)
   ```

   #### Python

   ```py theme={null}
   # Adyen Python API Library v12.2.0
   import Adyen

   adyen = Adyen.Adyen()
   adyen.client.xapikey = "ADYEN_API_KEY"
   adyen.client.platform = "test" # The environment to use library in.

   query_parameters = {
     "country" : "string",
     "terminalModelId" : "string",
     "offset" : "integer",
     "limit" : "integer"
   }

   result = adyen.management.terminal_orders_merchant_level_api.list_terminal_products(merchantId="merchantId", query_parameters=query_parameters)
   ```

   #### Ruby

   ```rb theme={null}
   # Adyen Ruby API Library v9.2.0
   require "adyen-ruby-api-library"

   adyen = Adyen::Client.new
   adyen.api_key = 'ADYEN_API_KEY'
   adyen.env = :test # Set to "live" for live environment

   query_params = {
     :country => 'string',
     :terminalModelId => 'string',
     :offset => 'integer',
     :limit => 'integer'
   }

   result = adyen.management.terminal_orders_merchant_level_api.list_terminal_products('merchantId', query_params: query_params)
   ```

   #### NodeJS (TypeScript)

   ```ts theme={null}
   // Adyen Node API Library v16.2.0
   // Require the parts of the module you want to use
   import { Client, ManagementAPI, Types } from "@adyen/api-library";

   // Initialize the client object
   const client = new Client({apiKey: "ADYEN_API_KEY", environment: "TEST"});

   // Make the request
   const managementAPI = new ManagementAPI(client);
   const response = managementAPI.TerminalOrdersMerchantLevelApi.listTerminalProducts("merchantId", "string", "string", 1, 1);
   ```

4. When you receive the response, save the `id` values of the products you want to order.

   The next example shows the response for the GET `merchants/{merchantId}/terminalProducts?country=FR&terminalModelId=Verifone.V400m` request (prices have been changed to 0.00 in the example).

   **Products related to a terminal model**

   ```json theme={null}
   {
           "data": [
               {
                   "id": "PART-620222-EU",
                   "name": "Receipt Roll",
                   "price": {
                       "currency": "EUR",
                       "value": 0.00
                   }
               },
               {
                   "id": "PART-175746-EU",
                   "name": "Adyen Test Card",
                   "price": {
                       "currency": "EUR",
                       "value": 0.00
                   }
               },
               {
                   "id": "PART-327486-EU",
                   "name": "Battery - V400m",
                   "price": {
                       "currency": "EUR",
                       "value": 0.00
                   }
               },
               {
                   "id": "PART-287001-EU",
                   "name": "Bluetooth Charging Base - V400m",
                   "price": {
                       "currency": "EUR",
                       "value": 0.00
                   }
               },
               {
                   "id": "PART-745984-EU",
                   "name": "Power Supply EU - V400m",
                   "price": {
                       "currency": "EUR",
                       "value": 0.00
                   }
               },
               {
                   "id": "TBOX-V400m-684-EU",
                   "name": "V400m Package",
                   "description": "Includes an EU Power Supply, SIM Card and battery",
                   "price": {
                       "currency": "EUR",
                       "value": 0.00
                   },
                   "itemsIncluded": [
                       "Receipt Roll",
                       "Terminal Device V400m EU/GB"
                   ]
               }
           ]
       }
   ```

## Get the billing entity ID

An order for terminal products must contain the ID of a billing entity. This is the legal entity where we charge the order to. We create billing entities for you based on the details provided when you applied for your company and merchant accounts.

When ordering products in Brazil, you do not need to provide a billing entity ID.

1. Get the billing entity ID for your company or merchant account. Use the following endpoints:

   * GET [/companies/\{companyId}/billingEntities](https://docs.adyen.com/api-explorer/Management/latest/get/companies/\(companyId\)/billingEntities) for the billing entities of the company and all merchant accounts belonging to the company.
   * GET [/merchants/\{merchantId}/billingEntities](https://docs.adyen.com/api-explorer/Management/latest/get/merchants/\(merchantId\)/billingEntities) for the billing entities of the merchant account.

   You can filter the response using the [name](https://docs.adyen.com/api-explorer/Management/latest/get/companies/\(companyId\)/billingEntities#query-name) of the billing entity as the query parameter:

   **Get billing entities for a company**

   #### curl

   ```bash theme={null}
   curl https://management-test.adyen.com/v3/companies/{companyId}/billingEntities \
   -H 'x-API-key: ADYEN_API_KEY' \
   -X GET
   ```

   #### Java

   ```java theme={null}
   // Adyen Java API Library v25.0.0
   import com.adyen.Client;
   import com.adyen.enums.Environment;
   import com.adyen.service.management.*;

   Client client = new Client("ADYEN_API_KEY", Environment.TEST);
   // Make the request
   TerminalOrdersCompanyLevelApi service = new TerminalOrdersCompanyLevelApi(client);
   BillingEntitiesResponse response = service.listBillingEntities("companyId", "String", null);
   ```

   #### PHP

   ```php theme={null}
   // Adyen PHP API Library v17.4.0
   use Adyen\Client;
   use Adyen\Environment;
   use Adyen\Service\Management\TerminalOrdersCompanyLevelApi;

   $client = new Client();
   $client->setXApiKey("ADYEN_API_KEY");
   $client->setEnvironment(Environment::TEST);

   $requestOptions['queryParams'] = array('name' => 'string');

   // Make the request
   $service = new TerminalOrdersCompanyLevelApi($client);
   $response = $service->listBillingEntities('companyId', $requestOptions);
   ```

   #### C\#

   ```cs theme={null}
   // Adyen .net API Library v14.3.0
   using Adyen;
   using Environment = Adyen.Model.Environment;
   using Adyen.Service.Management;

   var config = new Config()
   {
       XApiKey = "ADYEN_API_KEY",
       Environment = Environment.Test
   };
   var client = new Client(config);

   // Make the request
   var service = new TerminalOrdersCompanyLevelService(client);
   var response = service.ListBillingEntities("companyId", name: "string");
   ```

   #### NodeJS (JavaScript)

   ```js theme={null}
   // Adyen Node API Library v16.2.0
   // Require the parts of the module you want to use
   const { Client, ManagementAPI } = require('@adyen/api-library');

   // Initialize the client object
   const client = new Client({apiKey: "ADYEN_API_KEY", environment: "TEST"});

   // Make the request
   const managementAPI = new ManagementAPI(client);
   const response = managementAPI.TerminalOrdersCompanyLevelApi.listBillingEntities("companyId", "string");
   ```

   #### Go

   ```go theme={null}
   // Adyen Go API Library v9.2.0
   import (
   	"context"
   	"github.com/adyen/adyen-go-api-library/v9/src/common"
   	"github.com/adyen/adyen-go-api-library/v9/src/adyen"
   	"github.com/adyen/adyen-go-api-library/v9/src/management"
   )

   client := adyen.NewClient(&common.Config{
       ApiKey:      "ADYEN_API_KEY",
       Environment: common.TestEnv,
   })

   // Make the request
   service := client.Management()
   req := service.TerminalOrdersCompanyLevelApi.ListBillingEntitiesInput("companyId")
   req = req.Name("string")res, httpRes, err := service.TerminalOrdersCompanyLevelApi.ListBillingEntities(context.Background(), req)
   ```

   #### Python

   ```py theme={null}
   # Adyen Python API Library v12.2.0
   import Adyen

   adyen = Adyen.Adyen()
   adyen.client.xapikey = "ADYEN_API_KEY"
   adyen.client.platform = "test" # The environment to use library in.

   query_parameters = {
     "name" : "string"
   }

   result = adyen.management.terminal_orders_company_level_api.list_billing_entities(companyId="companyId", query_parameters=query_parameters)
   ```

   #### Ruby

   ```rb theme={null}
   # Adyen Ruby API Library v9.2.0
   require "adyen-ruby-api-library"

   adyen = Adyen::Client.new
   adyen.api_key = 'ADYEN_API_KEY'
   adyen.env = :test # Set to "live" for live environment

   query_params = {
     :name => 'string'
   }

   result = adyen.management.terminal_orders_company_level_api.list_billing_entities('companyId', query_params: query_params)
   ```

   #### NodeJS (TypeScript)

   ```ts theme={null}
   // Adyen Node API Library v16.2.0
   // Require the parts of the module you want to use
   import { Client, ManagementAPI, Types } from "@adyen/api-library";

   // Initialize the client object
   const client = new Client({apiKey: "ADYEN_API_KEY", environment: "TEST"});

   // Make the request
   const managementAPI = new ManagementAPI(client);
   const response = managementAPI.TerminalOrdersCompanyLevelApi.listBillingEntities("companyId", "string");
   ```

2. When you receive the response, save the [id](https://docs.adyen.com/api-explorer/Management/latest/get/companies/\(companyId\)/billingEntities#responses-200-data-id) of the billing entity to use in your order. The response also returns the [name](https://docs.adyen.com/api-explorer/Management/latest/get/companies/\(companyId\)/billingEntities#responses-200-data-name), [taxId](https://docs.adyen.com/api-explorer/Management/latest/get/companies/\(companyId\)/billingEntities#responses-200-data-taxId) (VAT number) and contact details for each billing entity.

   **Billing entity list**

   ```json theme={null}
   {
         "data": [
           {
             "id": "Company.ExampleCompany",
             "name": "ExampleCompany",
             "taxId": "111111111",
             "email": "financial@company.com",
             "address": {
               "companyName": "Example Company",
               "streetAddress": "Boulevard Principal 3",
               "streetAddress2": "Tour Azure",
               "postalCode": "23456",
               "city": "Paris",
               "country": "France"
             }
           },
           ...
           {
             "id": "MerchantAccount.ExampleCompanyFrance",
             "name": "ExampleCompanyFrance",
             "taxId": "222222222",
             "email": "jdupont@test.com",
             "address": {
               "companyName": "Example Company France",
               "streetAddress": "11 Rue de Ville",
               "postalCode": "12345",
               "city": "Paris",
               "country": "France"
             }
           }
         ]
       }
   ```

## Get the shipping location ID

An order for terminal products must contain the ID of a shipping location. This is the street address of the location where you want us to send the order to.

#### New shipping location

1. To create a shipping location for your company or merchant account, use the following endpoints:

   * POST [/companies/\{companyId}/shippingLocations](https://docs.adyen.com/api-explorer/Management/latest/post/companies/\(companyId\)/shippingLocations)
   * POST [/merchants/\{merchantId}/shippingLocations](https://docs.adyen.com/api-explorer/Management/latest/post/merchants/\(merchantId\)/shippingLocations)

   Specify the following parameters in the request body:

   | Parameter | Required | Description |
   | - | - | - |
   | [name](https://docs.adyen.com/api-explorer/Management/latest/post/merchants/\(merchantId\)/shippingLocations#request-name) | ![-white\_check\_mark-](https://docs.adyen.com/user/data/smileys/emoji/white_check_mark.png) | A unique reference that lets you recognize the location. |
   | [contact](https://docs.adyen.com/api-explorer/Management/latest/post/merchants/\(merchantId\)/shippingLocations#request-contact) | ![-white\_check\_mark-](https://docs.adyen.com/user/data/smileys/emoji/white_check_mark.png) | The name and phone number of the individual who can be contacted about the shipment. |
   | [address](https://docs.adyen.com/api-explorer/Management/latest/post/merchants/\(merchantId\)/shippingLocations#request-address) | ![-white\_check\_mark-](https://docs.adyen.com/user/data/smileys/emoji/white_check_mark.png) | Where to send the order. |

   **Create shipping location**

   #### curl

   ```bash theme={null}
   curl https://management-test.adyen.com/v3/merchants/{merchantId}/shippingLocations \
   -H 'x-API-key: ADYEN_API_KEY' \
   -X POST \
   -d '{
     "name": "POS France depot",
     "contact": {
        "firstName": "Jesse",
        "lastName": "Dupont",
        "phoneNumber": "+33 1 76 35 07 90",
        "email": "jdupont@test.com"
     },
     "address": {
        "companyName": "Example Company France",
        "streetAddress": "11 Rue de Ville",
        "postalCode": "12345",
        "city": "Paris",
        "stateOrProvince": "",
        "country": "FR"
     }
   }'
   ```

   #### Java

   ```java theme={null}
   // Adyen Java API Library v25.0.0
   import com.adyen.Client;
   import com.adyen.enums.Environment;
   import com.adyen.model.management.*;
   import java.time.OffsetDateTime;
   import java.util.*;
   import com.adyen.service.management.*;

   Client client = new Client("ADYEN_API_KEY", Environment.TEST);

   // Request objects
   Address address = new Address()
   	.country("FR")
   	.stateOrProvince("")
   	.streetAddress("11 Rue de Ville")
   	.city("Paris")
   	.companyName("Example Company France")
   	.postalCode("12345");

   Contact contact = new Contact()
   	.firstName("Jesse")
   	.lastName("Dupont")
   	.phoneNumber("+33 1 76 35 07 90")
   	.email("jdupont@test.com");

   ShippingLocation shippingLocation = new ShippingLocation()
   	.address(address)
   	.contact(contact)
   	.name("POS France depot");

   // Make the request
   TerminalOrdersMerchantLevelApi service = new TerminalOrdersMerchantLevelApi(client);
   ShippingLocation response = service.createShippingLocation("merchantId", shippingLocation, null);
   ```

   #### PHP

   ```php theme={null}
   // Adyen PHP API Library v17.4.0
   use Adyen\Client;
   use Adyen\Environment;
   use Adyen\Model\Management\Address;
   use Adyen\Model\Management\Contact;
   use Adyen\Model\Management\ShippingLocation;
   use Adyen\Service\Management\TerminalOrdersMerchantLevelApi;

   $client = new Client();
   $client->setXApiKey("ADYEN_API_KEY");
   $client->setEnvironment(Environment::TEST);


   // Request objects
   $address = new Address();
   $address
   	->setCountry("FR")
   	->setStateOrProvince("")
   	->setStreetAddress("11 Rue de Ville")
   	->setCity("Paris")
   	->setCompanyName("Example Company France")
   	->setPostalCode("12345");

   $contact = new Contact();
   $contact
   	->setFirstName("Jesse")
   	->setLastName("Dupont")
   	->setPhoneNumber("+33 1 76 35 07 90")
   	->setEmail("jdupont@test.com");

   $shippingLocation = new ShippingLocation();
   $shippingLocation
   	->setAddress($address)
   	->setContact($contact)
   	->setName("POS France depot");

   // Make the request
   $service = new TerminalOrdersMerchantLevelApi($client);
   $response = $service->createShippingLocation('merchantId', $shippingLocation);
   ```

   #### C\#

   ```cs theme={null}
   // Adyen .net API Library v14.3.0
   using Adyen;
   using Environment = Adyen.Model.Environment;
   using Adyen.Model;
   using Adyen.Model.Management;
   using Adyen.Service.Management;

   var config = new Config()
   {
       XApiKey = "ADYEN_API_KEY",
       Environment = Environment.Test
   };
   var client = new Client(config);

   // Fill in your request objects
   Address address = new Address
   {
   	Country = "FR",
   	StateOrProvince = "",
   	StreetAddress = "11 Rue de Ville",
   	City = "Paris",
   	CompanyName = "Example Company France",
   	PostalCode = "12345"
   };

   Contact contact = new Contact
   {
   	FirstName = "Jesse",
   	LastName = "Dupont",
   	PhoneNumber = "+33 1 76 35 07 90",
   	Email = "jdupont@test.com"
   };

   ShippingLocation shippingLocation = new ShippingLocation
   {
   	Address = address,
   	Contact = contact,
   	Name = "POS France depot"
   };

   // Make the request
   var service = new TerminalOrdersMerchantLevelService(client);
   var response = service.CreateShippingLocation("merchantId", shippingLocation);
   ```

   #### NodeJS (JavaScript)

   ```js theme={null}
   // Adyen Node API Library v16.2.0
   // Require the parts of the module you want to use
   const { Client, ManagementAPI } = require('@adyen/api-library');

   // Initialize the client object
   const client = new Client({apiKey: "ADYEN_API_KEY", environment: "TEST"});

   // Create the request object
   const shippingLocation = {
     name: "POS France depot",
     contact: {
       firstName: "Jesse",
       lastName: "Dupont",
       phoneNumber: "+33 1 76 35 07 90",
       email: "jdupont@test.com"
     },
     address: {
       companyName: "Example Company France",
       streetAddress: "11 Rue de Ville",
       postalCode: "12345",
       city: "Paris",
       stateOrProvince: "",
       country: "FR"
     }
   }

   // Make the request
   const managementAPI = new ManagementAPI(client);
   const response = managementAPI.TerminalOrdersMerchantLevelApi.createShippingLocation("merchantId", shippingLocation);
   ```

   #### Go

   ```go theme={null}
   // Adyen Go API Library v9.2.0
   import (
   	"context"
   	"github.com/adyen/adyen-go-api-library/v9/src/common"
   	"github.com/adyen/adyen-go-api-library/v9/src/adyen"
   	"github.com/adyen/adyen-go-api-library/v9/src/management"
   )

   client := adyen.NewClient(&common.Config{
       ApiKey:      "ADYEN_API_KEY",
       Environment: common.TestEnv,
   })

   // Fill in your request objects
   address := management.Address{
   	Country: common.PtrString("FR"),
   	StateOrProvince: common.PtrString(""),
   	StreetAddress: common.PtrString("11 Rue de Ville"),
   	City: common.PtrString("Paris"),
   	CompanyName: common.PtrString("Example Company France"),
   	PostalCode: common.PtrString("12345"),
   }

   contact := management.Contact{
   	FirstName: common.PtrString("Jesse"),
   	LastName: common.PtrString("Dupont"),
   	PhoneNumber: common.PtrString("+33 1 76 35 07 90"),
   	Email: common.PtrString("jdupont@test.com"),
   }

   shippingLocation := management.ShippingLocation{
   	Address: &address,
   	Contact: &contact,
   	Name: common.PtrString("POS France depot"),
   }

   // Make the request
   service := client.Management()
   req := service.TerminalOrdersMerchantLevelApi.CreateShippingLocationInput("merchantId").ShippingLocation(shippingLocation)
   res, httpRes, err := service.TerminalOrdersMerchantLevelApi.CreateShippingLocation(context.Background(), req)
   ```

   #### Python

   ```py theme={null}
   # Adyen Python API Library v12.2.0
   import Adyen

   adyen = Adyen.Adyen()
   adyen.client.xapikey = "ADYEN_API_KEY"
   adyen.client.platform = "test" # The environment to use library in.

   json_request = {
     "name": "POS France depot",
     "contact": {
       "firstName": "Jesse",
       "lastName": "Dupont",
       "phoneNumber": "+33 1 76 35 07 90",
       "email": "jdupont@test.com"
     },
     "address": {
       "companyName": "Example Company France",
       "streetAddress": "11 Rue de Ville",
       "postalCode": "12345",
       "city": "Paris",
       "stateOrProvince": "",
       "country": "FR"
     }
   }

   result = adyen.management.terminal_orders_merchant_level_api.create_shipping_location(request=json_request, merchantId="merchantId")
   ```

   #### Ruby

   ```rb theme={null}
   # Adyen Ruby API Library v9.2.0
   require "adyen-ruby-api-library"

   adyen = Adyen::Client.new
   adyen.api_key = 'ADYEN_API_KEY'
   adyen.env = :test # Set to "live" for live environment

   request_body = {
     :name => 'POS France depot',
     :contact => {
       :firstName => 'Jesse',
       :lastName => 'Dupont',
       :phoneNumber => '+33 1 76 35 07 90',
       :email => 'jdupont@test.com'
     },
     :address => {
       :companyName => 'Example Company France',
       :streetAddress => '11 Rue de Ville',
       :postalCode => '12345',
       :city => 'Paris',
       :stateOrProvince => '',
       :country => 'FR'
     }
   }

   result = adyen.management.terminal_orders_merchant_level_api.create_shipping_location(request_body, 'merchantId')
   ```

   #### NodeJS (TypeScript)

   ```ts theme={null}
   // Adyen Node API Library v16.2.0
   // Require the parts of the module you want to use
   import { Client, ManagementAPI, Types } from "@adyen/api-library";

   // Initialize the client object
   const client = new Client({apiKey: "ADYEN_API_KEY", environment: "TEST"});

   // Create the request objects
   const address: Types.management.Address = {
   	country: "FR",
   	stateOrProvince: "",
   	streetAddress: "11 Rue de Ville",
   	city: "Paris",
   	companyName: "Example Company France",
   	postalCode: "12345"
   };

   const contact: Types.management.Contact = {
   	firstName: "Jesse",
   	lastName: "Dupont",
   	phoneNumber: "+33 1 76 35 07 90",
   	email: "jdupont@test.com"
   };

   const shippingLocation: Types.management.ShippingLocation = {
   	address: address,
   	contact: contact,
   	name: "POS France depot"
   };

   // Make the request
   const managementAPI = new ManagementAPI(client);
   const response = managementAPI.TerminalOrdersMerchantLevelApi.createShippingLocation("merchantId", shippingLocation);
   ```

2. When you receive the response, note the following details:

   * [id](https://docs.adyen.com/api-explorer/Management/latest/post/merchants/\(merchantId\)/shippingLocations#responses-200-id): The generated shipping location ID. Save this ID because you need to specify it when you order terminal products.
   * [name](https://docs.adyen.com/api-explorer/Management/latest/post/merchants/\(merchantId\)/shippingLocations#responses-200-name): Your reference for this location. You can use the reference to filter the list of shipping locations.

   **Shipping location created**

   ```json theme={null}
   {
         "id": "S2-7145604F44356F424F4369432B3F486B6A6D",
         "name": "POS France depot",
         "contact": {
           "firstName": "Jesse",
           "lastName": "Dupont",
           "phoneNumber": "+33176350790",
           "email": "jdupont@test.com"
         },
         "address": {
           "companyName": "Example Company France",
           "streetAddress": "11 Rue de Ville",
           "postalCode": "12345",
           "city": "Paris"
         }
       }
   ```

If your next step after creating a new shipping location is to create an order for the new location, wait a few seconds before sending the order creation request.

#### Existing shipping locations

1. To get a list of existing shipping locations for your company or merchant account, use the following endpoints:

   * GET [/companies/\{companyId}/shippingLocations](https://docs.adyen.com/api-explorer/Management/latest/get/companies/\(companyId\)/shippingLocations)
   * GET [/merchants/\{merchantId}/shippingLocations](https://docs.adyen.com/api-explorer/Management/latest/get/merchants/\(merchantId\)/shippingLocations)

   You can filter the paginated response using the following query parameters:

   | Query parameter | Required | Description |
   | - | - | - |
   | [name](https://docs.adyen.com/api-explorer/Management/latest/get/merchants/\(merchantId\)/shippingLocations#query-name) | | Filters the list by your reference to the shipping location. |
   | [offset](https://docs.adyen.com/api-explorer/Management/latest/get/merchants/\(merchantId\)/shippingLocations#query-offset) | | Returns locations starting from this offset. |
   | [limit](https://docs.adyen.com/api-explorer/Management/latest/get/merchants/\(merchantId\)/shippingLocations#query-limit) | | Sets a limit for the number of locations to 3return. |

   **Get shipping locations for a merchant account**

   #### curl

   ```bash theme={null}
   curl https://management-test.adyen.com/v3/merchants/{merchantId}/shippingLocations \
   -H 'x-API-key: ADYEN_API_KEY' \
   -X GET
   ```

   #### Java

   ```java theme={null}
   // Adyen Java API Library v25.0.0
   import com.adyen.Client;
   import com.adyen.enums.Environment;
   import com.adyen.service.management.*;

   Client client = new Client("ADYEN_API_KEY", Environment.TEST);
   // Make the request
   TerminalOrdersMerchantLevelApi service = new TerminalOrdersMerchantLevelApi(client);
   ShippingLocationsResponse response = service.listShippingLocations("merchantId", "String", 1, 1, null);
   ```

   #### PHP

   ```php theme={null}
   // Adyen PHP API Library v17.4.0
   use Adyen\Client;
   use Adyen\Environment;
   use Adyen\Service\Management\TerminalOrdersMerchantLevelApi;

   $client = new Client();
   $client->setXApiKey("ADYEN_API_KEY");
   $client->setEnvironment(Environment::TEST);

   $requestOptions['queryParams'] = array('name' => 'string', 'offset' => 'integer', 'limit' => 'integer');

   // Make the request
   $service = new TerminalOrdersMerchantLevelApi($client);
   $response = $service->listShippingLocations('merchantId', $requestOptions);
   ```

   #### C\#

   ```cs theme={null}
   // Adyen .net API Library v14.3.0
   using Adyen;
   using Environment = Adyen.Model.Environment;
   using Adyen.Service.Management;

   var config = new Config()
   {
       XApiKey = "ADYEN_API_KEY",
       Environment = Environment.Test
   };
   var client = new Client(config);

   // Make the request
   var service = new TerminalOrdersMerchantLevelService(client);
   var response = service.ListShippingLocations("merchantId", name: "string", offset: 1, limit: 1);
   ```

   #### NodeJS (JavaScript)

   ```js theme={null}
   // Adyen Node API Library v16.2.0
   // Require the parts of the module you want to use
   const { Client, ManagementAPI } = require('@adyen/api-library');

   // Initialize the client object
   const client = new Client({apiKey: "ADYEN_API_KEY", environment: "TEST"});

   // Make the request
   const managementAPI = new ManagementAPI(client);
   const response = managementAPI.TerminalOrdersMerchantLevelApi.listShippingLocations("merchantId", "string", 1, 1);
   ```

   #### Go

   ```go theme={null}
   // Adyen Go API Library v9.2.0
   import (
   	"context"
   	"github.com/adyen/adyen-go-api-library/v9/src/common"
   	"github.com/adyen/adyen-go-api-library/v9/src/adyen"
   	"github.com/adyen/adyen-go-api-library/v9/src/management"
   )

   client := adyen.NewClient(&common.Config{
       ApiKey:      "ADYEN_API_KEY",
       Environment: common.TestEnv,
   })

   // Make the request
   service := client.Management()
   req := service.TerminalOrdersMerchantLevelApi.ListShippingLocationsInput("merchantId")
   req = req.Name("string").Offset(1).Limit(1)res, httpRes, err := service.TerminalOrdersMerchantLevelApi.ListShippingLocations(context.Background(), req)
   ```

   #### Python

   ```py theme={null}
   # Adyen Python API Library v12.2.0
   import Adyen

   adyen = Adyen.Adyen()
   adyen.client.xapikey = "ADYEN_API_KEY"
   adyen.client.platform = "test" # The environment to use library in.

   query_parameters = {
     "name" : "string",
     "offset" : "integer",
     "limit" : "integer"
   }

   result = adyen.management.terminal_orders_merchant_level_api.list_shipping_locations(merchantId="merchantId", query_parameters=query_parameters)
   ```

   #### Ruby

   ```rb theme={null}
   # Adyen Ruby API Library v9.2.0
   require "adyen-ruby-api-library"

   adyen = Adyen::Client.new
   adyen.api_key = 'ADYEN_API_KEY'
   adyen.env = :test # Set to "live" for live environment

   query_params = {
     :name => 'string',
     :offset => 'integer',
     :limit => 'integer'
   }

   result = adyen.management.terminal_orders_merchant_level_api.list_shipping_locations('merchantId', query_params: query_params)
   ```

   #### NodeJS (TypeScript)

   ```ts theme={null}
   // Adyen Node API Library v16.2.0
   // Require the parts of the module you want to use
   import { Client, ManagementAPI, Types } from "@adyen/api-library";

   // Initialize the client object
   const client = new Client({apiKey: "ADYEN_API_KEY", environment: "TEST"});

   // Make the request
   const managementAPI = new ManagementAPI(client);
   const response = managementAPI.TerminalOrdersMerchantLevelApi.listShippingLocations("merchantId", "string", 1, 1);
   ```

2. When you receive the response, save the [id](https://docs.adyen.com/api-explorer/Management/latest/get/merchants/\(merchantId\)/shippingLocations#responses-200-id) of the shipping location to use in your order.

   **Shipping locations list**

   ```json theme={null}
   {
         "data": [
           {
             "id": "S2-7145604F44356F424F4369432B3F486B6A6D",
             "name": "POS France depot",
             "contact": {
               "firstName": "Jesse",
               "lastName": "Dupont",
               "phoneNumber": "+33 1 76 35 07 90",
               "email": "jdupont@test.com"
             },
             "address": {
               "companyName": "Example Company France",
               "streetAddress": "11 Rue de Ville",
               "postalCode": "12345",
               "city": "Paris",
               "country": "France"
             }
           },
           {
             ...
           }
         ]
       }
   ```

## Create a terminal order

Use this request to order live terminals or [hardware kits](#order-hardware-kits) for your company or merchant account.

Requests to the Management API test endpoint do not create actual orders for test terminals. To order test terminals, you need to [submit a sales order](https://adyen-preview.mintlify.site/point-of-sale/managing-terminals/order-terminals.md#sales-order-steps) in your [test Customer Area](https://ca-test.adyen.com/).

1. Make sure that you have the following details:

   * The [IDs of the products](#get-product-id) you want to order.
   * The [ID of the billing entity](#get-billing-entity-id).
   * The [ID of the shipping location](#get-shipping-location-id).

   If the order includes a new shipping location, wait a few seconds after creating the new location before sending the order creation request.

2. To create an order for your company or merchant account, use the following endpoints:

   * POST [/companies/\{companyId}/terminalOrders](https://docs.adyen.com/api-explorer/Management/latest/post/companies/\(companyId\)/terminalOrders)
   * POST [/merchants/\{merchantId}/terminalOrders](https://docs.adyen.com/api-explorer/Management/latest/post/merchants/\(merchantId\)/terminalOrders)

   Specify the following parameters in the request body:

   | Parameter | Required | Description |
   | - | - | - |
   | [customerOrderReference](https://docs.adyen.com/api-explorer/Management/latest/post/merchants/\(merchantId\)/terminalOrders#request-customerOrderReference) | | Your purchase order number. This will be printed on the packing list. |
   | [billingEntityId](https://docs.adyen.com/api-explorer/Management/latest/post/merchants/\(merchantId\)/terminalOrders#request-billingEntityId) | ![-white\_check\_mark-](https://docs.adyen.com/user/data/smileys/emoji/white_check_mark.png) | The ID of the [billing entity](#get-billing-entity-id) for the company or merchant account.When ordering products in Brazil, you do not need to include the `billingEntityId` in the request. |
   | [shippingLocationId](https://docs.adyen.com/api-explorer/Management/latest/post/merchants/\(merchantId\)/terminalOrders#request-shippingLocationId) | ![-white\_check\_mark-](https://docs.adyen.com/user/data/smileys/emoji/white_check_mark.png) | The ID of the [shipping location](#get-shipping-location-id) where we need to send the order. |
   | [items](https://docs.adyen.com/api-explorer/Management/latest/post/merchants/\(merchantId\)/terminalOrders#request-items) | ![-white\_check\_mark-](https://docs.adyen.com/user/data/smileys/emoji/white_check_mark.png) | An array listing the `id` and `quantity` of each product you want to order.To order a hardware kit, use the kit's product `id` from the [terminal products response](#get-product-id). Kit product IDs are prefixed with `KIT-`. |
   | [taxId](https://docs.adyen.com/api-explorer/Management/latest/post/merchants/\(merchantId\)/terminalOrders#request-taxId) | | The tax number (VAT number) of the billing entity. Specify this parameter when the shipping location and the billing entity are in different countries/regions. |

   The next example places an order for one V400m terminal and 20 receipt rolls.

   **Place a terminal order**

   #### curl

   ```bash theme={null}
   curl https://management-test.adyen.com/v3/merchants/{merchantId}/terminalOrders \
   -H 'x-API-key: ADYEN_API_KEY' \
   -X POST \
   -d '{
      "items": [
         {
            "id": "TBOX-V400m-774-EU",
            "quantity": 1
         },
         {
            "id": "PART-482077-EU",
            "quantity": 20
         }
     ],
     "customerOrderReference": "YOUR_REFERENCE_1",
     "shippingLocationId": "S2-7145604F44356F424F4369432B3F486B6A6D",
     "billingEntityId": "Company.ExampleCompany"
   }'
   ```

   #### Java

   ```java theme={null}
   // Adyen Java API Library v25.0.0
   import com.adyen.Client;
   import com.adyen.enums.Environment;
   import com.adyen.model.management.*;
   import java.time.OffsetDateTime;
   import java.util.*;
   import com.adyen.service.management.*;

   Client client = new Client("ADYEN_API_KEY", Environment.TEST);

   // Request objects
   OrderItem orderItem1 = new OrderItem()
   	.quantity(1)
   	.id("TBOX-V400m-774-EU");

   OrderItem orderItem2 = new OrderItem()
   	.quantity(20)
   	.id("PART-482077-EU");

   TerminalOrderRequest terminalOrderRequest = new TerminalOrderRequest()
   	.customerOrderReference("YOUR_REFERENCE_1")
   	.shippingLocationId("S2-7145604F44356F424F4369432B3F486B6A6D")
   	.billingEntityId("Company.ExampleCompany")
   	.items(Arrays.asList(orderItem1, orderItem2));

   // Make the request
   TerminalOrdersMerchantLevelApi service = new TerminalOrdersMerchantLevelApi(client);
   TerminalOrder response = service.createOrder("merchantId", terminalOrderRequest, null);
   ```

   #### PHP

   ```php theme={null}
   // Adyen PHP API Library v17.4.0
   use Adyen\Client;
   use Adyen\Environment;
   use Adyen\Model\Management\OrderItem;
   use Adyen\Model\Management\TerminalOrderRequest;
   use Adyen\Service\Management\TerminalOrdersMerchantLevelApi;

   $client = new Client();
   $client->setXApiKey("ADYEN_API_KEY");
   $client->setEnvironment(Environment::TEST);


   // Request objects
   $orderItem1 = new OrderItem();
   $orderItem1
   	->setQuantity(1)
   	->setId("TBOX-V400m-774-EU");

   $orderItem2 = new OrderItem();
   $orderItem2
   	->setQuantity(20)
   	->setId("PART-482077-EU");

   $terminalOrderRequest = new TerminalOrderRequest();
   $terminalOrderRequest
   	->setCustomerOrderReference("YOUR_REFERENCE_1")
   	->setShippingLocationId("S2-7145604F44356F424F4369432B3F486B6A6D")
   	->setBillingEntityId("Company.ExampleCompany")
   	->setItems(array($orderItem1, $orderItem2));

   // Make the request
   $service = new TerminalOrdersMerchantLevelApi($client);
   $response = $service->createOrder('merchantId', $terminalOrderRequest);
   ```

   #### C\#

   ```cs theme={null}
   // Adyen .net API Library v14.3.0
   using Adyen;
   using Environment = Adyen.Model.Environment;
   using Adyen.Model;
   using Adyen.Model.Management;
   using Adyen.Service.Management;

   var config = new Config()
   {
       XApiKey = "ADYEN_API_KEY",
       Environment = Environment.Test
   };
   var client = new Client(config);

   // Fill in your request objects
   OrderItem orderItem1 = new OrderItem
   {
   	Quantity = 1,
   	Id = "TBOX-V400m-774-EU"
   };

   OrderItem orderItem2 = new OrderItem
   {
   	Quantity = 20,
   	Id = "PART-482077-EU"
   };

   TerminalOrderRequest terminalOrderRequest = new TerminalOrderRequest
   {
   	CustomerOrderReference = "YOUR_REFERENCE_1",
   	ShippingLocationId = "S2-7145604F44356F424F4369432B3F486B6A6D",
   	BillingEntityId = "Company.ExampleCompany",
   	Items = new List<OrderItem>{ orderItem1, orderItem2 }
   };

   // Make the request
   var service = new TerminalOrdersMerchantLevelService(client);
   var response = service.CreateOrder("merchantId", terminalOrderRequest);
   ```

   #### NodeJS (JavaScript)

   ```js theme={null}
   // Adyen Node API Library v16.2.0
   // Require the parts of the module you want to use
   const { Client, ManagementAPI } = require('@adyen/api-library');

   // Initialize the client object
   const client = new Client({apiKey: "ADYEN_API_KEY", environment: "TEST"});

   // Create the request object
   const terminalOrderRequest = {
     items: [ {
       id: "TBOX-V400m-774-EU",
       quantity: 1
     }, {
       id: "PART-482077-EU",
       quantity: 20
     } ],
     customerOrderReference: "YOUR_REFERENCE_1",
     shippingLocationId: "S2-7145604F44356F424F4369432B3F486B6A6D",
     billingEntityId: "Company.ExampleCompany"
   }

   // Make the request
   const managementAPI = new ManagementAPI(client);
   const response = managementAPI.TerminalOrdersMerchantLevelApi.createOrder("merchantId", terminalOrderRequest);
   ```

   #### Go

   ```go theme={null}
   // Adyen Go API Library v9.2.0
   import (
   	"context"
   	"github.com/adyen/adyen-go-api-library/v9/src/common"
   	"github.com/adyen/adyen-go-api-library/v9/src/adyen"
   	"github.com/adyen/adyen-go-api-library/v9/src/management"
   )

   client := adyen.NewClient(&common.Config{
       ApiKey:      "ADYEN_API_KEY",
       Environment: common.TestEnv,
   })

   // Fill in your request objects
   orderItem1 := management.OrderItem{
   	Quantity: common.PtrInt32(1),
   	Id: common.PtrString("TBOX-V400m-774-EU"),
   }

   orderItem2 := management.OrderItem{
   	Quantity: common.PtrInt32(20),
   	Id: common.PtrString("PART-482077-EU"),
   }

   terminalOrderRequest := management.TerminalOrderRequest{
   	CustomerOrderReference: common.PtrString("YOUR_REFERENCE_1"),
   	ShippingLocationId: common.PtrString("S2-7145604F44356F424F4369432B3F486B6A6D"),
   	BillingEntityId: common.PtrString("Company.ExampleCompany"),
   	Items: []management.OrderItem{
   			orderItem1, orderItem2,
   	},
   }

   // Make the request
   service := client.Management()
   req := service.TerminalOrdersMerchantLevelApi.CreateOrderInput("merchantId").TerminalOrderRequest(terminalOrderRequest)
   res, httpRes, err := service.TerminalOrdersMerchantLevelApi.CreateOrder(context.Background(), req)
   ```

   #### Python

   ```py theme={null}
   # Adyen Python API Library v12.2.0
   import Adyen

   adyen = Adyen.Adyen()
   adyen.client.xapikey = "ADYEN_API_KEY"
   adyen.client.platform = "test" # The environment to use library in.

   json_request = {
     "items": [ {
       "id": "TBOX-V400m-774-EU",
       "quantity": 1
     }, {
       "id": "PART-482077-EU",
       "quantity": 20
     } ],
     "customerOrderReference": "YOUR_REFERENCE_1",
     "shippingLocationId": "S2-7145604F44356F424F4369432B3F486B6A6D",
     "billingEntityId": "Company.ExampleCompany"
   }

   result = adyen.management.terminal_orders_merchant_level_api.create_order(request=json_request, merchantId="merchantId")
   ```

   #### Ruby

   ```rb theme={null}
   # Adyen Ruby API Library v9.2.0
   require "adyen-ruby-api-library"

   adyen = Adyen::Client.new
   adyen.api_key = 'ADYEN_API_KEY'
   adyen.env = :test # Set to "live" for live environment

   request_body = {
     :items => [ {
       :id => 'TBOX-V400m-774-EU',
       :quantity => 1
     }, {
       :id => 'PART-482077-EU',
       :quantity => 20
     } ],
     :customerOrderReference => 'YOUR_REFERENCE_1',
     :shippingLocationId => 'S2-7145604F44356F424F4369432B3F486B6A6D',
     :billingEntityId => 'Company.ExampleCompany'
   }

   result = adyen.management.terminal_orders_merchant_level_api.create_order(request_body, 'merchantId')
   ```

   #### NodeJS (TypeScript)

   ```ts theme={null}
   // Adyen Node API Library v16.2.0
   // Require the parts of the module you want to use
   import { Client, ManagementAPI, Types } from "@adyen/api-library";

   // Initialize the client object
   const client = new Client({apiKey: "ADYEN_API_KEY", environment: "TEST"});

   // Create the request objects
   const orderItem1: Types.management.OrderItem = {
   	quantity: 1,
   	id: "TBOX-V400m-774-EU"
   };

   const orderItem2: Types.management.OrderItem = {
   	quantity: 20,
   	id: "PART-482077-EU"
   };

   const terminalOrderRequest: Types.management.TerminalOrderRequest = {
   	customerOrderReference: "YOUR_REFERENCE_1",
   	shippingLocationId: "S2-7145604F44356F424F4369432B3F486B6A6D",
   	billingEntityId: "Company.ExampleCompany",
   	items: [orderItem1, orderItem2]
   };

   // Make the request
   const managementAPI = new ManagementAPI(client);
   const response = managementAPI.TerminalOrdersMerchantLevelApi.createOrder("merchantId", terminalOrderRequest);
   ```

   The response echoes the parameters you provided and additionally includes the [id](https://docs.adyen.com/api-explorer/Management/latest/post/merchants/\(merchantId\)/terminalOrders#responses-200-id) and [status](https://docs.adyen.com/api-explorer/Management/latest/post/merchants/\(merchantId\)/terminalOrders#responses-200-status) of your order, the date and time you placed the order, and the full details of the billing entity and the shipping location.

   **Order placed**

   ```json theme={null}
   {
         "id": "7219627091701347",
         "customerOrderReference": "YOUR_REFERENCE_1",
         "status": "Placed",
         "shippingLocation": {
           "id": "S2-7145604F44356F424F4369432B3F486B6A6D",
           "name": "POS France depot",
           "contact": {
             "firstName": "Jesse",
             "lastName": "Dupont",
             "phoneNumber": "+33 1 76 35 07 90",
             "email": "jdupont@test.com"
           },
           "address": {
             "companyName": "Example Company France",
             "streetAddress": "11 Rue de Ville",
             "postalCode": "12345",
             "city": "Paris",
             "country": "France"
           }
         },
         "billingEntity": {
           "id": "Company.ExampleCompany",
           "name": "ExampleCompany",
           "taxId": "111111111",
           "email": "financial@company.com",
           "address": {
             "companyName": "Example Company",
             "streetAddress": "Boulevard Principal 3",
             "streetAddress2": "Tour Azure",
             "postalCode": "23456",
             "city": "Paris",
             "country": "France"
           }
         },
         "orderDate": "2020-01-22T14:12:33Z",
         "items": [
           {
             "id": "TBOX-V400m-684-EU",
             "name": "V400m Package",
             "quantity": 1
           },
           {
             "id": "PART-620222-EU",
             "name": "Receipt Roll",
             "quantity": 20
           }
         ]
       }
   ```

When an order reaches the status Shipped, the response also includes a URL where you can track your order.

## Terminal order updates

To stay informed about your order, you can subscribe to [Terminal order update](https://adyen-preview.mintlify.site/point-of-sale/managing-terminals/order-terminals.md#terminal-order-notifications) webhooks. These webhooks are triggered at certain steps in the logistical process. The webhooks contain information such as shipment date, terminal serial numbers, and track & trace number. We send these platform webhooks as an HTTP callback (webhook) to your server.

We also keep you up to date on the status of your order through email messages and in your [Customer Area](https://ca-test.adyen.com/) > **Orders and returns**.

## Manage orders

You can [view ](#view-orders), [update](#update-an-order), and [cancel](#cancel-an-order) orders using API requests. However, updating and canceling is only allowed while the order has the status Placed. This indicates we haven't started processing the order yet.

### View orders

You can use the `/terminalOrders` endpoint to check which orders can still be updated or cancelled, and to get the ID of those orders. To keep up to date on the progress of your order, we recommend using [Terminal order update](https://adyen-preview.mintlify.site/point-of-sale/managing-terminals/order-terminals.md#terminal-order-notifications) webhooks.

#### List of orders

* To get the details of all orders for your company or merchant account, use the following endpoints:

  * GET [/companies/\{companyId}/terminalOrders](https://docs.adyen.com/api-explorer/Management/latest/get/companies/\(companyId\)/terminalOrders)
  * GET [/merchants/\{merchantId}/terminalOrders](https://docs.adyen.com/api-explorer/Management/latest/get/merchants/\(merchantId\)/terminalOrders)

  You can filter the paginated response using the following query parameters:

  | Query parameter | Required | Description |
  | - | - | - |
  | [customerOrderReference](https://docs.adyen.com/api-explorer/Management/latest/get/merchants/\(merchantId\)/terminalOrders#query-customerOrderReference) | | Returns the details of the specified purchase order number. |
  | [status](https://docs.adyen.com/api-explorer/Management/latest/get/merchants/\(merchantId\)/terminalOrders#query-status) | | Returns orders with the specified status. Possible values (not case-sensitive): Placed, Confirmed, Cancelled, Shipped, Delivered. |
  | [offset](https://docs.adyen.com/api-explorer/Management/latest/get/merchants/\(merchantId\)/terminalOrders#query-offset) | | Returns the orders shown on the specified page. |
  | [limit](https://docs.adyen.com/api-explorer/Management/latest/get/merchants/\(merchantId\)/terminalOrders#query-limit) | | The number of orders to have on a page. |

  **Get a list of placed orders for a merchant account**

  #### curl

  ```bash theme={null}
  curl https://management-test.adyen.com/v3/merchants/{merchantId}/terminalOrders?status=Placed \
  -H 'x-API-key: ADYEN_API_KEY' \
  -X GET
  ```

  #### Java

  ```java theme={null}
  // Adyen Java API Library v25.0.0
  import com.adyen.Client;
  import com.adyen.enums.Environment;
  import com.adyen.service.management.*;

  Client client = new Client("ADYEN_API_KEY", Environment.TEST);
  // Make the request
  TerminalOrdersMerchantLevelApi service = new TerminalOrdersMerchantLevelApi(client);
  TerminalOrdersResponse response = service.listOrders("merchantId", "String", "String", 1, 1, null);
  ```

  #### PHP

  ```php theme={null}
  // Adyen PHP API Library v17.4.0
  use Adyen\Client;
  use Adyen\Environment;
  use Adyen\Service\Management\TerminalOrdersMerchantLevelApi;

  $client = new Client();
  $client->setXApiKey("ADYEN_API_KEY");
  $client->setEnvironment(Environment::TEST);

  $requestOptions['queryParams'] = array('customerOrderReference' => 'string', 'status' => 'string', 'offset' => 'integer', 'limit' => 'integer');

  // Make the request
  $service = new TerminalOrdersMerchantLevelApi($client);
  $response = $service->listOrders('merchantId', $requestOptions);
  ```

  #### C\#

  ```cs theme={null}
  // Adyen .net API Library v14.3.0
  using Adyen;
  using Environment = Adyen.Model.Environment;
  using Adyen.Service.Management;

  var config = new Config()
  {
      XApiKey = "ADYEN_API_KEY",
      Environment = Environment.Test
  };
  var client = new Client(config);

  // Make the request
  var service = new TerminalOrdersMerchantLevelService(client);
  var response = service.ListOrders("merchantId", customerOrderReference: "string", status: "string", offset: 1, limit: 1);
  ```

  #### NodeJS (JavaScript)

  ```js theme={null}
  // Adyen Node API Library v16.2.0
  // Require the parts of the module you want to use
  const { Client, ManagementAPI } = require('@adyen/api-library');

  // Initialize the client object
  const client = new Client({apiKey: "ADYEN_API_KEY", environment: "TEST"});

  // Make the request
  const managementAPI = new ManagementAPI(client);
  const response = managementAPI.TerminalOrdersMerchantLevelApi.listOrders("merchantId", "string", "string", 1, 1);
  ```

  #### Go

  ```go theme={null}
  // Adyen Go API Library v9.2.0
  import (
  	"context"
  	"github.com/adyen/adyen-go-api-library/v9/src/common"
  	"github.com/adyen/adyen-go-api-library/v9/src/adyen"
  	"github.com/adyen/adyen-go-api-library/v9/src/management"
  )

  client := adyen.NewClient(&common.Config{
      ApiKey:      "ADYEN_API_KEY",
      Environment: common.TestEnv,
  })

  // Make the request
  service := client.Management()
  req := service.TerminalOrdersMerchantLevelApi.ListOrdersInput("merchantId")
  req = req.CustomerOrderReference("string").Status("string").Offset(1).Limit(1)res, httpRes, err := service.TerminalOrdersMerchantLevelApi.ListOrders(context.Background(), req)
  ```

  #### Python

  ```py theme={null}
  # Adyen Python API Library v12.2.0
  import Adyen

  adyen = Adyen.Adyen()
  adyen.client.xapikey = "ADYEN_API_KEY"
  adyen.client.platform = "test" # The environment to use library in.

  query_parameters = {
    "customerOrderReference" : "string",
    "status" : "string",
    "offset" : "integer",
    "limit" : "integer"
  }

  result = adyen.management.terminal_orders_merchant_level_api.list_orders(merchantId="merchantId", query_parameters=query_parameters)
  ```

  #### Ruby

  ```rb theme={null}
  # Adyen Ruby API Library v9.2.0
  require "adyen-ruby-api-library"

  adyen = Adyen::Client.new
  adyen.api_key = 'ADYEN_API_KEY'
  adyen.env = :test # Set to "live" for live environment

  query_params = {
    :customerOrderReference => 'string',
    :status => 'string',
    :offset => 'integer',
    :limit => 'integer'
  }

  result = adyen.management.terminal_orders_merchant_level_api.list_orders('merchantId', query_params: query_params)
  ```

  #### NodeJS (TypeScript)

  ```ts theme={null}
  // Adyen Node API Library v16.2.0
  // Require the parts of the module you want to use
  import { Client, ManagementAPI, Types } from "@adyen/api-library";

  // Initialize the client object
  const client = new Client({apiKey: "ADYEN_API_KEY", environment: "TEST"});

  // Make the request
  const managementAPI = new ManagementAPI(client);
  const response = managementAPI.TerminalOrdersMerchantLevelApi.listOrders("merchantId", "string", "string", 1, 1);
  ```

  The response returns an array of orders sorted by order date in ascending order. For each order, all [order details](https://docs.adyen.com/api-explorer/Management/latest/get/merchants/\(merchantId\)/terminalOrders#responses-200-data) are included.

#### Individual order

* To get the details of an individual order for your company or merchant account, use the following endpoints:

  * GET [/companies/\{companyId}/terminalOrders/\{orderId}](https://docs.adyen.com/api-explorer/Management/latest/get/companies/\(companyId\)/terminalOrders/\(orderId\))
  * GET [/merchants/\{merchantId}/terminalOrders/\{orderId}](https://docs.adyen.com/api-explorer/Management/latest/get/merchants/\(merchantId\)/terminalOrders/\(orderId\))

  **Get the details of a specific order**

  #### curl

  ```bash theme={null}
  curl https://management-test.adyen.com/v3/merchants/{merchantId}/terminalOrders/{orderId} \
  -H 'x-API-key: ADYEN_API_KEY' \
  -X GET
  ```

  #### Java

  ```java theme={null}
  // Adyen Java API Library v25.0.0
  import com.adyen.Client;
  import com.adyen.enums.Environment;
  import com.adyen.service.management.*;

  Client client = new Client("ADYEN_API_KEY", Environment.TEST);
  // Make the request
  TerminalOrdersMerchantLevelApi service = new TerminalOrdersMerchantLevelApi(client);
  TerminalOrder response = service.getOrder("merchantId", "orderId", null);
  ```

  #### PHP

  ```php theme={null}
  // Adyen PHP API Library v17.4.0
  use Adyen\Client;
  use Adyen\Environment;
  use Adyen\Service\Management\TerminalOrdersMerchantLevelApi;

  $client = new Client();
  $client->setXApiKey("ADYEN_API_KEY");
  $client->setEnvironment(Environment::TEST);

  // Make the request
  $service = new TerminalOrdersMerchantLevelApi($client);
  $response = $service->getOrder('merchantId', 'orderId');
  ```

  #### C\#

  ```cs theme={null}
  // Adyen .net API Library v14.3.0
  using Adyen;
  using Environment = Adyen.Model.Environment;
  using Adyen.Service.Management;

  var config = new Config()
  {
      XApiKey = "ADYEN_API_KEY",
      Environment = Environment.Test
  };
  var client = new Client(config);

  // Make the request
  var service = new TerminalOrdersMerchantLevelService(client);
  var response = service.GetOrder("merchantId", "orderId");
  ```

  #### NodeJS (JavaScript)

  ```js theme={null}
  // Adyen Node API Library v16.2.0
  // Require the parts of the module you want to use
  const { Client, ManagementAPI } = require('@adyen/api-library');

  // Initialize the client object
  const client = new Client({apiKey: "ADYEN_API_KEY", environment: "TEST"});

  // Make the request
  const managementAPI = new ManagementAPI(client);
  const response = managementAPI.TerminalOrdersMerchantLevelApi.getOrder("merchantId", "orderId");
  ```

  #### Go

  ```go theme={null}
  // Adyen Go API Library v9.2.0
  import (
  	"context"
  	"github.com/adyen/adyen-go-api-library/v9/src/common"
  	"github.com/adyen/adyen-go-api-library/v9/src/adyen"
  	"github.com/adyen/adyen-go-api-library/v9/src/management"
  )

  client := adyen.NewClient(&common.Config{
      ApiKey:      "ADYEN_API_KEY",
      Environment: common.TestEnv,
  })

  // Make the request
  service := client.Management()
  req := service.TerminalOrdersMerchantLevelApi.GetOrderInput("merchantId","orderId")
  res, httpRes, err := service.TerminalOrdersMerchantLevelApi.GetOrder(context.Background(), req)
  ```

  #### Python

  ```py theme={null}
  # Adyen Python API Library v12.2.0
  import Adyen

  adyen = Adyen.Adyen()
  adyen.client.xapikey = "ADYEN_API_KEY"
  adyen.client.platform = "test" # The environment to use library in.

  result = adyen.management.terminal_orders_merchant_level_api.get_order(merchantId="merchantId", orderId="orderId")
  ```

  #### Ruby

  ```rb theme={null}
  # Adyen Ruby API Library v9.2.0
  require "adyen-ruby-api-library"

  adyen = Adyen::Client.new
  adyen.api_key = 'ADYEN_API_KEY'
  adyen.env = :test # Set to "live" for live environment

  result = adyen.management.terminal_orders_merchant_level_api.get_order('merchantId', 'orderId')
  ```

  #### NodeJS (TypeScript)

  ```ts theme={null}
  // Adyen Node API Library v16.2.0
  // Require the parts of the module you want to use
  import { Client, ManagementAPI, Types } from "@adyen/api-library";

  // Initialize the client object
  const client = new Client({apiKey: "ADYEN_API_KEY", environment: "TEST"});

  // Make the request
  const managementAPI = new ManagementAPI(client);
  const response = managementAPI.TerminalOrdersMerchantLevelApi.getOrder("merchantId", "orderId");
  ```

  The response returns all order details.

### Update an order

While an order has the status Placed, you can change the order items, the shipping location, and the billing entity. The request body only needs to contain what you want to change. However, to update the `items` array, you need to replace the entire array. For example, let's assume the array has three items. To remove one item, the array must include the remaining two items. Or to add one item, the array must include all four items.

1. [Get the ID of the order](#view-orders) you want to update and check that the order has the `status` **Placed**.

2. To update the order for your company or merchant account, use the following endpoints:

   * PATCH [/companies/\{companyId}/terminalOrders/\{orderId}](https://docs.adyen.com/api-explorer/Management/latest/patch/companies/\(companyId\)/terminalOrders/\(orderId\))
   * PATCH [/merchants/\{merchantId}/terminalOrders/\{orderId}](https://docs.adyen.com/api-explorer/Management/latest/patch/merchants/\(merchantId\)/terminalOrders/\(orderId\))

   Specify the following optional parameters in the request body as needed:

   | Parameter | Required | Description |
   | - | - | - |
   | [billingEntityId](https://docs.adyen.com/api-explorer/Management/latest/patch/merchants/\(merchantId\)/terminalOrders/\(orderId\)#request-billingEntityId) | | The ID of the [billing entity](#get-billing-entity-id) for the company or merchant account.When ordering products in Brazil, you do not need to include the `billingEntityId` in the request. |
   | [shippingLocationId](https://docs.adyen.com/api-explorer/Management/latest/patch/merchants/\(merchantId\)/terminalOrders/\(orderId\)#request-shippingLocationId) | | The ID of the [shipping location](#get-shipping-location-id) where we need to send the order. |
   | [items](https://docs.adyen.com/api-explorer/Management/latest/patch/merchants/\(merchantId\)/terminalOrders/\(orderId\)#request-items) | | An array listing the `id` and `quantity` of each product you want to order. To remove an item, specify all remaining items. To add an item, specify all items already in the order plus the additional item. |

   The next request removes the 20 receipt rolls from our example order **7219627091701347** by listing only the remaining order item, and changes the billing entity.

   **Update order items and billing entity**

   #### curl

   ```bash theme={null}
   curl https://management-test.adyen.com/v3/merchants/{merchantId}/terminalOrders/7219627091701347 \
   -H 'x-API-key: ADYEN_API_KEY' \
   -X PATCH \
   -d '{
     "items": [
        {
           "id": "V400m_1",
           "quantity": 1
        }
     ],
     "billingEntityId": "MerchantAccount.ExampleCompanyFrance"
   }'
   ```

   #### Java

   ```java theme={null}
   // Adyen Java API Library v25.0.0
   import com.adyen.Client;
   import com.adyen.enums.Environment;
   import com.adyen.model.management.*;
   import java.time.OffsetDateTime;
   import java.util.*;
   import com.adyen.service.management.*;

   Client client = new Client("ADYEN_API_KEY", Environment.TEST);

   // Request objects
   OrderItem orderItem1 = new OrderItem()
   	.quantity(1)
   	.id("V400m_1");

   TerminalOrderRequest terminalOrderRequest = new TerminalOrderRequest()
   	.billingEntityId("MerchantAccount.ExampleCompanyFrance")
   	.items(Arrays.asList(orderItem1));

   // Make the request
   TerminalOrdersMerchantLevelApi service = new TerminalOrdersMerchantLevelApi(client);
   TerminalOrder response = service.updateOrder("merchantId", "orderId", terminalOrderRequest, null);
   ```

   #### PHP

   ```php theme={null}
   // Adyen PHP API Library v17.4.0
   use Adyen\Client;
   use Adyen\Environment;
   use Adyen\Model\Management\OrderItem;
   use Adyen\Model\Management\TerminalOrderRequest;
   use Adyen\Service\Management\TerminalOrdersMerchantLevelApi;

   $client = new Client();
   $client->setXApiKey("ADYEN_API_KEY");
   $client->setEnvironment(Environment::TEST);


   // Request objects
   $orderItem1 = new OrderItem();
   $orderItem1
   	->setQuantity(1)
   	->setId("V400m_1");

   $terminalOrderRequest = new TerminalOrderRequest();
   $terminalOrderRequest
   	->setBillingEntityId("MerchantAccount.ExampleCompanyFrance")
   	->setItems(array($orderItem1));

   // Make the request
   $service = new TerminalOrdersMerchantLevelApi($client);
   $response = $service->updateOrder('merchantId', 'orderId', $terminalOrderRequest);
   ```

   #### C\#

   ```cs theme={null}
   // Adyen .net API Library v14.3.0
   using Adyen;
   using Environment = Adyen.Model.Environment;
   using Adyen.Model;
   using Adyen.Model.Management;
   using Adyen.Service.Management;

   var config = new Config()
   {
       XApiKey = "ADYEN_API_KEY",
       Environment = Environment.Test
   };
   var client = new Client(config);

   // Fill in your request objects
   OrderItem orderItem1 = new OrderItem
   {
   	Quantity = 1,
   	Id = "V400m_1"
   };

   TerminalOrderRequest terminalOrderRequest = new TerminalOrderRequest
   {
   	BillingEntityId = "MerchantAccount.ExampleCompanyFrance",
   	Items = new List<OrderItem>{ orderItem1 }
   };

   // Make the request
   var service = new TerminalOrdersMerchantLevelService(client);
   var response = service.UpdateOrder("merchantId", "orderId", terminalOrderRequest);
   ```

   #### NodeJS (JavaScript)

   ```js theme={null}
   // Adyen Node API Library v16.2.0
   // Require the parts of the module you want to use
   const { Client, ManagementAPI } = require('@adyen/api-library');

   // Initialize the client object
   const client = new Client({apiKey: "ADYEN_API_KEY", environment: "TEST"});

   // Create the request object
   const terminalOrderRequest = {
     items: [ {
       id: "V400m_1",
       quantity: 1
     } ],
     billingEntityId: "MerchantAccount.ExampleCompanyFrance"
   }

   // Make the request
   const managementAPI = new ManagementAPI(client);
   const response = managementAPI.TerminalOrdersMerchantLevelApi.updateOrder("merchantId", "orderId", terminalOrderRequest);
   ```

   #### Go

   ```go theme={null}
   // Adyen Go API Library v9.2.0
   import (
   	"context"
   	"github.com/adyen/adyen-go-api-library/v9/src/common"
   	"github.com/adyen/adyen-go-api-library/v9/src/adyen"
   	"github.com/adyen/adyen-go-api-library/v9/src/management"
   )

   client := adyen.NewClient(&common.Config{
       ApiKey:      "ADYEN_API_KEY",
       Environment: common.TestEnv,
   })

   // Fill in your request objects
   orderItem1 := management.OrderItem{
   	Quantity: common.PtrInt32(1),
   	Id: common.PtrString("V400m_1"),
   }

   terminalOrderRequest := management.TerminalOrderRequest{
   	BillingEntityId: common.PtrString("MerchantAccount.ExampleCompanyFrance"),
   	Items: []management.OrderItem{
   			orderItem1,
   	},
   }

   // Make the request
   service := client.Management()
   req := service.TerminalOrdersMerchantLevelApi.UpdateOrderInput("merchantId","orderId").TerminalOrderRequest(terminalOrderRequest)
   res, httpRes, err := service.TerminalOrdersMerchantLevelApi.UpdateOrder(context.Background(), req)
   ```

   #### Python

   ```py theme={null}
   # Adyen Python API Library v12.2.0
   import Adyen

   adyen = Adyen.Adyen()
   adyen.client.xapikey = "ADYEN_API_KEY"
   adyen.client.platform = "test" # The environment to use library in.

   json_request = {
     "items": [ {
       "id": "V400m_1",
       "quantity": 1
     } ],
     "billingEntityId": "MerchantAccount.ExampleCompanyFrance"
   }

   result = adyen.management.terminal_orders_merchant_level_api.update_order(request=json_request, merchantId="merchantId", orderId="orderId")
   ```

   #### Ruby

   ```rb theme={null}
   # Adyen Ruby API Library v9.2.0
   require "adyen-ruby-api-library"

   adyen = Adyen::Client.new
   adyen.api_key = 'ADYEN_API_KEY'
   adyen.env = :test # Set to "live" for live environment

   request_body = {
     :items => [ {
       :id => 'V400m_1',
       :quantity => 1
     } ],
     :billingEntityId => 'MerchantAccount.ExampleCompanyFrance'
   }

   result = adyen.management.terminal_orders_merchant_level_api.update_order(request_body, 'merchantId', 'orderId')
   ```

   #### NodeJS (TypeScript)

   ```ts theme={null}
   // Adyen Node API Library v16.2.0
   // Require the parts of the module you want to use
   import { Client, ManagementAPI, Types } from "@adyen/api-library";

   // Initialize the client object
   const client = new Client({apiKey: "ADYEN_API_KEY", environment: "TEST"});

   // Create the request objects
   const orderItem1: Types.management.OrderItem = {
   	quantity: 1,
   	id: "V400m_1"
   };

   const terminalOrderRequest: Types.management.TerminalOrderRequest = {
   	billingEntityId: "MerchantAccount.ExampleCompanyFrance",
   	items: [orderItem1]
   };

   // Make the request
   const managementAPI = new ManagementAPI(client);
   const response = managementAPI.TerminalOrdersMerchantLevelApi.updateOrder("merchantId", "orderId", terminalOrderRequest);
   ```

   The response returns all order details.

   **Order updated**

   ```json theme={null}
   {
         "id": "7219627091701347",
         "status": "Placed",
         "customerOrderReference": "YOUR_REFERENCE_1",
         "shippingLocation": {
           "id": "S2-7145604F44356F424F4369432B3F486B6A6D",
           "name": "POS France depot",
           "address": {
             "companyName": "Example Company France",
             "streetAddress": "11 Rue de Ville",
             "postalCode": "12345",
             "city": "Paris",
             "country": "France"
           },
           "contact": {
             "firstName": "Jesse",
             "lastName": "Dupont",
             "phoneNumber": "+33 1 76 35 07 90",
             "email": "jdupont@test.com"
           }
         },
         "billingEntity": {
           "id": "MerchantAccount.ExampleCompanyFrance",
           "name": "ExampleCompanyFrance",
           "taxId": "222222222",
           "email": "jdupont@test.com",
           "address": {
             "companyName": "Example Company France",
             "streetAddress": "11 Rue de Ville",
             "postalCode": "12345",
             "city": "Paris",
             "country": "France"
           }
         },
         "orderDate": "2020-01-22T14:12:33Z",
         "items": [
           {
             "id": "V400m_1",
             "name": "V400m terminal package EU/GB",
             "quantity": 1
           }
         ]
       }
   ```

### Cancel an order

While an order has the status **Placed**, you can revoke the order.

1. [Get the ID of the order](#view-orders) you want to cancel and check that the order has the `status` **Placed**.

2. To cancel an order for your company or merchant account, use the following endpoints:

   * POST [/companies/\{companyId}/terminalOrders/\{orderId}/cancel](https://docs.adyen.com/api-explorer/Management/latest/post/companies/\(companyId\)/terminalOrders/\(orderId\)/cancel)
   * POST [/merchants/\{merchantId}/terminalOrders/\{orderId}/cancel](https://docs.adyen.com/api-explorer/Management/latest/post/merchants/\(merchantId\)/terminalOrders/\(orderId\)/cancel)

   Do not specify a request body.

   The next request cancels our example order **7219627091701347**.

   **Cancel a placed terminal order**

   #### curl

   ```bash theme={null}
   curl https://management-test.adyen.com/v3/merchants/{merchantId}/terminalOrders/7219627091701347/cancel \
   -H 'x-API-key: ADYEN_API_KEY' \
   -X POST
   ```

   #### Java

   ```java theme={null}
   // Adyen Java API Library v25.0.0
   import com.adyen.Client;
   import com.adyen.enums.Environment;
   import com.adyen.service.management.*;

   Client client = new Client("ADYEN_API_KEY", Environment.TEST);
   // Make the request
   TerminalOrdersMerchantLevelApi service = new TerminalOrdersMerchantLevelApi(client);
   TerminalOrder response = service.cancelOrder("merchantId", "orderId", null);
   ```

   #### PHP

   ```php theme={null}
   // Adyen PHP API Library v17.4.0
   use Adyen\Client;
   use Adyen\Environment;
   use Adyen\Service\Management\TerminalOrdersMerchantLevelApi;

   $client = new Client();
   $client->setXApiKey("ADYEN_API_KEY");
   $client->setEnvironment(Environment::TEST);

   // Make the request
   $service = new TerminalOrdersMerchantLevelApi($client);
   $response = $service->cancelOrder('merchantId', 'orderId');
   ```

   #### C\#

   ```cs theme={null}
   // Adyen .net API Library v14.3.0
   using Adyen;
   using Environment = Adyen.Model.Environment;
   using Adyen.Service.Management;

   var config = new Config()
   {
       XApiKey = "ADYEN_API_KEY",
       Environment = Environment.Test
   };
   var client = new Client(config);

   // Make the request
   var service = new TerminalOrdersMerchantLevelService(client);
   var response = service.CancelOrder("merchantId", "orderId");
   ```

   #### NodeJS (JavaScript)

   ```js theme={null}
   // Adyen Node API Library v16.2.0
   // Require the parts of the module you want to use
   const { Client, ManagementAPI } = require('@adyen/api-library');

   // Initialize the client object
   const client = new Client({apiKey: "ADYEN_API_KEY", environment: "TEST"});

   // Make the request
   const managementAPI = new ManagementAPI(client);
   const response = managementAPI.TerminalOrdersMerchantLevelApi.cancelOrder("merchantId", "orderId");
   ```

   #### Go

   ```go theme={null}
   // Adyen Go API Library v9.2.0
   import (
   	"context"
   	"github.com/adyen/adyen-go-api-library/v9/src/common"
   	"github.com/adyen/adyen-go-api-library/v9/src/adyen"
   	"github.com/adyen/adyen-go-api-library/v9/src/management"
   )

   client := adyen.NewClient(&common.Config{
       ApiKey:      "ADYEN_API_KEY",
       Environment: common.TestEnv,
   })

   // Make the request
   service := client.Management()
   req := service.TerminalOrdersMerchantLevelApi.CancelOrderInput("merchantId","orderId")
   res, httpRes, err := service.TerminalOrdersMerchantLevelApi.CancelOrder(context.Background(), req)
   ```

   #### Python

   ```py theme={null}
   # Adyen Python API Library v12.2.0
   import Adyen

   adyen = Adyen.Adyen()
   adyen.client.xapikey = "ADYEN_API_KEY"
   adyen.client.platform = "test" # The environment to use library in.

   result = adyen.management.terminal_orders_merchant_level_api.cancel_order(merchantId="merchantId", orderId="orderId")
   ```

   #### Ruby

   ```rb theme={null}
   # Adyen Ruby API Library v9.2.0
   require "adyen-ruby-api-library"

   adyen = Adyen::Client.new
   adyen.api_key = 'ADYEN_API_KEY'
   adyen.env = :test # Set to "live" for live environment

   result = adyen.management.terminal_orders_merchant_level_api.cancel_order('merchantId', 'orderId')
   ```

   #### NodeJS (TypeScript)

   ```ts theme={null}
   // Adyen Node API Library v16.2.0
   // Require the parts of the module you want to use
   import { Client, ManagementAPI, Types } from "@adyen/api-library";

   // Initialize the client object
   const client = new Client({apiKey: "ADYEN_API_KEY", environment: "TEST"});

   // Make the request
   const managementAPI = new ManagementAPI(client);
   const response = managementAPI.TerminalOrdersMerchantLevelApi.cancelOrder("merchantId", "orderId");
   ```

3. The response returns all [order details](https://docs.adyen.com/api-explorer/Management/latest/post/merchants/\(merchantId\)/terminalOrders/\(orderId\)/cancel#responses), but now the status is changed to **Cancelled**.

   **Order cancelled**

   ```json theme={null}
   {
         "id": "7219627091701347",
         "status": "Cancelled",
         "customerOrderReference": "YOUR_REFERENCE_1",
         "shippingLocation": {
           "id": "S2-7145604F44356F424F4369432B3F486B6A6D",
           "name": "POS France depot",
           "address": {
             "companyName": "Example Company France",
             "streetAddress": "11 Rue de Ville",
             "postalCode": "12345",
             "city": "Paris",
             "country": "France"
           },
           "contact": {
             "firstName": "Jesse",
             "lastName": "Dupont",
             "phoneNumber": "+33 1 76 35 07 90",
             "email": "jdupont@test.com"
           }
         },
         "billingEntity": {
           "id": "MerchantAccount.ExampleCompanyFrance",
           "name": "ExampleCompanyFrance",
           "taxId": "222222222",
           "email": "jdupont@test.com",
           "address": {
             "companyName": "Example Company France",
             "streetAddress": "11 Rue de Ville",
             "postalCode": "12345",
             "city": "Paris",
             "country": "France"
           }
         },
         "orderDate": "2020-01-22T14:12:33Z",
         "items": [
           {
             "id": "V400m_1",
             "name": "V400m terminal package EU/GB",
             "quantity": 1
           }
         ]
       }
   ```

## See also

* [Assign terminals using API requests](https://adyen-preview.mintlify.site/point-of-sale/automating-terminal-management/assign-terminals-api.md)
* [Configure terminals using API requests](https://adyen-preview.mintlify.site/point-of-sale/automating-terminal-management/configure-terminals-api.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.