---
updatedAt: 2025-08-21T13:31:11.000Z
agentTools:
  siteIndex: https://merchants.stgeorge.com.au/llms.txt
  projectIndex: https://merchants.stgeorge.com.au/onlinepay/llms.txt
---

# RSQL queries for Customer API

## Overview

RSQL operators can be used to retrieve Customer data based on specific criteria. The following table lists the available criteria and operators that can be used to filter Customer data:

| Criteria                      | Description | Operator Used                               |
| ----------------------------- | ----------- | ------------------------------------------- |
| billing.address\_1            | string      | ==, !=, =in=, =out=, =regex=                |
| billing.address\_2            | string      | ==, !=, =in=, =out=, =regex=                |
| billing.address\_3            | string      | ==, !=, =in=, =out=, =regex=                |
| billing.city                  | string      | ==, !=, =in=, =out=, =regex=                |
| billing.country\_code         | string      | ==, !=, =in=, =out=, =regex=                |
| billing.first\_name           | string      | ==, !=, =in=, =out=, =regex=                |
| billing.middle\_name          | string      | ==, !=, =in=, =out=, =regex=                |
| billing.last\_name            | string      | ==, !=, =in=, =out=, =regex=                |
| billing.phone                 | string      | ==, !=, =in=, =out=, =regex=                |
| billing.postal\_code          | string      | ==, !=, =in=, =out=, =regex=                |
| billing.state                 | string      | ==, !=, =in=, =out=, =regex=                |
| company\_name                 | string      | ==, !=, =in=, =out=, =regex=                |
| company\_registration\_number | string      | ==, !=, =in=, =out=, =regex=                |
| email\_address                | string      | ==, !=, =in=, =out=, =regex=                |
| entity\_id                    | string      | ==, !=, =in=, =out=, =regex=                |
| id                            | string      | ==, !=, =in=, =out=, =regex=                |
| phone\_number                 | string      | ==, !=, =in=, =out=, =regex=                |
| shipping.address\_1           | string      | ==, !=, =in=, =out=, =regex=                |
| shipping.address\_2           | string      | ==, !=, =in=, =out=, =regex=                |
| shipping.address\_3           | string      | ==, !=, =in=, =out=, =regex=                |
| shipping.city                 | string      | ==, !=, =in=, =out=, =regex=                |
| shipping.country\_code        | string      | ==, !=, =in=, =out=, =regex=                |
| shipping.first\_name          | string      | ==, !=, =in=, =out=, =regex=                |
| shipping.middle\_name         | string      | ==, !=, =in=, =out=, =regex=                |
| shipping.last\_name           | string      | ==, !=, =in=, =out=, =regex=                |
| shipping.phone                | number      | ==, !=, =in=, =out=, =gt=, =ge=, =lt=, =le= |
| shipping.postal\_code         | string      | ==, !=, =in=, =out=, =regex=                |
| shipping.state                | string      | ==, !=, =in=, =out=, =regex=                |
| title                         | string      | ==, !=, =in=, =out=, =regex=                |
| work\_phone                   | string      | ==, !=, =in=, =out=, =regex=                |
| tax.identifier                | string      | ==, !=, =in=, =out=, =regex=                |
| created\_at                   | date        | ==, !=, =in=, =out=, =gt=, =ge=, =lt=, =le= |
| updated\_at                   | date        | ==, !=, =in=, =out=, =gt=, =ge=, =lt=, =le= |
| language                      | string      | ==, !=, =in=, =out=, =regex=                |

## RSQL operators

The following table lists the RSQL operators that can be used to filter Customer data:

| Operator | Description               |
| -------- | ------------------------- |
| ==       | equal                     |
| !=       | not equal                 |
| =lt=     | less than                 |
| =le=     | less than and equal to    |
| =gt=     | greater than              |
| =ge=     | greater than and equal to |
| =regex=  | pattern matching          |
| =in=     | multiple arguments search |
| =out=    | exclude                   |
| **;**    | Logical AND               |
| **,**    | Logical OR                |

> ℹ️
>
> Logical AND (`;`) has higher precedence than Logical OR (`,`). This means that in an expression without parentheses, the `AND` operations will be evaluated before the `OR` operations. To change the order of evaluation, you can use parentheses `()` to group expressions and override the default precedence.

For example:

* `criteria1;criteria2,criteria3` is evaluated as `(criteria1 AND criteria2) OR criteria3`
* `(criteria1,criteria2);criteria3` is evaluated as `(criteria1 OR criteria2) AND criteria3`

## Example Queries

The following table provides example RSQL queries for the Customer API and their descriptions:

| Query                                                                                                      | Description                                                                                                                                |
| ---------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------ |
| `/v2/customer?search=id==123&order_by=ASC&order_criteria=email_address&page_size=1&page_number=2`          | Retrieves the customer with id `123`, ordered by email address in ascending order, with a page size of `1` and page number `2`.            |
| `/v2/customer?search=id==123435&order_by=DESC&order_criteria=billing.address_1&page_size=10&page_number=1` | Retrieves the customer with id `123435`, ordered by billing address `1` in descending order, with a page size of `10` and page number `1`. |
| `/v2/customer?search=id==dg373&order_by=ASC&order_criteria=company_name&page_size=1&page_number=2`         | Retrieves the customer with id `dg373`, ordered by company name in ascending order, with a page size of `1` and page number `2`.           |