> 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**

<table><thead><tr><th width="216.69140625">Field</th><th width="82.33203125">Type</th><th width="126.5859375">Requirement</th><th>Description</th></tr></thead><tbody><tr><td><code>merchant_id</code></td><td>long</td><td>M</td><td>Pagsmile-assigned unique identifier of the merchant.</td></tr><tr><td><code>collection_account_no</code></td><td>string</td><td>O</td><td>Account number of the collection account.</td></tr><tr><td><code>collection_unique_no</code></td><td>string</td><td>O</td><td>Globally unique reference assigned to the collection transaction.</td></tr><tr><td><code>audit_status</code></td><td>string</td><td>O</td><td>Filters records by collection transaction status.<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<br><code>12</code> — Reversal（Returned before the collection was credited）</td></tr><tr><td><code>refund_status</code></td><td>string</td><td>O</td><td>Filters records by refund status.<br>Supported values:<br><code>refunding</code> — The refund is being processed.<br><code>refunded</code> — The refund completed successfully.<br><code>refund failed</code> — The refund could not be completed.</td></tr><tr><td><code>start_date</code></td><td>string</td><td>M</td><td>Start of the query period, inclusive.<br>Format: <code>yyyy-MM-dd HH:</code>​<code>mm:ss</code>.</td></tr><tr><td><code>end_date</code></td><td>string</td><td>M</td><td>End of the query period, inclusive.<br>Format: <code>yyyy-MM-dd HH:</code>​<code>mm:ss</code>.</td></tr><tr><td><code>page_num</code></td><td>integer</td><td>O</td><td>One-based page number of the result set.<br>Default: <code>1</code>.</td></tr><tr><td><code>page_size</code></td><td>integer</td><td>O</td><td>Maximum number of records returned on each page.<br>Default: <code>10</code>.<br>Maximum: <code>30</code>.</td></tr></tbody></table>

**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",
  "audit_status": "2",
  "refund_status": "refunded",
  "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,
    "refund_amount": "100.00",
    "refund_currency": "BRL",
    "refund_status": "refunded",
    "refund_fee": "",
    "refunded_at": "2026-07-21 09:00:00"
  }
]
```

{% endtab %}

{% tab title="Invalid signature" %}

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

{% endtab %}
{% endtabs %}

**Response data fields**

<table><thead><tr><th>Field</th><th width="96.0546875">Type</th><th>Requirement</th><th>Description</th></tr></thead><tbody><tr><td><code>collection_id</code></td><td>long</td><td>M</td><td>Pagsmile-assigned unique identifier of the collection transaction.</td></tr><tr><td><code>merchant_id</code></td><td>long</td><td>M</td><td>Pagsmile-assigned unique identifier of the merchant associated with the returned record.</td></tr><tr><td><code>material_id</code></td><td>long</td><td>O</td><td>Pagsmile-assigned unique identifier of the material record.</td></tr><tr><td><code>collection_account_no</code></td><td>string</td><td>M</td><td>Account number of the collection account.</td></tr><tr><td><code>receive_amount</code></td><td>string</td><td>M</td><td>Amount credited in the receiving currency.</td></tr><tr><td><code>receive_currency</code></td><td>string</td><td>M</td><td>Three-letter ISO 4217 code of the currency credited to the recipient.</td></tr><tr><td><code>fee</code></td><td>string</td><td>O</td><td>Service fee charged for the transaction, expressed in the corresponding currency.</td></tr><tr><td><code>arrived_at</code></td><td>string</td><td>M</td><td>Date and time when the funds arrived.<br>Format: <code>yyyy-MM-dd HH:</code>​<code>mm:ss</code>.</td></tr><tr><td><code>collection_unique_no</code></td><td>string</td><td>M</td><td>Globally unique reference assigned to the collection transaction.</td></tr><tr><td><code>audit_status</code></td><td>integer</td><td>M</td><td>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<br><code>12</code> --ReversalPagsmile returned the collection before it was credited.</td></tr><tr><td><code>comments</code></td><td>string</td><td>O</td><td>Review comments or reason for rejection or failure, when provided.</td></tr><tr><td><code>sender.name</code></td><td>string</td><td>O</td><td>Name of the sender that originated the collection transaction.</td></tr><tr><td><code>sender.account_no</code></td><td>string</td><td>O</td><td>Account number from which the collection funds were sent.</td></tr><tr><td><code>sender.account_type</code></td><td>string</td><td>O</td><td>Type of the sender's bank account.</td></tr><tr><td><code>sender.descriptor</code></td><td>string</td><td>O</td><td>Statement descriptor or reference supplied for the sender.</td></tr><tr><td><code>sender.id_type</code></td><td>string</td><td>O</td><td>Type of identity document supplied for the sender.</td></tr><tr><td><code>sender.id_number</code></td><td>string</td><td>O</td><td>Identity document number supplied for the sender.</td></tr><tr><td><code>transaction_id</code></td><td>long</td><td>O</td><td>Pagsmile-assigned unique identifier of the transaction.</td></tr><tr><td><code>refund_transaction_id</code></td><td>Long</td><td>O </td><td>Pagsmile-assigned unique identifier of the accounting transaction created for the refund. </td></tr><tr><td><code>refund_amount</code></td><td>string</td><td>O</td><td>Amount returned in the original receiving currency. For a full refund, this value equals <code>receive_amount</code>. Empty when no refund exists.</td></tr><tr><td><code>refund_currency</code></td><td>string</td><td>O</td><td>Three-letter ISO 4217 code of the refund currency. This value is the same as <code>receive_currency</code>. Empty when no refund exists.</td></tr><tr><td><code>refund_status</code></td><td>string</td><td>O</td><td>Current refund status.<br>Supported values:<br><code>refunding</code> — The refund is being processed.<br><code>refunded</code> — The refund completed successfully.<br><code>refund failed</code> — The refund could not be completed.<br>Empty when no refund exists.</td></tr><tr><td><code>refund_fee</code></td><td>string</td><td>O</td><td>Refund fee charged for the refund. This field is returned as an empty string in the current release.</td></tr><tr><td><code>refunded_at</code></td><td>string</td><td>O</td><td>Date and time when the refund completed successfully.<br>Format: <code>yyyy-MM-dd HH:</code>​<code>mm:ss</code>.<br>Empty when no refund exists.</td></tr></tbody></table>

{% hint style="info" %}
When Pagsmile returns a rejected collection before it is credited and the return reaches `refunded`, the collection changes to `Reversal`. A refund performed after an approved collection has been credited does not change the collection from `Approved`; its result is reported through the refund fields.
{% endhint %}

**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)
