Sign inGet Started

List your number orders

GET
/v1/numbers/orders
const page = await bird.numbers.orders.list({ status: "failed" });
for (const order of page.data) {
  console.log(order.number, order.failure_reason ?? "");
}
Respons200
{
  "data": [
    {
      "id": "nor_01krdgeqcxet5s7t44vh8rt9mg",
      "country_code": "US",
      "number_type": "mobile",
      "status": "charging",
      "number_id": "nda_01krdgeqcxet5s7t44vh8rt9mg"
    }
  ],
  "next_cursor": "eyJ2IjoxLCJzIjoiXCIyMDI2LTA1LTI1VDE0OjAzOjEwWlwiIiwiaSI6IjAxOTJmM2IxLTRjN2UtN2EyYi05ZDYxLThmM2E1YzJlN2I0MCJ9",
  "prev_cursor": null,
  "refresh_cursor": "eyJ2IjoxLCJzIjoiXCIyMDI2LTA1LTI1VDE2OjQyOjAxWlwiIiwiaSI6IjAxOTJmM2IxLTllMDQtN2NkMy1iODE3LTJhNmY0ZDFjOGUwOSJ9"
}

Returns your workspace's number orders, newest first. Filter by status to find in-progress or failed orders.

Parameter Kueri

statusstring

Return only orders with status charging, ordering, pending, completed, or failed.

Possible values (may grow over time): charging, ordering, pending, completed, failed

limitinteger

Maximum number of items to return per page.

starting_afterstring

Cursor from the next_cursor field of a previous list response. Returns items immediately after the cursor position in the current sort order.

ending_beforestring

Cursor from the prev_cursor or refresh_cursor field of a previous list response. Returns items immediately before the cursor position in the current sort order. prev_cursor returns the preceding page. refresh_cursor anchors at the first row of that response, which on a newest-first sort is how to fetch the items that have appeared since.

Payload Respons

data
array of object
wajib
Tampilkan atribut turunan
data.id
string
wajib

Identifier of this purchase order.

data.number
string
wajib

The number being acquired, in E.164 format.

data.country_code
string
wajib

ISO 3166-1 alpha-2 country code.

data.number_type
string
wajib

Physical type of the number being acquired.

Possible values (may grow over time): mobile, local, national, short_code, short_code_fteu, toll_free

data.status
string
wajib

Lifecycle state of a number purchase order:

  • charging: Securing funds.
  • ordering: Placing the order with the carrier.
  • pending: The carrier accepted the order and is provisioning the number.
  • completed: Your workspace owns the number.
  • failed: The purchase did not complete.

A setup fee already charged is non-refundable. Contact support about a failed order.

Possible values (may grow over time): charging, ordering, pending, completed, failed

data.number_id
nullable string

Identifier of the number this order produced, set when status is completed. Pass it as number_id to GET /v1/numbers/{number_id} or DELETE /v1/numbers/{number_id}. null until the order completes.

data.failure_reason
nullable string

Human-readable reason the purchase failed. null unless status is failed. An order can fail some time after it was created, so updated_at tells you when the failure was recorded rather than when the order was placed.

data.completed_at
nullable string

When the purchase completed and the number became owned (status completed). null for orders still in progress or failed.

data.created_at
string
wajib
data.updated_at
string
wajib
next_cursor
nullable string
wajib

Cursor for the next page. Pass back as starting_after to advance forward. null when no next page exists.

prev_cursor
nullable string
wajib

Cursor for the previous page. Pass back as ending_before to step backward. null when no previous page exists.

refresh_cursor
nullable string
wajib

Refresh anchor, the first row of this response. Pass back as ending_before to fetch what precedes it in the current sort order. On a newest-first sort those are the items that have appeared since; on any other sort they are the items that sort earlier, so refreshing such a list means re-fetching it instead. Non-null whenever data is non-empty; null only on an empty page. Distinct from prev_cursor.

Lanjutkan dengan dokumentasi, panduan, dan contoh untuk topik ini.