> 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

# Order devices with the API

> Learn how to order Payabli payment devices for your organizations and paypoints with the Payabli API

Order Payabli payment devices for your organizations and paypoints entirely through the API. You describe the order once, Payabli prices it from the device catalog, and you pay for it by card. Payabli then ships the devices and adds tracking details to the order.

> **Note**
>
> Device ordering requires configuration by the Payabli team. Contact us to get started.

## Considerations

* **You never send card data.** To pay for an order by card, you collect the card with the [embedded component](/guides/pay-in-components-embeddedmethod-ui) and send Payabli only the temporary token ID it returns.
* **You use your own public token.** Load the embedded component with your own public token and entrypoint, the same way you do to save cards today. Payabli moves the temporary token onto the order for you.
* **Your API token needs device ordering permissions.** Reading the catalog, recipients, and orders needs `deviceorder_read`. Placing and paying for an order needs `deviceorder_create`. Canceling an order needs `deviceorder_update`.
* **The person placing the order accepts the terms.** Show them the terms at the catalog's `termsUrl` before you place the order.

You can place, pay for, read, list, and cancel orders. Payabli handles fulfillment: it moves orders through `Initiated`, `Dispatched`, and `Delivered`, and it's the only one that can cancel a paid order.

## Order devices

Every order follows the same steps.

#### Check that device ordering is enabled

Send a `GET` request to `/DeviceOrder/enabled/{entry}` with the entrypoint of the organization or paypoint. When `enabled` is `false`, hide device ordering from your users. Only Payabli can turn device ordering on or off, so contact Payabli to turn it on for an organization. See the [API reference](/developers/api-reference/device-orders/check-device-ordering-enabled) for this endpoint for full documentation.

### Request

GET [https://api-sandbox.payabli.com/api/DeviceOrder/enabled/\{entry}](https://api-sandbox.payabli.com/api/DeviceOrder/enabled/\{entry})

**`DeviceOrderingEnabled`**

```curl DeviceOrderingEnabled
curl https://api-sandbox.payabli.com/api/DeviceOrder/enabled/8cfec329267 \
     -H "Authorization: Bearer <token>"
```

**`DeviceOrderingEnabled`**

```typescript DeviceOrderingEnabled
import { PayabliClient } from "@payabli/sdk-node";

async function main() {
    const client = new PayabliClient({
        bearerAuth: {
            clientId: "YOUR_CLIENT_ID",
            clientSecret: "YOUR_CLIENT_SECRET",
        },
    });
    await client.deviceOrder.getDeviceOrderingEnabled("8cfec329267");
}
main();

```

**`DeviceOrderingEnabled`**

```python DeviceOrderingEnabled
from payabli import payabli

client = payabli(
    client_id="YOUR_CLIENT_ID",
    client_secret="YOUR_CLIENT_SECRET",
)

client.device_order.get_device_ordering_enabled(
    entry="8cfec329267",
)

```

**`DeviceOrderingEnabled`**

```java DeviceOrderingEnabled
package com.example.usage;

import io.github.payabli.api.PayabliApiClient;

public class Example {
    public static void main(String[] args) {
        PayabliApiClient client = PayabliApiClient.withCredentials("YOUR_CLIENT_ID", "YOUR_CLIENT_SECRET")
            .build()
        ;

        client.deviceOrder().getDeviceOrderingEnabled("8cfec329267");
    }
}
```

**`DeviceOrderingEnabled`**

```csharp DeviceOrderingEnabled
using PayabliApi;
using System.Threading.Tasks;

public partial class Examples
{
    public async Task Example() {
        var client = new PayabliApiClient(
            clientId: "YOUR_CLIENT_ID",
            clientSecret: "YOUR_CLIENT_SECRET"
        );

        await client.DeviceOrder.GetDeviceOrderingEnabledAsync(
            "8cfec329267"
        );
    }

}

```

**`DeviceOrderingEnabled`**

```go DeviceOrderingEnabled
package example

import (
    context "context"

    client "github.com/payabli/sdk-go/client"
    option "github.com/payabli/sdk-go/option"
)

func do() error {
    client := client.NewClient(
        option.WithClientCredentials(
            "YOUR_CLIENT_ID",
            "YOUR_CLIENT_SECRET",
        ),
    )
    _, err := client.DeviceOrder.GetDeviceOrderingEnabled(
        context.TODO(),
        "8cfec329267",
    )
    if err != nil {
        return err
    }
    return nil
}

```

**`DeviceOrderingEnabled`**

```php DeviceOrderingEnabled
<?php

namespace Example;

use Payabli\PayabliClient;

$client = new PayabliClient(
    clientId: 'YOUR_CLIENT_ID',
    clientSecret: 'YOUR_CLIENT_SECRET',
);
$client->deviceOrder->getDeviceOrderingEnabled(
    '8cfec329267',
);

```

**`DeviceOrderingEnabled`**

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

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

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

request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'

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

**`DeviceOrderingEnabled`**

```swift DeviceOrderingEnabled
import Foundation

let headers = ["Authorization": "Bearer <token>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://api-sandbox.payabli.com/api/DeviceOrder/enabled/8cfec329267")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

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()
```

### Response (200)

```json
{
  "enabled": true
}
```

This endpoint always returns `200`. If you aren't authorized for the entry, it returns `false`, so you can't use it to check whether an entry exists.

#### Get the device catalog

Send a `GET` request to `/DeviceOrder/catalog` to get the devices you can order. The response also lists the payment options, the shipping carriers Payabli uses, and the `termsUrl` of the terms the person placing the order must accept. Show only the payment options where `enabled` is `true`. See the [API reference](/developers/api-reference/device-orders/get-device-catalog) for this endpoint for full documentation.

### Request

GET [https://api-sandbox.payabli.com/api/DeviceOrder/catalog](https://api-sandbox.payabli.com/api/DeviceOrder/catalog)

```curl
curl https://api-sandbox.payabli.com/api/DeviceOrder/catalog \
     -H "Authorization: Bearer <token>"
```

```typescript
import { PayabliClient } from "@payabli/sdk-node";

async function main() {
    const client = new PayabliClient({
        bearerAuth: {
            clientId: "YOUR_CLIENT_ID",
            clientSecret: "YOUR_CLIENT_SECRET",
        },
    });
    await client.deviceOrder.getDeviceOrderCatalog();
}
main();

```

```python
from payabli import payabli

client = payabli(
    client_id="YOUR_CLIENT_ID",
    client_secret="YOUR_CLIENT_SECRET",
)

client.device_order.get_device_order_catalog()

```

```java
package com.example.usage;

import io.github.payabli.api.PayabliApiClient;

public class Example {
    public static void main(String[] args) {
        PayabliApiClient client = PayabliApiClient.withCredentials("YOUR_CLIENT_ID", "YOUR_CLIENT_SECRET")
            .build()
        ;

        client.deviceOrder().getDeviceOrderCatalog();
    }
}
```

```csharp
using PayabliApi;
using System.Threading.Tasks;

public partial class Examples
{
    public async Task Example() {
        var client = new PayabliApiClient(
            clientId: "YOUR_CLIENT_ID",
            clientSecret: "YOUR_CLIENT_SECRET"
        );

        await client.DeviceOrder.GetDeviceOrderCatalogAsync();
    }

}

```

```go
package example

import (
    context "context"

    client "github.com/payabli/sdk-go/client"
    option "github.com/payabli/sdk-go/option"
)

func do() error {
    client := client.NewClient(
        option.WithClientCredentials(
            "YOUR_CLIENT_ID",
            "YOUR_CLIENT_SECRET",
        ),
    )
    _, err := client.DeviceOrder.GetDeviceOrderCatalog(
        context.TODO(),
    )
    if err != nil {
        return err
    }
    return nil
}

```

```php
<?php

namespace Example;

use Payabli\PayabliClient;

$client = new PayabliClient(
    clientId: 'YOUR_CLIENT_ID',
    clientSecret: 'YOUR_CLIENT_SECRET',
);
$client->deviceOrder->getDeviceOrderCatalog();

```

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

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

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

request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'

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

```swift
import Foundation

let headers = ["Authorization": "Bearer <token>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://api-sandbox.payabli.com/api/DeviceOrder/catalog")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

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()
```

### Response (200)

```json
{
  "responseText": "Success",
  "responseData": {
    "items": [
      {
        "id": 67,
        "profileCode": "ingenico-ingenico-dx6000",
        "name": "Ingenico DX6000",
        "make": "Ingenico",
        "model": "DX6000",
        "description": null,
        "images": [],
        "specifications": {
          "Barcode Reader": "No",
          "Printer": "Yes",
          "RAM": "32 GB",
          "Wifi": "Yes"
        },
        "retailCost": 416,
        "shippingRate": 18,
        "shippingDays": 3,
        "supportsBillToPaypoint": false
      }
    ],
    "paymentOptions": [
      {
        "code": "PayNow",
        "enabled": true,
        "comingSoon": false
      },
      {
        "code": "BillToPartner",
        "enabled": false,
        "comingSoon": true
      },
      {
        "code": "BillToPaypoint",
        "enabled": false,
        "comingSoon": true
      }
    ],
    "termsUrl": "https://payabli.com/terms-and-conditions/",
    "carriers": [
      "UPS",
      "FedEx",
      "USPS",
      "DHL"
    ]
  },
  "responseCode": 1,
  "pageIdentifier": null,
  "roomId": 0,
  "isSuccess": true
}
```

Each device has an `id` to send as `deviceProfileId` when you place the order, plus its `retailCost`, `shippingRate`, and `shippingDays`.

#### Choose who the order is for

Send a `GET` request to `/DeviceOrder/recipients` to list the organizations and paypoints you can order devices for. Skip this step if you already know the recipient. See the [API reference](/developers/api-reference/device-orders/list-device-order-recipients) for this endpoint for full documentation.

### Request

GET [https://api-sandbox.payabli.com/api/DeviceOrder/recipients](https://api-sandbox.payabli.com/api/DeviceOrder/recipients)

```curl
curl https://api-sandbox.payabli.com/api/DeviceOrder/recipients \
     -H "Authorization: Bearer <token>"
```

```typescript
import { PayabliClient } from "@payabli/sdk-node";

async function main() {
    const client = new PayabliClient({
        bearerAuth: {
            clientId: "YOUR_CLIENT_ID",
            clientSecret: "YOUR_CLIENT_SECRET",
        },
    });
    await client.deviceOrder.getDeviceOrderRecipients();
}
main();

```

```python
from payabli import payabli

client = payabli(
    client_id="YOUR_CLIENT_ID",
    client_secret="YOUR_CLIENT_SECRET",
)

client.device_order.get_device_order_recipients()

```

```java
package com.example.usage;

import io.github.payabli.api.PayabliApiClient;

public class Example {
    public static void main(String[] args) {
        PayabliApiClient client = PayabliApiClient.withCredentials("YOUR_CLIENT_ID", "YOUR_CLIENT_SECRET")
            .build()
        ;

        client.deviceOrder().getDeviceOrderRecipients();
    }
}
```

```csharp
using PayabliApi;
using System.Threading.Tasks;

public partial class Examples
{
    public async Task Example() {
        var client = new PayabliApiClient(
            clientId: "YOUR_CLIENT_ID",
            clientSecret: "YOUR_CLIENT_SECRET"
        );

        await client.DeviceOrder.GetDeviceOrderRecipientsAsync();
    }

}

```

```go
package example

import (
    context "context"

    client "github.com/payabli/sdk-go/client"
    option "github.com/payabli/sdk-go/option"
)

func do() error {
    client := client.NewClient(
        option.WithClientCredentials(
            "YOUR_CLIENT_ID",
            "YOUR_CLIENT_SECRET",
        ),
    )
    _, err := client.DeviceOrder.GetDeviceOrderRecipients(
        context.TODO(),
    )
    if err != nil {
        return err
    }
    return nil
}

```

```php
<?php

namespace Example;

use Payabli\PayabliClient;

$client = new PayabliClient(
    clientId: 'YOUR_CLIENT_ID',
    clientSecret: 'YOUR_CLIENT_SECRET',
);
$client->deviceOrder->getDeviceOrderRecipients();

```

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

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

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

request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'

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

```swift
import Foundation

let headers = ["Authorization": "Bearer <token>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://api-sandbox.payabli.com/api/DeviceOrder/recipients")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

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()
```

### Response (200)

```json
{
  "responseText": "Success",
  "responseData": {
    "organizations": [
      {
        "id": 900123,
        "name": "Pilgrim Planner",
        "entryName": "pilgrim-planner",
        "parentId": 2,
        "deviceOrderingEnabled": true
      }
    ],
    "paypoints": [
      {
        "id": 3040,
        "name": "Sunshine Gutters",
        "entryName": "8cfec329267",
        "organizationId": 900123
      }
    ]
  },
  "responseCode": 1,
  "pageIdentifier": null,
  "roomId": 0,
  "isSuccess": true
}
```

When you place the order, send the paypoint's `entryName` as `entryName`. For an organization-level order, send the organization's `id` as `organizationId` instead.

#### Place the order

Send a `POST` request to `/DeviceOrder` with the recipient, the devices and quantities, the billing and shipping addresses, a contact, and `termsAccepted: true`. The request carries no amounts and no card data, because Payabli prices every line from the catalog. See the [API reference](/developers/api-reference/device-orders/place-device-order) for this endpoint for full documentation.

* Name the recipient. For a paypoint, send its `entryName`. Payabli uses the paypoint's parent organization, so you don't need to send `organizationId`. For an organization-level order, send `organizationId` and omit `entryName`. The request doesn't accept `paypointId`.
* 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. The message is the same in each case, so it doesn't reveal which paypoints exist.
* If you send `paypointId`, the request returns `400` with the message `paypointId is no longer supported. Send the paypoint's entryName instead.` If you send neither `entryName` nor `organizationId`, it returns `400` with the message `Organization is required.`
* List each device once and set its `quantity`. An order can include up to 100 units in total.
* In each address, `line1`, `city`, `state`, and `zip` are required. `country` is a two-letter ISO 3166-1 alpha-2 code and defaults to `US`.
* If you send `contactPhone`, it must contain 7 to 15 digits, optionally starting with `+`. Spaces, parentheses, periods, and hyphens are ignored.
* Send `termsAccepted: true` only after the person placing the order accepts the terms. Payabli records who placed the order and when.
* Send a unique `Idempotency-Key` header, 1 to 100 characters long. If you send the same key again, Payabli returns the original order instead of creating a new one.
* Set `payInline: true` if you pay for the order right after you place it. Payabli then sends one order confirmation email after the payment is approved, instead of one when you place the order that says payment is pending.

### Request

POST [https://api-sandbox.payabli.com/api/DeviceOrder](https://api-sandbox.payabli.com/api/DeviceOrder)

```curl
curl -X POST https://api-sandbox.payabli.com/api/DeviceOrder \
     -H "Idempotency-Key: a3f1c9e2-order-2026-10-16" \
     -H "Authorization: Bearer <token>" \
     -H "Content-Type: application/json" \
     -d '{
  "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
}'
```

```typescript
import { PayabliClient } from "@payabli/sdk-node";

async function main() {
    const client = new PayabliClient({
        bearerAuth: {
            clientId: "YOUR_CLIENT_ID",
            clientSecret: "YOUR_CLIENT_SECRET",
        },
    });
    await client.deviceOrder.submitDeviceOrder({
        "Idempotency-Key": "a3f1c9e2-order-2026-10-16",
        entryName: "8cfec329267",
        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",
        },
        contactName: "Jordan Smith",
        contactEmail: "jordan.smith@example.com",
        contactPhone: "5555550100",
        paymentOption: "PayNow",
        termsAccepted: true,
        payInline: true,
    });
}
main();

```

```python
from payabli import payabli, DeviceOrderLine, DeviceOrderAddress

client = payabli(
    client_id="YOUR_CLIENT_ID",
    client_secret="YOUR_CLIENT_SECRET",
)

client.device_order.submit_device_order(
    idempotency_key="a3f1c9e2-order-2026-10-16",
    entry_name="8cfec329267",
    lines=[
        DeviceOrderLine(
            device_profile_id=67,
            quantity=1,
        )
    ],
    bill_to=DeviceOrderAddress(
        line_1="123 Main St",
        city="Austin",
        state="TX",
        zip="78701",
        country="US",
    ),
    ship_to=DeviceOrderAddress(
        line_1="123 Main St",
        city="Austin",
        state="TX",
        zip="78701",
        country="US",
    ),
    contact_name="Jordan Smith",
    contact_email="jordan.smith@example.com",
    contact_phone="5555550100",
    payment_option="PayNow",
    terms_accepted=True,
    pay_inline=True,
)

```

```java
package com.example.usage;

import io.github.payabli.api.PayabliApiClient;
import io.github.payabli.api.resources.deviceorder.requests.SubmitDeviceOrderRequest;
import io.github.payabli.api.types.DeviceOrderAddress;
import io.github.payabli.api.types.DeviceOrderLine;
import io.github.payabli.api.types.DeviceOrderPaymentOption;
import java.util.Arrays;

public class Example {
    public static void main(String[] args) {
        PayabliApiClient client = PayabliApiClient.withCredentials("YOUR_CLIENT_ID", "YOUR_CLIENT_SECRET")
            .build()
        ;

        client.deviceOrder().submitDeviceOrder(
            SubmitDeviceOrderRequest
                .builder()
                .idempotencyKey("a3f1c9e2-order-2026-10-16")
                .billTo(
                    DeviceOrderAddress
                        .builder()
                        .line1("123 Main St")
                        .city("Austin")
                        .state("TX")
                        .zip("78701")
                        .country("US")
                        .build()
                )
                .shipTo(
                    DeviceOrderAddress
                        .builder()
                        .line1("123 Main St")
                        .city("Austin")
                        .state("TX")
                        .zip("78701")
                        .country("US")
                        .build()
                )
                .contactEmail("jordan.smith@example.com")
                .termsAccepted(true)
                .lines(
                    Arrays.asList(
                        DeviceOrderLine
                            .builder()
                            .deviceProfileId(67L)
                            .quantity(1)
                            .build()
                    )
                )
                .entryName("8cfec329267")
                .contactName("Jordan Smith")
                .contactPhone("5555550100")
                .paymentOption(DeviceOrderPaymentOption.PAY_NOW)
                .payInline(true)
                .build()
        );
    }
}
```

```csharp
using PayabliApi;
using System.Threading.Tasks;
using System.Collections.Generic;

public partial class Examples
{
    public async Task Example() {
        var client = new PayabliApiClient(
            clientId: "YOUR_CLIENT_ID",
            clientSecret: "YOUR_CLIENT_SECRET"
        );

        await client.DeviceOrder.SubmitDeviceOrderAsync(
            new SubmitDeviceOrderRequest {
                IdempotencyKey = "a3f1c9e2-order-2026-10-16",
                EntryName = "8cfec329267",
                Lines = new List<DeviceOrderLine>(){
                    new DeviceOrderLine {
                        DeviceProfileId = 67L,
                        Quantity = 1
                    },
                }
                ,
                BillTo = new DeviceOrderAddress {
                    Line1 = "123 Main St",
                    City = "Austin",
                    State = "TX",
                    Zip = "78701",
                    Country = "US"
                },
                ShipTo = new DeviceOrderAddress {
                    Line1 = "123 Main St",
                    City = "Austin",
                    State = "TX",
                    Zip = "78701",
                    Country = "US"
                },
                ContactName = "Jordan Smith",
                ContactEmail = "jordan.smith@example.com",
                ContactPhone = "5555550100",
                PaymentOption = DeviceOrderPaymentOption.PayNow,
                TermsAccepted = true,
                PayInline = true
            }
        );
    }

}

```

```go
package example

import (
    context "context"

    payabli "github.com/payabli/sdk-go"
    client "github.com/payabli/sdk-go/client"
    option "github.com/payabli/sdk-go/option"
)

func do() error {
    client := client.NewClient(
        option.WithClientCredentials(
            "YOUR_CLIENT_ID",
            "YOUR_CLIENT_SECRET",
        ),
    )
    request := &payabli.SubmitDeviceOrderRequest{
        IdempotencyKey: "a3f1c9e2-order-2026-10-16",
        EntryName: payabli.String(
            "8cfec329267",
        ),
        Lines: []*payabli.DeviceOrderLine{
            &payabli.DeviceOrderLine{
                DeviceProfileId: int64(67),
                Quantity: 1,
            },
        },
        BillTo: &payabli.DeviceOrderAddress{
            Line1: "123 Main St",
            City: "Austin",
            State: "TX",
            Zip: "78701",
            Country: payabli.String(
                "US",
            ),
        },
        ShipTo: &payabli.DeviceOrderAddress{
            Line1: "123 Main St",
            City: "Austin",
            State: "TX",
            Zip: "78701",
            Country: payabli.String(
                "US",
            ),
        },
        ContactName: payabli.String(
            "Jordan Smith",
        ),
        ContactEmail: "jordan.smith@example.com",
        ContactPhone: payabli.String(
            "5555550100",
        ),
        PaymentOption: payabli.DeviceOrderPaymentOptionPayNow.Ptr(),
        TermsAccepted: true,
        PayInline: payabli.Bool(
            true,
        ),
    }
    _, err := client.DeviceOrder.SubmitDeviceOrder(
        context.TODO(),
        request,
    )
    if err != nil {
        return err
    }
    return nil
}

```

```php
<?php

namespace Example;

use Payabli\PayabliClient;
use Payabli\DeviceOrder\Requests\SubmitDeviceOrderRequest;
use Payabli\Types\DeviceOrderLine;
use Payabli\Types\DeviceOrderAddress;
use Payabli\Types\DeviceOrderPaymentOption;

$client = new PayabliClient(
    clientId: 'YOUR_CLIENT_ID',
    clientSecret: 'YOUR_CLIENT_SECRET',
);
$client->deviceOrder->submitDeviceOrder(
    new SubmitDeviceOrderRequest([
        'idempotencyKey' => 'a3f1c9e2-order-2026-10-16',
        'entryName' => '8cfec329267',
        'lines' => [
            new DeviceOrderLine([
                'deviceProfileId' => 67,
                'quantity' => 1,
            ]),
        ],
        'billTo' => new DeviceOrderAddress([
            'line1' => '123 Main St',
            'city' => 'Austin',
            'state' => 'TX',
            'zip' => '78701',
            'country' => 'US',
        ]),
        'shipTo' => new DeviceOrderAddress([
            'line1' => '123 Main St',
            'city' => 'Austin',
            'state' => 'TX',
            'zip' => '78701',
            'country' => 'US',
        ]),
        'contactName' => 'Jordan Smith',
        'contactEmail' => 'jordan.smith@example.com',
        'contactPhone' => '5555550100',
        'paymentOption' => DeviceOrderPaymentOption::PayNow->value,
        'termsAccepted' => true,
        'payInline' => true,
    ]),
);

```

```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
```

```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()
```

### Response (200)

```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
}
```

The new order's `status` is `Placed` and its `payment.paymentStatus` is `Pending`. Pay for it in the next step.

#### Pay for the order

To pay for the order by card:

1. Load the [embedded component](/guides/pay-in-components-embeddedmethod-ui) with your own public token, your entrypoint, and `temporaryToken: true`. When the person placing the order enters their card, the component returns a temporary token ID in `referenceId`.
2. Send a `POST` request to `/DeviceOrder/{orderNumber}/pay` with the temporary token ID as `storedMethodId`. This endpoint accepts cards only, and it doesn't need an `Idempotency-Key` header.

See the [API reference](/developers/api-reference/device-orders/pay-device-order) for this endpoint for full documentation.

### Request

POST [https://api-sandbox.payabli.com/api/DeviceOrder/\{orderNumber}/pay](https://api-sandbox.payabli.com/api/DeviceOrder/\{orderNumber}/pay)

```curl
curl -X POST https://api-sandbox.payabli.com/api/DeviceOrder/DO-000035/pay \
     -H "Authorization: Bearer <token>" \
     -H "Content-Type: application/json" \
     -d '{
  "storedMethodId": "5084e643-a817-438c-adce-aed156326aae-854468"
}'
```

```typescript
import { PayabliClient } from "@payabli/sdk-node";

async function main() {
    const client = new PayabliClient({
        bearerAuth: {
            clientId: "YOUR_CLIENT_ID",
            clientSecret: "YOUR_CLIENT_SECRET",
        },
    });
    await client.deviceOrder.payDeviceOrder("DO-000035", {
        storedMethodId: "5084e643-a817-438c-adce-aed156326aae-854468",
    });
}
main();

```

```python
from payabli import payabli

client = payabli(
    client_id="YOUR_CLIENT_ID",
    client_secret="YOUR_CLIENT_SECRET",
)

client.device_order.pay_device_order(
    order_number="DO-000035",
    stored_method_id="5084e643-a817-438c-adce-aed156326aae-854468",
)

```

```java
package com.example.usage;

import io.github.payabli.api.PayabliApiClient;
import io.github.payabli.api.resources.deviceorder.requests.PayDeviceOrderRequest;

public class Example {
    public static void main(String[] args) {
        PayabliApiClient client = PayabliApiClient.withCredentials("YOUR_CLIENT_ID", "YOUR_CLIENT_SECRET")
            .build()
        ;

        client.deviceOrder().payDeviceOrder(
            "DO-000035",
            PayDeviceOrderRequest
                .builder()
                .storedMethodId("5084e643-a817-438c-adce-aed156326aae-854468")
                .build()
        );
    }
}
```

```csharp
using PayabliApi;
using System.Threading.Tasks;

public partial class Examples
{
    public async Task Example() {
        var client = new PayabliApiClient(
            clientId: "YOUR_CLIENT_ID",
            clientSecret: "YOUR_CLIENT_SECRET"
        );

        await client.DeviceOrder.PayDeviceOrderAsync(
            orderNumber: "DO-000035",
            request: new PayDeviceOrderRequest {
                StoredMethodId = "5084e643-a817-438c-adce-aed156326aae-854468"
            }
        );
    }

}

```

```go
package example

import (
    context "context"

    payabli "github.com/payabli/sdk-go"
    client "github.com/payabli/sdk-go/client"
    option "github.com/payabli/sdk-go/option"
)

func do() error {
    client := client.NewClient(
        option.WithClientCredentials(
            "YOUR_CLIENT_ID",
            "YOUR_CLIENT_SECRET",
        ),
    )
    request := &payabli.PayDeviceOrderRequest{
        StoredMethodId: "5084e643-a817-438c-adce-aed156326aae-854468",
    }
    _, err := client.DeviceOrder.PayDeviceOrder(
        context.TODO(),
        "DO-000035",
        request,
    )
    if err != nil {
        return err
    }
    return nil
}

```

```php
<?php

namespace Example;

use Payabli\PayabliClient;
use Payabli\DeviceOrder\Requests\PayDeviceOrderRequest;

$client = new PayabliClient(
    clientId: 'YOUR_CLIENT_ID',
    clientSecret: 'YOUR_CLIENT_SECRET',
);
$client->deviceOrder->payDeviceOrder(
    'DO-000035',
    new PayDeviceOrderRequest([
        'storedMethodId' => '5084e643-a817-438c-adce-aed156326aae-854468',
    ]),
);

```

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

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

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

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"storedMethodId\": \"5084e643-a817-438c-adce-aed156326aae-854468\"\n}"

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

```swift
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = ["storedMethodId": "5084e643-a817-438c-adce-aed156326aae-854468"] as [String : Any]

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

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

### Response (200)

```json
{
  "responseText": "Success",
  "responseData": {
    "id": 35,
    "orderNumber": "DO-000035",
    "status": "Paid",
    "createdAt": "2026-10-16T15:28:47.475824+00:00",
    "createdBy": "900123",
    "updatedAt": "2026-10-16T15:30:12.347011+00:00",
    "updatedBy": "system",
    "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": "Paid",
      "invoiceId": 3674,
      "invoiceNumber": "INV-2345",
      "paidAt": "2026-10-16T15:30:12.347011+00:00",
      "method": "card",
      "lastFour": "1111",
      "transactionId": "3040-477b678cf236404fb37ac868503dddf2"
    },
    "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
      },
      {
        "at": "2026-10-16T15:30:12.412870+00:00",
        "event": "DeviceOrderPaid",
        "fromStatus": "Placed",
        "toStatus": "Paid",
        "actingUser": "system",
        "note": "via hook"
      }
    ],
    "allowedNextStates": [],
    "termsAcceptedAt": "2026-10-16T15:28:47.475824+00:00"
  },
  "responseCode": 1,
  "pageIdentifier": null,
  "roomId": 0,
  "isSuccess": true
}
```

After a successful payment, the order's `status` and `payment.paymentStatus` are both `Paid`.

A temporary token can be used only once, even when the card is declined. If the card is declined, the endpoint returns `402` and the order isn't affected. Collect a card again, get a new temporary token from the component, and call `/pay` with the new ID. If you send the old ID, the endpoint returns `400`. Don't place the order again.

After a successful payment, Payabli emails a payment receipt to the order's `contactEmail`.

#### Track the order

Send a `GET` request to `/DeviceOrder/{orderNumber}` to get the order's status, payment details, and tracking. This endpoint also confirms the payment status when you read it, so use it as the source of truth for the order. See the [API reference](/developers/api-reference/device-orders/get-device-order) for this endpoint for full documentation.

### Request

GET [https://api-sandbox.payabli.com/api/DeviceOrder/\{orderNumber}](https://api-sandbox.payabli.com/api/DeviceOrder/\{orderNumber})

```curl
curl https://api-sandbox.payabli.com/api/DeviceOrder/DO-000035 \
     -H "Authorization: Bearer <token>"
```

```typescript
import { PayabliClient } from "@payabli/sdk-node";

async function main() {
    const client = new PayabliClient({
        bearerAuth: {
            clientId: "YOUR_CLIENT_ID",
            clientSecret: "YOUR_CLIENT_SECRET",
        },
    });
    await client.deviceOrder.getDeviceOrder("DO-000035");
}
main();

```

```python
from payabli import payabli

client = payabli(
    client_id="YOUR_CLIENT_ID",
    client_secret="YOUR_CLIENT_SECRET",
)

client.device_order.get_device_order(
    order_number="DO-000035",
)

```

```java
package com.example.usage;

import io.github.payabli.api.PayabliApiClient;

public class Example {
    public static void main(String[] args) {
        PayabliApiClient client = PayabliApiClient.withCredentials("YOUR_CLIENT_ID", "YOUR_CLIENT_SECRET")
            .build()
        ;

        client.deviceOrder().getDeviceOrder("DO-000035");
    }
}
```

```csharp
using PayabliApi;
using System.Threading.Tasks;

public partial class Examples
{
    public async Task Example() {
        var client = new PayabliApiClient(
            clientId: "YOUR_CLIENT_ID",
            clientSecret: "YOUR_CLIENT_SECRET"
        );

        await client.DeviceOrder.GetDeviceOrderAsync(
            "DO-000035"
        );
    }

}

```

```go
package example

import (
    context "context"

    client "github.com/payabli/sdk-go/client"
    option "github.com/payabli/sdk-go/option"
)

func do() error {
    client := client.NewClient(
        option.WithClientCredentials(
            "YOUR_CLIENT_ID",
            "YOUR_CLIENT_SECRET",
        ),
    )
    _, err := client.DeviceOrder.GetDeviceOrder(
        context.TODO(),
        "DO-000035",
    )
    if err != nil {
        return err
    }
    return nil
}

```

```php
<?php

namespace Example;

use Payabli\PayabliClient;

$client = new PayabliClient(
    clientId: 'YOUR_CLIENT_ID',
    clientSecret: 'YOUR_CLIENT_SECRET',
);
$client->deviceOrder->getDeviceOrder(
    'DO-000035',
);

```

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

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

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

request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'

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

```swift
import Foundation

let headers = ["Authorization": "Bearer <token>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://api-sandbox.payabli.com/api/DeviceOrder/DO-000035")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

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()
```

### Response (200)

```json
{
  "responseText": "Success",
  "responseData": {
    "id": 35,
    "orderNumber": "DO-000035",
    "status": "Placed",
    "createdAt": "2026-10-16T15:28:47.475824+00:00",
    "createdBy": "900123",
    "updatedAt": "2026-10-16T15:28:47.475824+00:00",
    "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.475824+00:00"
  },
  "responseCode": 1,
  "pageIdentifier": null,
  "roomId": 0,
  "isSuccess": true
}
```

After Payabli ships the order, its `shipment` object holds the `trackingCarrier`, the `trackingNumber`, and a `trackingUrl` for the carrier's tracking page. `shipment.events` lists the carrier's scans, newest first, and can be empty before the carrier's first scan.

Every order response includes `allowedNextStates`, 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. Paying for an order isn't listed in `allowedNextStates`. Show the pay step only when the order's `status` is `Placed` and its `payment.paymentStatus` is `Pending`. A canceled order that was never paid still has a `Pending` payment status, so check both.

## Order statuses

An order's `status` moves through these values:

| Status       | Meaning                                                                       |
| ------------ | ----------------------------------------------------------------------------- |
| `Placed`     | The order was placed. It stays `Placed` until it's paid.                      |
| `Paid`       | The order was paid.                                                           |
| `Initiated`  | Payabli started fulfilling the order. Nobody can cancel an `Initiated` order. |
| `Dispatched` | Payabli shipped the order and added the carrier and tracking number.          |
| `Delivered`  | The order was delivered.                                                      |
| `Canceled`   | The order was canceled. This status is final.                                 |

This diagram shows how an order moves between statuses, and the [notification](#get-notified-about-order-changes) each move sends.

![Device order status lifecycle from Placed through Paid, Initiated, and Dispatched to Delivered, with a Canceled end state, labeled with the notification each move sends](/_fern-files/payabli.docs.buildwithfern.com/d3221c76b7f58dada21a82d52cd279fba2f4e75ba67aa23ddaae0deeb5786bd3/images/generated-diagrams/device-order-status-lifecycle.svg)

#### Diagram: Device order status lifecycle

The diagram shows how a device order moves between statuses, and the notification each move sends:

1. You place the order, and it becomes `Placed`. Payabli sends `DeviceOrderPlaced`.
2. You pay the order, and it becomes `Paid`. Payabli sends `DeviceOrderPaid`.
3. Payabli starts fulfillment, and the order becomes `Initiated`. Payabli sends `DeviceOrderStatusChanged`.
4. Payabli ships the order, and it becomes `Dispatched`. Payabli sends `DeviceOrderStatusChanged`.
5. The order is delivered, and it becomes `Delivered`. Payabli sends `DeviceOrderStatusChanged`.

A `Placed` order can be canceled by you or Payabli. A `Paid` order can be canceled only by Payabli, which reverses the charge. Either way, the order becomes `Canceled` and Payabli sends `DeviceOrderStatusChanged`. An order can't be canceled after it's `Initiated`.

## Payment statuses

An order's `payment.paymentStatus` shows where its payment stands:

| Payment status | Meaning                                                                                                                       |
| -------------- | ----------------------------------------------------------------------------------------------------------------------------- |
| `Pending`      | The order isn't paid yet.                                                                                                     |
| `Paid`         | The order was charged. `transactionId`, `method`, and `lastFour` hold the payment details.                                    |
| `Voided`       | The paid order was canceled before the payment settled. The charge never appears on the cardholder's statement.               |
| `Refunded`     | The paid order was canceled after the payment settled. The refund appears on the cardholder's statement as a separate credit. |

> **Tip**
>
> When a customer asks where their money is after a canceled order, check the payment status. A `Voided` payment never appears on their statement, and a `Refunded` payment appears as a separate credit.

## Cancel an order

Send a `POST` request to `/DeviceOrder/{orderNumber}/cancel`, optionally with a `reason`. You can cancel an order only while it's `Placed`, meaning before it's paid. For any other status, the endpoint returns `409`. See the [API reference](/developers/api-reference/device-orders/cancel-device-order) for this endpoint for full documentation.

To cancel an order that's already paid, contact Payabli. Payabli reverses the charge before it cancels the order, so a canceled paid order always means the charge was voided or refunded. A voided charge never reaches the customer's account. A refund can take several business days to reach it, depending on the customer's bank. If Payabli can't reverse the charge, the order stays `Paid`.

## Get notified about order changes

Payabli sends three webhook notifications for device orders. Subscribe to them the same way you subscribe to other [notifications](/guides/pay-ops-notifications-webhooks-overview). A device order notification also reaches subscriptions on the organizations above the ordering organization or paypoint.

| Event                      | Subscription event key     | Sent when                                                                                                                                                  |
| -------------------------- | -------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `DeviceOrderPlaced`        | `deviceorderplaced`        | An order is placed, and its status becomes `Placed`.                                                                                                       |
| `DeviceOrderPaid`          | `deviceorderpaid`          | An order is paid, and its status moves from `Placed` to `Paid`.                                                                                            |
| `DeviceOrderStatusChanged` | `deviceorderstatuschanged` | Payabli moves an order from `Paid` to `Initiated`, `Initiated` to `Dispatched`, or `Dispatched` to `Delivered`, or a `Placed` or `Paid` order is canceled. |

The webhook body uses PascalCase field names and leaves out any field that has no value:

| Field              | Description                                                                        |
| ------------------ | ---------------------------------------------------------------------------------- |
| `Event`            | The event name, such as `DeviceOrderPlaced`.                                       |
| `OrderNumber`      | The order number, such as `DO-000035`.                                             |
| `Status`           | The order's status when the event was sent.                                        |
| `PreviousStatus`   | The order's status before the change. Set only on `DeviceOrderStatusChanged`.      |
| `PaymentStatus`    | The order's payment status when the event was sent.                                |
| `PaymentOption`    | How the order is paid for, such as `PayNow`.                                       |
| `OrganizationId`   | The ID of the organization that placed the order.                                  |
| `OrganizationName` | The name of the organization that placed the order.                                |
| `PaypointId`       | The ID of the paypoint the order is for. Not sent for an organization-level order. |
| `PaypointName`     | The name of the paypoint the order is for.                                         |
| `EntryName`        | The paypoint's entry name. Not sent for an organization-level order.               |
| `Total`            | The order total, including shipping.                                               |
| `Currency`         | The three-letter ISO 4217 currency code.                                           |
| `ContactEmail`     | The contact email for the order.                                                   |
| `TrackingCarrier`  | The shipping carrier, after Payabli dispatches the order.                          |
| `TrackingNumber`   | The carrier's tracking number, after Payabli dispatches the order.                 |
| `TrackingUrl`      | The carrier's tracking page for the shipment.                                      |

## List and export orders

To list device orders, send a `GET` request to `/Query/deviceOrders/{entry}` for a paypoint, or to `/Query/deviceOrders/org/{orgId}` for an organization. Results include only the orders you're authorized to see, and they're sorted newest first by default. Filter the results with query parameters, for example `status(in)=Paid|Dispatched` or `orderDate(ge)=2026-10-01`. To export the results as a file, add `exportFormat=csv` or `exportFormat=xlsx`.

For the full list of filters, see [List device orders by paypoint](/developers/api-reference/device-orders/get-list-of-device-orders-for-a-paypoint). For operator syntax and paging, see the [Filters and conditions reference](/guides/pay-ops-reporting-overview#filters-and-conditions-reference).

## Handle errors

| Status | Code   | Meaning                                                                                                                                                                                                                                                                                 | What to do                                                                                                                                  |
| ------ | ------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------- |
| `400`  |        | The request failed validation. `responseData` lists each field error as `field` and `message`. A missing `Idempotency-Key` header returns `responseData.explanation` instead. A missing required property, such as `termsAccepted`, returns a validation error with an `errors` object. | Fix the request and send it again.                                                                                                          |
| `401`  | `9001` | You aren't authorized for the organization or paypoint.                                                                                                                                                                                                                                 | Check the recipient and your API token's permissions.                                                                                       |
| `402`  | `9020` | The card was declined on `/pay`. The order isn't affected.                                                                                                                                                                                                                              | Collect a card again, get a new temporary token, and call `/pay` with the new ID.                                                           |
| `400`  |        | Device ordering isn't turned on for the organization. `responseData` returns `organizationId` with the message `Device ordering is not enabled for this organization.`                                                                                                                  | [Check that device ordering is enabled](#check-that-device-ordering-is-enabled) before you show it to users. Contact Payabli to turn it on. |
| `404`  | `9009` | The order doesn't exist, or you aren't authorized to see it.                                                                                                                                                                                                                            | Check the order number.                                                                                                                     |
| `409`  |        | The action isn't allowed from the order's current status. `responseData.allowedNextStates` lists the statuses that are.                                                                                                                                                                 | Read the order again. To cancel, use `allowedNextStates`. To pay, check that `status` is `Placed` and `payment.paymentStatus` is `Pending`. |