Payments

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


POST /v1/payment

Request

curl -v --location --request POST 'https://sandbox.smartfastpay.com/v1/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

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


GET /v1/payment/{id}

Request

curl -v --location --request GET 'https://sandbox.smartfastpay.com/v1/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


GET /v1/payments

Request

# Without parameters

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

curl -v --location --request GET 'https://sandbox.smartfastpay.com/v1/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/v1/payments' \
    --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"
        },
        {
            "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

Last updated