Create PIX QR Code Chargeback

This API allows you to request a chargeback (full or partial) for a paid PIX QR Code. The chargeback processing is asynchronous and the status can be consulted later through the Chargeback Status API.

Recent Requests
Log in to see full request history
TimeStatusUser Agent
Retrieving recent requests…
LoadingLoading…

Create PIX QR Code Chargeback

POST /v2/finance/chargebacks-pix-copy-and-paste

Request a chargeback (full or partial) for a paid PIX QR Code. The chargeback processing is asynchronous and status can be consulted via the Chargeback Status endpoint.

Authentication

HeaderTypeRequiredExample
AuthorizationStringYesBearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...
Content-TypeStringYesapplication/json

Request Body

ParameterTypeRequiredDescription
qr_code_idIntegerYesID of the PIX QR Code to be refunded. Unique identifier of the QR Code transaction.
informationStringYesReason/information for the chargeback. Descriptive text documenting why the chargeback is requested.
amountDecimalYesChargeback amount (must be > 0, with 2 decimal places). Can be equal to or less than the QR Code value.

Request Examples

Full Chargeback:

POST /v2/finance/chargebacks-pix-copy-and-paste
Authorization: Bearer <access_token>
Content-Type: application/json

{
  "qr_code_id": 12345,
  "information": "Full refund - customer canceled order",
  "amount": 100.00
}

Partial Chargeback:

POST /v2/finance/chargebacks-pix-copy-and-paste
Authorization: Bearer <access_token>
Content-Type: application/json

{
  "qr_code_id": 12345,
  "information": "Partial refund - returned 1 of 2 items",
  "amount": 50.00
}

Response (200 OK)

{
  "worked": true,
  "id": 98765,
  "end_to_end_id": "E6070119020210521123456789012345678",
  "amount": 50.00,
  "status": "PENDING",
  "fee": 0.00
}
FieldTypeDescription
workedBooleanAlways true for successful requests.
idIntegerUnique chargeback identifier. Use to query status later.
end_to_end_idStringEnd-to-End ID of the refund transaction. May be empty for pending chargebacks.
amountDecimalThe chargeback amount requested.
statusStringPENDING - Processing. SUCCESS - Completed. REJECTED - Failed.
feeDecimalTransaction fee. Usually 0.00 for chargebacks.

Error Responses

Status CodeError MessageCause
400QR Code not foundInvalid qr_code_id or doesn't belong to your account
400QR Code is not paidQR Code status is not PAID or CHARGEBACK
400There is a refund in processingA PENDING chargeback already exists for this QR Code
400Amount is greater than the value of the QR CodeChargeback amount exceeds available balance
400Cannot process chargeback for closed accountAssociated account is closed
401UnauthorizedInvalid or missing Bearer token
422Validation errorInvalid request format or missing required fields

Code Examples

cURL

curl --request POST \
  --url https://api.somossimpay.com.br/v2/finance/chargebacks-pix-copy-and-paste \
  --header 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
  --header 'Content-Type: application/json' \
  --data '{
    "qr_code_id": 12345,
    "information": "Full refund - customer canceled order",
    "amount": 100.00
  }'

JavaScript (Node.js)

const axios = require('axios');

async function createChargeback(accessToken, qrCodeId, amount, information) {
  try {
    const response = await axios.post(
      'https://api.somossimpay.com.br/v2/finance/chargebacks-pix-copy-and-paste',
      {
        qr_code_id: qrCodeId,
        information: information,
        amount: amount
      },
      {
        headers: {
          'Authorization': `Bearer ${accessToken}`,
          'Content-Type': 'application/json'
        }
      }
    );

    const { worked, id, status, end_to_end_id } = response.data;
    console.log(`Chargeback created: ID ${id}, Status: ${status}`);
    
    return response.data;
  } catch (error) {
    console.error('Chargeback failed:', error.response?.data || error.message);
    throw error;
  }
}

// Usage
createChargeback(accessToken, 12345, 100.00, 'Customer canceled order');

Python

import requests

def create_chargeback(access_token, qr_code_id, amount, information):
    url = "https://api.somossimpay.com.br/v2/finance/chargebacks-pix-copy-and-paste"
    
    payload = {
        "qr_code_id": qr_code_id,
        "information": information,
        "amount": amount
    }
    
    headers = {
        "Authorization": f"Bearer {access_token}",
        "Content-Type": "application/json"
    }
    
    try:
        response = requests.post(url, json=payload, headers=headers)
        response.raise_for_status()
        
        data = response.json()
        print(f"Chargeback created: ID {data['id']}, Status: {data['status']}")
        
        return data
    
    except requests.exceptions.HTTPError as e:
        print(f"Chargeback failed: {e.response.text}")
        raise

# Usage
create_chargeback(access_token, 12345, 100.00, "Customer canceled order")

Business Rules

Authentication

  • Requires valid Bearer token
  • User must be authenticated

Validations

  • QR Code must exist and belong to your account
  • QR Code status must be PAID or CHARGEBACK (partially refunded)
  • Cannot create chargeback if there's already a PENDING chargeback
  • Amount must be > 0 with exactly 2 decimal places
  • Amount cannot exceed remaining refundable balance
  • Associated account cannot be closed
  • All required fields must be provided

Processing

  • Internal Chargeback (same institution): May have synchronous processing with immediate SUCCESS status
  • External Chargeback (other institutions): Asynchronous processing with PENDING status. Use Chargeback Status endpoint to track completion
  • Cannot create a new chargeback while a previous one is still PENDING for the same QR Code

Related Documentation

Body Params
Responses

400

Bad request - Invalid parameters

401

Unauthorized - Invalid or missing authentication

500

Internal server error

Language
LoadingLoading…
Response
Choose an example:
application/json