Skip to main content

Creating a Charge using API

You can generate new Pix Charges using the OpenPix API in your backend or frontend

curl --location --request POST 'https://api.openpix.com.br/api/openpix/v1/charge' \
--header 'Content-Type: application/json' \
--header 'Authorization: <appID>' \
--data-raw '{
"correlationID": "8a4a4168-a877-4494-9d8d-eba2d4435e97",
"value": "1",
"comment": "my first pix charge",
"customer": {
"name": "Bob",
"email": "[email protected]",
"phone": "5511940468888",
"taxID": "471.737.080-52"
}
}'

Payload Description

  • correlationID: your ID to keep track of charge
  • value: charge value in cents
  • comment: comment to be shown in QRCode while the customer is payment the charge
  • customer: customer of this charge
  • customer.name: customer name
  • customer.email: customer email
  • customer.taxID: customer CPF/CNPJ
  • customer.phone: customer phone

Customer field is not required. However, if you decide to use it, you must send at least one of the following combinations:

  1. name + taxID
  2. name + email
  3. name + phone