Bridge Crypto Return Policies API

The Crypto Return Policies API from Bridge — 2 operation(s) for crypto return policies.

OpenAPI Specification

bridge-crypto-return-policies-api-openapi.yml Raw ↑
openapi: 3.0.2
info:
  title: Bridge API Keys Crypto Return Policies 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: Crypto Return Policies
paths:
  /crypto_return_policies:
    get:
      summary: Get all crypto return policies
      tags:
      - Crypto Return Policies
      description: Retrieve all crypto return policies for the authenticated developer
      responses:
        '200':
          description: List of crypto return policies
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/CryptoReturnPolicy'
        '401':
          $ref: '#/components/responses/AuthenticationError'
        '500':
          $ref: '#/components/responses/UnexpectedError'
    post:
      summary: Create a new crypto return policy
      tags:
      - Crypto Return Policies
      parameters:
      - $ref: '#/components/parameters/IdempotencyKeyParameter'
      requestBody:
        description: Crypto return policy object to be created
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PostCryptoReturnPoliciesInput'
      responses:
        '201':
          description: Crypto return policy created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CryptoReturnPolicy'
        '401':
          $ref: '#/components/responses/AuthenticationError'
        '400':
          $ref: '#/components/responses/BadRequestError'
        '500':
          $ref: '#/components/responses/UnexpectedError'
  /crypto_return_policies/{policyID}:
    parameters:
    - name: policyID
      in: path
      required: true
      schema:
        type: string
    put:
      summary: Update an existing crypto return policy
      tags:
      - Crypto Return Policies
      requestBody:
        description: Crypto return policy object to be updated
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PostCryptoReturnPoliciesInput'
      responses:
        '200':
          description: Crypto return policy updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CryptoReturnPolicy'
        '401':
          $ref: '#/components/responses/AuthenticationError'
        '400':
          $ref: '#/components/responses/BadRequestError'
        '404':
          $ref: '#/components/responses/NotFoundError'
        '500':
          $ref: '#/components/responses/UnexpectedError'
    delete:
      summary: Delete a single crypto return policy object
      tags:
      - Crypto Return Policies
      description: Delete a crypto return policy object from the passed in crypto return policy ID
      responses:
        '200':
          description: Successfully deleted crypto return policy object response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CryptoReturnPolicy'
        '401':
          $ref: '#/components/responses/AuthenticationError'
        '404':
          $ref: '#/components/responses/NotFoundError'
        '500':
          $ref: '#/components/responses/UnexpectedError'
components:
  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
    BadRequestError:
      description: Request containing missing or invalid parameters.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          examples:
            BadCustomerRequestErrorExample:
              summary: Bad customer request
              value:
                code: bad_customer_request
                message: fields missing from customer body.
                name: first_name,ssn
    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
  parameters:
    IdempotencyKeyParameter:
      in: header
      name: Idempotency-Key
      required: true
      schema:
        type: string
  schemas:
    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
    PostCryptoReturnPoliciesInput:
      type: object
      properties:
        refund_destination_address:
          type: string
          description: The address to which the refund will be sent. Required if the strategy is `static_address`, but must be unset if the strategy is `refund_to_sender`.
        refund_destination_blockchain_memo:
          type: string
          description: The memo to include with the refund transaction. Must be unset if the strategy is `refund_to_sender`.
        refund_destination_chain:
          type: string
          description: The blockchain on which the refund will be sent. Required if the strategy is `static_address`, but must be unset if the strategy is `refund_to_sender`.
        refund_destination_currency:
          type: string
          description: The currency to which the refund will be sent. Required if the strategy is `static_address`, but must be unset if the strategy is `refund_to_sender`.
        strategy:
          type: string
          description: The strategy to use for the refund. Can be `refund_to_sender` or `static_address`. We only support multiple policies for `static_address`; different strategies cannot have multiple policies. If multiple `static_address` policies exist, the policy that matches both the currency and chain will be used first. If no such policy is found, the policy that matches only the currency will be used instead.
    CryptoReturnPolicy:
      type: object
      properties:
        id:
          type: string
        developer_id:
          type: string
        refund_destination_address:
          type: string
        refund_destination_blockchain_memo:
          type: string
        refund_destination_chain:
          type: string
        refund_destination_currency:
          type: string
        strategy:
          type: string
  securitySchemes:
    ApiKey:
      type: apiKey
      name: Api-Key
      in: header