PIX

Call the Payments API to request payments via 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": "pix",
        "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 / 99999999999999

yes

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

document_type

string min: 2 | max: 100

no

Allowed document types: CPF, CNPJ.

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 (pix) min: 3 | max: 13

yes

The payment method your customer will use. If pix is provided, we will return pix information for deposit.

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

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

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

Last updated