> For the complete documentation index, see [llms.txt](https://docs.pagsmile.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.pagsmile.com/reference/remittance-api/business/collection/query-collections.md).

# Query Collections

Retrieves incoming collection transactions for a merchant within a specified time range, with optional account filters and pagination.

**Endpoint**

`POST /remittance/collection/query-collections`

**Sandbox base URL:** `https://rem-api-sandbox.pagsmile.com`\
**Content-Type:** `application/json; charset=UTF-8`

The request uses the standard [Remittance API request envelope](https://docs.pagsmile.com/remittance-api/common). The fields below describe the decrypted `biz_data` object.

{% hint style="info" %}
**Requirement:** `M` = Mandatory, `O` = Optional, and `C` = Conditional. A conditional field is mandatory only when the condition stated in its description applies.
{% endhint %}

{% hint style="warning" %}
Encrypt `biz_data`, encrypt the AES key into `random_key`, and sign the request according to the Common request specification.
{% endhint %}

**Request body**

**Decrypted `biz_data` fields**

| Field                   | Type    | Requirement | Description                                                                                                       |
| ----------------------- | ------- | ----------- | ----------------------------------------------------------------------------------------------------------------- |
| `merchant_id`           | long    | M           | Pagsmile-assigned unique identifier of the merchant.                                                              |
| `collection_account_no` | string  | O           | Account number of the collection account.                                                                         |
| `collection_unique_no`  | string  | O           | Globally unique reference assigned to the collection transaction.                                                 |
| `start_date`            | string  | M           | <p>Start of the query period, inclusive.<br>Format: <code>yyyy-MM-dd HH:</code>​<code>mm:ss</code>.</p>           |
| `end_date`              | string  | M           | <p>End of the query period, inclusive.<br>Format: <code>yyyy-MM-dd HH:</code>​<code>mm:ss</code>.</p>             |
| `page_num`              | integer | O           | <p>One-based page number of the result set.<br>Default: <code>1</code>.</p>                                       |
| `page_size`             | integer | O           | <p>Maximum number of records returned on each page.<br>Default: <code>10</code>.<br>Maximum: <code>30</code>.</p> |

**Plaintext `biz_data` example**

{% hint style="info" %}
This example includes mandatory fields and representative optional or conditional fields. Submit fields marked `C` only when the condition in the field description applies.
{% endhint %}

```json
{
  "merchant_id": 100398,
  "collection_account_no": "1234567890",
  "collection_unique_no": "COLLECTION_202607200001",
  "start_date": "2026-07-20 00:00:00",
  "end_date": "2026-07-20 23:59:59",
  "page_num": 1,
  "page_size": 10
}
```

**Request example**

```bash
curl --request POST \
  --url https://rem-api-sandbox.pagsmile.com/remittance/collection/query-collections \
  --header 'Content-Type: application/json; charset=UTF-8' \
  --data '{
    "partner_id": "<your_partner_id>",
    "app_id": "<your_app_id>",
    "timestamp": "2026-07-20 10:30:00",
    "version": "2.0",
    "language": "en",
    "random_key": "<RSA-encrypted AES key>",
    "request_id": "<globally_unique_request_id>",
    "sign_type": "RSA",
    "biz_data": "<AES-encrypted biz_data>"
  }'
```

{% hint style="info" %}
Use the `partner_id` and `app_id` assigned to your integration. The values above are placeholders.
{% endhint %}

**Response**

{% tabs %}
{% tab title="Success" %}
The `data` field in the response envelope is AES-encrypted. Decrypt `random_key` with your RSA private key, then use the resulting AES key to decrypt `data`. See [Security](https://docs.pagsmile.com/remittance-api/security) for implementation details.

**Encrypted response example**

```json
{
  "code": "10000",
  "msg": "Success",
  "data": "<AES-encrypted response data>",
  "total": 8,
  "random_key": "<RSA-encrypted AES key>",
  "sign_type": "RSA",
  "app_id": "2017051914172236111"
}
```

**Decrypted `data` example**

```json
[
  {
    "collection_id": 200001,
    "merchant_id": 100398,
    "material_id": 100001,
    "collection_account_no": "1234567890",
    "receive_amount": "100.00",
    "receive_currency": "BRL",
    "fee": "1.50",
    "arrived_at": "2026-07-20 10:30:00",
    "collection_unique_no": "COLLECTION_202607200001",
    "audit_status": 2,
    "comments": "Approved after compliance review.",
    "sender": {
      "name": "Example Buyer Ltd.",
      "account_no": "9876543210",
      "account_type": "checking",
      "descriptor": "Invoice INV-20260720-001",
      "id_type": "CNPJ",
      "id_number": "12345678000199"
    },
    "transaction_id": 300001
  }
]
```

{% endtab %}

{% tab title="Invalid signature" %}

```json
{
  "code": "40002",
  "msg": "Business Failed",
  "sub_code": "invalid-signature",
  "sub_msg": "invalid signature"
}
```

{% endtab %}
{% endtabs %}

**Response data fields**

| Field                   | Type    | Requirement | Description                                                                                                                                                                                                                                               |
| ----------------------- | ------- | ----------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `collection_id`         | long    | M           | Pagsmile-assigned unique identifier of the collection transaction.                                                                                                                                                                                        |
| `merchant_id`           | long    | M           | Pagsmile-assigned unique identifier of the merchant associated with the returned record.                                                                                                                                                                  |
| `material_id`           | long    | O           | Pagsmile-assigned unique identifier of the material record.                                                                                                                                                                                               |
| `collection_account_no` | string  | M           | Account number of the collection account.                                                                                                                                                                                                                 |
| `receive_amount`        | string  | M           | Amount credited in the receiving currency.                                                                                                                                                                                                                |
| `receive_currency`      | string  | M           | Three-letter ISO 4217 code of the currency credited to the recipient.                                                                                                                                                                                     |
| `fee`                   | string  | O           | Service fee charged for the transaction, expressed in the corresponding currency.                                                                                                                                                                         |
| `arrived_at`            | string  | M           | <p>Date and time when the funds arrived.<br>Format: <code>yyyy-MM-dd HH:</code>​<code>mm:ss</code>.</p>                                                                                                                                                   |
| `collection_unique_no`  | string  | M           | Globally unique reference assigned to the collection transaction.                                                                                                                                                                                         |
| `audit_status`          | integer | M           | <p>Current compliance or material review status of the record.<br>Supported values:<br><code>1</code> — Reviewing<br><code>2</code> — Approved<br><code>11</code> — Rejected<br><code>7</code> — To be linked<br><code>15</code> — To be supplemented</p> |
| `comments`              | string  | O           | Review comments or reason for rejection or failure, when provided.                                                                                                                                                                                        |
| `sender.name`           | string  | O           | Name of the sender that originated the collection transaction.                                                                                                                                                                                            |
| `sender.account_no`     | string  | O           | Account number from which the collection funds were sent.                                                                                                                                                                                                 |
| `sender.account_type`   | string  | O           | Type of the sender's bank account.                                                                                                                                                                                                                        |
| `sender.descriptor`     | string  | O           | Statement descriptor or reference supplied for the sender.                                                                                                                                                                                                |
| `sender.id_type`        | string  | O           | Type of identity document supplied for the sender.                                                                                                                                                                                                        |
| `sender.id_number`      | string  | O           | Identity document number supplied for the sender.                                                                                                                                                                                                         |
| `transaction_id`        | long    | O           | Pagsmile-assigned unique identifier of the transaction.                                                                                                                                                                                                   |

**Related APIs**

* [Apply Collection Account](https://docs.pagsmile.com/remittance-api/business/collection/apply-collection-account)
* [Apply Collection Account Result Notification](https://docs.pagsmile.com/remittance-api/business/collection/apply-collection-account-result-notification)
* [Collection Notification](https://docs.pagsmile.com/remittance-api/business/collection/collection-notification)
* [Query Apply Collection Account Result](https://docs.pagsmile.com/remittance-api/business/collection/query-apply-collection-account-result)
* [Query Collection Account Detail](https://docs.pagsmile.com/remittance-api/business/collection/query-collection-account-detail)
* [Query Collection Accounts](https://docs.pagsmile.com/remittance-api/business/collection/query-collection-accounts)
