R2

R2 callbacks API

The callbacks API from R2 — 2 operation(s) for callbacks.

OpenAPI Specification

r2-callbacks-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 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: callbacks
paths:
  /callbacks/{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/callbacks.Callback'
                    type: array
                type: object
        '400':
          description: Bad Request
        '404':
          description: Not Found
        '500':
          description: Internal Server Error
      security:
      - JWT: []
      summary: Show a callback by its id as filtering key.
      tags:
      - callbacks
    put:
      parameters:
      - description: uuid formatted ID.
        in: path
        name: id
        required: true
        schema:
          type: string
      requestBody:
        $ref: '#/components/requestBodies/callbacks.CallbackRequestArray'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                properties:
                  error:
                    type: string
                  items:
                    items:
                      $ref: '#/components/schemas/callbacks.Callback'
                    type: array
                type: object
        '400':
          description: Bad Request
        '404':
          description: Not Found
        '500':
          description: Internal Server Error
      security:
      - JWT: []
      summary: Update a callback.
      tags:
      - callbacks
  /callbacks/:
    get:
      description: Show a list of callbacks associated to the partner using the given filtering params.
      parameters:
      - in: query
        name: page
        schema:
          type: integer
      - in: query
        name: per_page
        schema:
          type: integer
      - in: query
        name: sort
        schema:
          type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                properties:
                  error:
                    type: string
                  items:
                    items:
                      $ref: '#/components/schemas/callbacks.Callback'
                    type: array
                type: object
        '400':
          description: Bad Request
        '404':
          description: Not Found
        '500':
          description: Internal Server Error
      security:
      - JWT: []
      summary: Show all callbacks.
      tags:
      - callbacks
    post:
      description: 'Important: It only allows callbacks from one unique financing each time.'
      requestBody:
        $ref: '#/components/requestBodies/callbacks.CallbackRequestArray'
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                properties:
                  error:
                    type: string
                  items:
                    items:
                      $ref: '#/components/schemas/callbacks.Callback'
                    type: array
                type: object
        '400':
          description: Bad Request
        '404':
          description: Not Found
        '500':
          description: Internal Server Error
      security:
      - JWT: []
      summary: Add a new callback.
      tags:
      - callbacks
components:
  requestBodies:
    callbacks.CallbackRequestArray:
      content:
        application/json:
          schema:
            items:
              $ref: '#/components/schemas/callbacks.CallbackRequest'
            type: array
      description: callback data
      required: true
  schemas:
    callbacks.CallbackRequest:
      properties:
        url:
          type: string
      type: object
    callbacks.Callback:
      properties:
        created_at:
          type: string
        id:
          type: string
        updated_at:
          type: string
        url:
          type: string
      type: object
  securitySchemes:
    JWT:
      in: header
      name: Authorization
      type: apiKey