Skip to content

Create Pix Charge

Endpoint

  • URL: https://gateway.prd.pppay.cloud/api/pix/charge
  • Method: POST
  • Authentication: Bearer Token (Authorization: Bearer YOUR_TOKEN)

Creates a new Pix Charge with a QR code to be paid.

Request Body Parameters

Field name Data type Required Filter type
amount float Yes Decimal value of the amount being charged (in R$)
merchant_transaction_id string Yes Transaction id on the side of the merchant
first_name string Yes First name of the one being charged
last_name string Yes Last name of the one being charged
email string Yes Email address for the one being charged
document_number string Yes Document number for the one being charged. Usually CPF for people and CNPJ for companies.
message string No Pix message
ip_address string No IP address of the one being charged
player_id string No The player's account number on the platform
phone_number string No Phone number of the one being charged
bank_accounts_allowed array No Bank accounts authorized to make the payment.
bank_accounts_allowed[].ispb string No This field specifies the ISPB of the bank associated with the account allowed for the transaction.
bank_accounts_allowed[].account_number string No Represents the account number associated with the bank account allowed for the transaction.
bank_accounts_allowed[].branch string No Represents the branch number associated with the bank account allowed for the transaction.
tag string No Tag for categorizing transactions, free to use by the merchant.

Request Body Example

{
    "amount": 250,
    "merchant_transaction_id": "TRANSACTION_ID",
    "first_name": "Lorem",
    "last_name": "Ipsum",
    "email": "[email protected]",
    "document_number": "12345678909",
    "pix_message": "Lorem ipsum dolor sit amet.",
    "bank_accounts_allowed": [
        {
            "ispb": "12345678",
            "account_number": "123456",
            "branch": "123"
        },
        {
            "ispb": "12345678",
            "account_number": "123456",
            "branch": "123"
        }
    ],
    "tag": "example"
}

Authorization

To access this endpoint, you need to include your merchant token in the request header as a Bearer token.

Code sample

Create Pix Charge

curl --request POST \
    --url "https://gateway.prd.pppay.cloud/api/pix/charge" \
    --header 'Authorization: Bearer YOUR_TOKEN' \
    --header 'accept: application/json' \
    --header 'content-type: application/json'`
    --data '{"amount":250,"merchant_transaction_id":"TRANSACTION_ID","first_name":"Lorem","last_name":"Ipsum","email":"[email protected]","document_number":"12345678909","pix_message":"Lorem ipsum dolor sit amet.","bank_accounts_allowed":[{"ispb":"12345678","account_number":"123456","branch":"123"},{"ispb":"12345678","account_number":"123456","branch":"123"}]}'
import requests

url = "https://gateway.prd.pppay.cloud/api/pix/charge"

headers = {
    "accept": "application/json",
    "Authorization": "Bearer YOUR_TOKEN"
}

data = {
    "amount": 250,
    "merchant_transaction_id": "ID_TRANSACAO_COMERCIANTE",
    "first_name": "Lorem",
    "last_name": "Ipsum",
    "email": "[email protected]",
    "document_number": "12345678909",
    "pix_message": "Lorem ipsum dolor sit amet.",
    "bank_accounts_allowed": [
        {
            "ispb": "12345678",
            "account_number": "123456",
            "branch": "123"
        },
        {
            "ispb": "12345678",
            "account_number": "123456",
            "branch": "123"
        }
    ]
}

response = requests.post(url, headers=headers, json=data)

print(response.text)

Responses

200 - Success
{
    "transaction": {
        "id":"string",
        "merchant_id":"string",
        "user_id":"string",
        "processor_id":"string",
        "merchant_transaction_id":"string",
        "transaction_type":"string",
        "first_name":"string",
        "last_name":"string",
        "email":"string",
        "checkout_url":"string",
        "updated_at":"string",
        "created_at":"string",
        "events": [
            {
                "id": "string",
                "success": "boolean",
                "status":"String",
                "event_type":"string",
                "amount":"string"
                "processor_transaction_id":"string",
                "qrcode":"string",
                "qrcode_image":"string",
                "updated_at":"string",
                "created_at":"string"
            }
        ],
        "bank_accounts_allowed": [
            {
                "ispb": "12345678",
                "account_number": "123456",
                "branch": "123"
            },
            {
                "ispb": "12345678",
                "account_number": "123456",
                "branch": "123"
            }
        ]
    }
}
401 - Not authenticated
{
"error": {
    "message": {
    "base": ["Not authenticated"]
    },
    "status": 401
},
"debug": []
}
422 - Unprocessable
{
"error": {
    "message": {
    "base": ["Unprocessable"]
    },
    "status": 422
},
"debug": []
}