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

# Get all charges

> Returns a paginated list of charges filtered by the provided criteria.



## OpenAPI

````yaml /api-reference/openapi.yaml get /v1/charges
openapi: 3.0.0
info:
  title: FastPay API
  version: 1.0.0
  description: >-
    API for creating and managing payment charges.


    ## Authentication


    This API uses **Basic Authentication** for direct API access, such as
    creating charges.

    Use your API key as the username and an empty string as password.

    The header should be formatted as:


    `Authorization: Basic {base64(apiKey:)}`.


    For example:


    ```

    Authorization: Basic YWxleG91dG9uOiIi

    ```


    ## Webhooks


    FastPay sends webhooks to notify your application about charge status
    changes in real-time.

    Webhooks are sent via HTTP POST requests to your configured webhook
    endpoints.


    ### Webhook Events


    The following webhook events are available for charges:


    - `charge.created` - Sent when a new charge is created

    - `charge.pending` - Sent when a charge is pending payment

    - `charge.paid` - Sent when a charge is successfully paid

    - `charge.updated` - Sent when a charge is updated


    ### Webhook Payload Structure


    All webhook payloads follow this structure:


    ```json

    {
      "id": "webhook_event_id",
      "event": "charge.paid",
      "data": {
        // Complete charge object
      }
    }

    ```


    ### Webhook Delivery


    - Webhooks are sent via HTTP POST requests

    - Content-Type: `application/json`

    - Retry logic is implemented for failed deliveries

    - Webhook events are stored in the database for audit purposes

    - Delivery logs are maintained for debugging and monitoring


    ### Webhook Security


    - Webhooks are sent to pre-configured endpoints

    - Endpoints can be enabled/disabled per merchant

    - Event filtering is supported (only receive specific events)

    - Failed deliveries are retried with exponential backoff
servers:
  - url: https://api-global.fastpaybrasil.com
    description: Produção e Sandbox (diferenciados pela API key)
security: []
paths:
  /v1/charges:
    get:
      tags:
        - Charges
      summary: Get all charges
      description: Returns a paginated list of charges filtered by the provided criteria.
      parameters:
        - name: page
          in: query
          description: Page number (starts at 1)
          required: false
          schema:
            type: integer
            example: 1
            default: 1
        - name: size
          in: query
          description: Number of items per page
          required: false
          schema:
            type: integer
            example: 20
            default: 10
        - name: orderBy
          in: query
          description: |-
            Order results by fields (comma-separated).
            Prefix with - for descending order.
          required: false
          schema:
            type: string
            example: createdAt,-amount
        - name: status
          in: query
          description: Filter charges by status
          required: false
          schema:
            type: string
            enum:
              - paid
              - pending
              - refused
              - failed
              - refunded
              - in_analysis
              - authentication_required
              - pre_chargeback
              - chargeback
            example: paid
        - name: merchantId
          in: query
          description: Filter charges by merchant ID
          required: false
          schema:
            type: string
            example: 2vorkDcXyvzifL63YX09S9VqcnI
      responses:
        '200':
          description: Successfully retrieved the list of charges
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedChargeList'
        '401':
          description: Unauthorized - invalid credentials
          content:
            application/json:
              schema:
                type: object
                properties:
                  statusCode:
                    type: integer
                    example: 401
                  message:
                    type: string
                    example: Unauthorized
        '403':
          description: Forbidden - insufficient permissions
          content:
            application/json:
              schema:
                type: object
                properties:
                  statusCode:
                    type: integer
                    example: 403
                  message:
                    type: string
                    example: Forbidden
      security:
        - basic: []
components:
  schemas:
    PaginatedChargeList:
      type: object
      properties:
        data:
          type: array
          description: Array of charges in the current page
          items:
            $ref: '#/components/schemas/Charge'
        page:
          type: integer
          description: Current page number
          example: 1
        pages:
          type: integer
          description: Total number of pages available
          example: 10
        total:
          type: integer
          description: Total number of charges across all pages
          example: 100
        size:
          type: integer
          description: Number of charges per page
          example: 10
    Charge:
      type: object
      properties:
        id:
          type: string
          description: The unique identifier of the charge
          example: 2vorkDcXyvzifL63YX09S9VqcnI
        status:
          type: string
          enum:
            - paid
            - pending
            - refused
            - failed
            - refunded
            - in_analysis
            - authentication_required
            - pre_chargeback
            - chargeback
          description: The status of the charge
          example: paid
        chargebackAlertRefunded:
          type: boolean
          nullable: true
          description: >-
            Presente em cobranças com alerta de pré-chargeback (`status:
            pre_chargeback`). `true` = o valor já foi estornado ao portador como
            parte do tratamento do alerta; `false` = disputa aberta sem estorno.
            `null` quando não há alerta.
          example: true
        chargebackAlertReason:
          type: string
          nullable: true
          description: Motivo/referência informado no alerta de pré-chargeback.
          example: Chargeback - NSU 123456789
        pspRefId:
          type: string
          nullable: true
          description: >-
            The reference identifier in the PSP (Payment Service Provider)
            system
          example: ch_123456789
        amount:
          type: number
          description: The total amount of the charge
          example: 100.5
        currency:
          type: string
          description: The currency of the charge in ISO 4217 format
          example: USD
        spread:
          type: number
          description: The spread applied to the charge
          example: 2.5
        net:
          type: number
          description: The net amount after applying the spread
          example: 98
        customer:
          type: object
          properties:
            id:
              type: string
              description: The unique identifier of the customer
              example: 2vorkDcXyvzifL63YX09S9VqcnI
            name:
              type: string
              description: The name of the customer
              example: John Doe
            email:
              type: string
              description: The email address of the customer
              example: john.doe@example.com
            document:
              type: string
              description: The document identifier of the customer
              example: 123.456.789-00
        paymentMethod:
          oneOf:
            - title: Credit Card
              type: object
              required:
                - type
                - firstSix
                - lastFour
                - expirationMonth
                - expirationYear
                - holderName
                - installments
              properties:
                type:
                  type: string
                  enum:
                    - credit_card
                  description: The payment method type.
                  example: credit_card
                firstSix:
                  type: string
                  description: Credit card first six digits.
                  example: '123456'
                lastFour:
                  type: string
                  description: Credit card last four digits.
                  example: '7890'
                expirationMonth:
                  type: string
                  description: Credit card expiration month.
                  example: '08'
                expirationYear:
                  type: string
                  description: Credit card expiration year.
                  example: '2024'
                holderName:
                  type: string
                  description: Credit card holdername.
                  example: John Doe
                installments:
                  type: number
                  description: Number of installments used.
                  example: 3
            - title: Rapipago
              type: object
              required:
                - type
                - identifyType
                - identifyNumber
              properties:
                type:
                  type: string
                  enum:
                    - rapipago
                  description: The payment method type
                  example: rapipago
                identifyType:
                  type: string
                  enum:
                    - dni
                    - cuit
                    - cuil
                    - cdi
                  description: The type of identity document
                  example: dni
                identifyNumber:
                  type: string
                  description: The identification number
                  example: '12345678'
                  minLength: 8
                  maxLength: 11
            - title: Khipu
              type: object
              required:
                - type
                - bankName
                - identifyType
                - identifyNumber
              properties:
                type:
                  type: string
                  enum:
                    - khipu
                  description: The payment method type
                  example: khipu
                bankName:
                  type: string
                  description: The name of the bank
                  example: Bank of America
                identifyType:
                  type: string
                  enum:
                    - dni
                    - cuit
                    - cuil
                    - cdi
                  description: The type of identity document
                  example: dni
                identifyNumber:
                  type: string
                  description: The identification number
                  example: '12345678'
                  minLength: 8
                  maxLength: 11
            - title: QRCode
              type: object
              required:
                - type
                - identifyType
                - identifyNumber
              properties:
                type:
                  type: string
                  enum:
                    - qrcode
                  description: The payment method type
                  example: qrcode
                identifyType:
                  type: string
                  enum:
                    - dni
                    - cuit
                    - cuil
                    - cdi
                  description: The type of identity document
                  example: dni
                identifyNumber:
                  type: string
                  description: The identification number
                  example: '12345678'
                  minLength: 8
                  maxLength: 11
        merchantId:
          type: string
          description: The merchant identifier
          example: 2vorkDcXyvzifL63YX09S9VqcnI
        paymentDetails:
          type: object
          nullable: true
          description: >-
            Additional payment details. Its different based on the payment
            method.
          example:
            authorization_code: '123456'
          oneOf:
            - title: Credit Card
              type: object
              required:
                - firstSix
                - lastFour
                - expirationMonth
                - expirationYear
                - holderName
                - installments
              properties:
                firstSix:
                  type: string
                  description: Credit card first six digits.
                  example: '123456'
                lastFour:
                  type: string
                  description: Credit card last four digits.
                  example: '7890'
                expirationMonth:
                  type: string
                  description: Credit card expiration month.
                  example: '08'
                expirationYear:
                  type: string
                  description: Credit card expiration year.
                  example: '2024'
                holderName:
                  type: string
                  description: Credit card holdername.
                  example: John Doe
                installments:
                  type: number
                  description: Number of installments used.
                  example: 3
            - title: Rapipago
              type: object
              required:
                - barcode
                - paymentCode
                - paymentUrl
              properties:
                barcode:
                  type: string
                  description: Barcode number. (e.g., "3335008****05200211740749")
                  example: 3335008****05200211740749
                paymentCode:
                  type: string
                  description: The ticket number that the user needs to use for payment.
                  example: '1111111111'
                paymentUrl:
                  type: string
                  description: |-
                    Link to complete the payment. This link is
                    dynamically created by the provider (PSP).
                  example: http://payment.link
            - title: Khipu
              type: object
              required:
                - payUrl
              properties:
                payUrl:
                  type: string
                  description: |-
                    Link to complete the payment. This link is
                    dynamically created by the provider (PSP).
                  example: http://payment.link
            - title: Pix
              type: object
              required:
                - endToEndId
                - copyPaste
              properties:
                endToEndId:
                  type: string
                  description: End to End Pix ID.
                  example: '1231389'
                copyPaste:
                  type: string
                  description: Pix payment link to use with "copy and paste".
                  example: http://091230.pix/12321309
            - title: QRCode
              type: object
              required:
                - payUrl
              properties:
                payUrl:
                  type: string
                  description: |-
                    Link to complete the payment. This link is
                    dynamically created by the provider (PSP).
                  example: http://payment.link
        metadata:
          type: object
          nullable: true
          description: Custom metadata associated with the charge
          example:
            order_id: '123'
            user_id: '456'
        paidAt:
          type: string
          format: date-time
          nullable: true
          description: The date and time when the charge was paid
          example: '2023-01-15T14:30:00Z'
        createdAt:
          type: string
          format: date-time
          description: The date and time when the charge was created
          example: '2023-01-15T14:30:00Z'
        updatedAt:
          type: string
          format: date-time
          description: The date and time when the charge was last updated
          example: '2023-01-15T14:30:00Z'
  securitySchemes:
    basic:
      type: http
      scheme: basic
      description: |-
        HTTP Basic authentication. Use your secret key as the
        username and an empty string as password. The API key
        should be base64 encoded in the format 'username:' when
        sending the Authorization header.

````