> This page is for Server SDKs.

> Fetch clean Markdown by appending `.md` to any page URL under https://signalwire.com/docs or requesting it with the HTTP header `Accept: text/markdown`. The root index at https://signalwire.com/docs/llms.txt lists the available documentation indexes.

# list_orders

> List number assignment orders for a campaign.

List number assignment orders for a campaign.

### Schema

```yaml
openapi: 3.1.0
info:
  title: API
  version: 1.0.0
paths:
  /api/relay/rest/registry/beta/campaigns/{id}/orders:
    get:
      operationId: subpackageCampaignRegistryPhoneNumberAssignments_list_orders
      summary: List phone number assignment orders
      description: >-
        Lists the batch requests submitted to bind project phone numbers to one
        US 10-digit long code (10DLC) campaign. Use it to monitor assignment
        processing; use [List phone number
        assignments](/docs/apis/rest/campaign-registry/phone-number-assignments/list-number-assignments)
        for the resulting bindings.


        #### Permissions


        The API token used to authenticate must have the following scope(s)
        enabled to make a successful request: _Messaging_ and _Numbers_.


        [Learn more about API scopes](/docs/platform/your-signalwire-api-space).
      tags:
        - subpackage_campaignRegistryPhoneNumberAssignments
      parameters:
        - name: id
          in: path
          description: Unique ID of the campaign.
          required: true
          schema:
            $ref: '#/components/schemas/uuid'
        - name: filter_state
          in: query
          description: >-
            The state of the orders in the registration process, such as pending
            or processed. Will return all orders with this value.
          required: false
          schema:
            type: string
      responses:
        '200':
          description: The request has succeeded.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OrderListResponse'
        '401':
          description: Access is unauthorized.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Types.StatusCodes.StatusCode401'
        '404':
          description: The server cannot find the requested resource.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Types.StatusCodes.StatusCode404'
        '500':
          description: An internal server error occurred.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Types.StatusCodes.StatusCode500'
tags:
  - name: subpackage_campaignRegistryPhoneNumberAssignments
servers:
  - url: https://%7BYour_Space_Name%7D.signalwire.com
    description: SignalWire API
components:
  schemas:
    uuid:
      type: string
      format: uuid
      description: Universal Unique Identifier.
      title: uuid
    PaginationLinks:
      type: object
      properties:
        self:
          type: string
          description: Link to the current page.
        first:
          type: string
          description: Link to the first page.
        next:
          type: string
          description: Link to the next page. Only present when there are more results.
        prev:
          type: string
          description: Link to the previous page. Only present when not on the first page.
      required:
        - self
        - first
      description: Pagination links for list responses.
      title: PaginationLinks
    Order:
      type: object
      properties:
        id:
          $ref: '#/components/schemas/uuid'
          description: The unique identifier of the order.
        state:
          type: string
          description: The current state of the order.
        processed_at:
          type: string
          format: date-time
          description: Timestamp when the order was processed.
        created_at:
          type: string
          format: date-time
          description: Timestamp when the order was created.
        updated_at:
          type: string
          format: date-time
          description: Timestamp when the order was last updated.
        status_callback_url:
          type: string
          description: >-
            Optional: Specify a URL to receive webhook notifications when your
            number assignment order and the number assignments that belong to it
            change state. See the [10DLC status
            callback](/docs/apis/rest/webhooks/ten-dlc-status-callback) docs for
            the webhook payload.
      required:
        - id
      description: Order model for campaign registry operations.
      title: Order
    OrderListResponse:
      type: object
      properties:
        links:
          $ref: '#/components/schemas/PaginationLinks'
          description: Pagination links.
        data:
          type: array
          items:
            $ref: '#/components/schemas/Order'
          description: List of orders.
      description: Response containing a list of orders.
      title: OrderListResponse
    TypesStatusCodesStatusCode401Error:
      type: string
      enum:
        - Unauthorized
      title: TypesStatusCodesStatusCode401Error
    Types.StatusCodes.StatusCode401:
      type: object
      properties:
        error:
          $ref: '#/components/schemas/TypesStatusCodesStatusCode401Error'
      required:
        - error
      description: Access is unauthorized.
      title: Types.StatusCodes.StatusCode401
    TypesStatusCodesStatusCode404Error:
      type: string
      enum:
        - Not Found
      title: TypesStatusCodesStatusCode404Error
    Types.StatusCodes.StatusCode404:
      type: object
      properties:
        error:
          $ref: '#/components/schemas/TypesStatusCodesStatusCode404Error'
      required:
        - error
      description: The server cannot find the requested resource.
      title: Types.StatusCodes.StatusCode404
    TypesStatusCodesStatusCode500Error:
      type: string
      enum:
        - Internal Server Error
      title: TypesStatusCodesStatusCode500Error
    Types.StatusCodes.StatusCode500:
      type: object
      properties:
        error:
          $ref: '#/components/schemas/TypesStatusCodesStatusCode500Error'
      required:
        - error
      description: An internal server error occurred.
      title: Types.StatusCodes.StatusCode500

```

## **Response Example**

### Response (200)

```json
{
  "links": {
    "self": "string",
    "first": "string",
    "next": "string",
    "prev": "string"
  },
  "data": [
    {
      "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
      "state": "pending",
      "processed_at": "2024-01-15T09:30:00Z",
      "created_at": "2024-01-15T09:30:00Z",
      "updated_at": "2024-01-15T09:30:00Z",
      "status_callback_url": "https://example.com/handle_callback"
    }
  ]
}
```

## **Example**

```python {9}
from signalwire.rest import RestClient

client = RestClient(
    project="your-project-id",
    token="your-api-token",
    host="your-space.signalwire.com",
)

orders = client.registry.campaigns.list_orders("campaign-id")
for order in orders.get("data", []):
    print(order.get("id"), order.get("status"))
```