> For the complete documentation index, see [llms.txt](https://docs.smartfastpay.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.smartfastpay.com/v1/reference/checkout/brazil.md).

# Checkout (Brazil)

Use the Checkout API for a secure checkout via SmartFastPay. It auto-presents relevant payment types to shoppers, easing purchase with methods like Bank Transfer, PIX, and more.

***

### <mark style="color:orange;">POST</mark> /v1/transaction/checkout

{% hint style="info" %}
**Request**
{% endhint %}

```bash
curl -v --location --request POST 'https://sandbox.smartfastpay.com/v1/transaction/checkout' \
    --header 'Content-Type: application/json' \
    --header 'Authorization: Bearer <Access-Token>' \
    --data-raw '{
        "customer_id": "58f0c005-3b7d-4c75-81f3-93b9a6fee864",
        "name": "Richard Roe",
        "email": "richard@roe.com",
        "amount": 4300,
        "currency": "USD",
        "callback": "http://mysite.com/api/notification",
        "transaction": {
            "id": "b08e3897-6505-4bb4-81a5-6e3a1d29e277",
            "redirect": {
                "url": "http://mysite.com/success_payment",
                "type": "URL"
            }
        },
        "payment": {
            "method": ["pix","boleto","picpay","bank_transfer"]
        }
    }'
```

{% hint style="info" %}
**Parameters details**
{% endhint %}

<table><thead><tr><th width="193">Parameter</th><th width="196" align="center">Type</th><th width="100" align="center">Required</th><th>Description</th></tr></thead><tbody><tr><td><mark style="color:red;"><code>customer_id</code></mark></td><td align="center"><mark style="color:red;"><code>string</code></mark><br><mark style="color:red;"><code>min: 1 | max: 255</code></mark></td><td align="center"><strong>yes</strong></td><td>The customer id stored on your platform for future identification.</td></tr><tr><td><mark style="color:red;"><code>branch</code></mark></td><td align="center"><mark style="color:red;"><code>string</code></mark><br><mark style="color:red;"><code>min: 1 | max: 255</code></mark></td><td align="center">no</td><td>When the merchant needs to keep track of its various offices / branch, this field must be fill.</td></tr><tr><td><mark style="color:red;"><code>name</code></mark></td><td align="center"><mark style="color:red;"><code>string</code></mark><br><mark style="color:red;"><code>min: 3 | max: 150</code></mark></td><td align="center"><strong>yes</strong></td><td>Name of the customer who started the transaction.</td></tr><tr><td><mark style="color:red;"><code>email</code></mark></td><td align="center"><mark style="color:red;"><code>string</code></mark><br><mark style="color:red;"><code>min: 30 | max: 255</code></mark></td><td align="center"><strong>yes</strong></td><td>Email of the customer who started the transaction.</td></tr><tr><td><mark style="color:red;"><code>document</code></mark></td><td align="center"><mark style="color:red;"><code>string</code></mark><br><mark style="color:red;"><code>Format: 99999999999</code></mark></td><td align="center"><strong>yes</strong></td><td>Brazilian document (CPF) of the customer who started the transaction.<br>- Must be a valid CPF document;<br><mark style="color:red;"><code>Eg: 12345678909</code></mark></td></tr><tr><td><mark style="color:red;"><code>amount</code></mark></td><td align="center"><mark style="color:red;"><code>decimal (10,2)</code></mark><br><mark style="color:red;"><code>min: 2</code></mark></td><td align="center"><strong>yes</strong></td><td>The amount that the client specified when initiating the transaction showed IN DOLLARS (use dot instead of comma)<br><mark style="color:red;"><code>Eg: 300.10</code></mark></td></tr><tr><td><mark style="color:red;"><code>currency</code></mark></td><td align="center"><mark style="color:red;"><code>string (3)</code></mark><br><mark style="color:red;"><code>(USD or BRL)</code></mark><br><mark style="color:red;"><code>min: 3 | max: 3</code></mark></td><td align="center">no</td><td>The currency type that the amount will be credited. If USD is provided there will be a conversion from USD to BRL, if BRL is provided there will be no conversion.<br><br>This parameter is optional, if currency isn't provided it will auto-select USD.<br><strong>Default: USD</strong></td></tr><tr><td><mark style="color:red;"><code>callback</code></mark></td><td align="center"><mark style="color:red;"><code>string</code></mark><br><mark style="color:red;"><code>min: 30 | max: 250</code></mark><br><mark style="color:red;"><code>(Method: POST)</code></mark></td><td align="center"><strong>yes</strong></td><td>The URL in you site that our API will notify when the payment changes the status, the HTTP supported method should be HTTP<br><mark style="color:red;"><code>Eg: http://my-url-callback/</code></mark></td></tr><tr><td><mark style="color:red;"><code>transaction</code></mark></td><td align="center"></td><td align="center"></td><td></td></tr><tr><td><mark style="color:red;"><code>id</code></mark></td><td align="center"><mark style="color:red;"><code>string</code></mark><br><mark style="color:red;"><code>min: 1 | max: 255</code></mark></td><td align="center"><strong>yes</strong></td><td>The id of the transaction generated in you platform.</td></tr><tr><td><mark style="color:red;"><code>payment</code></mark></td><td align="center"></td><td align="center"></td><td></td></tr><tr><td><mark style="color:red;"><code>method</code></mark></td><td align="center"><mark style="color:red;"><code>array</code></mark><br><mark style="color:red;"><code>min: 1</code></mark></td><td align="center">no</td><td>By using this field, our checkout page will only list the payment methods entered here. <code>Allowed:</code> <code>pix, picpay, boleto and bank_transfer</code></td></tr><tr><td><mark style="color:red;"><code>redirect</code></mark></td><td align="center"></td><td align="center"></td><td></td></tr><tr><td><mark style="color:red;"><code>url</code></mark></td><td align="center"><mark style="color:red;"><code>string</code></mark><br><mark style="color:red;"><code>min: 30 | max: 250</code></mark></td><td align="center"><strong>yes</strong></td><td>Redirect URL that we will set to our "back to website" button after the transaction was completed</td></tr><tr><td><mark style="color:red;"><code>type</code></mark></td><td align="center"><mark style="color:red;"><code>string</code></mark><br><mark style="color:red;"><code>(HTML or URL)</code></mark><br><mark style="color:red;"><code>min: 0 | max: 10</code></mark></td><td align="center"><strong>yes</strong></td><td>Return type of the request, if HTML is provided the request will return the HTML of the page, if URL is provided the request will return a URL with that will redirect to the HTML page rendered.</td></tr></tbody></table>

{% hint style="info" %}
**Response (URL)**
{% endhint %}

```json
{
    "requestId": "a2435636-5f69-447d-8e22-8382f62ef7dd",
    "data": {
        "url": "https://sandbox-checkout.smartfastpay.com/v1/cbfc1b2e-b1d7-42c0-8dc5-ffe94d64938e"
        "transaction_id": "cbfc1b2e-b1d7-42c0-8dc5-ffe94d64938e",
        "expires_in": 1694786912
    }
}
```

{% hint style="info" %}
**Response (HTML)**
{% endhint %}

<div><figure><img src="https://content.gitbook.com/content/OLfB7ZDbZdI3Jx0BxPQE/blobs/ohq4dRclrsUAT2K01GFr/initial.png" alt=""><figcaption></figcaption></figure> <figure><img src="https://content.gitbook.com/content/OLfB7ZDbZdI3Jx0BxPQE/blobs/s8ez3AAKDecBtBnoiq4E/payment_method.png" alt=""><figcaption></figcaption></figure></div>

<div><figure><img src="https://content.gitbook.com/content/OLfB7ZDbZdI3Jx0BxPQE/blobs/myd7it3vANKHaxTALqui/pix%20(1).png" alt=""><figcaption></figcaption></figure> <figure><img src="https://content.gitbook.com/content/OLfB7ZDbZdI3Jx0BxPQE/blobs/Ht6DscnU8U8TpKCaAfo2/picpay.png" alt=""><figcaption></figcaption></figure></div>

<div><figure><img src="https://content.gitbook.com/content/OLfB7ZDbZdI3Jx0BxPQE/blobs/QhgdrLUtGDDFrzlQqFLf/bank-transfer.png" alt=""><figcaption></figcaption></figure> <figure><img src="https://content.gitbook.com/content/OLfB7ZDbZdI3Jx0BxPQE/blobs/hRP5lR0UFril2kUkrUTZ/boleto-1.png" alt=""><figcaption></figcaption></figure> <figure><img src="https://content.gitbook.com/content/OLfB7ZDbZdI3Jx0BxPQE/blobs/dhKDVPwZR7IXmkOlaQZc/boleto-2.png" alt=""><figcaption></figcaption></figure></div>
