Bridge Prefunded Accounts API

The Prefunded Accounts API from Bridge — 3 operation(s) for prefunded accounts.

OpenAPI Specification

bridge-prefunded-accounts-api-openapi.yml Raw ↑
openapi: 3.0.2
info:
  title: Bridge API Keys Prefunded Accounts API
  description: APIs to move into, out of, and between any form of a dollar
  version: '1'
servers:
- url: https://api.bridge.xyz/v0
  description: The base path for all resources
security:
- ApiKey: []
tags:
- name: Prefunded Accounts
paths:
  /prefunded_accounts:
    get:
      summary: Get a list of all Prefunded Account
      tags:
      - Prefunded Accounts
      description: Retrieve a all Prefunded Accounts
      responses:
        '200':
          description: List of prefunded accounts.
          content:
            application/json:
              schema:
                title: Prefunded Accounts
                type: object
                required:
                - data
                properties:
                  data:
                    type: array
                    minItems: 0
                    items:
                      $ref: '#/components/schemas/PrefundedAccount'
              examples:
                PrefundedAccountsFound:
                  summary: A non-empty list of prefunded accounts
                  value:
                    data:
                    - $ref: '#/components/examples/SuccessfulPrefundedAccountResponse/value'
                NoPrefundedAccountsFound:
                  summary: An empty list of prefunded accounts
                  value:
                    data: []
        '401':
          $ref: '#/components/responses/AuthenticationError'
        '404':
          $ref: '#/components/responses/NotFoundError'
        '500':
          $ref: '#/components/responses/UnexpectedError'
  /prefunded_accounts/{prefundedAccountID}:
    parameters:
    - $ref: '#/components/parameters/PrefundedAccountIDParameter'
    get:
      summary: Get details for a specific Prefunded Account
      tags:
      - Prefunded Accounts
      description: Retrieve a Prefunded Account
      responses:
        '200':
          description: Successful Prefunded Account object response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PrefundedAccount'
              examples:
                SuccessfulPrefundedAccountResponse:
                  $ref: '#/components/examples/SuccessfulPrefundedAccountResponse'
        '401':
          $ref: '#/components/responses/AuthenticationError'
        '404':
          $ref: '#/components/responses/NotFoundError'
        '500':
          $ref: '#/components/responses/UnexpectedError'
  /prefunded_accounts/{prefundedAccountID}/history:
    parameters:
    - $ref: '#/components/parameters/PrefundedAccountIDParameter'
    - $ref: '#/components/parameters/LimitParameter'
    - $ref: '#/components/parameters/PrefundedAccountHistoryStartingAfterParameter'
    - $ref: '#/components/parameters/PrefundedAccountHistoryEndingBeforeParameter'
    get:
      summary: Get funding history of a Prefunded Account
      tags:
      - Prefunded Accounts
      description: Retrieve the funding events and returns for a Prefunded Account
      responses:
        '200':
          description: Successful Prefunded Account object response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PrefundedAccountHistory'
              examples:
                SuccessfulCustomerResponse:
                  $ref: '#/components/examples/SuccessfulPrefundedAccountHistoryResponse'
        '401':
          $ref: '#/components/responses/AuthenticationError'
        '404':
          $ref: '#/components/responses/NotFoundError'
        '500':
          $ref: '#/components/responses/UnexpectedError'
components:
  parameters:
    PrefundedAccountHistoryEndingBeforeParameter:
      in: query
      name: ending_before
      schema:
        type: string
      description: This is a prefunded event id. If this is specified, the previous page that ends with an event right BEFORE the specified event id on the event timeline, which is always ordered from the newest to the oldest by creation time, will be returned. This also implies that events newer than the specified event id will be returned (shouldn't be set if starting_after is set)
    PrefundedAccountIDParameter:
      name: prefundedAccountID
      in: path
      required: true
      schema:
        $ref: '#/components/schemas/Id'
    LimitParameter:
      in: query
      name: limit
      schema:
        type: integer
        minimum: 1
        maximum: 100
        default: 10
      description: The number of items to return (min 1, default 10, max 100)
    PrefundedAccountHistoryStartingAfterParameter:
      in: query
      name: starting_after
      schema:
        type: string
      description: This is a prefunded event id. If this is specified, the next page that starts with an event right AFTER the specified event id on the event timeline, which is always ordered from the newest to the oldest by creation time, will be returned. This also implies that events older than the specified event id will be returned (shouldn't be set if ending_before is set)
  schemas:
    FiatCurrency:
      type: string
      enum:
      - usd
    Error:
      required:
      - code
      - message
      properties:
        code:
          type: string
          minLength: 1
          maxLength: 256
        message:
          type: string
          minLength: 1
          maxLength: 512
        source:
          title: ErrorSource
          required:
          - location
          - key
          properties:
            location:
              type: string
              enum:
              - path
              - query
              - body
              - header
            key:
              type: string
              description: Comma separated names of the properties or parameters causing the error
    Id:
      description: A UUID that uniquely identifies a resource
      type: string
      pattern: '[a-z0-9]*'
      minLength: 1
      maxLength: 42
    PrefundedAccount:
      required:
      - id
      - available_balance
      - currency
      - name
      properties:
        id:
          $ref: '#/components/schemas/Id'
          readOnly: true
        available_balance:
          description: Amount available for spending, represented as a dollar denominated string. Examples include "100.25", "0.1", "1.234567", "1.01" etc.
          type: string
          readOnly: true
        currency:
          description: currency associated with the bank account.
          $ref: '#/components/schemas/FiatCurrency'
          readOnly: true
        name:
          description: Serialized name of the account which identifies the counterparty.
          type: string
          readOnly: true
    PrefundedAccountHistory:
      required:
      - id
      - amount
      - available_balance
      - currency
      - name
      - type
      - created_at
      properties:
        id:
          $ref: '#/components/schemas/Id'
          readOnly: true
        amount:
          description: Amount of the transaction, represented as a dollar denominated string. Examples include "100.25", "0.1", "1.234567", "1.01" etc.
          type: string
          readOnly: true
        available_balance:
          description: Amount available for spending, represented as a dollar denominated string. Examples include "100.25", "0.1", "1.234567", "1.01" etc.
          type: string
          readOnly: true
        currency:
          description: currency associated with the bank account.
          $ref: '#/components/schemas/FiatCurrency'
          readOnly: true
        name:
          description: Serialized name of the account.
          type: string
          readOnly: true
        type:
          description: The type of the transaction.
          type: string
          enum:
          - funding
          - refunded transfer
          readOnly: true
        created_at:
          readOnly: true
          type: string
          description: Time of creation of the External Account
          format: date-time
        withdrawal_id:
          readOnly: true
          type: string
          description: The ID of the transfer which created this event. Exclusive with deposit_id.
        deposit_id:
          readOnly: true
          type: string
          description: The ID of the transfer which created this event. Exclusive with withdrawal_id.
  responses:
    AuthenticationError:
      description: Missing or invalid API key
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          examples:
            MissingTokenError:
              summary: No Api-Key header
              description: The header may be missing or misspelled.
              value:
                code: required
                location: header
                name: Api-Key
                message: Missing Api-Key header
            InvalidTokenError:
              summary: Invalid key in Api-Key header
              value:
                code: invalid
                location: header
                name: Api-Key
                message: Invalid Api-Key header
    NotFoundError:
      description: No resource found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          examples:
            NotFoundErrorExample:
              summary: Invalid customer id
              value:
                code: Invalid
                message: Unknown customer id
    UnexpectedError:
      description: Unexpected error. User may try and send the request again.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          examples:
            UnexpectedError:
              summary: An unexpected error
              value:
                errors:
                - code: unexpected
                  message: An expected error occurred, you may try again later
  examples:
    SuccessfulPrefundedAccountResponse:
      summary: A successful Prefunded Account object
      value:
        id: f15972de-4cdd-460c-9da3-34f7321bfa3f
        currency: usd
        available_balance: '134.12'
        name: my_account
        created_at: '2020-01-01T00:00:00.000Z'
        updated_at: '2020-01-02T00:00:00.000Z'
    SuccessfulPrefundedAccountHistoryResponse:
      summary: A successful Prefunded Account history
      value:
        count: 1
        data:
        - id: abced012-4cdd-460c-9da3-34f7321bfa3f
          amount: '500.00'
          available_balance: '1300.31'
          currency: usd
          name: my_account
          type: funding
          created_at: '2020-01-01T00:00:00.000Z'
  securitySchemes:
    ApiKey:
      type: apiKey
      name: Api-Key
      in: header