Stark Bank Brcode Payment API

Here we will teach you how to create and manage brcode payments.

OpenAPI Specification

stark-bank-brcode-payment-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: Stark Bank Balance Brcode Payment API
  version: v2
  description: 'This is our second API version. It is another small step towards launching the product we want to create for you, but it''s a giant leap for the brazilian financial market. We created the first banking API in Brazil and we are proud of it.

    Our API is RESTFul. This means we use predictable, resource-oriented URLs to do banking operations. The API itself speaks exclusively in JSON, including errors, but our SDK libraries convert responses to appropriate language-specific objects.

    Want to check our OpenAPI 3.1 specification? You can download our yaml file right here.

    You can also try our Postman collection. Download it here.

    '
  contact:
    name: Stark Bank Developers
    email: help@starkbank.com
    url: https://starkbank.com
  license:
    name: Stark Bank License
servers:
- url: https://api.starkbank.com
  description: Production
- url: https://sandbox.api.starkbank.com
  description: Sandbox
security:
- digitalSignature: []
tags:
- name: Brcode Payment
  description: Here we will teach you how to create and manage brcode payments.
paths:
  /v2/brcode-payment:
    post:
      summary: Create Brcode Payments
      operationId: create-brcodePayment
      tags:
      - Brcode Payment
      description: 'Use this route to pay registered brcodes generated at Stark Bank or at other financial institutions using the available balance in your Stark Bank account.

        NOTE:Initially, the brcode entity amount will be zero because the brcode is processed asynchronously.

        '
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                brcode:
                  type: string
                  description: Brcode that describes the payment.
                description:
                  type: string
                  description: Text to be displayed in your statement. Min length = 10.
                taxId:
                  type: string
                  description: 'Receiver CPF (11 digits formatted or unformatted) or CNPJ (14 digits formatted or unformatted). Example: 012.345.678-90.'
                amount:
                  type: integer
                  description: 'If the brcode does not provide an amount, this parameter is mandatory, else it is optional. Example: 23456 (R$ 234,56).'
                rules:
                  type: array
                  items:
                    type: string
                  description: 'List of rules for modifying brcodePayment behavior. Example:

                    [{"key": "resendingLimit", "value": 5}]

                    '
                scheduled:
                  type: string
                  format: date-time
                  description: Schedule the payment for a specific date. Default value is the current day.
                tags:
                  type: array
                  items:
                    type: string
                  description: Array of strings to tag the entity for future queries. All tags will be converted to lowercase.
              required:
              - brcode
              - description
              - taxId
              - amount
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                type: object
        '400':
          description: Client error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors'
        '500':
          description: Server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors'
    get:
      summary: List Brcode Payments
      operationId: list-brcodePayment
      tags:
      - Brcode Payment
      description: Get a list of non-deleted brcodes in chunks of at most 100. If you need smaller chunks, use the limit parameter.
      parameters:
      - name: after
        in: query
        description: Filter entities created after this date.
        required: false
        schema:
          type: string
          format: date
      - name: before
        in: query
        description: Filter entities created before this date.
        required: false
        schema:
          type: string
          format: date
      - name: cursor
        in: query
        description: String used to get the next batch of results. Our SDKs handle this for you.
        required: false
        schema:
          type: string
      - name: fields
        in: query
        description: List of strings to filter response JSON keys. Not available in the SDKs.
        required: false
        schema:
          type: array
          items:
            type: string
      - name: ids
        in: query
        description: List of strings to get specific entities by ids.
        required: false
        schema:
          type: array
          items:
            type: string
      - name: limit
        in: query
        description: Number of results per cursor. Max = 100.
        required: false
        schema:
          type: integer
          minimum: 1
          maximum: 100
      - name: status
        in: query
        description: Filter brcode payments by the specified status.
        required: false
        schema:
          type: string
      - name: tags
        in: query
        description: Filter entities that contain the specified tags.
        required: false
        schema:
          type: array
          items:
            type: string
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                type: object
        '400':
          description: Client error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors'
        '500':
          description: Server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors'
  /v2/brcode-payment/{id}:
    get:
      summary: Get a Brcode Payment
      operationId: get-brcodePayment-byId
      tags:
      - Brcode Payment
      description: Get a single brcode by its id.
      parameters:
      - name: id
        in: path
        description: Id of the brcode entity.
        required: true
        schema:
          type: string
      - name: fields
        in: query
        description: List of strings to filter response JSON keys. Not available in the SDKs.
        required: false
        schema:
          type: array
          items:
            type: string
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                type: object
        '400':
          description: Client error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors'
        '500':
          description: Server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors'
    patch:
      summary: Update a Brcode Payment
      operationId: update-brcodePayment-byId
      tags:
      - Brcode Payment
      description: Update a single brcode payment, if it hasn't been paid yet.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                status:
                  type: string
                  description: This can be used to cancel the payment by passing "canceled" as the status patch.
      parameters:
      - name: id
        in: path
        description: Id of the brcode payment entity.
        required: true
        schema:
          type: string
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                type: object
        '400':
          description: Client error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors'
        '500':
          description: Server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors'
  /v2/brcode-payment/{id}/pdf:
    get:
      summary: Get a Brcode Payment PDF
      operationId: get-brcodePayment-byId-pdf
      tags:
      - Brcode Payment
      description: Get a brcode payment PDF receipt. You can only get a receipt for payments whose status are either success, processing or created.
      parameters:
      - name: id
        in: path
        description: Id of the brcode payment entity
        required: true
        schema:
          type: string
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                type: object
        '400':
          description: Client error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors'
        '500':
          description: Server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors'
  /v2/brcode-payment/log:
    get:
      summary: List Brcode Payment Logs
      operationId: list-brcodePayment-log
      tags:
      - Brcode Payment
      description: Get a paged list of all brcode payment logs. A log tracks a change in the payment entity according to its life cycle.
      parameters:
      - name: after
        in: query
        description: Filter entities created after this date.
        required: false
        schema:
          type: string
          format: date
      - name: before
        in: query
        description: Filter entities created before this date.
        required: false
        schema:
          type: string
          format: date
      - name: cursor
        in: query
        description: String used to get the next batch of results. Our SDKs handle this for you.
        required: false
        schema:
          type: string
      - name: fields
        in: query
        description: List of strings to filter response JSON keys. Not available in the SDKs.
        required: false
        schema:
          type: array
          items:
            type: string
      - name: limit
        in: query
        description: Number of results per cursor. Max = 100.
        required: false
        schema:
          type: integer
          minimum: 1
          maximum: 100
      - name: paymentIds
        in: query
        description: Array of payment ids linked to the desired logs.
        required: false
        schema:
          type: array
          items:
            type: string
      - name: types
        in: query
        description: Filters logs by log types.
        required: false
        schema:
          type: string
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                type: object
        '400':
          description: Client error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors'
        '500':
          description: Server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors'
  /v2/brcode-payment/log/{id}:
    get:
      summary: Get a Brcode Payment Log
      operationId: get-brcodePayment-log-byId
      tags:
      - Brcode Payment
      description: Get a single brcode payment log by its id.
      parameters:
      - name: id
        in: path
        description: Id of the log entity
        required: true
        schema:
          type: string
      - name: fields
        in: query
        description: List of strings to filter response JSON keys. Not available in the SDKs.
        required: false
        schema:
          type: array
          items:
            type: string
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                type: object
        '400':
          description: Client error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors'
        '500':
          description: Server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors'
components:
  schemas:
    Errors:
      type: object
      properties:
        errors:
          type: array
          items:
            $ref: '#/components/schemas/Error'
    Error:
      type: object
      properties:
        code:
          type: string
          description: Error code string
        message:
          type: string
          description: Human-readable error message
  securitySchemes:
    digitalSignature:
      type: apiKey
      name: Digital-Signature
      in: header
      description: ECDSA digital signature for request authentication
externalDocs:
  url: https://docs.starkbank.com/api
  description: Stark Bank API documentation
x-tagGroups:
- name: Business Account
  tags:
  - Workspace
  - Balance
  - Transaction
- name: Cash Receivables
  tags:
  - Invoice
  - Dynamic Brcode
  - Deposit
  - Boleto
  - Boleto Holmes
  - Split
  - Split Receiver
  - Split Profile
- name: Cash Subscription
  tags:
  - Invoice Pull Subscription
  - Invoice Pull Request
- name: Card Receivables
  tags:
  - Merchant Session
  - Merchant Purchase
  - Merchant Card
  - Merchant Installment
- name: Bill Payments
  tags:
  - Transfer
  - Brcode Payment
  - Boleto Payment
  - Utility Payment
  - Tax Payment
  - Darf Payment
  - Payment Preview
  - Payment Request
- name: Others
  tags:
  - Webhook
  - Event
  - Event Attempt
  - Pix Key
  - Institutions
  - Public Key