Skip to content

Commit

Permalink
Fix filter and collection docs links (#1868)
Browse files Browse the repository at this point in the history
* Fix links pointing to filters and expand

* Fix sort type definition
  • Loading branch information
mikerebilly authored Apr 11, 2024
1 parent d240004 commit ad7d35a
Show file tree
Hide file tree
Showing 11 changed files with 12 additions and 82 deletions.
2 changes: 1 addition & 1 deletion openapi/components/parameters/collectionExpand.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ description: |-
property of the response. This field accepts a comma-separated list of objects.
For more information, see
[Expand to include embedded objects](https://www.rebilly.com/catalog/all/#section/Expand-to-include-embedded-objects).
[Expand to include embedded objects](https://www.rebilly.com/docs/dev-docs/api/#section/Expand-to-include-embedded-objects).
schema:
type: string
2 changes: 1 addition & 1 deletion openapi/components/parameters/collectionFilter.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ description: |-
a special format. Use `,` for multiple allowed values. Use `;` for multiple fields.
For more information, see
[Using filter with collections](https://www.rebilly.com/catalog/all/#section/Using-filter-with-collections).
[Using filter with collections](https://www.rebilly.com/docs/dev-docs/api/#section/Using-filter-with-collections).
schema:
type: string
7 changes: 3 additions & 4 deletions openapi/components/parameters/collectionSort.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@ name: sort
in: query
description: |-
Sorts and orders the collection of items. To sort in descending
order, prefix with `-`.
order, prefix with `-`. Multiple fields can be sorted by separating each with `,`.
example: -createdTime,firstName
style: form
explode: false
schema:
type: array
items:
type: string
type: string
2 changes: 1 addition & 1 deletion openapi/components/parameters/subscriptionExpand.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@ description: |-
- `upcomingInvoice`
- `paymentInstrument`
For more information, see [Expand to include embedded objects](https://www.rebilly.com/catalog/all/#section/Expand-to-include-embedded-objects).
For more information, see [Expand to include embedded objects](https://www.rebilly.com/docs/dev-docs/api/#section/Expand-to-include-embedded-objects).
schema:
type: string
2 changes: 1 addition & 1 deletion openapi/components/schemas/Bind.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ properties:
This field requires a special format. Use `,` for multiple allowed values.
Use `;` for multiple fields.
For more information, see [Using filter with collections](https://www.rebilly.com/catalog/all/#section/Using-filter-with-collections).
For more information, see [Using filter with collections](https://www.rebilly.com/docs/dev-docs/api/#section/Using-filter-with-collections).
type: string
actions:
description: Actions that execute when an event occurs.
Expand Down
2 changes: 1 addition & 1 deletion openapi/components/schemas/GatewayAccount.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ properties:
If a transaction exceeds this value, the gateway account is not used.
For more information see,
[Using filters](https://www.rebilly.com/catalog/all/#section/Using-filter-with-collections).
[Using filters](https://www.rebilly.com/docs/dev-docs/api/#section/Using-filter-with-collections).
type:
- 'string'
- 'null'
Expand Down
2 changes: 1 addition & 1 deletion openapi/components/schemas/GlobalWebhook.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ properties:
Use `;` for multiple fields.
For more information,
see [Using filters](https://www.rebilly.com/catalog/all/#section/Using-filter-with-collections).
see [Using filters](https://www.rebilly.com/docs/dev-docs/api/#section/Using-filter-with-collections).
type:
- 'string'
- 'null'
Expand Down
2 changes: 1 addition & 1 deletion openapi/components/schemas/ReadyToPayMethodFilters.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ type: array
description: |-
For the method to be applicable, one or more of the following filters must match.
If no filters are sent, no restrictions are applied.
For more information, see [Using filters](https://www.rebilly.com/catalog/all/#section/Using-filter-with-collections).
For more information, see [Using filters](https://www.rebilly.com/docs/dev-docs/api/#section/Using-filter-with-collections).
items:
type: string
2 changes: 1 addition & 1 deletion openapi/components/schemas/ReadyToPayoutMethodFilters.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ type: array
description: |-
For the method to be applicable, one or more of the following filters must match.
If no filters are sent, no restrictions are applied.
For more information, see [Using filters](https://www.rebilly.com/catalog/all/#section/Using-filter-with-collections).
For more information, see [Using filters](https://www.rebilly.com/docs/dev-docs/api/#section/Using-filter-with-collections).
items:
type: string
69 changes: 0 additions & 69 deletions openapi/description.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,75 +62,6 @@ $client = new Rebilly\Client([
]);
```

# Using filter with collections

Rebilly provides collections filtering. Use the `?filter` parameter on collections to define which records should be shown in the response.

Format description:

- Fields and values in the filter are separated with `:`: `?filter=firstName:John`.

- Sub-fields are separated with `.`: `?filter=billingAddress.country:US`.

- Multiple filters are separated with `;`: `?filter=firstName:John;lastName:Doe`. \
They are joined with `AND` logic. Example: `firstName:John` AND `lastName:Doe`.

- To use multiple values, use `,` as values separators: `?filter=firstName:John,Bob`. \
Multiple values specified for a field are joined with `OR` logic. Example: `firstName:John` OR `firstName:Bob`.

- To negate the filter, use `!`: `?filter=firstName:!John`.

- To negate multiple values, use: `?filter=firstName:!John,!Bob`.
This filter rule excludes all `Johns` and `Bobs` from the response.

- To use range filters, use: `?filter=amount:1..10`.

- To use a gte (greater than or equals) filter, use: `?filter=amount:1..`.
This also works for datetime-based fields.

- To use a lte (less than or equals) filter, use: `?filter=amount:..10`.
This also works for datetime-based fields.

- To create [specified values lists](https://www.rebilly.com/catalog/all/Lists) and use them in filters, use: `?filter=firstName:@yourListName`. \
You can also exclude list values: `?filter=firstName:!@yourListName`. \
Use value lists to compare against a list of data when setting conditions for rules or binds,
or applying filters to data table segments.
Commonly used lists contain values related to conditions that target specific properties such as: customers, transactions, or BINs.

- Datetime-based fields accept values formatted using RFC 3339. Example: `?filter=createdTime:2021-02-14T13:30:00Z`.

# Expand to include embedded objects

Rebilly provides the ability to pre-load additional objects with a request.

You can use the `?expand` parameter on most requests to expand and include embedded objects within the `_embedded` property of the response.
The `_embedded` property contains an array of objects keyed by the expand parameter values.
To expand multiple objects, pass them as a comma-separated list of objects.

Example request containing multiple objects:

```
?expand=recentInvoice,customer
```

Example response:

```
"_embedded": [
"recentInvoice": {...},
"customer": {...}
]
```

Expand may be used on `GET`, `PATCH`, `POST`, `PUT` requests.

# Limit on collections offset

For performance reasons, take note that we have a `1000` limit on `?offset=...`.
For example, attempting to retrieve a collection using `?offset=1001` or `?offset=2000` returns the same results as if you used `?offset=1000`.

Visit our [Data Exports API](https://www.rebilly.com/catalog/all/Data-exports) for an asynchronous solution.

# Get started

The full [Rebilly API](https://www.rebilly.com/catalog/all/) has over 500 operations.
Expand Down
2 changes: 1 addition & 1 deletion openapi/paths/[email protected]
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ get:
A revenue audit report is a combination of a granular [revenue waterfall](https://www.rebilly.com/docs/data-tables/revenue-recognition/#revenue-waterfall) and a journal report,
which describes revenue per account.
Use [`filter`](https://www.rebilly.com/catalog/all/#section/Using-filter-with-collections) `limit` and `offset` parameters to restrict the output.
Use [`filter`](https://www.rebilly.com/docs/dev-docs/api/#section/Using-filter-with-collections) `limit` and `offset` parameters to restrict the output.
security:
- SecretApiKey: []
- JWT: []
Expand Down

0 comments on commit ad7d35a

Please sign in to comment.