> This is Payabli documentation. For a complete page index, fetch https://docs.payabli.com/llms.txt — append .md to any page URL for lightweight markdown. For section-level indexes, query parameters, and other AI-optimized access methods, see https://docs.payabli.com/ai-agents.md

# Place device order

POST https://api-sandbox.payabli.com/api/DeviceOrder
Content-Type: application/json

Places a device order. Payabli prices every line from the device
catalog, so the request carries no amounts and no card data.

After you place the order, its `payment.paymentStatus` is `Pending`.
Collect the card with the embedded component and pay for the order
with `POST /DeviceOrder/{orderNumber}/pay`.

This endpoint requires an `Idempotency-Key` header. If you send the
same key again, Payabli returns the original order instead of creating
a new one.

This endpoint requires the `deviceorder_create` permission.

Reference: https://docs.payabli.com/developers/api-reference/device-orders/place-device-order

## Authentication

- `Authorization` header (bearer token, required) — Bearer authentication of the form `Bearer <token>`, where token is your auth token.
- `requestToken` header (required) — Long-lived API token sent in the `requestToken` header. See [API token authentication](/developers/api-tokens).

## Servers

- `https://api-sandbox.payabli.com/api` (Sandbox, default)
- `https://api.payabli.com/api` (Production)

## Request

### Headers

- `Idempotency-Key` (string, required) — A unique ID that you generate for each order, 1 to 100 characters long. If you send a request again with the same key, Payabli returns the original order instead of creating a duplicate.

### Body (application/json)

This endpoint expects a DeviceOrderSubmitRequest.

- `lines` (list of DeviceOrderLine, required) — The devices and quantities to order. Each device can appear only once, so use `quantity` to order more than one unit. An order can include up to 100 units in total.
- `billTo` (DeviceOrderAddress, required) — The billing address for the order.
- `shipTo` (DeviceOrderAddress, required) — The address to ship the devices to.
- `contactEmail` (string, required) — The contact email for the order. Payabli sends the order confirmation and the payment receipt to this address.
- `termsAccepted` (true, required) — Confirms that the person placing the order accepted the terms at the catalog's `termsUrl`. Must be `true`. Show the terms to that person and send `true` only after they accept. Payabli records who placed the order and when.
- `organizationId` (long, optional) — The ID of the organization the devices are for. Required for an organization-level order. When you send `entryName`, you can omit it, and Payabli uses the paypoint's parent organization.
- `entryName` (string, optional) — The entry name of the paypoint the devices are for. Omit it for an organization-level order. Payabli matches the entry name without regard to letter case or leading and trailing spaces. The request returns `400` with the message `Recipient not found.` when the entry name doesn't exist or belongs to someone else, matches more than one paypoint, isn't in the organization you sent in `organizationId`, or is longer than 255 characters.
- `contactName` (string, optional) — The name of the contact person for the order.
- `contactPhone` (string, optional) — The contact phone number for the order. When you send a value, it must contain 7 to 15 digits, optionally starting with `+`. Spaces, parentheses, periods, and hyphens are ignored.
- `paymentOption` (enum, optional) — How the order is paid for. Defaults to `PayNow`. * `PayNow`: The buyer pays by card. After you place the order, collect the card with the embedded component and pay the order with `POST /DeviceOrder/{orderNumber}/pay`. Use `paymentOptions` in the catalog response to see which options are available.
  - Allowed values: `PayNow`
- `payInline` (boolean, optional) — Set to `true` when you pay for the order with `POST /DeviceOrder/{orderNumber}/pay` right after you place it. Payabli then sends the order confirmation email after the payment is approved, instead of when you place the order. When it's `false` or omitted, Payabli sends the confirmation email when you place the order. If you set this to `true` and the order is paid some other way, Payabli sends only the payment receipt and no confirmation email.

## Response

### 200

Success

- `responseText` (string, required) — `Success` when the request succeeds.
- `responseData` (DeviceOrder, required) — A device order.
- `responseCode` (integer, optional) — Code for the response. Learn more in [API Response Codes](/developers/api-reference/api-responses).
- `pageIdentifier` (string, optional) — Auxiliary validation used internally by payment pages and components.
- `roomId` (long, optional) — Field not in use on this endpoint. It always returns `0`.
- `isSuccess` (boolean, optional) — Boolean indicating whether the operation was successful. A `true` value indicates success. A `false` value indicates failure.

## Errors

### 400 Bad Request Error

Bad request / invalid data.

- `isSuccess` (boolean, required) — Always `false` for error responses.
- `responseText` (string, required) — Error text describing what went wrong.
- `responseCode` (integer, optional) — Code for the response. Learn more in [API Response Codes](/developers/api-reference/api-responses).
- `responseData` (PayabliErrorBodyResponseData, optional) — Object with detailed error context.

### 401 Unauthorized Error

Unauthorized request.

- `isSuccess` (boolean, required) — Always `false` for error responses.
- `responseText` (string, required) — Error text describing what went wrong.
- `responseCode` (integer, optional) — Code for the response. Learn more in [API Response Codes](/developers/api-reference/api-responses).
- `responseData` (PayabliErrorBodyResponseData, optional) — Object with detailed error context.

### 500 Internal Server Error

Internal server error.

- `isSuccess` (boolean, required) — Always `false` for error responses.
- `responseText` (string, required) — Error text describing what went wrong.
- `responseCode` (integer, optional) — Code for the response. Learn more in [API Response Codes](/developers/api-reference/api-responses).
- `responseData` (PayabliErrorBodyResponseData, optional) — Object with detailed error context.

## Types

### DeviceOrderLine

One device in the order and how many units to order.

- `deviceProfileId` (long, required) — The ID of the device, from the device catalog.
- `quantity` (integer, required) — The number of units to order.

### DeviceOrderAddress

A postal address for billing or shipping.

- `line1` (string, required) — The street address.
- `city` (string, required) — The city.
- `state` (string, required) — The state or province.
- `zip` (string, required) — The postal code.
- `name` (string, optional) — The recipient's name, when it's different from the contact name.
- `company` (string, optional) — The company name printed on the invoice and shipping label.
- `line2` (string, optional) — The suite, floor, or unit.
- `country` (string, optional, default: US) — The two-letter ISO 3166-1 alpha-2 country code. Defaults to `US`.

### DeviceOrder

A device order.

- `id` (long, required) — The order's internal ID.
- `orderNumber` (string, required) — The order number. Use it in the path of the other device order endpoints.
- `status` (enum, required) — The order's status. - `Placed`: The order was placed. A `PayNow` order stays `Placed` until it's paid. - `Paid`: The `PayNow` order was paid. - `Initiated`: Payabli started fulfilling the order. - `Dispatched`: Payabli shipped the order. - `Delivered`: The order was delivered. - `Canceled`: The order was canceled. This status is final.
  - Allowed values: `Placed`, `Paid`, `Initiated`, `Dispatched`, `Delivered`, `Canceled`
- `createdAt` (datetime, required) — When the order was placed, in UTC.
- `createdBy` (string, required) — Who placed the order.
- `updatedAt` (datetime, required) — When the order was last updated, in UTC.
- `updatedBy` (string, required) — Who last updated the order.
- `organizationId` (long, required) — The ID of the organization the order is for.
- `organizationName` (string, required) — The name of the organization the order is for.
- `paypointId` (long, required, nullable) — The ID of the paypoint the devices are for. `null` for an organization-level order.
- `paypointName` (string, required, nullable) — The name of the paypoint the devices are for. `null` for an organization-level order.
- `entryName` (string, required, nullable) — The entry name of the paypoint the devices are for. `null` for an organization-level order.
- `deviceSubtotal` (double, required) — The total price of the devices, before shipping.
- `shippingTotal` (double, required) — The total shipping cost.
- `total` (double, required) — The order total, including shipping.
- `currency` (string, required) — The currency of the order's amounts, for example `USD`.
- `billTo` (DeviceOrderAddressDetail, required) — The billing address for the order.
- `shipTo` (DeviceOrderAddressDetail, required) — The address the devices ship to.
- `contactName` (string, required, nullable) — The name of the contact person for the order.
- `contactEmail` (string, required) — The contact email for the order.
- `contactPhone` (string, required, nullable) — The contact phone number for the order.
- `payment` (DeviceOrderPayment, required) — The order's payment details.
- `shipment` (DeviceOrderShipment, required) — The order's shipping and tracking details.
- `lines` (list of DeviceOrderLineDetail, required) — The devices on the order.
- `history` (list of DeviceOrderHistoryEvent, required) — The order's events, oldest first.
- `allowedNextStates` (list of enum, required) — The statuses you can move the order to from its current status. Use it to decide what to show your users, instead of building the order lifecycle into your code.
  - Allowed values: `Placed`, `Paid`, `Initiated`, `Dispatched`, `Delivered`, `Canceled`
- `termsAcceptedAt` (datetime, required) — When the person placing the order accepted the terms, in UTC.

### PayabliErrorBodyResponseData

Object with detailed error context.

- `explanation` (string, optional) — Human-readable explanation of what happened.
- `todoAction` (string, optional) — Suggested resolution.

### DeviceOrderAddressDetail

A postal address on an order.

- `name` (string, required, nullable) — The recipient's name, when it's different from the contact name.
- `company` (string, required, nullable) — The company name printed on the invoice and shipping label.
- `line1` (string, required) — The street address.
- `line2` (string, required, nullable) — The suite, floor, or unit.
- `city` (string, required) — The city.
- `state` (string, required) — The state or province.
- `zip` (string, required) — The postal code.
- `country` (string, required) — The two-letter ISO 3166-1 alpha-2 country code.

### DeviceOrderPayment

The order's payment details.

- `paymentOption` (enum, required) — How the order is paid for. Defaults to `PayNow`. * `PayNow`: The buyer pays by card. After you place the order, collect the card with the embedded component and pay the order with `POST /DeviceOrder/{orderNumber}/pay`. Use `paymentOptions` in the catalog response to see which options are available.
  - Allowed values: `PayNow`
- `paymentStatus` (enum, required) — Where the order's payment stands. - `Pending`: The `PayNow` order isn't paid yet. - `Paid`: The order was charged. - `Voided`: The paid order was canceled before the payment settled. - `Refunded`: The paid order was canceled after the payment settled.
  - Allowed values: `Pending`, `Paid`, `Voided`, `Refunded`
- `invoiceId` (long, required) — The ID of the invoice Payabli created for the order.
- `invoiceNumber` (string, required) — The number of the invoice Payabli created for the order.
- `paidAt` (datetime, required, nullable) — When the order was paid, in UTC. `null` until it's paid.
- `method` (string, required, nullable) — The payment method used. `null` until the order is paid.
- `lastFour` (string, required, nullable) — The last four digits of the card used. `null` until the order is paid.
- `transactionId` (string, required, nullable) — The ID of the payment transaction. `null` until the order is paid.

### DeviceOrderShipment

The order's shipping and tracking details.

- `trackingCarrier` (string, required, nullable) — The shipping carrier. `null` until Payabli ships the order.
- `trackingNumber` (string, required, nullable) — The carrier's tracking number. `null` until Payabli ships the order.
- `expectedShipAt` (datetime, required, nullable) — When Payabli expects to ship the order, in UTC.
- `dispatchedAt` (datetime, required, nullable) — When Payabli shipped the order, in UTC.
- `deliveredAt` (datetime, required, nullable) — When the order was delivered, in UTC.
- `canceledAt` (datetime, required, nullable) — When the order was canceled, in UTC.
- `cancelReason` (string, required, nullable) — The reason sent when the order was canceled.
- `trackingUrl` (string, required, nullable) — A link to the carrier's tracking page. `null` until Payabli ships the order.
- `events` (list of DeviceOrderTrackingEvent, required) — The carrier's tracking scans. Empty before the carrier's first scan.

### DeviceOrderLineDetail

One device on an order.

- `id` (long, required) — The line's internal ID.
- `deviceProfileId` (long, required) — The ID of the device, from the device catalog.
- `profileCode` (string, required) — The device's code in the catalog.
- `name` (string, required) — The device's name.
- `make` (string, required) — The device's manufacturer.
- `model` (string, required) — The device's model.
- `quantity` (integer, required) — The number of units ordered.
- `unitPrice` (double, required) — The price of one unit.
- `unitShipping` (double, required) — The shipping cost for one unit.
- `shippingDays` (integer, required) — The estimated number of days to ship the device.
- `lineTotal` (double, required) — The line total, including shipping.
- `serials` (list of string, required) — The serial numbers of the units shipped for this line. Empty until Payabli ships the order.

### DeviceOrderHistoryEvent

One event in the order's history.

- `at` (datetime, required) — When the event happened, in UTC.
- `event` (string, required) — The event name, for example `DeviceOrderPlaced` or `DeviceOrderCanceled`.
- `fromStatus` (enum, required, nullable) — The status before the event. `null` for the event that placed the order.
  - Allowed values: `Placed`, `Paid`, `Initiated`, `Dispatched`, `Delivered`, `Canceled`
- `toStatus` (enum, required) — The status after the event.
  - Allowed values: `Placed`, `Paid`, `Initiated`, `Dispatched`, `Delivered`, `Canceled`
- `actingUser` (string, required) — Who caused the event.
- `note` (string, required, nullable) — A note about the event.

### DeviceOrderTrackingEvent

One carrier tracking scan.

- `eventDate` (datetime, required, nullable) — When the carrier recorded the scan, in UTC.
- `location` (string, required, nullable) — Where the scan happened, as the carrier reports it.
- `description` (string, required, nullable) — What happened, as the carrier reports it.

## Examples

**Request**

```json
{
  "lines": [
    {
      "deviceProfileId": 67,
      "quantity": 1
    }
  ],
  "billTo": {
    "line1": "123 Main St",
    "city": "Austin",
    "state": "TX",
    "zip": "78701",
    "country": "US"
  },
  "shipTo": {
    "line1": "123 Main St",
    "city": "Austin",
    "state": "TX",
    "zip": "78701",
    "country": "US"
  },
  "contactEmail": "jordan.smith@example.com",
  "termsAccepted": true,
  "entryName": "8cfec329267",
  "contactName": "Jordan Smith",
  "contactPhone": "5555550100",
  "paymentOption": "PayNow",
  "payInline": true
}
```

**Response**

```json
{
  "responseText": "Success",
  "responseData": {
    "id": 35,
    "orderNumber": "DO-000035",
    "status": "Placed",
    "createdAt": "2026-10-16T15:28:47.4758249Z",
    "createdBy": "900123",
    "updatedAt": "2026-10-16T15:28:47.4758249Z",
    "updatedBy": "900123",
    "organizationId": 900123,
    "organizationName": "Pilgrim Planner",
    "paypointId": 3040,
    "paypointName": "Sunshine Gutters",
    "entryName": "8cfec329267",
    "deviceSubtotal": 416,
    "shippingTotal": 18,
    "total": 434,
    "currency": "USD",
    "billTo": {
      "name": null,
      "company": null,
      "line1": "123 Main St",
      "line2": null,
      "city": "Austin",
      "state": "TX",
      "zip": "78701",
      "country": "US"
    },
    "shipTo": {
      "name": null,
      "company": null,
      "line1": "123 Main St",
      "line2": null,
      "city": "Austin",
      "state": "TX",
      "zip": "78701",
      "country": "US"
    },
    "contactName": "Jordan Smith",
    "contactEmail": "jordan.smith@example.com",
    "contactPhone": "5555550100",
    "payment": {
      "paymentOption": "PayNow",
      "paymentStatus": "Pending",
      "invoiceId": 3674,
      "invoiceNumber": "INV-2345",
      "paidAt": null,
      "method": null,
      "lastFour": null,
      "transactionId": null
    },
    "shipment": {
      "trackingCarrier": null,
      "trackingNumber": null,
      "expectedShipAt": null,
      "dispatchedAt": null,
      "deliveredAt": null,
      "canceledAt": null,
      "cancelReason": null,
      "trackingUrl": null,
      "events": []
    },
    "lines": [
      {
        "id": 35,
        "deviceProfileId": 67,
        "profileCode": "ingenico-ingenico-dx6000",
        "name": "Ingenico DX6000",
        "make": "Ingenico",
        "model": "DX6000",
        "quantity": 1,
        "unitPrice": 416,
        "unitShipping": 18,
        "shippingDays": 3,
        "lineTotal": 434,
        "serials": []
      }
    ],
    "history": [
      {
        "at": "2026-10-16T15:28:47.761144+00:00",
        "event": "DeviceOrderPlaced",
        "fromStatus": null,
        "toStatus": "Placed",
        "actingUser": "900123",
        "note": null
      }
    ],
    "allowedNextStates": [
      "Canceled"
    ],
    "termsAcceptedAt": "2026-10-16T15:28:47.4758249Z"
  },
  "responseCode": 1,
  "pageIdentifier": null,
  "roomId": 0,
  "isSuccess": true
}
```

**SDK Code**

```python
import requests

url = "https://api-sandbox.payabli.com/api/DeviceOrder"

payload = {
    "lines": [
        {
            "deviceProfileId": 67,
            "quantity": 1
        }
    ],
    "billTo": {
        "line1": "123 Main St",
        "city": "Austin",
        "state": "TX",
        "zip": "78701",
        "country": "US"
    },
    "shipTo": {
        "line1": "123 Main St",
        "city": "Austin",
        "state": "TX",
        "zip": "78701",
        "country": "US"
    },
    "contactEmail": "jordan.smith@example.com",
    "termsAccepted": True,
    "entryName": "8cfec329267",
    "contactName": "Jordan Smith",
    "contactPhone": "5555550100",
    "paymentOption": "PayNow",
    "payInline": True
}
headers = {
    "Idempotency-Key": "a3f1c9e2-order-2026-10-16",
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript
const url = 'https://api-sandbox.payabli.com/api/DeviceOrder';
const options = {
  method: 'POST',
  headers: {
    'Idempotency-Key': 'a3f1c9e2-order-2026-10-16',
    Authorization: 'Bearer <token>',
    'Content-Type': 'application/json'
  },
  body: '{"lines":[{"deviceProfileId":67,"quantity":1}],"billTo":{"line1":"123 Main St","city":"Austin","state":"TX","zip":"78701","country":"US"},"shipTo":{"line1":"123 Main St","city":"Austin","state":"TX","zip":"78701","country":"US"},"contactEmail":"jordan.smith@example.com","termsAccepted":true,"entryName":"8cfec329267","contactName":"Jordan Smith","contactPhone":"5555550100","paymentOption":"PayNow","payInline":true}'
};

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

```go
package main

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

func main() {

	url := "https://api-sandbox.payabli.com/api/DeviceOrder"

	payload := strings.NewReader("{\n  \"lines\": [\n    {\n      \"deviceProfileId\": 67,\n      \"quantity\": 1\n    }\n  ],\n  \"billTo\": {\n    \"line1\": \"123 Main St\",\n    \"city\": \"Austin\",\n    \"state\": \"TX\",\n    \"zip\": \"78701\",\n    \"country\": \"US\"\n  },\n  \"shipTo\": {\n    \"line1\": \"123 Main St\",\n    \"city\": \"Austin\",\n    \"state\": \"TX\",\n    \"zip\": \"78701\",\n    \"country\": \"US\"\n  },\n  \"contactEmail\": \"jordan.smith@example.com\",\n  \"termsAccepted\": true,\n  \"entryName\": \"8cfec329267\",\n  \"contactName\": \"Jordan Smith\",\n  \"contactPhone\": \"5555550100\",\n  \"paymentOption\": \"PayNow\",\n  \"payInline\": true\n}")

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

	req.Header.Add("Idempotency-Key", "a3f1c9e2-order-2026-10-16")
	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))

}
```

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

url = URI("https://api-sandbox.payabli.com/api/DeviceOrder")

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

request = Net::HTTP::Post.new(url)
request["Idempotency-Key"] = 'a3f1c9e2-order-2026-10-16'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"lines\": [\n    {\n      \"deviceProfileId\": 67,\n      \"quantity\": 1\n    }\n  ],\n  \"billTo\": {\n    \"line1\": \"123 Main St\",\n    \"city\": \"Austin\",\n    \"state\": \"TX\",\n    \"zip\": \"78701\",\n    \"country\": \"US\"\n  },\n  \"shipTo\": {\n    \"line1\": \"123 Main St\",\n    \"city\": \"Austin\",\n    \"state\": \"TX\",\n    \"zip\": \"78701\",\n    \"country\": \"US\"\n  },\n  \"contactEmail\": \"jordan.smith@example.com\",\n  \"termsAccepted\": true,\n  \"entryName\": \"8cfec329267\",\n  \"contactName\": \"Jordan Smith\",\n  \"contactPhone\": \"5555550100\",\n  \"paymentOption\": \"PayNow\",\n  \"payInline\": true\n}"

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

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

HttpResponse<String> response = Unirest.post("https://api-sandbox.payabli.com/api/DeviceOrder")
  .header("Idempotency-Key", "a3f1c9e2-order-2026-10-16")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"lines\": [\n    {\n      \"deviceProfileId\": 67,\n      \"quantity\": 1\n    }\n  ],\n  \"billTo\": {\n    \"line1\": \"123 Main St\",\n    \"city\": \"Austin\",\n    \"state\": \"TX\",\n    \"zip\": \"78701\",\n    \"country\": \"US\"\n  },\n  \"shipTo\": {\n    \"line1\": \"123 Main St\",\n    \"city\": \"Austin\",\n    \"state\": \"TX\",\n    \"zip\": \"78701\",\n    \"country\": \"US\"\n  },\n  \"contactEmail\": \"jordan.smith@example.com\",\n  \"termsAccepted\": true,\n  \"entryName\": \"8cfec329267\",\n  \"contactName\": \"Jordan Smith\",\n  \"contactPhone\": \"5555550100\",\n  \"paymentOption\": \"PayNow\",\n  \"payInline\": true\n}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api-sandbox.payabli.com/api/DeviceOrder', [
  'body' => '{
  "lines": [
    {
      "deviceProfileId": 67,
      "quantity": 1
    }
  ],
  "billTo": {
    "line1": "123 Main St",
    "city": "Austin",
    "state": "TX",
    "zip": "78701",
    "country": "US"
  },
  "shipTo": {
    "line1": "123 Main St",
    "city": "Austin",
    "state": "TX",
    "zip": "78701",
    "country": "US"
  },
  "contactEmail": "jordan.smith@example.com",
  "termsAccepted": true,
  "entryName": "8cfec329267",
  "contactName": "Jordan Smith",
  "contactPhone": "5555550100",
  "paymentOption": "PayNow",
  "payInline": true
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
    'Idempotency-Key' => 'a3f1c9e2-order-2026-10-16',
  ],
]);

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

```csharp
using RestSharp;

var client = new RestClient("https://api-sandbox.payabli.com/api/DeviceOrder");
var request = new RestRequest(Method.POST);
request.AddHeader("Idempotency-Key", "a3f1c9e2-order-2026-10-16");
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"lines\": [\n    {\n      \"deviceProfileId\": 67,\n      \"quantity\": 1\n    }\n  ],\n  \"billTo\": {\n    \"line1\": \"123 Main St\",\n    \"city\": \"Austin\",\n    \"state\": \"TX\",\n    \"zip\": \"78701\",\n    \"country\": \"US\"\n  },\n  \"shipTo\": {\n    \"line1\": \"123 Main St\",\n    \"city\": \"Austin\",\n    \"state\": \"TX\",\n    \"zip\": \"78701\",\n    \"country\": \"US\"\n  },\n  \"contactEmail\": \"jordan.smith@example.com\",\n  \"termsAccepted\": true,\n  \"entryName\": \"8cfec329267\",\n  \"contactName\": \"Jordan Smith\",\n  \"contactPhone\": \"5555550100\",\n  \"paymentOption\": \"PayNow\",\n  \"payInline\": true\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "Idempotency-Key": "a3f1c9e2-order-2026-10-16",
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "lines": [
    [
      "deviceProfileId": 67,
      "quantity": 1
    ]
  ],
  "billTo": [
    "line1": "123 Main St",
    "city": "Austin",
    "state": "TX",
    "zip": "78701",
    "country": "US"
  ],
  "shipTo": [
    "line1": "123 Main St",
    "city": "Austin",
    "state": "TX",
    "zip": "78701",
    "country": "US"
  ],
  "contactEmail": "jordan.smith@example.com",
  "termsAccepted": true,
  "entryName": "8cfec329267",
  "contactName": "Jordan Smith",
  "contactPhone": "5555550100",
  "paymentOption": "PayNow",
  "payInline": true
] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://api-sandbox.payabli.com/api/DeviceOrder")! 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()
```