SocredDocs

    Check Chargeback Status by QR Code

    This API allows you to consult the status of a previously created chargeback. The query can be made using either the chargeback ID or the End-to-End ID.

    GEThttps://api.socredsa.com.br/v2/finance/chargebacks-pix-copy-and-paste/status
    curl --request GET \
      --url 'https://api.socredsa.com.br/v2/finance/chargebacks-pix-copy-and-paste/status' \
      --header 'Authorization: Bearer <ACCESS_TOKEN>'
    Response200
    {
      "worked": true,
      "id": 98765,
      "end_to_end_id": "E6070119020210521123456789012345678",
      "amount": 50,
      "status": "SUCCESS",
      "fee": 0
    }

    Check Chargeback Status

    GET /v2/finance/chargebacks-pix-copy-and-paste/status

    Query the status of a previously created chargeback using either the chargeback ID or the End-to-End ID.

    Authentication

    HeaderTypeRequiredExample
    AuthorizationStringYesBearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...

    Query Parameters

    ParameterTypeRequiredDescription
    idIntegerOptionalChargeback ID returned when creating the chargeback. Provide either id OR end_to_end_id, not both.
    end_to_end_idStringOptionalEnd-to-End ID (UUID) returned when creating. Provide either id OR end_to_end_id, not both.

    Important: You must provide exactly ONE parameter - either id OR end_to_end_id.

    Request Examples

    Check status by chargeback ID:

    GET /v2/finance/chargebacks-pix-copy-and-paste/status?id=98765
    Authorization: Bearer <access_token>

    Check status by End-to-End ID:

    GET /v2/finance/chargebacks-pix-copy-and-paste/status?end_to_end_id=E6070119020210521123456789012345678
    Authorization: Bearer <access_token>

    Response (200 OK)

    {
      "worked": true,
      "id": 98765,
      "end_to_end_id": "E6070119020210521123456789012345678",
      "amount": 50.00,
      "status": "SUCCESS",
      "fee": 0.00
    }
    FieldTypeDescription
    workedBooleanAlways true for successful requests.
    idIntegerUnique chargeback identifier.
    end_to_end_idStringEnd-to-End ID of the refund transaction. Always present in a successful response.
    amountDecimalChargeback amount value.
    statusStringPENDING - Processing. SUCCESS - Completed. REJECTED - Failed.
    feeDecimalTransaction fee. Usually 0.00 for chargebacks.

    Status Values

    StatusDescription
    PENDINGChargeback is being processed. Query again after a few minutes.
    SUCCESSChargeback successfully completed. The refund has been processed and amount returned.
    REJECTEDChargeback was rejected. The refund could not be completed.

    Error Responses

    Status CodeError MessageCause
    400Either 'id' or 'end_to_end_id' parameter is requiredNo parameter provided. Must send one.
    400Only one parameter should be provided: 'id' or 'end_to_end_id'Both parameters sent. Send only one.
    400Chargeback not foundInvalid ID, or the chargeback is not available for the account you can access
    400field: messageQuery parameter validation failed. The detail names the offending field, and data carries the details
    401Not authenticatedMissing, malformed or expired Bearer token
    403Missing scopes: [...]The token is valid but does not carry the permission required to read chargebacks
    500Internal Server ErrorUnexpected error while processing the request

    All errors are returned in the standard error envelope:

    {
      "worked": false,
      "detail": "Chargeback not found",
      "message": "Chargeback not found",
      "data": null
    }

    Code Examples

    cURL

    # By ID
    curl --request GET \
      --url 'https://api.socredsa.com.br/v2/finance/chargebacks-pix-copy-and-paste/status?id=98765' \
      --header 'Authorization: Bearer YOUR_ACCESS_TOKEN'
    
    # By End-to-End ID
    curl --request GET \
      --url 'https://api.socredsa.com.br/v2/finance/chargebacks-pix-copy-and-paste/status?end_to_end_id=E6070119020210521123456789012345678' \
      --header 'Authorization: Bearer YOUR_ACCESS_TOKEN'

    JavaScript (Node.js)

    const axios = require('axios');
    
    async function checkChargebackStatus(accessToken, chargebackId = null, endToEndId = null) {
      if (!chargebackId && !endToEndId) {
        throw new Error('Either chargebackId or endToEndId must be provided');
      }
    
      const params = chargebackId ? { id: chargebackId } : { end_to_end_id: endToEndId };
    
      try {
        const response = await axios.get(
          'https://api.socredsa.com.br/v2/finance/chargebacks-pix-copy-and-paste/status',
          {
            params,
            headers: {
              'Authorization': `Bearer ${accessToken}`
            }
          }
        );
    
        const { id, status, amount } = response.data;
        console.log(`Chargeback ${id}: ${status} - ${amount} BRL`);
        
        return response.data;
      } catch (error) {
        console.error('Error checking status:', error.response?.data || error.message);
        throw error;
      }
    }
    
    // Usage
    checkChargebackStatus(accessToken, 98765);  // By ID
    checkChargebackStatus(accessToken, null, 'E6070119020210521123456789012345678');  // By E2E ID

    Python

    import requests
    
    def check_chargeback_status(access_token, chargeback_id=None, end_to_end_id=None):
        if not chargeback_id and not end_to_end_id:
            raise ValueError("Either chargeback_id or end_to_end_id must be provided")
        
        url = "https://api.socredsa.com.br/v2/finance/chargebacks-pix-copy-and-paste/status"
        
        params = {"id": chargeback_id} if chargeback_id else {"end_to_end_id": end_to_end_id}
        
        headers = {
            "Authorization": f"Bearer {access_token}"
        }
        
        try:
            response = requests.get(url, params=params, headers=headers)
            response.raise_for_status()
            
            data = response.json()
            print(f"Chargeback {data['id']}: {data['status']} - {data['amount']} BRL")
            
            return data
        
        except requests.exceptions.HTTPError as e:
            print(f"Error checking status: {e.response.text}")
            raise
    
    # Usage
    check_chargeback_status(access_token, chargeback_id=98765)  # By ID
    check_chargeback_status(access_token, end_to_end_id='E6070119020210521123456789012345678')  # By E2E ID

    Business Rules

    Authentication

    • Requires valid Bearer token
    • User must be authenticated

    Parameter Requirements

    • Exactly one parameter must be provided: either id OR end_to_end_id
    • Cannot provide both parameters
    • Cannot omit both parameters

    Query Identifiers

    • Use id for queries using the chargeback ID returned when creating
    • Use end_to_end_id for queries using the End-to-End ID for reconciliation
    • Both identifiers are unique and valid for querying

    Authorization

    • The chargeback must belong to your account
    • Only the account that created the chargeback can query its status

    Polling Recommendations

    • For PENDING status, wait at least 30 seconds between queries
    • External chargebacks typically complete within 5-10 minutes
    • If a chargeback remains PENDING for >30 minutes, contact support
    • Consider implementing webhooks for real-time notifications instead of polling