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.


POST /v1/transaction/checkout

Request

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"]
        }
    }'

Parameters details

Parameter
Type
Required
Description

customer_id

string min: 1 | max: 255

yes

The customer id stored on your platform for future identification.

branch

string min: 1 | max: 255

no

When the merchant needs to keep track of its various offices / branch, this field must be fill.

name

string min: 3 | max: 150

yes

Name of the customer who started the transaction.

email

string min: 30 | max: 255

yes

Email of the customer who started the transaction.

document

string Format: 99999999999

yes

Brazilian document (CPF) of the customer who started the transaction. - Must be a valid CPF document; Eg: 12345678909

amount

decimal (10,2) min: 2

yes

The amount that the client specified when initiating the transaction showed IN DOLLARS (use dot instead of comma) Eg: 300.10

currency

string (3) (USD or BRL) min: 3 | max: 3

no

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. This parameter is optional, if currency isn't provided it will auto-select USD. Default: USD

callback

string min: 30 | max: 250 (Method: POST)

yes

The URL in you site that our API will notify when the payment changes the status, the HTTP supported method should be HTTP Eg: http://my-url-callback/

transaction

id

string min: 1 | max: 255

yes

The id of the transaction generated in you platform.

payment

method

array min: 1

no

By using this field, our checkout page will only list the payment methods entered here. Allowed: pix, picpay, boleto and bank_transfer

redirect

url

string min: 30 | max: 250

yes

Redirect URL that we will set to our "back to website" button after the transaction was completed

type

string (HTML or URL) min: 0 | max: 10

yes

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.

Response (URL)

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

Response (HTML)

Last updated