PIX

PIX is a payment method used in Brazil and it is supported by the Paysafe Payments API. With the use of PIX, transactions can be completed in less than 10 seconds, round-the-clock and on all days of the week, including weekends and holidays. A QR Code can be scanned with a smartphone or copied and pasted into a banking or digital wallet app by the users who choose this payment option at the checkout page. All that's left to do is confirm the action and check the receiver's information.

Advantages:

  • Accept payments from unbanked people.

  • Instant payment confirmation.

  • PIX has no chargebacks risks.

  • QR code expiration date. If the QR code is not paid in the appropriate time it expires and the transaction is cancelled.

  • Large customer base of 100 million users in Brazil.

Setup Requirements

For Paysafe to create a test account in sandbox and production environments, the following information is required.

  • Paysafecard API key

Transaction Types

  • Payments

Minimum Amount

Maximum Amount
$1 $10,000

Payments Flow Diagram

Typical Scenarios

PIX Payment

When you want to process a payment request using PIX as the payment type, you would do the following:

  1. Create a Payment Handle with the transactionType parameter set to PAYMENT and the paymentType parameter set to one of the following value: PIX

  2. Redirect the customer to the SafetyPay redirect URL so they can generate a payment code. The status of the Payment Handle becomes PAYABLE. The merchant gets notified of this status change via webhooks that have been configured.

  3. Use the paymentHandleToken returned in the response to process the Payment request. The Payment will have a status of PROCESSING until the customer has made the payment.

Once the Payment is successfully completed by customer online, the merchant gets Payment Completed notification via webhooks.

APIs to use:Payment Handles + Payments

API Contracts

Create a Payment Handle Example

{
    "paymentType": "PIX",
    "pix": {
        "consumerId": "merchantclientid5HzDvoZSodKDJ7X7VQ"
    },
    "transactionType": "PAYMENT",
    "amount": 3000,
    "currencyCode": "BRL",
    "profile": {
        "firstName": "ALBERTA",
        "lastName": "BOBBETHCHARLESON",
        "email": "accountholder0@example.com",
        "phone": "1234567890",
        "dateOfBirth": {
            "day": 23,
            "month": 12,
            "year": 1990
        }
    },
    "billingDetails": {
        "nickName": "John Dee",
        "street": "100",
        "street2": "Queen Street",
        "city": "Cupertino",
        "zip": "14236",
        "country": "US",
        "state": "NY"
    },
    "merchantRefNum": "1653044860375",
    "merchantDescriptor": {
        "dynamicDescriptor": "Test Description",
        "phone": "5555345456"
    },
    "shippingDetails": {
        "recipientName": "Vishnu",
        "street": "20735 Stevens Creek Blvd",
        "street2": "Montessori",
        "city": "Cupertino",
        "zip": "95014",
        "country": "US",
        "state": "CA"
    },
    "dupCheck": false,
    "deviceFingerprinting": {
        "threatMetrixSessionId": "855d67c9-86dd-4b67-a036-72359bf5631a"
    },
    "returnLinks": [
        {
            "rel": "on_completed",
            "href": "https://api.dev.paysafe.com/checkout/v2/pages/redirect-success.html",
            "method": "GET"
        },
        {
            "rel": "on_failed",
            "href": "https://api.dev.paysafe.com/checkout/v2/pages/redirect-error.html",
            "method": "GET"
        },
        {
            "rel": "default",
            "href": "https://api.dev.paysafe.com/checkout/v2/pages/redirect-success.html",
            "method": "GET"
        }
    ]
}

PIX Redirect URL to Generate a Payment Code Example

{
    "id": "741adb5b-ce25-46a7-bea1-f42d0e62eaff",
    "paymentType": "PIX",
    "paymentHandleToken": "PHo5pbcWk55HFy1S",
    "merchantRefNum": "1653044860375",
    "currencyCode": "BRL",
    "txnTime": "2022-08-19T06:56:02Z",
    "billingDetails": {
        "street": "100",
        "street2": "Queen Street",
        "city": "Cupertino",
        "zip": "14236",
        "state": "NY",
        "country": "US"
    },
    "customerIp": "10.195.57.168",
    "status": "INITIATED",
    "links": [
        {
            "rel": "redirect_payment",
            "href": "https://api.qa.paysafe.com/alternatepayments/v1/redirect?accountId=1020462040&paymentHandleId=741adb5b-ce25-46a7-bea1-f42d0e62eaff&token=eyJhbGciOiJIUzI1NiJ9.eyJhY2QiOiIxMDIwNDYyMDQwIiwicHlkIjoiNzQxYWRiNWItY2UyNS00NmE3LWJlYTEtZjQyZDBlNjJlYWZmIiwiZXhwIjoxNjYwODkzOTYzfQ.PsE1xwmXEVhXKgbXUb2QWElUezAAX-buya7dX6rjre0"
        }
    ],
    "liveMode": false,
    "simulator": "EXTERNAL",
    "usage": "SINGLE_USE",
    "action": "REDIRECT",
    "executionMode": "ASYNCHRONOUS",
    "amount": 3000,
    "merchantDescriptor": {
        "dynamicDescriptor": "Test Description",
        "phone": "5555345456"
    },
    "timeToLiveSeconds": 599,
    "gatewayResponse": {
        "processor": "PAYSAFECARD",
        "id": "pay_1020014923_K43tTez3D4gEBP7hHCDo79ehK70oLoF6_BRL"
    },
    "returnLinks": [
        {
            "rel": "default",
            "href": "https://api.dev.paysafe.com/checkout/v2/pages/redirect-success.html"
        },
        {
            "rel": "on_failed",
            "href": "https://api.dev.paysafe.com/checkout/v2/pages/redirect-error.html"
        },
        {
            "rel": "on_completed",
            "href": "https://api.dev.paysafe.com/checkout/v2/pages/redirect-success.html"
        }
    ],
    "transactionType": "PAYMENT",
    "gatewayReconciliationId": "pay_1020014923_K43tTez3D4gEBP7hHCDo79ehK70oLoF6_BRL",
    "updatedTime": "2022-08-19T06:56:03Z",
    "statusTime": "2022-08-19T06:56:03Z",
    "shippingDetails": {
        "recipientName": "Vishnu",
        "street": "20735 Stevens Creek Blvd",
        "street2": "Montessori",
        "city": "Cupertino",
        "state": "CA",
        "country": "US",
        "zip": "95014"
    },
    "pix": {
        "consumerId": "merchantclientid5HzDvoZSodKDJ7X7VQ"
    },
    "profile": {
        "firstName": "ALBERTA",
        "lastName": "BOBBETHCHARLESON",
        "email": "accountholder0@example.com",
        "dateOfBirth": {
            "day": 23,
            "month": 12,
            "year": 1990
        },
        "phone": "1234567890"
    }
}

Process Payment Request Using paymentHandleToken

{
  "merchantRefNum": "1653044860375",
  "amount": 3000,
  "currencyCode": "BRL",
  "dupCheck": true,
  "settleWithAuth": true,
  "paymentHandleToken": "PHo5pbcWk55HFy1S",
  "customerIp": "172.0.0.1",
  "description": "Casino game purchase"
}

Payment Completed Notification via Webhooks

{
    "id": "9c9769ae-e2e8-4373-8123-4cca74fed47d",
    "paymentType": "PIX",
    "paymentHandleToken": "PHo5pbcWk55HFy1S",
    "merchantRefNum": "1653044860375",
    "currencyCode": "BRL",
    "settleWithAuth": true,
    "dupCheck": false,
    "txnTime": "2022-08-19T06:56:02Z",
    "billingDetails": {
        "street1": "100",
        "street2": "Queen Street",
        "city": "Cupertino",
        "zip": "14236",
        "state": "NY",
        "country": "US"
    },
    "status": "PROCESSING",
    "gatewayReconciliationId": "pay_1020014923_K43tTez3D4gEBP7hHCDo79ehK70oLoF6_BRL",
    "amount": 3000,
    "availableToRefund": 0,
    "consumerIp": "10.195.57.168",
    "liveMode": false,
    "simulator": "EXTERNAL",
    "updatedTime": "2022-08-19T07:00:47Z",
    "statusTime": "2022-08-19T07:00:47Z",
    "gatewayResponse": {
        "processor": "PAYSAFECARD",
        "id": "pay_1020014923_K43tTez3D4gEBP7hHCDo79ehK70oLoF6_BRL"
    },
    "availableToSettle": 0,
    "shippingDetails": {
        "recipientName": "Vishnu",
        "street": "20735 Stevens Creek Blvd",
        "street2": "Montessori",
        "city": "Cupertino",
        "state": "CA",
        "country": "US",
        "zip": "95014"
    },
    "pix": {
        "consumerId": "merchantclientid5HzDvoZSodKDJ7X7VQ"
    },
    "profile": {
        "firstName": "ALBERTA",
        "lastName": "BOBBETHCHARLESON",
        "email": "accountholder0@example.com",
        "dateOfBirth": {
            "day": 23,
            "month": 12,
            "year": 1990
        },
        "phone": "1234567890"
    },
    "settlements": {
        "amount": 3000,
        "txnTime": "2022-08-19T06:56:02.000+0000",
        "availableToRefund": 0,
        "merchantRefNum": "1653044860375",
        "id": "9c9769ae-e2e8-4373-8123-4cca74fed47d",
        "status": "RECEIVED"
    }
}

To know more about each parameter, you can visit Payments.

Did you find this page useful?