Filters can be used to further refine your searches, such as returning orders that are only in one status or between one and the other. The delimiters help you in these scenarios.
Each resource has its attributes available for filters. Consult the documentation for the desired feature to find out which ones you can use.
The Wirecard APIs allow detailed searches to be carried out. As a standard, three methods will always be used to compose your search, which can be used separately or together to refine your search. Are they:
- Pagination: determines how many records will be returned.
- Generic query: search for a string or for information that you used when creating the resource.
- Delimiters: delimits some parameters in your search.
Pagination
The records are currently sorted by date of creation in descending order.
Name | Type | Description |
---|---|---|
| integer | The number of records returned per search (page). The default value is 20. |
| integer | Record from which the search will return. The default value is 0. |
EXAMPLE
GET https://sandbox.moip.com.br/v2/orders?limit=100&offset=300
Note that you must define the filter with
?
.
When adding a new delimiter to the search, add&
.
IMPORTANT
When making a query the Wirecard will return a hyperlink so that you can browse and make a new query with the same parameters (
_links.next
and_links.previous
), returning the results after and before your consultation. Below is an example of the links that should be returned in the search.
"_links": {
"next": {
"href": "https://test.moip.com.br/v2/orders?filters=&limit=100&offset=110"
},
"previous": {
"href": "https://test.moip.com.br/v2/orders?filters=&limit=100&offset=0"
}
Generic Search
It is possible to search for a specific value in your order using the q
parameter in the resource URL, this method is ideal for searching for a resource through its own identifier.
Name | Description |
---|---|
| Query a specific value. |
EXAMPLE
GET https://sandbox.moip.com.br/v2/orders?q=ORD-7NHI33JLXQQK
In this case, the possible search values are:
- Wirecard identifier codes (those that start with three letters and are followed by a hash. Example: ORD-7NHI33JLXQQK);
- Name of the customer/buyer;
- Customer email;
- ownId.
Delimiters
The URI must be mounted bypassing the filters inside the filters parameter. Use the ::
delimiters to represent key and value and |
to separate one filter from another.
Name | Type | Description |
---|---|---|
| number or date | “Greater Than” |
| number or date | “Greater than or Equal” |
| number or date | “Less Than” |
| number or date | “Less than or Equal” |
| string | “Between” |
| string | “IN” |
EXAMPLE
Searching with the following requirements:
- Value transactions between
5000
and10000
(in cents);- Payment methods: Credit Card and Boleto;
- The client with the name
jose silva
;- Returning 3 results only.
GET https://sandbox.moip.com.br/v2/orders?q=jose silva
&filters=status::in(PAID,WAITING)|paymentMethod::in(CREDIT_CARD,BOLETO)
|value::bt(5000,10000)&limit=3&offset=0You can also search for orders within a time frame:
For cURL requests use the encoded URL format: