> 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/payin/submit-a-payin/costa-rica/creditcardpreauth/caputre.md).

# Capture

## Capture Authorization

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

This endpoint allows you to capture an authorization.

#### Headers

| Name                                            | Type   | Description                                |
| ----------------------------------------------- | ------ | ------------------------------------------ |
| Content-Type<mark style="color:red;">\*</mark>  | string | application/json; chartset=UTF-8           |
| Authorization<mark style="color:red;">\*</mark> | string | Basic Base($app\_*id:$security\_*&#x6B;ey) |

#### Request Body

| Name                                             | Type   | Description                                                          |
| ------------------------------------------------ | ------ | -------------------------------------------------------------------- |
| app\_id<mark style="color:red;">\*</mark>        | 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<br>- Max. 19 chars -</p>                      |
| version                                          | string | fixed value: 2.0                                                     |
| amount<mark style="color:red;">\*</mark>         | string | 500 \~ 1,000,000                                                     |
| currency<mark style="color:red;">\*</mark>       | string | Fixed value: CRC                                                     |
| out\_trade\_no<mark style="color:red;">\*</mark> | string | <p>ID given by the merchant in their system<br>- Max. 64 chars -</p> |

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

```json
{
    "msg": "Success",
    "code": "10000"
}
```

{% endtab %}

{% tab title="400: Bad Request invalid signature" %}

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

{% endtab %}
{% endtabs %}

### Example

```
curl --location --request POST 'https://security-test.pagsmile.com/trade/capture' \
--header 'Authorization: Basic MTYyNTgyOTIxNDUzMTY2Mzg6UGFnc21pbGVfc2tfZDUwMWQ1ZGNkNTI5OGQ5N2MwNmUzYjI4YjA2OWZjZmY3NDU5ZjY2NzNiMjFjMTFlYTY3NDM5MDgzOTZkOTYxNQ==' \
--header 'Content-Type: application/json' \
--data-raw '{
    "app_id": "1617***052",
    "timestamp": "2022-08-11 10:26:03",
    "version": "2.0",
    "amount": "2000",
    "currency": "CRC",
    "out_trade_no": "out_18***1300"
}'
```

{% 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 %}

{% hint style="danger" %}
Please use your own **app\_id** and generate your own **authorization token** when testing.
{% endhint %}
