> For the complete documentation index, see [llms.txt](https://docs.xyb.co/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.xyb.co/xyb-platform-1/api-reference/accounts/query-accounts-apis.md).

# Query Accounts APIs

## GET /api/v2.0/account

> Query accounts

```json
{"openapi":"3.0.3","info":{"title":"Account Service","version":"0.18.1-bb9ff03"},"paths":{"/api/v2.0/account":{"get":{"tags":["AccountController"],"description":"Query accounts","operationId":"AccountController::queryAccounts","parameters":[{"name":"filter","in":"query","required":false,"schema":{"type":"string"}},{"name":"page[size]","in":"query","required":false,"schema":{"type":"string"}},{"name":"page[number]","in":"query","required":false,"schema":{"type":"string"}},{"name":"sort","in":"query","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Response to /api/v2.0/account","content":{"application/json":{"schema":{"type":"object","properties":{"record_count":{"type":"integer","description":"The total number of records in the dataset. The record count may return zero if there are no records in the dataset."},"page_number":{"type":"integer","description":"The number of the page within the complete dataset. This is indexed from 1."},"page":{"type":"array","items":{"$ref":"#/components/schemas/cac_account_schema_account_lite"},"description":"A list of the records included in the page. The length of the list may be zero; it SHOULD NOT exceed the quoted page size."},"continuation":{"type":"string"},"page_count":{"type":"integer","description":"The largest page number that yield an empty page. The page count may return zero if there are no records in the dataset."},"page_size":{"type":"integer","description":"The size of page that was requested (or defaulted). This is the maximum number of records that will be returned in the page."}},"required":["page_number","page_size","page"]}}}}}}}},"components":{"schemas":{"cac_account_schema_account_lite":{"type":"object","properties":{"attributes":{"type":"object","additionalProperties":{"type":"string"},"description":"A collection of account attributes."},"created_at":{"type":"string","format":"date-time","description":"The time at which the account was created in the XYB system."},"id":{"type":"string","format":"uuid","description":"A globally unique identifier for the account, generated on creation."},"name":{"type":"string","description":"Customer defined name of the account."},"product_uuid":{"type":"string","format":"uuid","description":"Product UUID of the account"},"product_version":{"type":"string","description":"Product Version of the account"},"reference":{"type":"string","description":"A globally unique identifier for the account."},"status":{"type":"string","enum":["PENDING","OPEN","SUSPENDED","SUSPENDED_OUT","SUSPENDED_IN","CLOSED","TERMINATED","BLOCKED"],"description":"Account status"},"updated_at":{"type":"string","format":"date-time","description":"The time at which the account was created in the XYB system."}},"required":["id","reference","product_uuid","product_version","name","status","created_at","updated_at"],"title":"AccountLite"}}}}
```

## GET /api/v2.0/account/list

> Returns list of account by uuids or external references

```json
{"openapi":"3.0.3","info":{"title":"Account Service","version":"0.18.1-bb9ff03"},"paths":{"/api/v2.0/account/list":{"get":{"tags":["AccountController"],"description":"Returns list of account by uuids or external references","operationId":"AccountController::getAllByIds","parameters":[{"name":"ids","in":"query","required":false,"style":"form","explode":true,"schema":{"type":"array","items":{"type":"string","format":"uuid"}}},{"name":"refs","in":"query","required":false,"style":"form","explode":true,"schema":{"type":"array","items":{"type":"string"}}}],"responses":{"200":{"description":"Response to /api/v2.0/account/list","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/cac_account_schema_account"}}}}}}}}},"components":{"schemas":{"cac_account_schema_account":{"type":"object","properties":{"account_coordinates":{"type":"array","items":{"$ref":"#/components/schemas/cac_account_schema_account_coordinates"},"description":"The coordinates that apply (or have applied) to the account."},"attributes":{"type":"object","additionalProperties":{"type":"string"},"description":"A collection of account attributes."},"created_at":{"type":"string","format":"date-time","description":"The time at which the account was created in the XYB system."},"currency":{"type":"string","description":"The currency in which the account is denominated."},"default_wallet":{"type":"string","description":"Default wallet code of the account"},"id":{"type":"string","format":"uuid","description":"A globally unique identifier for the account, generated on creation."},"jurisdictions":{"type":"array","items":{"$ref":"#/components/schemas/cac_account_schema_jurisdiction"},"description":"The jurisdictions under which the account has operated, ordered by the date since the jurisdiction has applied (increasing)."},"name":{"type":"string","description":"Customer defined name of the account."},"owner":{"$ref":"#/components/schemas/cda_entity_schema_entity_entity","description":"The owner of the account, see Owning Entities."},"product_uuid":{"type":"string","format":"uuid","description":"Product UUID of the account"},"product_version":{"type":"string","description":"Product Version of the account"},"reference":{"type":"string","description":"A globally unique identifier for the account."},"state":{"type":"string","enum":["PENDING","OPEN","SUSPENDED","SUSPENDED_OUT","SUSPENDED_IN","CLOSED","TERMINATED","BLOCKED"],"description":"One of the Account States."},"state_changes":{"type":"array","items":{"$ref":"#/components/schemas/cac_account_schema_account_state_change"},"description":"The states of the account over time, ordered by the date at which the state was applied (increasing)."},"state_id":{"type":"string","format":"uuid","description":"An globally unique identifier that is updated on each recorded change of the state field to match the id of the associated AccountStateChange."},"updated_at":{"type":"string","format":"date-time","description":"The time at which the account was updated in the XYB system."},"wallets":{"type":"array","items":{"$ref":"#/components/schemas/cac_account_schema_wallet_live"},"description":"Account wallets list with balances"}},"required":["id","reference","currency","product_uuid","product_version","owner","name","state","created_at","updated_at"],"title":"Account"},"cac_account_schema_account_coordinates":{"type":"object","properties":{"coordinates":{"$ref":"#/components/schemas/pay_payment_schema_account_coords","description":"Records an IBAN, account number, etc. for an account."},"external":{"type":"object","additionalProperties":{"type":"string"},"description":"Strictly optional external information for account coordinates."},"id":{"type":"string","format":"uuid","description":"A globally unique identifier for the account, generated on creation."},"tags":{"type":"array","items":{"type":"string"},"description":"Strictly optional application-scoped tags for the account coordinates."}},"required":["id","coordinates"],"title":"AccountCoordinates"},"pay_payment_schema_account_coords":{"type":"object","properties":{"acceptor":{"$ref":"#/components/schemas/pay_payment_schema_acceptor"},"banking":{"$ref":"#/components/schemas/schema_payment_banking_coords_carrier"},"external":{"type":"object","additionalProperties":{"type":"string"}},"internal":{"$ref":"#/components/schemas/pay_payment_schema_internal_coords"},"reference":{"type":"string"}},"title":"AccountCoords","description":"A standard way of transmitting account coordinates between services."},"pay_payment_schema_acceptor":{"type":"object","properties":{"acquirer_id":{"type":"string","description":"The id of the acquirer on the card network"},"facilitator_id":{"type":"string","description":"The id of the payment facilitator (sub acceptor)"},"id":{"type":"string","description":"The id of the acceptor on the card network"},"mcc":{"type":"string","description":"The merchant category code, four numerical digits 0000-9999"},"terminal_id":{"type":"string","description":"Unique id identifying the terminal used"}},"title":"Acceptor","description":"A merchant qualified to accept credit or debit cards as payment"},"schema_payment_banking_coords_carrier":{"type":"object","properties":{"account_code":{"type":"string","description":"Used to record the combined account number and routing code (CLABE in MX)"},"account_number":{"type":"string","description":"Account number."},"account_type":{"type":"string","description":"Account type - has a national meaning in GT, IS, BR and BG."},"balance_account_number":{"type":"string","description":"The balance account according to the chart of accounts - used in Belarus. See https://www.nbrb.by/engl/payment/ibanbic"},"bank_code":{"type":"string","description":"The national bank code (as opposed to BIC.)"},"bic":{"type":"string","description":"The BIC code"},"bic_bank_code":{"type":"string","description":"The 4 letter SWIFT bank code."},"bic_branch_code":{"type":"string","description":"The 3 character SWIFT branch code."},"bic_location_code":{"type":"string","description":"The 2 character SWIFT location code."},"branch_code":{"type":"string","description":"Branch code (sort-code in UK, guichet-code in FR.)"},"country_code":{"type":"string","description":"Required in the absence of a BIC or IBAN"},"currency":{"type":"string","description":"Used in GT, MU & SC (two character in GT, three character elsewhere.)"},"iban":{"type":"string","description":"The account coordinates as an IBAN"},"national_id":{"type":"string","description":"National identifier - IS kennitala."},"owner_account_number":{"type":"string","description":"Used to identify individual accounts in Brazil."},"routing_code":{"type":"string","description":"Identifies the bank for an account, often combines institution and branch data."}},"title":"BankingCoordsCarrier","description":"Banking coordinates."},"pay_payment_schema_internal_coords":{"type":"object","properties":{"account_id":{"type":"string","format":"uuid","description":"The Monese assigned id for the account. This is not necessarily the id assigned by the ledger holder."},"account_reference":{"type":"string","description":"The reference for the account"},"card_id":{"type":"string","format":"uuid","description":"The Monese assigned card id for the account."},"contact_account_id":{"type":"string","description":"A id that reference a contact account."},"currency_code":{"type":"string","description":"The denomination of funds within the account."},"legacy_account_id":{"description":"The legacy Monese assigned id for the account.","type":"integer","format":"int64"}},"title":"InternalCoords","description":"Account coordinates that are used to conveniently identify accounts within the Monese system."},"cac_account_schema_jurisdiction":{"type":"object","properties":{"classification":{"type":"string","enum":["INTERNATIONAL","SUPRANATIONAL","NATIONAL","SUBNATIONAL"],"description":"One of INTERNATIONAL, SUPRANATIONAL, NATIONAL, SUBNATIONAL"},"country_code":{"type":"string","description":"The 3 letter country code for the national geographic boundary of the jurisdiction where one applies."}},"required":["classification","country_code"],"title":"Jurisdiction"},"cda_entity_schema_entity_entity":{"type":"object","properties":{"affiliation":{"type":"string","enum":["CUSTOMER","INTERNAL","EXTERNAL"],"description":"Describes the relationship the entity has with Monese."},"aspects":{"type":"array","items":{"$ref":"#/components/schemas/cda_entity_schema_entity_aspect_entity_aspect"},"description":"The list of aspects associated with the Entity"},"reference":{"type":"string","description":"Possibly a company number, a service identifier or an employee code"},"type":{"type":"string","enum":["INDIVIDUAL","ORGANIZATION","COLLECTIVE","VIRTUAL"],"description":"The type of the entity; determines how any entity reference is interpreted."}},"required":["type","affiliation"],"title":"Entity","description":"Something or someone who owns an account, or who interacts directly or indirectly with the system."},"cda_entity_schema_entity_aspect_entity_aspect":{"type":"object","properties":{"aspect":{"$ref":"#/components/schemas/cda_entity_schema_entity_aspect_aspect","description":"Concrete aspect"},"identifier":{"type":"string","format":"uuid","description":"A unique identifier for the aspect"},"relation":{"type":"string","description":"May be used to disambiguate aspects of the same type associated with the same entity"}},"required":["identifier","aspect"],"title":"EntityAspect"},"cda_entity_schema_entity_aspect_aspect":{"type":"object","properties":{},"title":"Aspect"},"cac_account_schema_account_state_change":{"type":"object","properties":{"account_id":{"type":"string","format":"uuid","description":"A globally unique internal identifier for account"},"applied_at":{"type":"string","format":"date-time","description":"The ISO-8601 time at which the state was applied."},"external_reference":{"type":"string","description":"A globally unique external identifier for account"},"id":{"type":"string","format":"uuid","description":"A globally unique identifier assigned on state change."},"previous_state":{"type":"string","enum":["PENDING","OPEN","SUSPENDED","SUSPENDED_OUT","SUSPENDED_IN","CLOSED","TERMINATED","BLOCKED"],"description":"Account previous state value. One of OPEN , BLOCKED , CLOSED or FINALIZED ."},"reason":{"type":"string","description":"A human-readable reason for the change of account state."},"state":{"type":"string","enum":["PENDING","OPEN","SUSPENDED","SUSPENDED_OUT","SUSPENDED_IN","CLOSED","TERMINATED","BLOCKED"],"description":"One of OPEN , BLOCKED , CLOSED or FINALIZED ."}},"required":["id","state","applied_at"],"title":"AccountStateChange"},"cac_account_schema_wallet_live":{"type":"object","properties":{"account_balance":{"type":"string","description":"Wallet LIVE balance"},"available_balance":{"type":"string","description":"Wallet LIVE available balance"},"code":{"type":"string","description":"Wallet code used to group wallets. DEFAULT being default wallet and SECONDARY being supporting wallets"},"currency":{"type":"string","description":"The currency in which the wallet is denominated."},"hold_balance":{"type":"string","description":"Wallet LIVE hold balance"},"updated_at":{"type":"string","format":"date-time","description":"The time at which the wallet balance was last updated"}},"required":["currency","code","available_balance","hold_balance","account_balance","updated_at"],"title":"WalletLive"}}}}
```

## GET /api/v2.0/account/owner/{customerType}/{reference}

> Deletes an account by idRef

```json
{"openapi":"3.0.3","info":{"title":"Account Service","version":"0.18.1-bb9ff03"},"paths":{"/api/v2.0/account/owner/{customerType}/{reference}":{"get":{"tags":["AccountController"],"description":"Deletes an account by idRef","operationId":"AccountController::getByOwner","parameters":[{"name":"customerType","in":"path","required":true,"schema":{"type":"string"}},{"name":"reference","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Response to /api/v2.0/account/owner/{customerType}/{reference}","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/cac_account_schema_account"}}}}}}}}},"components":{"schemas":{"cac_account_schema_account":{"type":"object","properties":{"account_coordinates":{"type":"array","items":{"$ref":"#/components/schemas/cac_account_schema_account_coordinates"},"description":"The coordinates that apply (or have applied) to the account."},"attributes":{"type":"object","additionalProperties":{"type":"string"},"description":"A collection of account attributes."},"created_at":{"type":"string","format":"date-time","description":"The time at which the account was created in the XYB system."},"currency":{"type":"string","description":"The currency in which the account is denominated."},"default_wallet":{"type":"string","description":"Default wallet code of the account"},"id":{"type":"string","format":"uuid","description":"A globally unique identifier for the account, generated on creation."},"jurisdictions":{"type":"array","items":{"$ref":"#/components/schemas/cac_account_schema_jurisdiction"},"description":"The jurisdictions under which the account has operated, ordered by the date since the jurisdiction has applied (increasing)."},"name":{"type":"string","description":"Customer defined name of the account."},"owner":{"$ref":"#/components/schemas/cda_entity_schema_entity_entity","description":"The owner of the account, see Owning Entities."},"product_uuid":{"type":"string","format":"uuid","description":"Product UUID of the account"},"product_version":{"type":"string","description":"Product Version of the account"},"reference":{"type":"string","description":"A globally unique identifier for the account."},"state":{"type":"string","enum":["PENDING","OPEN","SUSPENDED","SUSPENDED_OUT","SUSPENDED_IN","CLOSED","TERMINATED","BLOCKED"],"description":"One of the Account States."},"state_changes":{"type":"array","items":{"$ref":"#/components/schemas/cac_account_schema_account_state_change"},"description":"The states of the account over time, ordered by the date at which the state was applied (increasing)."},"state_id":{"type":"string","format":"uuid","description":"An globally unique identifier that is updated on each recorded change of the state field to match the id of the associated AccountStateChange."},"updated_at":{"type":"string","format":"date-time","description":"The time at which the account was updated in the XYB system."},"wallets":{"type":"array","items":{"$ref":"#/components/schemas/cac_account_schema_wallet_live"},"description":"Account wallets list with balances"}},"required":["id","reference","currency","product_uuid","product_version","owner","name","state","created_at","updated_at"],"title":"Account"},"cac_account_schema_account_coordinates":{"type":"object","properties":{"coordinates":{"$ref":"#/components/schemas/pay_payment_schema_account_coords","description":"Records an IBAN, account number, etc. for an account."},"external":{"type":"object","additionalProperties":{"type":"string"},"description":"Strictly optional external information for account coordinates."},"id":{"type":"string","format":"uuid","description":"A globally unique identifier for the account, generated on creation."},"tags":{"type":"array","items":{"type":"string"},"description":"Strictly optional application-scoped tags for the account coordinates."}},"required":["id","coordinates"],"title":"AccountCoordinates"},"pay_payment_schema_account_coords":{"type":"object","properties":{"acceptor":{"$ref":"#/components/schemas/pay_payment_schema_acceptor"},"banking":{"$ref":"#/components/schemas/schema_payment_banking_coords_carrier"},"external":{"type":"object","additionalProperties":{"type":"string"}},"internal":{"$ref":"#/components/schemas/pay_payment_schema_internal_coords"},"reference":{"type":"string"}},"title":"AccountCoords","description":"A standard way of transmitting account coordinates between services."},"pay_payment_schema_acceptor":{"type":"object","properties":{"acquirer_id":{"type":"string","description":"The id of the acquirer on the card network"},"facilitator_id":{"type":"string","description":"The id of the payment facilitator (sub acceptor)"},"id":{"type":"string","description":"The id of the acceptor on the card network"},"mcc":{"type":"string","description":"The merchant category code, four numerical digits 0000-9999"},"terminal_id":{"type":"string","description":"Unique id identifying the terminal used"}},"title":"Acceptor","description":"A merchant qualified to accept credit or debit cards as payment"},"schema_payment_banking_coords_carrier":{"type":"object","properties":{"account_code":{"type":"string","description":"Used to record the combined account number and routing code (CLABE in MX)"},"account_number":{"type":"string","description":"Account number."},"account_type":{"type":"string","description":"Account type - has a national meaning in GT, IS, BR and BG."},"balance_account_number":{"type":"string","description":"The balance account according to the chart of accounts - used in Belarus. See https://www.nbrb.by/engl/payment/ibanbic"},"bank_code":{"type":"string","description":"The national bank code (as opposed to BIC.)"},"bic":{"type":"string","description":"The BIC code"},"bic_bank_code":{"type":"string","description":"The 4 letter SWIFT bank code."},"bic_branch_code":{"type":"string","description":"The 3 character SWIFT branch code."},"bic_location_code":{"type":"string","description":"The 2 character SWIFT location code."},"branch_code":{"type":"string","description":"Branch code (sort-code in UK, guichet-code in FR.)"},"country_code":{"type":"string","description":"Required in the absence of a BIC or IBAN"},"currency":{"type":"string","description":"Used in GT, MU & SC (two character in GT, three character elsewhere.)"},"iban":{"type":"string","description":"The account coordinates as an IBAN"},"national_id":{"type":"string","description":"National identifier - IS kennitala."},"owner_account_number":{"type":"string","description":"Used to identify individual accounts in Brazil."},"routing_code":{"type":"string","description":"Identifies the bank for an account, often combines institution and branch data."}},"title":"BankingCoordsCarrier","description":"Banking coordinates."},"pay_payment_schema_internal_coords":{"type":"object","properties":{"account_id":{"type":"string","format":"uuid","description":"The Monese assigned id for the account. This is not necessarily the id assigned by the ledger holder."},"account_reference":{"type":"string","description":"The reference for the account"},"card_id":{"type":"string","format":"uuid","description":"The Monese assigned card id for the account."},"contact_account_id":{"type":"string","description":"A id that reference a contact account."},"currency_code":{"type":"string","description":"The denomination of funds within the account."},"legacy_account_id":{"description":"The legacy Monese assigned id for the account.","type":"integer","format":"int64"}},"title":"InternalCoords","description":"Account coordinates that are used to conveniently identify accounts within the Monese system."},"cac_account_schema_jurisdiction":{"type":"object","properties":{"classification":{"type":"string","enum":["INTERNATIONAL","SUPRANATIONAL","NATIONAL","SUBNATIONAL"],"description":"One of INTERNATIONAL, SUPRANATIONAL, NATIONAL, SUBNATIONAL"},"country_code":{"type":"string","description":"The 3 letter country code for the national geographic boundary of the jurisdiction where one applies."}},"required":["classification","country_code"],"title":"Jurisdiction"},"cda_entity_schema_entity_entity":{"type":"object","properties":{"affiliation":{"type":"string","enum":["CUSTOMER","INTERNAL","EXTERNAL"],"description":"Describes the relationship the entity has with Monese."},"aspects":{"type":"array","items":{"$ref":"#/components/schemas/cda_entity_schema_entity_aspect_entity_aspect"},"description":"The list of aspects associated with the Entity"},"reference":{"type":"string","description":"Possibly a company number, a service identifier or an employee code"},"type":{"type":"string","enum":["INDIVIDUAL","ORGANIZATION","COLLECTIVE","VIRTUAL"],"description":"The type of the entity; determines how any entity reference is interpreted."}},"required":["type","affiliation"],"title":"Entity","description":"Something or someone who owns an account, or who interacts directly or indirectly with the system."},"cda_entity_schema_entity_aspect_entity_aspect":{"type":"object","properties":{"aspect":{"$ref":"#/components/schemas/cda_entity_schema_entity_aspect_aspect","description":"Concrete aspect"},"identifier":{"type":"string","format":"uuid","description":"A unique identifier for the aspect"},"relation":{"type":"string","description":"May be used to disambiguate aspects of the same type associated with the same entity"}},"required":["identifier","aspect"],"title":"EntityAspect"},"cda_entity_schema_entity_aspect_aspect":{"type":"object","properties":{},"title":"Aspect"},"cac_account_schema_account_state_change":{"type":"object","properties":{"account_id":{"type":"string","format":"uuid","description":"A globally unique internal identifier for account"},"applied_at":{"type":"string","format":"date-time","description":"The ISO-8601 time at which the state was applied."},"external_reference":{"type":"string","description":"A globally unique external identifier for account"},"id":{"type":"string","format":"uuid","description":"A globally unique identifier assigned on state change."},"previous_state":{"type":"string","enum":["PENDING","OPEN","SUSPENDED","SUSPENDED_OUT","SUSPENDED_IN","CLOSED","TERMINATED","BLOCKED"],"description":"Account previous state value. One of OPEN , BLOCKED , CLOSED or FINALIZED ."},"reason":{"type":"string","description":"A human-readable reason for the change of account state."},"state":{"type":"string","enum":["PENDING","OPEN","SUSPENDED","SUSPENDED_OUT","SUSPENDED_IN","CLOSED","TERMINATED","BLOCKED"],"description":"One of OPEN , BLOCKED , CLOSED or FINALIZED ."}},"required":["id","state","applied_at"],"title":"AccountStateChange"},"cac_account_schema_wallet_live":{"type":"object","properties":{"account_balance":{"type":"string","description":"Wallet LIVE balance"},"available_balance":{"type":"string","description":"Wallet LIVE available balance"},"code":{"type":"string","description":"Wallet code used to group wallets. DEFAULT being default wallet and SECONDARY being supporting wallets"},"currency":{"type":"string","description":"The currency in which the wallet is denominated."},"hold_balance":{"type":"string","description":"Wallet LIVE hold balance"},"updated_at":{"type":"string","format":"date-time","description":"The time at which the wallet balance was last updated"}},"required":["currency","code","available_balance","hold_balance","account_balance","updated_at"],"title":"WalletLive"}}}}
```

## GET /api/v2.0/account/search

> Search accounts

```json
{"openapi":"3.0.3","info":{"title":"Account Service","version":"0.18.1-bb9ff03"},"paths":{"/api/v2.0/account/search":{"get":{"tags":["AccountController"],"description":"Search accounts","operationId":"AccountController::searchAccounts","parameters":[{"name":"search","in":"query","required":true,"schema":{"type":"string"}},{"name":"page[size]","in":"query","required":false,"schema":{"type":"string"}},{"name":"page[number]","in":"query","required":false,"schema":{"type":"string"}},{"name":"sort","in":"query","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Response to /api/v2.0/account/search","content":{"application/json":{"schema":{"type":"object","properties":{"record_count":{"type":"integer","description":"The total number of records in the dataset. The record count may return zero if there are no records in the dataset."},"page_number":{"type":"integer","description":"The number of the page within the complete dataset. This is indexed from 1."},"page":{"type":"array","items":{"$ref":"#/components/schemas/cac_account_schema_account_lite"},"description":"A list of the records included in the page. The length of the list may be zero; it SHOULD NOT exceed the quoted page size."},"continuation":{"type":"string"},"page_count":{"type":"integer","description":"The largest page number that yield an empty page. The page count may return zero if there are no records in the dataset."},"page_size":{"type":"integer","description":"The size of page that was requested (or defaulted). This is the maximum number of records that will be returned in the page."}},"required":["page_number","page_size","page"]}}}}}}}},"components":{"schemas":{"cac_account_schema_account_lite":{"type":"object","properties":{"attributes":{"type":"object","additionalProperties":{"type":"string"},"description":"A collection of account attributes."},"created_at":{"type":"string","format":"date-time","description":"The time at which the account was created in the XYB system."},"id":{"type":"string","format":"uuid","description":"A globally unique identifier for the account, generated on creation."},"name":{"type":"string","description":"Customer defined name of the account."},"product_uuid":{"type":"string","format":"uuid","description":"Product UUID of the account"},"product_version":{"type":"string","description":"Product Version of the account"},"reference":{"type":"string","description":"A globally unique identifier for the account."},"status":{"type":"string","enum":["PENDING","OPEN","SUSPENDED","SUSPENDED_OUT","SUSPENDED_IN","CLOSED","TERMINATED","BLOCKED"],"description":"Account status"},"updated_at":{"type":"string","format":"date-time","description":"The time at which the account was created in the XYB system."}},"required":["id","reference","product_uuid","product_version","name","status","created_at","updated_at"],"title":"AccountLite"}}}}
```

## GET /api/v2.0/account/{idRef}

> Returns single account by idRef

```json
{"openapi":"3.0.3","info":{"title":"Account Service","version":"0.18.1-bb9ff03"},"paths":{"/api/v2.0/account/{idRef}":{"get":{"tags":["AccountController"],"description":"Returns single account by idRef","operationId":"AccountController::getByIdRef","parameters":[{"name":"idRef","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Response to /api/v2.0/account/{idRef}","content":{"application/json":{"schema":{"$ref":"#/components/schemas/cac_account_schema_account"}}}}}}}},"components":{"schemas":{"cac_account_schema_account":{"type":"object","properties":{"account_coordinates":{"type":"array","items":{"$ref":"#/components/schemas/cac_account_schema_account_coordinates"},"description":"The coordinates that apply (or have applied) to the account."},"attributes":{"type":"object","additionalProperties":{"type":"string"},"description":"A collection of account attributes."},"created_at":{"type":"string","format":"date-time","description":"The time at which the account was created in the XYB system."},"currency":{"type":"string","description":"The currency in which the account is denominated."},"default_wallet":{"type":"string","description":"Default wallet code of the account"},"id":{"type":"string","format":"uuid","description":"A globally unique identifier for the account, generated on creation."},"jurisdictions":{"type":"array","items":{"$ref":"#/components/schemas/cac_account_schema_jurisdiction"},"description":"The jurisdictions under which the account has operated, ordered by the date since the jurisdiction has applied (increasing)."},"name":{"type":"string","description":"Customer defined name of the account."},"owner":{"$ref":"#/components/schemas/cda_entity_schema_entity_entity","description":"The owner of the account, see Owning Entities."},"product_uuid":{"type":"string","format":"uuid","description":"Product UUID of the account"},"product_version":{"type":"string","description":"Product Version of the account"},"reference":{"type":"string","description":"A globally unique identifier for the account."},"state":{"type":"string","enum":["PENDING","OPEN","SUSPENDED","SUSPENDED_OUT","SUSPENDED_IN","CLOSED","TERMINATED","BLOCKED"],"description":"One of the Account States."},"state_changes":{"type":"array","items":{"$ref":"#/components/schemas/cac_account_schema_account_state_change"},"description":"The states of the account over time, ordered by the date at which the state was applied (increasing)."},"state_id":{"type":"string","format":"uuid","description":"An globally unique identifier that is updated on each recorded change of the state field to match the id of the associated AccountStateChange."},"updated_at":{"type":"string","format":"date-time","description":"The time at which the account was updated in the XYB system."},"wallets":{"type":"array","items":{"$ref":"#/components/schemas/cac_account_schema_wallet_live"},"description":"Account wallets list with balances"}},"required":["id","reference","currency","product_uuid","product_version","owner","name","state","created_at","updated_at"],"title":"Account"},"cac_account_schema_account_coordinates":{"type":"object","properties":{"coordinates":{"$ref":"#/components/schemas/pay_payment_schema_account_coords","description":"Records an IBAN, account number, etc. for an account."},"external":{"type":"object","additionalProperties":{"type":"string"},"description":"Strictly optional external information for account coordinates."},"id":{"type":"string","format":"uuid","description":"A globally unique identifier for the account, generated on creation."},"tags":{"type":"array","items":{"type":"string"},"description":"Strictly optional application-scoped tags for the account coordinates."}},"required":["id","coordinates"],"title":"AccountCoordinates"},"pay_payment_schema_account_coords":{"type":"object","properties":{"acceptor":{"$ref":"#/components/schemas/pay_payment_schema_acceptor"},"banking":{"$ref":"#/components/schemas/schema_payment_banking_coords_carrier"},"external":{"type":"object","additionalProperties":{"type":"string"}},"internal":{"$ref":"#/components/schemas/pay_payment_schema_internal_coords"},"reference":{"type":"string"}},"title":"AccountCoords","description":"A standard way of transmitting account coordinates between services."},"pay_payment_schema_acceptor":{"type":"object","properties":{"acquirer_id":{"type":"string","description":"The id of the acquirer on the card network"},"facilitator_id":{"type":"string","description":"The id of the payment facilitator (sub acceptor)"},"id":{"type":"string","description":"The id of the acceptor on the card network"},"mcc":{"type":"string","description":"The merchant category code, four numerical digits 0000-9999"},"terminal_id":{"type":"string","description":"Unique id identifying the terminal used"}},"title":"Acceptor","description":"A merchant qualified to accept credit or debit cards as payment"},"schema_payment_banking_coords_carrier":{"type":"object","properties":{"account_code":{"type":"string","description":"Used to record the combined account number and routing code (CLABE in MX)"},"account_number":{"type":"string","description":"Account number."},"account_type":{"type":"string","description":"Account type - has a national meaning in GT, IS, BR and BG."},"balance_account_number":{"type":"string","description":"The balance account according to the chart of accounts - used in Belarus. See https://www.nbrb.by/engl/payment/ibanbic"},"bank_code":{"type":"string","description":"The national bank code (as opposed to BIC.)"},"bic":{"type":"string","description":"The BIC code"},"bic_bank_code":{"type":"string","description":"The 4 letter SWIFT bank code."},"bic_branch_code":{"type":"string","description":"The 3 character SWIFT branch code."},"bic_location_code":{"type":"string","description":"The 2 character SWIFT location code."},"branch_code":{"type":"string","description":"Branch code (sort-code in UK, guichet-code in FR.)"},"country_code":{"type":"string","description":"Required in the absence of a BIC or IBAN"},"currency":{"type":"string","description":"Used in GT, MU & SC (two character in GT, three character elsewhere.)"},"iban":{"type":"string","description":"The account coordinates as an IBAN"},"national_id":{"type":"string","description":"National identifier - IS kennitala."},"owner_account_number":{"type":"string","description":"Used to identify individual accounts in Brazil."},"routing_code":{"type":"string","description":"Identifies the bank for an account, often combines institution and branch data."}},"title":"BankingCoordsCarrier","description":"Banking coordinates."},"pay_payment_schema_internal_coords":{"type":"object","properties":{"account_id":{"type":"string","format":"uuid","description":"The Monese assigned id for the account. This is not necessarily the id assigned by the ledger holder."},"account_reference":{"type":"string","description":"The reference for the account"},"card_id":{"type":"string","format":"uuid","description":"The Monese assigned card id for the account."},"contact_account_id":{"type":"string","description":"A id that reference a contact account."},"currency_code":{"type":"string","description":"The denomination of funds within the account."},"legacy_account_id":{"description":"The legacy Monese assigned id for the account.","type":"integer","format":"int64"}},"title":"InternalCoords","description":"Account coordinates that are used to conveniently identify accounts within the Monese system."},"cac_account_schema_jurisdiction":{"type":"object","properties":{"classification":{"type":"string","enum":["INTERNATIONAL","SUPRANATIONAL","NATIONAL","SUBNATIONAL"],"description":"One of INTERNATIONAL, SUPRANATIONAL, NATIONAL, SUBNATIONAL"},"country_code":{"type":"string","description":"The 3 letter country code for the national geographic boundary of the jurisdiction where one applies."}},"required":["classification","country_code"],"title":"Jurisdiction"},"cda_entity_schema_entity_entity":{"type":"object","properties":{"affiliation":{"type":"string","enum":["CUSTOMER","INTERNAL","EXTERNAL"],"description":"Describes the relationship the entity has with Monese."},"aspects":{"type":"array","items":{"$ref":"#/components/schemas/cda_entity_schema_entity_aspect_entity_aspect"},"description":"The list of aspects associated with the Entity"},"reference":{"type":"string","description":"Possibly a company number, a service identifier or an employee code"},"type":{"type":"string","enum":["INDIVIDUAL","ORGANIZATION","COLLECTIVE","VIRTUAL"],"description":"The type of the entity; determines how any entity reference is interpreted."}},"required":["type","affiliation"],"title":"Entity","description":"Something or someone who owns an account, or who interacts directly or indirectly with the system."},"cda_entity_schema_entity_aspect_entity_aspect":{"type":"object","properties":{"aspect":{"$ref":"#/components/schemas/cda_entity_schema_entity_aspect_aspect","description":"Concrete aspect"},"identifier":{"type":"string","format":"uuid","description":"A unique identifier for the aspect"},"relation":{"type":"string","description":"May be used to disambiguate aspects of the same type associated with the same entity"}},"required":["identifier","aspect"],"title":"EntityAspect"},"cda_entity_schema_entity_aspect_aspect":{"type":"object","properties":{},"title":"Aspect"},"cac_account_schema_account_state_change":{"type":"object","properties":{"account_id":{"type":"string","format":"uuid","description":"A globally unique internal identifier for account"},"applied_at":{"type":"string","format":"date-time","description":"The ISO-8601 time at which the state was applied."},"external_reference":{"type":"string","description":"A globally unique external identifier for account"},"id":{"type":"string","format":"uuid","description":"A globally unique identifier assigned on state change."},"previous_state":{"type":"string","enum":["PENDING","OPEN","SUSPENDED","SUSPENDED_OUT","SUSPENDED_IN","CLOSED","TERMINATED","BLOCKED"],"description":"Account previous state value. One of OPEN , BLOCKED , CLOSED or FINALIZED ."},"reason":{"type":"string","description":"A human-readable reason for the change of account state."},"state":{"type":"string","enum":["PENDING","OPEN","SUSPENDED","SUSPENDED_OUT","SUSPENDED_IN","CLOSED","TERMINATED","BLOCKED"],"description":"One of OPEN , BLOCKED , CLOSED or FINALIZED ."}},"required":["id","state","applied_at"],"title":"AccountStateChange"},"cac_account_schema_wallet_live":{"type":"object","properties":{"account_balance":{"type":"string","description":"Wallet LIVE balance"},"available_balance":{"type":"string","description":"Wallet LIVE available balance"},"code":{"type":"string","description":"Wallet code used to group wallets. DEFAULT being default wallet and SECONDARY being supporting wallets"},"currency":{"type":"string","description":"The currency in which the wallet is denominated."},"hold_balance":{"type":"string","description":"Wallet LIVE hold balance"},"updated_at":{"type":"string","format":"date-time","description":"The time at which the wallet balance was last updated"}},"required":["currency","code","available_balance","hold_balance","account_balance","updated_at"],"title":"WalletLive"}}}}
```

## GET /api/v2.0/account/{idRef}/exists

> Checks if an account exists by idRef

```json
{"openapi":"3.0.3","info":{"title":"Account Service","version":"0.18.1-bb9ff03"},"paths":{"/api/v2.0/account/{idRef}/exists":{"get":{"tags":["AccountController"],"description":"Checks if an account exists by idRef","operationId":"AccountController::getIfExists","parameters":[{"name":"idRef","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Response to /api/v2.0/account/{idRef}/exists"}}}}}}
```


---

# 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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.xyb.co/xyb-platform-1/api-reference/accounts/query-accounts-apis.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
