> 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

# List order recipients

GET https://api-sandbox.payabli.com/api/DeviceOrder/recipients

Returns the organizations and paypoints you can order devices for.
Partners see their own organizations and everything beneath them.

This endpoint requires the `deviceorder_read` permission.


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

## 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)

## Response

### 200

Success

- `responseText` (string, required) — Response text for operation: 'Success' or 'Declined'.
- `responseData` (DeviceOrderRecipients, required) — The organizations and paypoints you can order devices for.
- `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

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

### DeviceOrderRecipients

The organizations and paypoints you can order devices for.

- `organizations` (list of DeviceOrderRecipientOrganization, required) — The organizations you can order devices for.
- `paypoints` (list of DeviceOrderRecipientPaypoint, required) — The paypoints you can order devices for.

### PayabliErrorBodyResponseData

Object with detailed error context.

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

### DeviceOrderRecipientOrganization

An organization you can order devices for.

- `id` (long, required) — The organization ID. Send it as `organizationId` in the order request.
- `name` (string, required) — The organization's name.
- `entryName` (string, required, nullable) — The organization's entry name. `null` when the organization has no entry name.
- `parentId` (long, required) — The ID of the organization's parent organization.
- `deviceOrderingEnabled` (boolean, required) — Whether device ordering is enabled for the organization.

### DeviceOrderRecipientPaypoint

A paypoint you can order devices for.

- `id` (long, required) — The paypoint ID.
- `name` (string, required) — The paypoint's name.
- `entryName` (string, required, nullable) — The paypoint's entry name. Send it as `entryName` in the order request. `null` when the paypoint has no entry name.
- `organizationId` (long, required) — The ID of the paypoint's parent organization.

## Examples

**Response**

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

**SDK Code**

```python
import requests

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

headers = {"Authorization": "Bearer <token>"}

response = requests.get(url, headers=headers)

print(response.json())
```

```javascript
const url = 'https://api-sandbox.payabli.com/api/DeviceOrder/recipients';
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};

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"
	"net/http"
	"io"
)

func main() {

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

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("Authorization", "Bearer <token>")

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

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

HttpResponse<String> response = Unirest.get("https://api-sandbox.payabli.com/api/DeviceOrder/recipients")
  .header("Authorization", "Bearer <token>")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api-sandbox.payabli.com/api/DeviceOrder/recipients', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
  ],
]);

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

```csharp
using RestSharp;

var client = new RestClient("https://api-sandbox.payabli.com/api/DeviceOrder/recipients");
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "Bearer <token>");
IRestResponse response = client.Execute(request);
```

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