# Payin Detail

## Get your Payin transaction detail in Pagsmile.

<mark style="color:green;">`POST`</mark> `https://gateway-test.pagsmile.com/trade/query`

#### Headers

<table><thead><tr><th width="227">Name</th><th width="116">Type</th><th>Description</th></tr></thead><tbody><tr><td>Content-Type<mark style="color:red;">*</mark></td><td>String</td><td>application/json; chartset=UTF-8</td></tr><tr><td>Authorization<mark style="color:red;">*</mark></td><td>String</td><td>Basic Base($app_<em>id:$security_</em>key)</td></tr></tbody></table>

#### Request Body

| Name                                        | Type   | Description                                                                                                                         |
| ------------------------------------------- | ------ | ----------------------------------------------------------------------------------------------------------------------------------- |
| app\_id\*                                   | string | <p>created app's id at dashboard</p><p>- Max. 32 chars -</p>                                                                        |
| timestamp<mark style="color:red;">\*</mark> | string | <p>yyyy-MM-dd HH:mm:ss</p><p>- Max. 19 chars -</p>                                                                                  |
| out\_trade\_no                              | string | Merchant's trade NO., merchant sent in the request when creating transaction. (cannot be empty with trade\_no at same time)         |
| trade\_no                                   | string | Pagsmile trade NO., Pagsmile returned in the response when creating transaction. (cannot be empty with out\_trade\_no at same time) |

{% tabs %}
{% tab title="200: submit successfully " %}

```javascript
{
    "code": "10000",
    "msg": "Success",
    "trade_no": "",
    "out_trade_no": "",
    "trade_status": "SUCCESS",
    "order_currency": "BRL",
    "order_amount": "20",
    //The information sent when creating requests will be returned
    "customer": {
        "identification": {
            "number": "",
            "type": ""
        },
        "username": "",
        "email": "",
        "phone": "",
        "buyer_id": "",
        "ip": ""
    },
    //Currently only PIX and SPEI return the payer's information.
    "payer": {
        "identification": {
            "number": "",
            "type": ""
        },
        "username": "",
        "account": {
            "number": "", //bank account number for PIX, clabe for SPEI
            "type": ""  //bank account type for PIX, clabe for SPEI
        }
        //Currently Only PIX returns the payer's bank information
        "bank": {
            "bank_id": "", //bank code or bank id
            "bank_name": "",
            "agency": "" //bank branch

        },
    },
    "refuse_detail": "", //only for refused transactions
    "create_time": "",
    "update_time": ""
}

```

{% endtab %}

{% tab title="400: invalid-signature " %}

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

{% endtab %}
{% endtabs %}

## Example

```
curl --location --request POST 'https://gateway-test.pagsmile.com/trade/query' \
--header 'Authorization: Basic MTYyNTgyOTIxNDUzMTY2Mzg6UGFnc21pbGVfc2tfZDUwMWQ1ZGNkNTI5OGQ5N2MwNmUzYjI4YjA2OWZjZmY3NDU5ZjY2NzNiMjFjMTFlYTY3NDM5MDgzOTZkOTYxNQ==' \
--header 'Content-Type: application/json' \
--data-raw '{
   * "app_id": "167**********8028",
   * "timestamp": "2023-08-03 07:48:01",
     "out_trade_no": "", //At least one of "out_trade_no" or "trade_no" should be sent
     "trade_no": ""
}'
```

{% hint style="info" %}
Note: **162\*\*\*\*\*\*\*\*\*\*\*\*38** is pagsmile's test app id for sandbox, and **MTYyNTgyOTIxNDUzMTY2Mzg6UGFnc21pbGVfc2tfZDUwMWQ1ZGNkNTI5OGQ5N2MwNmUzYjI4YjA2OWZjZmY3NDU5ZjY2NzNiMjFjMTFlYTY3NDM5MDgzOTZkOTYxNQ==** is authorization token associated with the test app id.
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.pagsmile.com/payin/payin-detail.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
