# Order a terminal

Order one or more terminals for a processing account by sending a POST request to the processing accounts terminal-orders endpoint with training, shipping, and solution details.

**Prerequisites:** [Authentication](/api/authentication)

**Important:** These documents are an early draft and are subject to change.

To order a terminal, you need the `processingAccountId` of the account you want to order the terminal for. To get the `processingAccountId`, go to [Retrieve Merchant Platform](/api#getMerchantAcccounts).

To order one or more terminals for a processing account, provide the following information:

- Training provider who will train the merchant to use the solution.
- Shipping address for hardware devices and peripheral devices.
- Solution details for each terminal including gateway settings, device settings, and application settings.

To receive a notification when we change the status of a terminal order, subscribe to our terminalOrder.status.changed event. For more information about how to subscribe to an event, go to [Create a Subscription](/guides/events/create-event-subscription).

<a id="integration-steps"></a>
## Integration steps

- Create a terminal order.

<a id="before-you-begin"></a>
## Before you begin

[Authenticate your requests](/api/authentication) before making API calls. If your request fails, see [Errors](/api/errors).

<a id="create-a-terminal-order"></a>
## Create a terminal order

To order a terminal, send a POST request to our processing accounts endpoint.

| Environment | URL |
| --- | --- |
| Test | [https://api.uat.payroc.com/v1/processing-accounts/\{processingAccountId\}/terminal-orders](https://api.uat.payroc.com/v1/processing-accounts/%7BprocessingAccountId%7D/terminal-orders) |
| Production | [https://api.payroc.com/v1/processing-accounts/\{processingAccountId\}/terminal-orders](https://api.payroc.com/v1/processing-accounts/%7BprocessingAccountId%7D/terminal-orders) |

<a id="request-parameters"></a>
### Request parameters

To create the body of your request, use the following parameters:

<a id="schema-requestbody"></a>
### Schema (`request.body`)

[Request body schema for `POST /processing-accounts/{processingAccountId}/terminal-orders`](/api/create-terminal-order)

<a id="example-request"></a>
### Example request

<a id="request"></a>
### Request

POST [https://api.payroc.com/v1/processing-accounts/\{processingAccountId\}/terminal-orders](https://api.payroc.com/v1/processing-accounts/%7BprocessingAccountId%7D/terminal-orders)

**`Terminal order`**

```curl
curl -X POST https://api.payroc.com/v1/processing-accounts/38765/terminal-orders \
     -H "Idempotency-Key: 8e03978e-40d5-43e8-bc93-6894a57f9324" \
     -H "Authorization: Bearer <token>" \
     -H "Content-Type: application/json" \
     -d '{
  "orderItems": [
    {
      "type": "solution",
      "solutionTemplateId": "Roc Services_DX8000",
      "solutionQuantity": 1,
      "deviceCondition": "new",
      "solutionSetup": {
        "timezone": "America/Chicago",
        "industryTemplateId": "Retail",
        "gatewaySettings": {
          "merchantPortfolioId": "Company Ltd",
          "merchantTemplateId": "Company Ltd Merchant Template",
          "userTemplateId": "Company Ltd User Template",
          "terminalTemplateId": "Company Ltd Terminal Template"
        },
        "applicationSettings": {
          "clerkPrompt": false,
          "security": {
            "refundPassword": true,
            "keyedSalePassword": false,
            "reversalPassword": true
          }
        },
        "deviceSettings": {
          "numberOfMobileUsers": 2,
          "communicationType": "wifi"
        },
        "batchClosure": {
          "batchCloseType": "automatic",
          "batchCloseTime": "23:40"
        },
        "receiptNotifications": {
          "emailReceipt": true,
          "smsReceipt": false
        },
        "taxes": [
          {
            "taxRate": 6,
            "taxLabel": "Sales Tax"
          }
        ],
        "tips": {
          "enabled": false
        },
        "tokenization": true
      }
    }
  ],
  "trainingProvider": "payroc",
  "shipping": {
    "preferences": {
      "method": "nextDay",
      "saturdayDelivery": true
    },
    "address": {
      "recipientName": "Sarah Hopper",
      "addressLine1": "1 Example Ave.",
      "city": "Chicago",
      "state": "Illinois",
      "postalCode": "60056",
      "email": "example@mail.com",
      "businessName": "Company Ltd",
      "addressLine2": "Example Address Line 2",
      "phone": "2025550164"
    }
  },
  "paymentIntent": {
    "paymentIntentType": "purchase",
    "payment": {
      "payer": "merchant",
      "method": "hostedPaymentPage",
      "frequency": {
        "type": "singlePayment"
      }
    },
    "costBreakdown": {
      "items": [
        {
          "name": "dx8000",
          "quantity": 1,
          "unitCost": 4999
        }
      ],
      "shippingCost": 599
    },
    "subTotal": 5598
  }
}'
```

**`Terminal order`**

```python
import requests

url = "https://api.payroc.com/v1/processing-accounts/38765/terminal-orders"

payload = {
    "orderItems": [
        {
            "type": "solution",
            "solutionTemplateId": "Roc Services_DX8000",
            "solutionQuantity": 1,
            "deviceCondition": "new",
            "solutionSetup": {
                "timezone": "America/Chicago",
                "industryTemplateId": "Retail",
                "gatewaySettings": {
                    "merchantPortfolioId": "Company Ltd",
                    "merchantTemplateId": "Company Ltd Merchant Template",
                    "userTemplateId": "Company Ltd User Template",
                    "terminalTemplateId": "Company Ltd Terminal Template"
                },
                "applicationSettings": {
                    "clerkPrompt": False,
                    "security": {
                        "refundPassword": True,
                        "keyedSalePassword": False,
                        "reversalPassword": True
                    }
                },
                "deviceSettings": {
                    "numberOfMobileUsers": 2,
                    "communicationType": "wifi"
                },
                "batchClosure": {
                    "batchCloseType": "automatic",
                    "batchCloseTime": "23:40"
                },
                "receiptNotifications": {
                    "emailReceipt": True,
                    "smsReceipt": False
                },
                "taxes": [
                    {
                        "taxRate": 6,
                        "taxLabel": "Sales Tax"
                    }
                ],
                "tips": { "enabled": False },
                "tokenization": True
            }
        }
    ],
    "trainingProvider": "payroc",
    "shipping": {
        "preferences": {
            "method": "nextDay",
            "saturdayDelivery": True
        },
        "address": {
            "recipientName": "Sarah Hopper",
            "addressLine1": "1 Example Ave.",
            "city": "Chicago",
            "state": "Illinois",
            "postalCode": "60056",
            "email": "example@mail.com",
            "businessName": "Company Ltd",
            "addressLine2": "Example Address Line 2",
            "phone": "2025550164"
        }
    },
    "paymentIntent": {
        "paymentIntentType": "purchase",
        "payment": {
            "payer": "merchant",
            "method": "hostedPaymentPage",
            "frequency": { "type": "singlePayment" }
        },
        "costBreakdown": {
            "items": [
                {
                    "name": "dx8000",
                    "quantity": 1,
                    "unitCost": 4999
                }
            ],
            "shippingCost": 599
        },
        "subTotal": 5598
    }
}
headers = {
    "Idempotency-Key": "8e03978e-40d5-43e8-bc93-6894a57f9324",
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

**`Terminal order`**

```javascript
const url = 'https://api.payroc.com/v1/processing-accounts/38765/terminal-orders';
const options = {
  method: 'POST',
  headers: {
    'Idempotency-Key': '8e03978e-40d5-43e8-bc93-6894a57f9324',
    Authorization: 'Bearer <token>',
    'Content-Type': 'application/json'
  },
  body: '{"orderItems":[{"type":"solution","solutionTemplateId":"Roc Services_DX8000","solutionQuantity":1,"deviceCondition":"new","solutionSetup":{"timezone":"America/Chicago","industryTemplateId":"Retail","gatewaySettings":{"merchantPortfolioId":"Company Ltd","merchantTemplateId":"Company Ltd Merchant Template","userTemplateId":"Company Ltd User Template","terminalTemplateId":"Company Ltd Terminal Template"},"applicationSettings":{"clerkPrompt":false,"security":{"refundPassword":true,"keyedSalePassword":false,"reversalPassword":true}},"deviceSettings":{"numberOfMobileUsers":2,"communicationType":"wifi"},"batchClosure":{"batchCloseType":"automatic","batchCloseTime":"23:40"},"receiptNotifications":{"emailReceipt":true,"smsReceipt":false},"taxes":[{"taxRate":6,"taxLabel":"Sales Tax"}],"tips":{"enabled":false},"tokenization":true}}],"trainingProvider":"payroc","shipping":{"preferences":{"method":"nextDay","saturdayDelivery":true},"address":{"recipientName":"Sarah Hopper","addressLine1":"1 Example Ave.","city":"Chicago","state":"Illinois","postalCode":"60056","email":"example@mail.com","businessName":"Company Ltd","addressLine2":"Example Address Line 2","phone":"2025550164"}},"paymentIntent":{"paymentIntentType":"purchase","payment":{"payer":"merchant","method":"hostedPaymentPage","frequency":{"type":"singlePayment"}},"costBreakdown":{"items":[{"name":"dx8000","quantity":1,"unitCost":4999}],"shippingCost":599},"subTotal":5598}}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

**`Terminal order`**

```go
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.payroc.com/v1/processing-accounts/38765/terminal-orders"

	payload := strings.NewReader("{\n  \"orderItems\": [\n    {\n      \"type\": \"solution\",\n      \"solutionTemplateId\": \"Roc Services_DX8000\",\n      \"solutionQuantity\": 1,\n      \"deviceCondition\": \"new\",\n      \"solutionSetup\": {\n        \"timezone\": \"America/Chicago\",\n        \"industryTemplateId\": \"Retail\",\n        \"gatewaySettings\": {\n          \"merchantPortfolioId\": \"Company Ltd\",\n          \"merchantTemplateId\": \"Company Ltd Merchant Template\",\n          \"userTemplateId\": \"Company Ltd User Template\",\n          \"terminalTemplateId\": \"Company Ltd Terminal Template\"\n        },\n        \"applicationSettings\": {\n          \"clerkPrompt\": false,\n          \"security\": {\n            \"refundPassword\": true,\n            \"keyedSalePassword\": false,\n            \"reversalPassword\": true\n          }\n        },\n        \"deviceSettings\": {\n          \"numberOfMobileUsers\": 2,\n          \"communicationType\": \"wifi\"\n        },\n        \"batchClosure\": {\n          \"batchCloseType\": \"automatic\",\n          \"batchCloseTime\": \"23:40\"\n        },\n        \"receiptNotifications\": {\n          \"emailReceipt\": true,\n          \"smsReceipt\": false\n        },\n        \"taxes\": [\n          {\n            \"taxRate\": 6,\n            \"taxLabel\": \"Sales Tax\"\n          }\n        ],\n        \"tips\": {\n          \"enabled\": false\n        },\n        \"tokenization\": true\n      }\n    }\n  ],\n  \"trainingProvider\": \"payroc\",\n  \"shipping\": {\n    \"preferences\": {\n      \"method\": \"nextDay\",\n      \"saturdayDelivery\": true\n    },\n    \"address\": {\n      \"recipientName\": \"Sarah Hopper\",\n      \"addressLine1\": \"1 Example Ave.\",\n      \"city\": \"Chicago\",\n      \"state\": \"Illinois\",\n      \"postalCode\": \"60056\",\n      \"email\": \"example@mail.com\",\n      \"businessName\": \"Company Ltd\",\n      \"addressLine2\": \"Example Address Line 2\",\n      \"phone\": \"2025550164\"\n    }\n  },\n  \"paymentIntent\": {\n    \"paymentIntentType\": \"purchase\",\n    \"payment\": {\n      \"payer\": \"merchant\",\n      \"method\": \"hostedPaymentPage\",\n      \"frequency\": {\n        \"type\": \"singlePayment\"\n      }\n    },\n    \"costBreakdown\": {\n      \"items\": [\n        {\n          \"name\": \"dx8000\",\n          \"quantity\": 1,\n          \"unitCost\": 4999\n        }\n      ],\n      \"shippingCost\": 599\n    },\n    \"subTotal\": 5598\n  }\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Idempotency-Key", "8e03978e-40d5-43e8-bc93-6894a57f9324")
	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

**`Terminal order`**

```ruby
require 'uri'
require 'net/http'

url = URI("https://api.payroc.com/v1/processing-accounts/38765/terminal-orders")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Idempotency-Key"] = '8e03978e-40d5-43e8-bc93-6894a57f9324'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"orderItems\": [\n    {\n      \"type\": \"solution\",\n      \"solutionTemplateId\": \"Roc Services_DX8000\",\n      \"solutionQuantity\": 1,\n      \"deviceCondition\": \"new\",\n      \"solutionSetup\": {\n        \"timezone\": \"America/Chicago\",\n        \"industryTemplateId\": \"Retail\",\n        \"gatewaySettings\": {\n          \"merchantPortfolioId\": \"Company Ltd\",\n          \"merchantTemplateId\": \"Company Ltd Merchant Template\",\n          \"userTemplateId\": \"Company Ltd User Template\",\n          \"terminalTemplateId\": \"Company Ltd Terminal Template\"\n        },\n        \"applicationSettings\": {\n          \"clerkPrompt\": false,\n          \"security\": {\n            \"refundPassword\": true,\n            \"keyedSalePassword\": false,\n            \"reversalPassword\": true\n          }\n        },\n        \"deviceSettings\": {\n          \"numberOfMobileUsers\": 2,\n          \"communicationType\": \"wifi\"\n        },\n        \"batchClosure\": {\n          \"batchCloseType\": \"automatic\",\n          \"batchCloseTime\": \"23:40\"\n        },\n        \"receiptNotifications\": {\n          \"emailReceipt\": true,\n          \"smsReceipt\": false\n        },\n        \"taxes\": [\n          {\n            \"taxRate\": 6,\n            \"taxLabel\": \"Sales Tax\"\n          }\n        ],\n        \"tips\": {\n          \"enabled\": false\n        },\n        \"tokenization\": true\n      }\n    }\n  ],\n  \"trainingProvider\": \"payroc\",\n  \"shipping\": {\n    \"preferences\": {\n      \"method\": \"nextDay\",\n      \"saturdayDelivery\": true\n    },\n    \"address\": {\n      \"recipientName\": \"Sarah Hopper\",\n      \"addressLine1\": \"1 Example Ave.\",\n      \"city\": \"Chicago\",\n      \"state\": \"Illinois\",\n      \"postalCode\": \"60056\",\n      \"email\": \"example@mail.com\",\n      \"businessName\": \"Company Ltd\",\n      \"addressLine2\": \"Example Address Line 2\",\n      \"phone\": \"2025550164\"\n    }\n  },\n  \"paymentIntent\": {\n    \"paymentIntentType\": \"purchase\",\n    \"payment\": {\n      \"payer\": \"merchant\",\n      \"method\": \"hostedPaymentPage\",\n      \"frequency\": {\n        \"type\": \"singlePayment\"\n      }\n    },\n    \"costBreakdown\": {\n      \"items\": [\n        {\n          \"name\": \"dx8000\",\n          \"quantity\": 1,\n          \"unitCost\": 4999\n        }\n      ],\n      \"shippingCost\": 599\n    },\n    \"subTotal\": 5598\n  }\n}"

response = http.request(request)
puts response.read_body
```

**`Terminal order`**

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.payroc.com/v1/processing-accounts/38765/terminal-orders")
  .header("Idempotency-Key", "8e03978e-40d5-43e8-bc93-6894a57f9324")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"orderItems\": [\n    {\n      \"type\": \"solution\",\n      \"solutionTemplateId\": \"Roc Services_DX8000\",\n      \"solutionQuantity\": 1,\n      \"deviceCondition\": \"new\",\n      \"solutionSetup\": {\n        \"timezone\": \"America/Chicago\",\n        \"industryTemplateId\": \"Retail\",\n        \"gatewaySettings\": {\n          \"merchantPortfolioId\": \"Company Ltd\",\n          \"merchantTemplateId\": \"Company Ltd Merchant Template\",\n          \"userTemplateId\": \"Company Ltd User Template\",\n          \"terminalTemplateId\": \"Company Ltd Terminal Template\"\n        },\n        \"applicationSettings\": {\n          \"clerkPrompt\": false,\n          \"security\": {\n            \"refundPassword\": true,\n            \"keyedSalePassword\": false,\n            \"reversalPassword\": true\n          }\n        },\n        \"deviceSettings\": {\n          \"numberOfMobileUsers\": 2,\n          \"communicationType\": \"wifi\"\n        },\n        \"batchClosure\": {\n          \"batchCloseType\": \"automatic\",\n          \"batchCloseTime\": \"23:40\"\n        },\n        \"receiptNotifications\": {\n          \"emailReceipt\": true,\n          \"smsReceipt\": false\n        },\n        \"taxes\": [\n          {\n            \"taxRate\": 6,\n            \"taxLabel\": \"Sales Tax\"\n          }\n        ],\n        \"tips\": {\n          \"enabled\": false\n        },\n        \"tokenization\": true\n      }\n    }\n  ],\n  \"trainingProvider\": \"payroc\",\n  \"shipping\": {\n    \"preferences\": {\n      \"method\": \"nextDay\",\n      \"saturdayDelivery\": true\n    },\n    \"address\": {\n      \"recipientName\": \"Sarah Hopper\",\n      \"addressLine1\": \"1 Example Ave.\",\n      \"city\": \"Chicago\",\n      \"state\": \"Illinois\",\n      \"postalCode\": \"60056\",\n      \"email\": \"example@mail.com\",\n      \"businessName\": \"Company Ltd\",\n      \"addressLine2\": \"Example Address Line 2\",\n      \"phone\": \"2025550164\"\n    }\n  },\n  \"paymentIntent\": {\n    \"paymentIntentType\": \"purchase\",\n    \"payment\": {\n      \"payer\": \"merchant\",\n      \"method\": \"hostedPaymentPage\",\n      \"frequency\": {\n        \"type\": \"singlePayment\"\n      }\n    },\n    \"costBreakdown\": {\n      \"items\": [\n        {\n          \"name\": \"dx8000\",\n          \"quantity\": 1,\n          \"unitCost\": 4999\n        }\n      ],\n      \"shippingCost\": 599\n    },\n    \"subTotal\": 5598\n  }\n}")
  .asString();
```

**`Terminal order`**

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.payroc.com/v1/processing-accounts/38765/terminal-orders', [
  'body' => '{
  "orderItems": [
    {
      "type": "solution",
      "solutionTemplateId": "Roc Services_DX8000",
      "solutionQuantity": 1,
      "deviceCondition": "new",
      "solutionSetup": {
        "timezone": "America/Chicago",
        "industryTemplateId": "Retail",
        "gatewaySettings": {
          "merchantPortfolioId": "Company Ltd",
          "merchantTemplateId": "Company Ltd Merchant Template",
          "userTemplateId": "Company Ltd User Template",
          "terminalTemplateId": "Company Ltd Terminal Template"
        },
        "applicationSettings": {
          "clerkPrompt": false,
          "security": {
            "refundPassword": true,
            "keyedSalePassword": false,
            "reversalPassword": true
          }
        },
        "deviceSettings": {
          "numberOfMobileUsers": 2,
          "communicationType": "wifi"
        },
        "batchClosure": {
          "batchCloseType": "automatic",
          "batchCloseTime": "23:40"
        },
        "receiptNotifications": {
          "emailReceipt": true,
          "smsReceipt": false
        },
        "taxes": [
          {
            "taxRate": 6,
            "taxLabel": "Sales Tax"
          }
        ],
        "tips": {
          "enabled": false
        },
        "tokenization": true
      }
    }
  ],
  "trainingProvider": "payroc",
  "shipping": {
    "preferences": {
      "method": "nextDay",
      "saturdayDelivery": true
    },
    "address": {
      "recipientName": "Sarah Hopper",
      "addressLine1": "1 Example Ave.",
      "city": "Chicago",
      "state": "Illinois",
      "postalCode": "60056",
      "email": "example@mail.com",
      "businessName": "Company Ltd",
      "addressLine2": "Example Address Line 2",
      "phone": "2025550164"
    }
  },
  "paymentIntent": {
    "paymentIntentType": "purchase",
    "payment": {
      "payer": "merchant",
      "method": "hostedPaymentPage",
      "frequency": {
        "type": "singlePayment"
      }
    },
    "costBreakdown": {
      "items": [
        {
          "name": "dx8000",
          "quantity": 1,
          "unitCost": 4999
        }
      ],
      "shippingCost": 599
    },
    "subTotal": 5598
  }
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
    'Idempotency-Key' => '8e03978e-40d5-43e8-bc93-6894a57f9324',
  ],
]);

echo $response->getBody();
```

**`Terminal order`**

```csharp
using RestSharp;

var client = new RestClient("https://api.payroc.com/v1/processing-accounts/38765/terminal-orders");
var request = new RestRequest(Method.POST);
request.AddHeader("Idempotency-Key", "8e03978e-40d5-43e8-bc93-6894a57f9324");
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"orderItems\": [\n    {\n      \"type\": \"solution\",\n      \"solutionTemplateId\": \"Roc Services_DX8000\",\n      \"solutionQuantity\": 1,\n      \"deviceCondition\": \"new\",\n      \"solutionSetup\": {\n        \"timezone\": \"America/Chicago\",\n        \"industryTemplateId\": \"Retail\",\n        \"gatewaySettings\": {\n          \"merchantPortfolioId\": \"Company Ltd\",\n          \"merchantTemplateId\": \"Company Ltd Merchant Template\",\n          \"userTemplateId\": \"Company Ltd User Template\",\n          \"terminalTemplateId\": \"Company Ltd Terminal Template\"\n        },\n        \"applicationSettings\": {\n          \"clerkPrompt\": false,\n          \"security\": {\n            \"refundPassword\": true,\n            \"keyedSalePassword\": false,\n            \"reversalPassword\": true\n          }\n        },\n        \"deviceSettings\": {\n          \"numberOfMobileUsers\": 2,\n          \"communicationType\": \"wifi\"\n        },\n        \"batchClosure\": {\n          \"batchCloseType\": \"automatic\",\n          \"batchCloseTime\": \"23:40\"\n        },\n        \"receiptNotifications\": {\n          \"emailReceipt\": true,\n          \"smsReceipt\": false\n        },\n        \"taxes\": [\n          {\n            \"taxRate\": 6,\n            \"taxLabel\": \"Sales Tax\"\n          }\n        ],\n        \"tips\": {\n          \"enabled\": false\n        },\n        \"tokenization\": true\n      }\n    }\n  ],\n  \"trainingProvider\": \"payroc\",\n  \"shipping\": {\n    \"preferences\": {\n      \"method\": \"nextDay\",\n      \"saturdayDelivery\": true\n    },\n    \"address\": {\n      \"recipientName\": \"Sarah Hopper\",\n      \"addressLine1\": \"1 Example Ave.\",\n      \"city\": \"Chicago\",\n      \"state\": \"Illinois\",\n      \"postalCode\": \"60056\",\n      \"email\": \"example@mail.com\",\n      \"businessName\": \"Company Ltd\",\n      \"addressLine2\": \"Example Address Line 2\",\n      \"phone\": \"2025550164\"\n    }\n  },\n  \"paymentIntent\": {\n    \"paymentIntentType\": \"purchase\",\n    \"payment\": {\n      \"payer\": \"merchant\",\n      \"method\": \"hostedPaymentPage\",\n      \"frequency\": {\n        \"type\": \"singlePayment\"\n      }\n    },\n    \"costBreakdown\": {\n      \"items\": [\n        {\n          \"name\": \"dx8000\",\n          \"quantity\": 1,\n          \"unitCost\": 4999\n        }\n      ],\n      \"shippingCost\": 599\n    },\n    \"subTotal\": 5598\n  }\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

**`Terminal order`**

```swift
import Foundation

let headers = [
  "Idempotency-Key": "8e03978e-40d5-43e8-bc93-6894a57f9324",
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "orderItems": [
    [
      "type": "solution",
      "solutionTemplateId": "Roc Services_DX8000",
      "solutionQuantity": 1,
      "deviceCondition": "new",
      "solutionSetup": [
        "timezone": "America/Chicago",
        "industryTemplateId": "Retail",
        "gatewaySettings": [
          "merchantPortfolioId": "Company Ltd",
          "merchantTemplateId": "Company Ltd Merchant Template",
          "userTemplateId": "Company Ltd User Template",
          "terminalTemplateId": "Company Ltd Terminal Template"
        ],
        "applicationSettings": [
          "clerkPrompt": false,
          "security": [
            "refundPassword": true,
            "keyedSalePassword": false,
            "reversalPassword": true
          ]
        ],
        "deviceSettings": [
          "numberOfMobileUsers": 2,
          "communicationType": "wifi"
        ],
        "batchClosure": [
          "batchCloseType": "automatic",
          "batchCloseTime": "23:40"
        ],
        "receiptNotifications": [
          "emailReceipt": true,
          "smsReceipt": false
        ],
        "taxes": [
          [
            "taxRate": 6,
            "taxLabel": "Sales Tax"
          ]
        ],
        "tips": ["enabled": false],
        "tokenization": true
      ]
    ]
  ],
  "trainingProvider": "payroc",
  "shipping": [
    "preferences": [
      "method": "nextDay",
      "saturdayDelivery": true
    ],
    "address": [
      "recipientName": "Sarah Hopper",
      "addressLine1": "1 Example Ave.",
      "city": "Chicago",
      "state": "Illinois",
      "postalCode": "60056",
      "email": "example@mail.com",
      "businessName": "Company Ltd",
      "addressLine2": "Example Address Line 2",
      "phone": "2025550164"
    ]
  ],
  "paymentIntent": [
    "paymentIntentType": "purchase",
    "payment": [
      "payer": "merchant",
      "method": "hostedPaymentPage",
      "frequency": ["type": "singlePayment"]
    ],
    "costBreakdown": [
      "items": [
        [
          "name": "dx8000",
          "quantity": 1,
          "unitCost": 4999
        ]
      ],
      "shippingCost": 599
    ],
    "subTotal": 5598
  ]
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.payroc.com/v1/processing-accounts/38765/terminal-orders")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

<a id="response-fields"></a>
### Response fields

If the request is successful, we create the terminal order and return the following response:

**Status code 201**

Successful request. We created the terminal order.

<a id="schema-responsebody"></a>
### Schema (`response.body`)

[Response body schema for `POST /processing-accounts/{processingAccountId}/terminal-orders`](/api/create-terminal-order)

<a id="example-response"></a>
### Example response

<a id="response-201"></a>
### Response (201)

```json
{
  "terminalOrderId": "2346",
  "status": "open",
  "orderItems": [
    {
      "type": "solution",
      "solutionTemplateId": "Roc Services_DX8000",
      "solutionQuantity": 1,
      "deviceCondition": "new",
      "solutionSetup": {
        "timezone": "America/Chicago",
        "industryTemplateId": "Retail",
        "gatewaySettings": {
          "merchantPortfolioId": "Example Corp",
          "merchantTemplateId": "Example Corp Merchant Template",
          "userTemplateId": "Example Corp User Template",
          "terminalTemplateId": "Example Corp Terminal Template"
        },
        "applicationSettings": {
          "clerkPrompt": false,
          "security": {
            "refundPassword": true,
            "keyedSalePassword": false,
            "reversalPassword": true
          }
        },
        "deviceSettings": {
          "numberOfMobileUsers": 2,
          "communicationType": "wifi"
        },
        "batchClosure": {
          "batchCloseType": "automatic",
          "batchCloseTime": "23:40"
        },
        "receiptNotifications": {
          "emailReceipt": true,
          "smsReceipt": false
        },
        "taxes": [
          {
            "taxRate": 6,
            "taxLabel": "Sales Tax"
          }
        ],
        "tips": {
          "enabled": false
        },
        "tokenization": true
      }
    }
  ],
  "createdDate": "2024-07-02T12:00:00.000+00:00",
  "lastModifiedDate": "2024-07-02T12:00:00.000+00:00",
  "trainingProvider": "payroc",
  "shipping": {
    "preferences": {
      "method": "nextDay",
      "saturdayDelivery": true
    },
    "address": {
      "recipientName": "Jane Doe",
      "addressLine1": "1 Example Ave.",
      "city": "Chicago",
      "state": "Illinois",
      "postalCode": "60056",
      "email": "jane.doe@example.com",
      "businessName": "Example Corp",
      "addressLine2": "Example Address Line 2",
      "phone": "2025550164"
    }
  }
}
```
