R2

R2 transactions API

The transactions API from R2 — 3 operation(s) for transactions.

OpenAPI Specification

r2-transactions-api-openapi.yml Raw ↑
openapi: 3.0.0
info:
  contact:
    email: support@r2capital.co
    name: R2 Support
  description: '## Introduction

    <p>Through our REST APIs, you''ll be able to run an end-to-end capital program for your merchants. Specifically, you will: </br></p>

    <ul>

    <li>Securely share data about your merchants and their transactions so that R2 can score them</li>

    <li>Issue optimal financing offers for your preapproved merchants</li>

    <li>Launch marketing touchpoints so that preapproved merchants learn about their financing offers</li>

    <li>Send or capture specific data about a merchant to run R2''s KYC process</li>

    <li>Learn when a financing has been made along with its specific terms</li>

    <li>Provide sales and/or repayment data on financed merchants</li>

    <li>Retrieve updated balances</li>

    <li>Renew financings</li>

    </ul>

    <p>We have language bindings in Shell. You can view code snippets on the right-hand panel, and you can switch the snippets'' programming language using the tabs above the code view.</br>

    To access our APIs, you need an access token. Please sign-up and get a new access token by registering at our developer portal.</p>'
  title: R2 APIs callbacks transactions API
  version: '0.1'
servers:
- url: https://gateway-dev.r2capital.co:443/v2
- url: https://gateway-dev.r2capital.co/v2/
  description: Development environment (DEV)
tags:
- name: transactions
paths:
  /transactions/{id}:
    get:
      parameters:
      - description: uuid formatted ID.
        in: path
        name: id
        required: true
        schema:
          type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                properties:
                  error:
                    type: string
                  items:
                    items:
                      $ref: '#/components/schemas/transactions.Transaction'
                    type: array
                type: object
        '400':
          description: Bad Request
        '404':
          description: Not Found
        '500':
          description: Internal Server Error
      security:
      - JWT: []
      summary: Show a Transaction by its id.
      tags:
      - transactions
  /transactions/async:
    post:
      description: Create a list of transactions associated to the partner.
      requestBody:
        $ref: '#/components/requestBodies/transactions.transactionRequestArray'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                properties:
                  error:
                    type: string
                  items:
                    items:
                      $ref: '#/components/schemas/transactions.Transaction'
                    type: array
                type: object
        '400':
          description: Bad Request
        '500':
          description: Internal Server Error
      security:
      - JWT: []
      summary: Create transactions asynchronously.
      tags:
      - transactions
  /transactions/:
    post:
      description: 'Important: It only allows transactions from one unique financing each time.'
      requestBody:
        $ref: '#/components/requestBodies/transactions.transactionRequestArray'
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                properties:
                  error:
                    type: string
                  items:
                    items:
                      $ref: '#/components/schemas/transactions.Transaction'
                    type: array
                type: object
        '400':
          description: Bad Request
        '404':
          description: Not Found
        '500':
          description: Internal Server Error
      security:
      - JWT: []
      summary: Add one or more transactions.
      tags:
      - transactions
components:
  requestBodies:
    transactions.transactionRequestArray:
      content:
        application/json:
          schema:
            items:
              $ref: '#/components/schemas/transactions.transactionRequest'
            type: array
      description: Transaction data
      required: true
  schemas:
    transactions.Transaction:
      properties:
        amount:
          example: 100.5
          type: number
        category:
          example: REGULAR
          type: string
        created_at:
          example: '2023-11-01T00:00:00Z'
          type: string
        currency:
          enum:
          - MXN
          - CLP
          - COP
          example: MXN
          type: string
        external_id:
          example: '1234567890'
          type: string
        id:
          example: 123e4567-e89b-12d3-a456-426614174000
          type: string
        metadata:
          type: object
        occurred_at:
          example: '2023-01-25T07:00:18.00580Z'
          format: date
          type: string
        partner_transaction_id:
          example: '1234567890'
          type: string
        updated_at:
          example: '2023-11-01T00:00:00Z'
          type: string
      type: object
    transactions.transactionRequest:
      properties:
        amount:
          example: 100.5
          type: number
        category:
          default: REGULAR
          enum:
          - REGULAR
          - CHARGE_BACK
          example: REGULAR
          type: string
        currency:
          enum:
          - MXN
          - CLP
          - COP
          example: MXN
          type: string
        external_id:
          example: '1234567890'
          type: string
        metadata:
          description: "Metadata represents additional data in JSON format\n\t@Example\t{\"key1\": \"value1\", \"key2\": \"123\"}"
          type: object
        occurred_at:
          example: '2023-01-25T07:00:18.00580Z'
          type: string
        partner_transaction_id:
          example: '1234567890'
          type: string
      required:
      - amount
      - category
      - currency
      - external_id
      - metadata
      - occurred_at
      - partner_transaction_id
      type: object
  securitySchemes:
    JWT:
      in: header
      name: Authorization
      type: apiKey