> ## Documentation Index
> Fetch the complete documentation index at: https://docs.wepayout.co/llms.txt
> Use this file to discover all available pages before exploring further.

# Get Unique Charge

> Get details of a specific charge by ID

# Get Unique Charge

Get details of a specific charge by ID.

## Path Parameters

<ParamField path="id" type="integer" required>
  The charge ID to retrieve.

  Example: `32457`
</ParamField>

## Response

Returns a single charge object with all details.

<ResponseField name="id" type="integer">
  WEpayment's auto generated id, use this id to perform conciliation or perform queries via API / Dashboard.
</ResponseField>

<ResponseField name="merchant" type="object">
  Merchant object.

  <Expandable title="Merchant">
    <ResponseField name="id" type="integer">
      Id of the WE account that created the payin.
    </ResponseField>

    <ResponseField name="name" type="string">
      Name of the WE account that created the payin.
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="hash" type="string">
  WEpayments auto generated hash, use this hash to send your user to the payment page.
</ResponseField>

<ResponseField name="payment_page" type="string">
  The WEpayments payment page is the place where you will redirect the end customer to pay the bill.
</ResponseField>

<ResponseField name="our_number" type="string">
  The bank identification number.
</ResponseField>

<ResponseField name="invoice" type="string">
  Your identification number.
</ResponseField>

<ResponseField name="notification_url" type="string">
  The url where we will submit the callbacks.
</ResponseField>

<ResponseField name="payment_method" type="string">
  Payment method that will be used in payin.

  Values: `pix`, `boleto`
</ResponseField>

<ResponseField name="currency" type="object">
  Currency object.

  <Expandable title="Currency">
    <ResponseField name="id" type="integer">
      Currency id.
    </ResponseField>

    <ResponseField name="name" type="string">
      Currency name.
    </ResponseField>

    <ResponseField name="code" type="string">
      Currency code (ISO 4217).
    </ResponseField>

    <ResponseField name="symbol" type="string">
      Currency symbol.
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="amount" type="integer">
  The payin total amount in cents.
</ResponseField>

<ResponseField name="paid_amount" type="integer">
  The total amount of the payin paid.
</ResponseField>

<ResponseField name="refunded_amount" type="integer">
  Amount refunded from this charge. Only pix payment\_method.
</ResponseField>

<ResponseField name="description" type="string">
  Instructions that will be displayed to the user.
</ResponseField>

<ResponseField name="buyer" type="object">
  The person you are charging object.

  <Expandable title="Buyer">
    <ResponseField name="name" type="string">
      The buyer name.
    </ResponseField>

    <ResponseField name="email" type="string">
      Buyer's email.
    </ResponseField>

    <ResponseField name="document" type="object">
      The buyer document object.

      <Expandable title="Document">
        <ResponseField name="type" type="string">
          Document type (CPF, CNPJ).
        </ResponseField>

        <ResponseField name="number" type="string">
          Document number.
        </ResponseField>
      </Expandable>
    </ResponseField>

    <ResponseField name="address" type="object">
      The buyer's address object.

      <Expandable title="Address">
        <ResponseField name="country" type="string">
          Country code.
        </ResponseField>

        <ResponseField name="city" type="string">
          City name.
        </ResponseField>

        <ResponseField name="street" type="string">
          Street name.
        </ResponseField>

        <ResponseField name="number" type="string">
          Street number.
        </ResponseField>

        <ResponseField name="complement" type="string">
          Address complement.
        </ResponseField>

        <ResponseField name="zipcode" type="string">
          ZIP/Postal code.
        </ResponseField>

        <ResponseField name="district" type="string">
          District/Neighborhood.
        </ResponseField>

        <ResponseField name="state_code" type="string">
          State code.
        </ResponseField>
      </Expandable>
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="originator_legal_entity" type="object">
  Final Beneficiary object.

  <Expandable title="Originator Legal Entity">
    <ResponseField name="name" type="string">
      The final beneficiary name to appear in the payin.
    </ResponseField>

    <ResponseField name="document" type="string">
      The tax ID to appear in the charge.
    </ResponseField>

    <ResponseField name="helpdesk" type="string">
      Website, e-mail address or other customer channel to appear in the payin.
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="pix" type="object">
  Pix QRCode specific instructions object (when payment\_method is pix).

  <Expandable title="Pix">
    <ResponseField name="expire_date" type="string">
      Expiration date in format YYYY-MM-DDTHH:MM:SS.
    </ResponseField>

    <ResponseField name="refund_mode" type="string">
      Type of refund mode.
    </ResponseField>

    <ResponseField name="qr_code" type="string">
      QRCode Pix / Copy and paste that will be used by your end customer to make the payin payment.
    </ResponseField>

    <ResponseField name="qr_code_url" type="string">
      QR Code URL.
    </ResponseField>

    <ResponseField name="end_to_end" type="string">
      Unique identifier for a transaction.
    </ResponseField>

    <ResponseField name="fine" type="object">
      Fine when the expiration date is reached.
    </ResponseField>

    <ResponseField name="discount" type="object">
      Discount when a certain date is reached.
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="boleto" type="object">
  Boleto specific instructions object (when payment\_method is boleto).

  <Expandable title="Boleto">
    <ResponseField name="expire_date" type="string">
      Expiration date in format YYYY-MM-DD.
    </ResponseField>

    <ResponseField name="digitable_line" type="string">
      Typed boleto line that will be used by your end customer to pay payin.
    </ResponseField>

    <ResponseField name="bar_code_number" type="string">
      Barcode number for the boleto.
    </ResponseField>

    <ResponseField name="agreement" type="object">
      Extra data for billet rendering.
    </ResponseField>

    <ResponseField name="fine" type="object">
      Fine when the expiration date is reached.
    </ResponseField>

    <ResponseField name="discount" type="object">
      Discount when a certain date is reached.
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="status" type="object">
  Status object.

  <Expandable title="Status">
    <ResponseField name="id" type="integer">
      Status id.
    </ResponseField>

    <ResponseField name="name" type="string">
      Status name.
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="status_history" type="array">
  Status History object.

  <Expandable title="Status History Item">
    <ResponseField name="status" type="object">
      Status object.
    </ResponseField>

    <ResponseField name="updated_at" type="string">
      Status update date.
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="substatus" type="object">
  Sub status object.

  <Expandable title="Substatus">
    <ResponseField name="id" type="integer">
      The Id of the substatus.
    </ResponseField>

    <ResponseField name="name" type="string">
      The substatus meaning.
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="reason_canceled" type="object">
  Reason for the payin cancellation (only appears if the payin was cancelled).

  <Expandable title="Reason Canceled">
    <ResponseField name="id" type="integer">
      The ID cancellation in our database.

      Possible values:

      * `1` - Canceled By Processor
      * `2` - Canceled By Client
    </ResponseField>

    <ResponseField name="name" type="string">
      The cancellation meaning.

      Possible values:

      * `Canceled By Processor`
      * `Canceled By Client`
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="kyc" type="object">
  Know your customer object.

  <Expandable title="KYC">
    <ResponseField name="id" type="integer">
      The KYC ID in our database.
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="refunds" type="array">
  Refund object.

  <Expandable title="Refund">
    <ResponseField name="id" type="integer">
      Refund id.
    </ResponseField>

    <ResponseField name="status" type="object">
      Current status of the refund.
    </ResponseField>

    <ResponseField name="amount" type="integer">
      Refund amount.
    </ResponseField>

    <ResponseField name="reason" type="string">
      Free field to inform the reason for the refund.
    </ResponseField>

    <ResponseField name="created_at" type="string">
      Refund created date.
    </ResponseField>

    <ResponseField name="updated_at" type="string">
      Refund update date.
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="automatic_pix" type="object">
  Automatic Pix configuration (if enabled).
</ResponseField>

<ResponseField name="created_at" type="string">
  Cash-in created date.
</ResponseField>

<ResponseField name="updated_at" type="string">
  Cash-in update date.
</ResponseField>

## Request Example

<CodeGroup>
  ```bash cURL theme={null}
  curl --request GET \
    --url https://api.sandbox.wepayout.com.br/v2/payin/payments/32457 \
    --header 'Accept: application/json' \
    --header 'Authorization: Bearer 123'
  ```

  ```javascript JavaScript theme={null}
  async function getChargeById(id) {
    const response = await fetch(
      `https://api.sandbox.wepayout.com.br/v2/payin/payments/${id}`,
      {
        headers: {
          'Accept': 'application/json',
          'Authorization': 'Bearer 123'
        }
      }
    );
    
    return await response.json();
  }

  // Usage
  const charge = await getChargeById(32457);
  console.log('Charge:', charge);
  ```

  ```python Python theme={null}
  import requests

  def get_charge_by_id(charge_id):
      url = f'https://api.sandbox.wepayout.com.br/v2/payin/payments/{charge_id}'
      headers = {
          'Accept': 'application/json',
          'Authorization': 'Bearer 123'
      }
      
      response = requests.get(url, headers=headers)
      return response.json()

  # Usage
  charge = get_charge_by_id(32457)
  print('Charge:', charge)
  ```
</CodeGroup>

<ResponseExample>
  ```json 200 OK - Pix Charge theme={null}
  {
    "id": 51644,
    "merchant": {
      "id": 477,
      "name": "Merchant Name"
    },
    "hash": "bf0976019f5349567a315262cdb4d54e98842061fa26ed0a844c8384a40a58ee",
    "payment_page": "https://pagar.sandbox.goboleto.com/?hash=bf0976019f5349567a315262cdb4d54e98842061fa26ed0a844c8384a40a58ee",
    "our_number": "30858",
    "invoice": "YOUR-INVOICE-1234",
    "notification_url": "https://your-webhook-url.com/notify",
    "payment_method": "pix",
    "amount": 3000,
    "paid_amount": null,
    "refunded_amount": 0,
    "currency": {
      "id": 19,
      "name": "Reais",
      "code": "BRL",
      "symbol": "R$"
    },
    "description": "Descrição",
    "created_at": "2025-11-14T17:35:33.000000Z",
    "updated_at": "2025-11-14T17:35:36.000000Z",
    "buyer": {
      "name": "Customer Name",
      "email": "customer@example.com",
      "document": {
        "type": "cnpj",
        "number": "99999919999979"
      },
      "address": {
        "country": "BR",
        "city": null,
        "street": null,
        "number": null,
        "complement": null,
        "zipcode": null,
        "district": null,
        "state_code": null
      }
    },
    "originator_legal_entity": {
      "name": "Empresa X",
      "document": "56251499000164",
      "helpdesk": "wepayments.com.br"
    },
    "pix": {
      "expire_date": "2025-12-31 23:59:59",
      "refund_mode": "FULL_REFUND_MERCHANT",
      "qr_code": "00020126910014BR.GOV.BCB.PIX2569api-pix-h.bancobs2.com.br/spi/v2/7cc95f1a-743e-4f4a-a3ad-e2ba14f5f6f8520400005303986540510.005802BR5908Wepayout6014Belo Horizonte61083038040362070503***63049F6B",
      "end_to_end": null,
      "fine": {
        "percent": null,
        "amount": null,
        "date": null
      },
      "discount": {
        "percent": null,
        "amount": null,
        "date": null
      }
    },
    "status": {
      "id": 1,
      "name": "Created"
    },
    "status_history": [
      {
        "status": {
          "id": 1,
          "name": "Created"
        },
        "updated_at": "2025-11-14T17:35:36.000000Z"
      }
    ],
    "substatus": null,
    "refunds": [],
    "automatic_pix": null
  }
  ```

  ```json 200 OK - Canceled Charge theme={null}
  {
    "id": 51615,
    "merchant": {
      "id": 507,
      "name": "Merchant Name"
    },
    "hash": "a014e4043acf0631c29dbce842a11a2120ecd8fec71aa8ad72979b0efd26f14a",
    "payment_page": "https://pagar.sandbox.goboleto.com/?hash=a014e4043acf0631c29dbce842a11a2120ecd8fec71aa8ad72979b0efd26f14a",
    "our_number": "30831",
    "invoice": "YOUR-INVOICE-4567",
    "notification_url": "https://your-webhook-url.com/notify",
    "payment_method": "pix",
    "amount": 96728,
    "paid_amount": null,
    "refunded_amount": 0,
    "currency": {
      "id": 19,
      "name": "Reais",
      "code": "BRL",
      "symbol": "R$"
    },
    "description": "Bill collection",
    "created_at": "2025-11-14T08:10:29.000000Z",
    "updated_at": "2025-11-14T08:20:38.000000Z",
    "buyer": {
      "name": "Customer Name",
      "email": "customer@example.com",
      "document": {
        "type": "cpf",
        "number": "34960826312"
      },
      "address": {
        "country": "BR",
        "city": null,
        "street": null,
        "number": null,
        "complement": null,
        "zipcode": null,
        "district": null,
        "state_code": null
      }
    },
    "originator_legal_entity": {
      "name": "Company Name",
      "document": "34960826312",
      "helpdesk": "https://www.company-website.com/"
    },
    "pix": {
      "expire_date": "2025-11-15 16:10:29",
      "refund_mode": "FULL_REFUND_MERCHANT",
      "qr_code": "00020126910014BR.GOV.BCB.PIX2569api-pix-h.bancobs2.com.br/spi/v2/7cc95f1a-743e-4f4a-a3ad-e2ba14f5f6f8520400005303986540510.005802BR5908Wepayout6014Belo Horizonte61083038040362070503***63049F6B",
      "end_to_end": null,
      "fine": {
        "percent": null,
        "amount": null,
        "date": null
      },
      "discount": {
        "percent": null,
        "amount": null,
        "date": null
      }
    },
    "status": {
      "id": 2,
      "name": "Canceled"
    },
    "status_history": [
      {
        "status": {
          "id": 1,
          "name": "Created"
        },
        "updated_at": "2025-11-14T08:10:31.000000Z"
      },
      {
        "status": {
          "id": 2,
          "name": "Canceled"
        },
        "updated_at": "2025-11-14T08:20:38.000000Z"
      }
    ],
    "substatus": null,
    "reason_canceled": {
      "id": 1,
      "name": "Canceled By Processor"
    },
    "refunds": [],
    "automatic_pix": null
  }
  ```

  ```json 404 Not Found theme={null}
  {
    "message": "Charge not found"
  }
  ```
</ResponseExample>

## Use Cases

<AccordionGroup>
  <Accordion title="Check Payment Status">
    Monitor the payment status of a specific charge:

    ```javascript theme={null}
    async function checkPaymentStatus(chargeId) {
      const charge = await getChargeById(chargeId);
      
      console.log(`Charge ${charge.invoice}:`);
      console.log(`Status: ${charge.status.name}`);
      console.log(`Amount: R$ ${charge.amount / 100}`);
      console.log(`Paid: R$ ${charge.paid_amount / 100}`);
      
      return charge.status.id === 4; // 4 = Pago
    }
    ```
  </Accordion>

  <Accordion title="Get QR Code">
    Retrieve the Pix QR Code for display:

    ```javascript theme={null}
    async function getPixQRCode(chargeId) {
      const charge = await getChargeById(chargeId);
      
      if (charge.payment_method !== 'pix') {
        throw new Error('Not a Pix charge');
      }
      
      return {
        qrCode: charge.pix.qr_code,
        qrCodeUrl: charge.pix.qr_code_url,
        expiresAt: charge.pix.expire_date
      };
    }
    ```
  </Accordion>

  <Accordion title="Get Boleto Details">
    Retrieve boleto payment details:

    ```javascript theme={null}
    async function getBoletoDetails(chargeId) {
      const charge = await getChargeById(chargeId);
      
      if (charge.payment_method !== 'boleto') {
        throw new Error('Not a Boleto charge');
      }
      
      return {
        digitableLine: charge.boleto.digitable_line,
        barCode: charge.boleto.bar_code_number,
        expiresAt: charge.boleto.expire_date,
        ourNumber: charge.our_number
      };
    }
    ```
  </Accordion>

  <Accordion title="Track Status History">
    View the complete status history of a charge:

    ```javascript theme={null}
    async function getStatusHistory(chargeId) {
      const charge = await getChargeById(chargeId);
      
      console.log(`Status history for charge ${charge.invoice}:`);
      charge.status_history.forEach(history => {
        console.log(`${history.updated_at}: ${history.status.name}`);
      });
      
      return charge.status_history;
    }
    ```
  </Accordion>

  <Accordion title="Verify Payment">
    Verify if a charge has been paid:

    ```javascript theme={null}
    async function verifyPayment(chargeId) {
      const charge = await getChargeById(chargeId);
      
      const isPaid = charge.status.id === 4;
      const paidAmount = charge.paid_amount;
      const expectedAmount = charge.amount;
      
      return {
        isPaid,
        paidAmount,
        expectedAmount,
        fullyPaid: isPaid && paidAmount >= expectedAmount
      };
    }
    ```
  </Accordion>
</AccordionGroup>

## Best Practices

<Note>
  **ID Lookup**: Use the numeric charge ID to retrieve charge details.
</Note>

<Tip>
  **Status Monitoring**: Check the `status_history` array to see the complete timeline of status changes for the charge.
</Tip>

<Warning>
  **QR Code Expiration**: For Pix charges, always check the `expire_date` before displaying the QR Code to ensure it hasn't expired.
</Warning>
