Pay in

Generate a Pix QR to receive BRL in your account.

POST

https://api.exchangecopter.com/createBRLdashDeposit

import axios from 'axios';

const code = 'your_code_here'; // Unique identifier for the object in your system.
const amount = 50; // Amount in BRL
const userId = 'user_id_here';
      
const accessToken = 'your_access_token_here'; // Authentication token

const callCreatePixQR = async () => {
  try {
    const result = await axios.post(
      'https://api.exchangecopter.com/createBRLdashDeposit',
      {
        code: code,
        amount: amount,
        userId: userId,
      },
      {
        headers: {
          Authorization: `Bearer ${accessToken}`, // Include Bearer Token
          Accept: 'application/json',
          'Content-Type': 'application/json',
        },
      }
    );
    console.log('Server response:', result.data);
  } catch (error) {
    if (error.response) {
      console.error('Error in server response', error.response.data);
    } else {
      console.error('Unknown error:', error);
    }
  }
};

callCreatePixQR();

👍

Response 200

{
  "id": "7426458b-f092-4eaf-b9c9-0e27c7f46803",
  "code": "km9vre5pzLutrxSXgngU",
  "amount": 5000, // Amount is returned in cents. 
  "metadata": {},
  "payload": "00020101021226860014br.gov.bcb.pix2564qrcode.fitbank.com.br/QR/cob/25E62D247C809EA53912D0C6F4BD3DD002B5204000053039865802BR5924SQALAPAY PAGAMENTOS LTDA6008Curitiba61088003501062070503***630488F3", 
} ⁠

❗️

Response 400 or 500

{
	'data': {
  	'message':"Error message here.",
    'description': error,
  }
}