> For the complete documentation index, see [llms.txt](https://apidocs.akinon.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://apidocs.akinon.com/commerce-openapis/admin/bin-numbers/list-bin-numbers.md). Agents can also search and read this documentation through its [MCP server](https://apidocs.akinon.com/~gitbook/mcp).

# List bin numbers

Returns a paginated list of bin numbers, ordered by identifier ascending.

Use `id`, `card`, or `bin_number` to narrow the list. Each of these filters matches the whole value exactly, so `?bin_number=454671` returns the record while `?bin_number=4546` returns an empty page. Query parameters other than the ones listed below are ignored.

Deactivated records are included in the response and can be told apart by their `is_active` value; there is no filter for the active state.

Results can be ordered with `sort` on `pk`, `bin_number`, `card`, and `is_active`.

```json
{"openapi":"3.1.0","info":{"title":"Admin API","version":"1.0.0"},"tags":[{"name":"Bin Numbers","description":"Administrative endpoints for **bin numbers** — the leading digits of a payment card that identify the bank and the card programme that issued it. Each record binds one set of leading digits to a card definition, so that when a customer starts typing a card number on the storefront the platform can recognise which card it is and offer the installment options, terminals and 3D secure rules configured for that card.\n\nA record is small: the digits themselves, the card they belong to, and whether the record is in use.\n\n## Core Capabilities\n\n**1. Listing & Filtering**\n* Retrieve a paginated list of bin numbers, ordered by identifier ascending.\n* Filter by identifier, card or the digits themselves. All three filters match the whole value exactly; a partial value returns an empty page.\n* Order results with the `sort` parameter, as described under **Filtering & Ordering**.\n\n**2. Lifecycle Management**\n* Register a set of leading digits against a card.\n* Fully or partially update an existing record.\n* Deactivate a record. `DELETE` is a **soft delete** — the record is kept and its digits stay reserved. See **Deleting a Bin Number**.\n\n**3. Uniqueness**\n* The digits identify the record and must be unique across all bin numbers, deactivated ones included. A create or update that would repeat digits already stored is rejected.\n\n## Bin Number Fields\n\n| Field | Type | Description |\n|-------|------|-------------|\n| `pk` | integer | The unique identifier of the record. Assigned by the server; supplying it in a request body has no effect. |\n| `bin_number` | string | The leading digits of the card. Required on create and on full update, optional on a partial update. Exactly 6 or 8 characters, digits only, and unique across all records. It may not be sent as `null`. See **Accepted Digits**. |\n| `card` | integer | The identifier of the card these digits belong to. Required on create and on full update. |\n| `is_active` | boolean | Whether the record is in use. Defaults to `true` on create. A deactivated record is still returned by the listing and retrieval endpoints. |\n| `bin_number_length` | string | Read-only. The number of characters in `bin_number`, reported as text — `\"6\"` or `\"8\"`. Sending it in a request body has no effect. |\n\n## Accepted Digits\n\nA value for `bin_number` is accepted only when it is exactly 6 or 8 characters long and made up entirely of digits. There is a single exception: the placeholder value reserved for Google Pay, which contains letters and is configured per deployment. See **Dynamic Settings & Environment Variables**.\n\n## Deleting a Bin Number\n\n> **Important:** `DELETE` never removes the record. Its active state is set to `false`, and it keeps appearing in the list and can still be retrieved by its identifier.\n\nTwo consequences are worth knowing:\n\n* The digits stay reserved. They cannot be registered again on another card while the deactivated record exists — reuse the existing record instead, by setting `is_active` back to `true`.\n* Deletion is never refused. Because the record is kept, no other record can block the request the way a still-referenced bank or card would.\n\n## Filtering & Ordering\n\nBin numbers can be filtered with the `id`, `card`, and `bin_number` query parameters. Each is an **exact** match — `?bin_number=454671` returns the record, while `?bin_number=4546` returns an empty page. Query parameters that are not listed here are ignored rather than rejected. There is no filter for the active state; deactivated records are always included and have to be told apart by their `is_active` value.\n\nResults can be ordered with the `sort` parameter on `pk`, `bin_number`, `card`, and `is_active`. Prefix the field with a hyphen for descending order, and separate several fields with commas. `bin_number_length` is calculated while the response is built rather than stored, so it cannot be used for ordering. When `sort` is omitted, records are returned by identifier ascending.\n\n## Dynamic Settings & Environment Variables\n\nNo dynamic settings (`dj_dynamic_settings`) are read by these endpoints. Listing, filtering, creation, update, and deactivation behave identically regardless of how the management panel is configured. The payment module's dynamic settings — such as the 3D Secure and installment settings — govern how payments are processed on the storefront and have no effect on the administrative endpoints in this section.\n\n**Environment variables:** One deployment setting changes what these endpoints accept.\n\n| Variable | Type | Default | Effect |\n|----------|------|---------|--------|\n| `GPAY_BIN_NUMBER` | string | `GPAY00` | The placeholder value that stands in for a card paid through Google Pay, where the real leading digits are never disclosed to the store. It is the only value exempt from the digits-only rule, so it can be stored as a `bin_number` even though it contains letters. The length rule still applies: the value must be 6 or 8 characters long, otherwise it is rejected like any other input. Changing it on a running deployment does not rewrite records already stored. |"}],"servers":[{"description":"Omnitron Remote Proxy (external access — recommended)","url":"https://{omnitron_url}/api/v1/remote/{channel_id}","variables":{"omnitron_url":{"default":"sandbox.akinon.com","description":"Omnitron server URL (e.g., {omnitron.akinon.com})"},"channel_id":{"default":"1","description":"The channel identifier the remote request is routed through"}}},{"description":"Commerce API Server (internal / direct access only)","url":"https://{commerce_url}/api/v1","variables":{"commerce_url":{"default":"sandbox.akinon.com","description":"Internal commerce server URL, reachable only from within the Omnitron network"}}}],"security":[{"tokenAuth":[]}],"components":{"securitySchemes":{"tokenAuth":{"type":"apiKey","in":"header","name":"Authorization","description":"Token credential sent in the Authorization header, in the form: `Token <your-token>`. Requires a staff (admin) account."}},"parameters":{"page":{"name":"page","in":"query","required":false,"description":"The page number to return.","schema":{"type":"integer","default":1}},"limit":{"name":"limit","in":"query","required":false,"description":"The number of items to return per page.","schema":{"type":"integer","default":10}},"sort":{"name":"sort","in":"query","required":false,"description":"Orders the results by one or more fields. Separate multiple fields with commas. Prefix a field with a hyphen (`-`) for descending order.","schema":{"type":"string"}}},"schemas":{"PaginatedBinNumberList":{"type":"object","description":"A paginated list of bin numbers.","properties":{"count":{"type":"integer","description":"Total number of bin numbers matching the request."},"next":{"type":["string","null"],"format":"uri","description":"URL of the next page, or `null` if this is the last page."},"previous":{"type":["string","null"],"format":"uri","description":"URL of the previous page, or `null` if this is the first page."},"results":{"type":"array","description":"The bin numbers on the current page.","items":{"$ref":"#/components/schemas/BinNumber"}}}},"BinNumber":{"type":"object","description":"A bin number record — the leading digits of a card, bound to the card definition they belong to.","properties":{"pk":{"type":"integer","readOnly":true,"description":"The unique identifier of the record."},"bin_number":{"type":"string","maxLength":8,"description":"The leading digits of the card. Exactly 6 or 8 characters, and unique across all records."},"card":{"type":"integer","description":"The identifier of the card these digits belong to."},"is_active":{"type":"boolean","description":"Whether the record is in use. A deactivated record is still returned by the listing and retrieval endpoints."},"bin_number_length":{"type":"string","readOnly":true,"description":"The number of characters in `bin_number`, reported as text — `\"6\"` or `\"8\"`."}}},"ValidationError":{"type":"object","description":"Returned when the request contains invalid or missing data. Errors are grouped by the field they apply to: each key is the name of a field from the request and its value is a list of one or more messages describing what is wrong with that field. Messages that do not belong to any single field are grouped under `non_field_errors`.","properties":{"non_field_errors":{"type":"array","description":"Error messages that apply to the request as a whole rather than to a specific field.","items":{"type":"string"}}},"additionalProperties":{"type":"array","description":"The list of error messages for the field named by the key.","items":{"type":"string"}}},"Error":{"type":"object","description":"An error response.","properties":{"detail":{"type":"string","description":"A human-readable description of the error."}},"additionalProperties":true}},"responses":{"ValidationError":{"description":"The request contains invalid or missing data.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"Unauthorized":{"description":"Authentication credentials were not provided or are invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Forbidden":{"description":"The authenticated user does not have administrator privileges.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"BinNumberPageNotFound":{"description":"The requested page of the bin number list does not exist — the page number is beyond the last page or is not a number.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"paths":{"/bin_numbers/":{"get":{"tags":["Bin Numbers"],"operationId":"listBinNumbers","summary":"List bin numbers","description":"Returns a paginated list of bin numbers, ordered by identifier ascending.\n\nUse `id`, `card`, or `bin_number` to narrow the list. Each of these filters matches the whole value exactly, so `?bin_number=454671` returns the record while `?bin_number=4546` returns an empty page. Query parameters other than the ones listed below are ignored.\n\nDeactivated records are included in the response and can be told apart by their `is_active` value; there is no filter for the active state.\n\nResults can be ordered with `sort` on `pk`, `bin_number`, `card`, and `is_active`.","parameters":[{"$ref":"#/components/parameters/page"},{"$ref":"#/components/parameters/limit"},{"$ref":"#/components/parameters/sort"},{"name":"id","in":"query","description":"Filter by the exact identifier of a bin number record.","required":false,"schema":{"type":"integer"}},{"name":"card","in":"query","description":"Filter by the identifier of the card the digits belong to.","required":false,"schema":{"type":"integer"}},{"name":"bin_number","in":"query","description":"Filter by the leading digits. Exact match; partial values return an empty page.","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"A page of bin numbers.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaginatedBinNumberList"}}}},"400":{"$ref":"#/components/responses/ValidationError"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/BinNumberPageNotFound"}}}}}}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://apidocs.akinon.com/commerce-openapis/admin/bin-numbers/list-bin-numbers.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
