Payments

Call the Payments API to request payments via Bank Transfer or PIX.


POST /payment

Request

curl -v --location --request POST 'https://sandbox.smartfastpay.com/payment' \
    --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",
        "document": "16972691419",
        "amount": 300,
        "currency": "USD",
        "payment_method": "bank_transfer",
        "callback": "http://mysite.com/api/notification",
        "transaction": {
            "id": "b08e3897-6505-4bb4-81a5-6e3a1d29e277"
        }
    }'

Parameters details

ParameterTypeRequiredDescription

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

payment_method

string (bank_transfer or pix) min: 3 | max: 13

yes

The payment method your customer will use. If bank_transfer is provided, we will return bank information for deposit, but if the provided is pix, the information for pix will be returned.

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.

pix

expire_in

integer (11)

no

Lifetime of the charge, specified in seconds from the creation date, so that the charge payment can be made. If not informed, the duration is assumed to be 1800 seconds, which corresponds to 30 minutes.

Response (PIX)

{
    "requestId": "a2435636-5f69-447d-8e22-8382f62ef7dd",
    "data": {
        "id": "4a79f3b4-8d55-428b-a560-984fedd6f78a",
        "status": "pending",
        "payment": {
            "method": "pix"
        },
        "values": {
            "total": "1557.00",
            "subtotal": "1557.00",
            "exchange": "5.19",
            "fee": 0
        },
        "pix": {
            "qrcode": "00020101021226850014br.gov.bcb.pix2563qrcodepix",
            "reference": "00020101021226850014br.gov.bcb.pix2563qrcodepix",
            "beneficiary": "SmartFastPay"
        }
    }
}

Response (Bank Transfer)

{
    "requestId": "a2435636-5f69-447d-8e22-8382f62ef7dd",
    "data": {
        "id": "4a79f3b4-8d55-428b-a560-984fedd6f78a",
        "status": "pending",
        "payment": {
            "method": "bank_transfer"
        },
        "values": {
            "total": "1557.00",
            "subtotal": "1557.00",
            "exchange": "5.19",
            "fee": 0
        },
        "bank": {
            "name": "VIACREDI",
            "code": "085",
            "agency": "0101-5",
            "account": "12551163",
            "account_operation": "Conta Corrente",
            "document": "34.911.051/0001-97",
            "beneficiary": "SmartFastPay"
        }
    }
}

Response details

ParameterDescription

id

The created payment by the request made a unique identificator. Can be used to verify the payment status in the GET /payment/{id} endpoint

status

The current status of the payment. These are our statuses: pending, paid, denied, expired

payment

method

The payment method chosen. bank_transfer or pix

values

total

The full value of the transaction, including service fees. Decimal separator it a dot

subtotal

The value of the transaction, without service fees. Decimal separator it a dot

exchange

The exchange rate applied to the current transaction

fee

The service fee value

bank

name

Name of the bank where the deposit is going to be made

code

Brazilian code of the bank to which the deposit is going to be directed

agency

Agency number with verification digit to which the deposit is going to be directed

account

Account number with verification digit to which the deposit is going to be directed

account_operation

Either it's a savings account or a current account. current account, saving account

document

Either the owner document or the company document for the account to which the deposit is going to be directed

beneficiary

Name of the owner of the account to which the deposit is going to be direct

pix

qrcode

String that contains the information of the qrcode. It is necessary to use some programming resource to convert this text into an image.

reference

String that contains the information of the copy and paste pix (pix copia e cola).

beneficiary

Name of the owner of the account to which the deposit is going to be direct


GET /payment/{id}

Request

curl -v --location --request GET 'https://sandbox.smartfastpay.com/payment/{id}' \
    --header 'Content-Type: application/json' \
    --header 'Authorization: Bearer <Access-Token>' \'

Response

{
    "requestId": "a2435636-5f69-447d-8e22-8382f62ef7dd",
    "data": {
        "id": "4a79f3b4-8d55-428b-a560-984fedd6f78a",
        "customer_id": "58f0c005-3b7d-4c75-81f3-93b9a6fee864",
        "transaction_id": "b08e3897-6505-4bb4-81a5-6e3a1d29e277",
        "amount": "300.00",
        "currency": "USD",
        "status": "pending",    
        "method": "bank_transfer",
        "created_at": "2021-11-11T19:08:20.000000Z",
        "updated_at": "2021-11-11T19:08:20.000000Z"
    }
}

Response details

ParameterDescription

id

The created payment by the request made unique identificator.

customer_id

The customer id stored on your platform for future identification.

transaction_id

The id of the transaction generated in you platform.

amount

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

currency

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.

status

The current status of the payment. These are our statuses: pending, paid, denied, expired

method

The payment method your customer will use. If bank_transfer is provided, we will return bank information for deposit, but if the provided is pix, the information for pix will be returned.

created_at

The date and time the transaction was created.

updated_at

The date and time the transaction was updated with new status.


GET /payments

Request

# Without parameters

curl -v --location --request GET 'https://sandbox.smartfastpay.com/payments' \
    --header 'Content-Type: application/json' \
    --header 'Authorization: Bearer <Access-Token>' \'
# With parameters

curl -v --location --request GET 'https://sandbox.smartfastpay.com/payments?limit=1&order=id,desc' \
    --header 'Content-Type: application/json' \
    --header 'Authorization: Bearer <Access-Token>' \'

Parameters detail

# Without parameters

curl -v --location --request GET 'https://sandbox.smartfastpay.com/payments' \
    --header 'Content-Type: application/json' \
    --header 'Authorization: Bearer <Access-Token>' \'
ParameterTypeDescription

limit

integer min: 1 | max: 40

The number of items to return in the response.

page

integer min: 1 | max: 9999999

The page number indicating which set of items will be returned in the response. So, the combination of page=1 and limit=20 returns the first 20 items. The combination of page=2 and limit=20 returns items 21 through 40.

sort

string Format: item,(asc|desc)

Sorts the items in the response by filter in ascending or descending order. Eg.: sort=id,desc (This combination returns a list in descending order based on id.)

start_time

string Internet date and time format

The start date and time for the range to show in the response, in Internet date and time format. Eg.: start_time=2021-09-05T11:00:00Z.

end_time

string Internet date and time format

The end date and time for the range to show in the response, in Internet date and time format. Eg.: end_time=2021-09-05T11:00:00Z.

customer_id

string min: 1 | max: 255

Sorts the items in the response by looking for the customer_id that was once provided by your system.

transaction_id

string

Sorts the items in the response by looking for the transaction_id that was once provided by your system. To get multiple transaction_id, send each transaction_id separating by comma (,). Eg.: 8fecdfcc-4e4d-11ee,8fece5ee-4e4d-11ee, d42953be-4e4d-11ee

Response

{
    "requestId": "a2435636-5f69-447d-8e22-8382f62ef7dd",
    "data": [
        {
            "id": "4a79f3b4-8d55-428b-a560-984fedd6f78a",
            "customer_id": "58f0c005-3b7d-4c75-81f3-93b9a6fee864",
            "transaction_id": "b08e3897-6505-4bb4-81a5-6e3a1d29e277",
            "amount": "300.00",
            "currency": "USD",
            "status": "pending",
            "method": "bank_transfer",
            "created_at": "2021-11-11T19:08:20.000000Z",
            "updated_at": "2021-11-11T19:08:20.000000Z"
        },
        {
            "id": "3eff3ce4-9666-4b93-8bbc-64887f164622",
            "customer_id": "d9e9557e-11a5-49df-b51b-d513a7f5b348",
            "transaction_id": "22dd9e47-97c7-4982-af50-3d3e0782d054",
            "amount": "980.00",
            "currency": "USD",
            "status": "pending",
            "method": "pix",
            "created_at": "2021-11-11T19:08:20.000000Z",
            "updated_at": "2021-11-11T19:08:20.000000Z"
        }
    ],
    "current_page": 1,
    "last_page": 1,
    "per_page": 10,
    "to": 2,
    "total": 2
}

Response details

ParameterDescription

id

The created payment by the request made unique identificator.

customer_id

The customer id stored on your platform for future identification.

transaction_id

The id of the transaction generated in you platform.

amount

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

currency

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.

status

The current status of the payment. These are our statuses: pending, paid, denied, expired

payment_method

The payment method your customer will use. If bank_transfer is provided, we will return bank information for deposit, but if the provided is pix, the information for pix will be returned.

created_at

The date and time the transaction was created.

updated_at

The date and time the transaction was updated with new status.