# Payment CreatedAt Sort Clause

> For the complete documentation index, see [llms.txt](https://doc.ibexa.co/en/5.0/llms.txt).

Payment CreatedAt Sort Clause

Editions: Commerce

The `CreatedAt` Sort Clause sorts search results by the date and time when the payment was created.

## Arguments

- (optional) `sortDirection` - `CreatedAt` constant, either `CreatedAt::SORT_ASC` or `CreatedAt::SORT_DESC`

## Example

```php
use Ibexa\Contracts\Payment\Payment\PaymentQuery;

$criteria = null;

$paymentQuery = new PaymentQuery(
    $criteria,
    [
        new \Ibexa\Contracts\Payment\Payment\Query\SortClause\CreatedAt(
            \Ibexa\Contracts\Payment\Payment\Query\SortClause\CreatedAt::SORT_ASC
        ),
    ]
);
```
