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

# Create Next Collection

> Create next collection



## OpenAPI

````yaml v2/api-reference/openapi.json POST /v2/in/pix/recurrences/collections/next
openapi: 3.0.0
info:
  title: Trio API v2
  version: 2026-10-19.v2
servers:
  - url: https://api.sandbox.trio.com.br
    variables: {}
  - url: https://api.qa.trio.com.br
    variables: {}
  - url: https://api.trio.com.br
    variables: {}
security: []
tags: []
paths:
  /v2/in/pix/recurrences/collections/next:
    parameters:
      - description: >-
          Version of the v2 contract the client is written against. Each
          breaking change publishes a new version.
        example: 2026-10-19.v2
        in: header
        name: Trio-Version
        required: true
        schema:
          enum:
            - 2026-10-19.v2
          type: string
          x-struct: null
          x-validate: null
      - description: >-
          ID of another org to act on instead of the API key's own org. The
          key's org must have been granted access to it, and the request is
          refused with 403 FORBIDDEN otherwise. When that access or the API key
          is read-only, only GET and HEAD requests may carry it. When the target
          org requires mTLS, so does the request. Leave it out to act on the
          key's own org.
        in: header
        name: Trio-Target-Org-Id
        required: false
        schema:
          format: uuid
          type: string
          x-struct: null
          x-validate: null
    post:
      tags:
        - Receivables (in)
        - Recurrences
        - Collections
      summary: Create next collection
      description: Create next collection
      operationId: >-
        TrioFoundationWeb.V2.In.Pix.Recurrence.CollectionController.create_next_collection
      parameters: []
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/V2_CreateNextCollectionParams'
        description: Create next_collection attributes
        required: true
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/V2_RecurrenceCollectionResponse'
          description: Collection
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/V2_error'
          description: >-
            Malformed request: a body that is not valid JSON
            (MALFORMED_REQUEST), or a Trio-Version header that is missing or not
            the current one (INVALID_TRIO_VERSION).
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/V2_error'
          description: Missing or invalid API key credentials (INVALID_CREDENTIALS).
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/V2_error'
          description: >-
            The API key may not do this (FORBIDDEN): for instance
            Trio-Target-Org-Id names an org it has no access to, or writes
            through a read-only access.
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/V2_error'
          description: >-
            Invalid input (INVALID_PARAMETER, REQUIRED_PARAMETER, or the code of
            the rule the request breaks). A request outside the operation's
            schema lists the offending fields in `errors`.
        '503':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/V2_error'
          description: >-
            A service needed to answer is unavailable
            (TRIO_SERVICE_UNAVAILABLE).
      callbacks: {}
      security:
        - authorization: []
components:
  schemas:
    V2_CreateNextCollectionParams:
      description: Body params to create the next collection of a recurrence
      example:
        recurrence_id: 019a0d9e-d161-cd70-e9bd-f90cf4b50e33
      properties:
        recurrence_id:
          description: Recurrence ID
          format: uuid
          type: string
          x-struct: null
          x-validate: null
      required:
        - recurrence_id
      title: V2 CreateNextCollectionParams
      type: object
      x-struct: >-
        Elixir.TrioFoundationWeb.Schemas.Banking.V2.Cashin.Recurrence.Collection.CreateNextCollectionParams
      x-validate: null
    V2_RecurrenceCollectionResponse:
      description: Recurrence collection response with stages and attempts
      example:
        data:
          additional_info: ''
          amount:
            amount: 0
            currency: ''
          attempts:
            - due_date: '2025-07-14'
              end_to_end_id: E33333333202507141500duiiTl1rnpc
              external_id: null
              id: 019809e6-c836-fe49-0b1a-ccd48befb6b8
              inserted_at: '2025-07-14T17:06:16.606122Z'
              status: requested
              transaction_date: null
              updated_at: '2025-07-14T17:06:16.606122Z'
          bank_account_id: 02ef9c5f-29e6-48fc-9ec3-7ed57ed351f6
          final_date: '2020-04-20'
          id: 02ef9c5f-29e6-48fc-9ec3-7ed57ed351f6
          inserted_at: '2020-04-20T16:20:00Z'
          next_working_day: false
          recurrence:
            id: 02ef9c5f-29e6-48fc-9ec3-7ed57ed351f6
          stages:
            - error_code: null
              error_message: null
              id: 019a0d9e-d21f-5a1e-0c1d-9e5f2b8a7c31
              inserted_at: '2025-10-22T20:31:46.843629Z'
              status: active
          status: created
          transaction_date: '2020-04-20T16:20:00Z'
          updated_at: '2020-04-20T16:20:00Z'
      properties:
        data:
          $ref: '#/components/schemas/V2_RecurrenceCollectionDataWithStages'
      title: V2 RecurrenceCollectionResponse
      type: object
      x-struct: >-
        Elixir.TrioFoundationWeb.Schemas.Banking.V2.Cashin.Recurrence.Collection.Response
      x-validate: null
    V2_error:
      example:
        error:
          error_code: INVALID_PARAMETER
          error_message: 'Invalid parameters: /amount: Invalid integer. Got: string'
          errors:
            - field: /amount
              message: 'Invalid integer. Got: string'
      properties:
        error:
          properties:
            error_code:
              description: >-
                Stable UPPER_SNAKE identifier of the error, for programs and
                logs. Branch on this, not on the message.
              type: string
              x-struct: null
              x-validate: null
            error_message:
              description: Human readable explanation of the error.
              type: string
              x-struct: null
              x-validate: null
            errors:
              description: >-
                Only on INVALID_PARAMETER for a request outside the operation's
                schema: one entry per offending field.
              items:
                properties:
                  field:
                    description: JSON pointer to the field, e.g. /amount.
                    type: string
                    x-struct: null
                    x-validate: null
                  message:
                    description: What is wrong with it.
                    type: string
                    x-struct: null
                    x-validate: null
                required:
                  - field
                  - message
                type: object
                x-struct: null
                x-validate: null
              type: array
              x-struct: null
              x-validate: null
          required:
            - error_code
            - error_message
          type: object
          x-struct: null
          x-validate: null
      required:
        - error
      title: V2 error
      type: object
      x-struct: Elixir.TrioFoundationWeb.Schemas.HTTP.V2Error
      x-validate: null
    V2_RecurrenceCollectionDataWithStages:
      description: >-
        A recurrence collection. `stages` and `attempts` are present only when
        asked for with `load_stages` / `load_attempts`.
      properties:
        additional_info:
          description: Additional information sent to the payer
          nullable: true
          type: string
          x-struct: null
          x-validate: null
        amount:
          description: Collection amount
          nullable: true
          properties:
            amount:
              description: Amount in cents
              type: integer
              x-struct: null
              x-validate: null
            currency:
              description: Currency
              type: string
              x-struct: null
              x-validate: null
          type: object
          x-struct: null
          x-validate: null
        attempts:
          items:
            $ref: '#/components/schemas/V2_RecurrenceCollectionAttemptEmbeddedData'
          type: array
          x-struct: null
          x-validate: null
        bank_account_id:
          description: Bank account that receives the collection
          format: uuid
          type: string
          x-struct: null
          x-validate: null
        final_date:
          description: Last day of the collection
          format: date
          nullable: true
          type: string
          x-struct: null
          x-validate: null
        id:
          description: Collection ID
          format: uuid
          type: string
          x-struct: null
          x-validate: null
        inserted_at:
          description: When the collection was created
          format: date-time
          type: string
          x-struct: null
          x-validate: null
        next_working_day:
          description: Whether a collection on a non-working day moves to the next one
          type: boolean
          x-struct: null
          x-validate: null
        recurrence:
          description: Recurrence the collection belongs to
          properties:
            id:
              description: Recurrence ID
              format: uuid
              type: string
              x-struct: null
              x-validate: null
          type: object
          x-struct: null
          x-validate: null
        stages:
          items:
            $ref: '#/components/schemas/V2_RecurrenceCollectionStageData'
          type: array
          x-struct: null
          x-validate: null
        status:
          description: Collection status
          enum:
            - created
            - active
            - settled
            - expired
            - rejected
            - cancelled
          type: string
          x-struct: null
          x-validate: null
        transaction_date:
          description: Transaction date
          format: date-time
          nullable: true
          type: string
          x-struct: null
          x-validate: null
        updated_at:
          description: When the collection was last updated
          format: date-time
          type: string
          x-struct: null
          x-validate: null
      title: V2 RecurrenceCollectionDataWithStages
      type: object
      x-struct: >-
        Elixir.TrioFoundationWeb.Schemas.Banking.V2.Cashin.Recurrence.Collection.DataWithStagesAndAttempts
      x-validate: null
    V2_RecurrenceCollectionAttemptEmbeddedData:
      description: >-
        An attempt to charge a recurrence collection. `stages` is present only
        when they were loaded.
      example:
        due_date: '2025-07-14'
        end_to_end_id: E33333333202507141500duiiTl1rnpc
        external_id: null
        id: 019809e6-c836-fe49-0b1a-ccd48befb6b8
        inserted_at: '2025-07-14T17:06:16.606122Z'
        status: requested
        transaction_date: null
        updated_at: '2025-07-14T17:06:16.606122Z'
      properties:
        due_date:
          description: Day the attempt is due
          format: date
          type: string
          x-struct: null
          x-validate: null
        end_to_end_id:
          description: Pix end to end ID
          nullable: true
          type: string
          x-struct: null
          x-validate: null
        external_id:
          description: External ID
          nullable: true
          type: string
          x-struct: null
          x-validate: null
        id:
          description: Attempt ID
          format: uuid
          type: string
          x-struct: null
          x-validate: null
        inserted_at:
          description: When the attempt was created
          format: date-time
          type: string
          x-struct: null
          x-validate: null
        stages:
          description: Attempt stages
          items:
            $ref: '#/components/schemas/V2_RecurrenceCollectionAttemptStage'
          type: array
          x-struct: null
          x-validate: null
        status:
          description: Attempt status
          enum:
            - requested
            - scheduled
            - settled
            - cancelled
            - rejected
            - expired
            - failed
          type: string
          x-struct: null
          x-validate: null
        transaction_date:
          description: When the attempt was paid
          format: date-time
          nullable: true
          type: string
          x-struct: null
          x-validate: null
        updated_at:
          description: When the attempt was last updated
          format: date-time
          type: string
          x-struct: null
          x-validate: null
      title: V2 RecurrenceCollectionAttemptEmbeddedData
      type: object
      x-struct: >-
        Elixir.TrioFoundationWeb.Schemas.Banking.V2.Cashin.Recurrence.Collection.Attempt.EmbeddedData
      x-validate: null
    V2_RecurrenceCollectionStageData:
      description: >-
        A stage of a recurrence collection. `error_code` and `error_message`
        carry the rejection reason when there is one.
      example:
        error_code: null
        error_message: null
        id: 019a0d9e-d21f-5a1e-0c1d-9e5f2b8a7c31
        inserted_at: '2025-10-22T20:31:46.843629Z'
        status: active
      properties:
        error_code:
          description: Rejection code
          nullable: true
          type: string
          x-struct: null
          x-validate: null
        error_message:
          description: Rejection description
          nullable: true
          type: string
          x-struct: null
          x-validate: null
        id:
          description: Stage ID
          format: uuid
          type: string
          x-struct: null
          x-validate: null
        inserted_at:
          description: When the stage was recorded
          format: date-time
          type: string
          x-struct: null
          x-validate: null
        status:
          description: Collection status the stage recorded
          enum:
            - created
            - active
            - settled
            - expired
            - rejected
            - cancelled
            - attempt_link
          type: string
          x-struct: null
          x-validate: null
      title: V2 RecurrenceCollectionStageData
      type: object
      x-struct: null
      x-validate: null
    V2_RecurrenceCollectionAttemptStage:
      description: >-
        A stage of a collection attempt. `error_code` carries the rejection code
        when there is one.
      example:
        error_code: null
        error_message: null
        id: 019809e6-c836-5a1e-0c1d-9e5f2b8a7c31
        inserted_at: '2025-07-14T17:06:16.606122Z'
        status: requested
      properties:
        error_code:
          description: Rejection code
          nullable: true
          type: string
          x-struct: null
          x-validate: null
        error_message:
          description: Error message
          nullable: true
          type: string
          x-struct: null
          x-validate: null
        id:
          description: Stage ID
          format: uuid
          type: string
          x-struct: null
          x-validate: null
        inserted_at:
          description: When the stage was recorded
          format: date-time
          type: string
          x-struct: null
          x-validate: null
        status:
          description: Attempt status the stage recorded
          enum:
            - requested
            - scheduled
            - settled
            - cancelled
            - rejected
            - expired
            - failed
          type: string
          x-struct: null
          x-validate: null
      title: V2 RecurrenceCollectionAttemptStage
      type: object
      x-struct: >-
        Elixir.TrioFoundationWeb.Schemas.Banking.V2.Cashin.Recurrence.Collection.Attempt.Stage
      x-validate: null
  securitySchemes:
    authorization:
      scheme: basic
      type: http

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.