---
openapi: 3.0.0
info:
  description: |
    Shared components for the rest of OpenAPI files
  version: 1.0.0
  title: Apto API shared components
components:
  schemas:
    Additional_Fields:
      type: object
      description: This object is used for special program setups and custom configs.
      properties:
        field_1:
          type: string
          example: some image id here
        field_2:
          type: string
          example: https://dummyimage.com/600x400/000/fff.png
        field_3:
          type: string
          example: some qr code here
        field_4:
          type: string
        field_5:
          type: string
    Address:
      type: object
      properties:
        street_one:
          type: string
          example: Malibu Point 10880
        street_two:
          type: string
          nullable: true
          example: ''
        locality:
          type: string
          example: Malibu
        region:
          type: string
          example: CA
        postal_code:
          type: string
          example: '90265'
        country:
          type: string
          description: The 3-letter ISO 3166-1 country code.
          example: USA
      required:
        - street_one
        - street_two
        - locality
        - region
        - postal_code
        - country
    Amount:
      type: object
      required:
        - currency
        - amount
      properties:
        currency:
          type: string
          example: USD
          description: ISO 4217 currency code.
        amount:
          type: number
          example: 1457.87
    Balance_Object:
      type: object
      required:
        - currency
        - amount
      properties:
        balance:
          type: object
          properties:
            id:
              type: string
              description: The id of this balance
              example: bal_192837192y3kajhsdk
            version:
              type: string
              description: >-
                Old balances will have version 1, new balances will have version
                2
              example: v2
            type:
              type: string
              description: The type of balance
              example: coinbase_balance
            name:
              type: string
              description: The balance name
              example: My bitcoin wallet
            state:
              type: string
              description: The balance state
              example: VALID
            currency:
              type: string
              description: The balance currency
              example: USD
            total_amount:
              type: number
              description: The balance total amount
              example: 12.34
            spendable_amount:
              type: number
              description: The balance spendable amount
              example: 12.34
            held_amount:
              type: number
              description: The balance held amount
              example: 12.34
            native_id:
              type: string
              description: >-
                In the case this balance represents an external balance, this
                field contains the external balance id
              example: 4054598e-q7ca-36c1-93d0-eafae0935vdl
            native_currency:
              type: string
              description: >-
                The balance native currency. In crypto scenarios, for example,
                this could be a crypto currency
              example: BTC
            native_amount:
              type: number
              description: The balance amount, expressed in the balance's native currency
              example: 0.02
            dda_number:
              type: string
              example: '9990000267938'
              description: >-
                If a program is configured to be backed by a bank account, this
                is the bank account number of the checking account created with
                the card. Also known as a Demand Deposit Account.
            aba_routing_number:
              type: string
              example: '121182810'
              description: >-
                If a program is configured to be backed by a bank account, this
                is the bank routing number of the checking account created with
                the card.
    BankAccountPaymentSourceContainer:
      type: object
      properties:
        payment_source:
          $ref: '#/components/schemas/BankAccountPaymentSource'
    BankAccountPaymentSource:
      type: object
      properties:
        id:
          type: string
          description: Payment source identifier.
          example: payment_src_abcde46376482478
        description:
          type: string
          description: The description of the Payment source (optional).
          example: My Bank account
        type:
          type: string
          description: The type of payment source. In this case, "bank_account".
          example: bank_account
        is_preferred:
          type: boolean
          description: Defines the payment source as the preferred by to user.
          example: true
    BillingAmountObject:
      type: object
      description: >-
        Billing amount is the amount that affects the cardholder's balance, and
        indicates the net amount to charge the card.<br /><br />

        This amount includes hold amounts and fee amounts.
      properties:
        currency:
          type: string
          example: USD
        amount:
          type: float
          example: -23.57
    CardFormat:
      type: string
      example: virtual
      enum:
        - virtual
        - physical
      description: >-
        Indicates if the card is virtual (no plastic card printed) or physical
        (plastic card printed).
    CardNetwork:
      type: string
      example: VISA
      enum:
        - VISA
        - MASTERCARD
        - AMEX
        - DISCOVER
      description: This is the network in which the card program was assigned.
    CardObject:
      type: object
      properties:
        card:
          properties:
            id:
              type: string
              example: crd_fde2d61d233455b9
              description: Unique id of the card.
            program_id:
              type: string
              example: Apto_GPR
              description: >-
                Programs are a collection of rules defined for a card. These are
                set up internally by Apto depending on the requirements of your
                product.
            design_key:
              type: string
              example: blue
              description: >-
                Design keys allow you to specify different card designs when
                issuing a card. These are set up internally by Apto under
                request.
            name_on_card:
              type: string
              example: J. SMITH
              description: >-
                Shows the name printed in the card taking into account the
                applied rules to shorten long (not allowed) names.
            last_four:
              type: string
              example: '5542'
              description: >-
                Last four digits of the card. Useful to confirm card details
                with user.
            status:
              type: string
              enum:
                - CREATED
                - ACTIVATED
                - DEACTIVATED
                - CLOSED
              description: >-
                * `CREATED`  card created but not still activated

                * `ACTIVATED`  card activated, open to transactions

                * `DEACTIVATED`  card temporarily deactivated, blocked for doing
                operations, can be activated again

                * `CLOSED`  card closed, blocked for doing operations, this is
                final state
              example: CREATED
            ordered_status:
              type: string
              enum:
                - NOT_APPLICABLE
                - AVAILABLE
                - ORDERED
                - RECEIVED
              example: AVAILABLE
              description: >-
                Indicates whether a corresponding physical card can be ordered
                alongside the virual card. Physical cards can be shipped by
                default in some program setups.
            format:
              $ref: '#/components/schemas/CardFormat'
            dda_number:
              type: string
              example: '9990000267938'
              description: >-
                If a program is configured to be backed by a bank account, this
                is the bank account number of the checking account created with
                the card. Also known as a Demand Deposit Account.
            aba_routing_number:
              type: string
              example: '121182810'
              description: >-
                If a program is configured to be backed by a bank account, this
                is the bank routing number of the checking account created with
                the card.
            activated_at:
              type: string
              example: 2016-10-19T23:20:21.034Z
              description: Timestamp of when a card was activated.
            network:
              type: string
              example: VISA
              enum:
                - VISA
                - MASTERCARD
              description: Network in which the card program was assigned.
            issued_at:
              type: string
              example: 2016-10-19T23:20:21.034Z
              description: Timestamp of when a card was issued.
            shipped_at:
              type: string
              example: 2016-10-19T23:20:21.034Z
              description: Timestamp of when a card was shipped.
            created_at:
              type: string
              example: 2016-10-19T23:20:19.000Z
              description: Timestamp of when a card application was created.
            balance_id:
              type: string
              example: bal_1cd68f70917cb5ed
              description: >-
                Identifier of the card active balance. This ID will be used to
                retrieve the balance information (total amount, spendable amount
                ...) applicable to the card.
            cardholder_id:
              type: string
              example: crdhldr_1cd68f70917cb5ed
              description: Card's associated cardholder id.
            corporation_id:
              type: string
              example: corp_1cd68f70917cb5ed
              description: Card's associated corporation id.
            number:
              type: string
              example: 4013111122223333
              description: >-
                Full PAN of card. Only revealed if PCI compliant. We have
                compliant SDKs to assist frontend implementations in these
                scenarios.
            expiration:
              type: string
              example: 03/26
              description: >-
                Card's Expiration. Only revealed if PCI compliant. We have
                compliant SDKs to assist frontend implementations in these
                scenarios.
            cvv:
              type: string
              example: 123
              description: >-
                Card's CVV. Only revealed if PCI compliant. We have compliant
                SDKs to assist frontend implementations in these scenarios.
            livemode:
              type: boolean
              default: true
              description: Deprecated, but still returned on the payload.
            additional_fields:
              description: >-
                This object is used for special program setups and custom
                configs.
              $ref: '#/components/schemas/Additional_Fields'
            metadata:
              type: string
              description: >-
                The metadata stored along with this card. This field can contain
                up to 256 characters.
    CardPaymentSourceContainer:
      type: object
      properties:
        payment_source:
          $ref: '#/components/schemas/CardPaymentSource'
    CardPaymentSource:
      type: object
      properties:
        id:
          type: string
          description: Payment source identifier.
          example: payment_source_abcde46376482478
        description:
          type: string
          description: The description of the Payment source (optional).
          example: My Credit card
        type:
          type: string
          description: The type of payment source. In this case, "card".
          example: card
        card_type:
          type: string
          description: The type of card (debit or credit).
          example: debit
          enum:
            - debit
            - credit
        card_network:
          type: string
          description: The card's network.
          example: VISA
          enum:
            - VISA
            - MASTERCARD
            - AMEX
            - DISCOVER
        last_four:
          type: string
          description: The card's number last four digits. Only digits, without spaces.
          example: '8792'
        preference_types:
          type: array
          description: Defines the preferences for this payment_source
          example:
            - billing
            - funding
          enum:
            - billing
            - funding
        postal_code:
          type: string
          description: Postal code.
          example: '94103'
        created_at:
          type: string
          description: Date when the payment source was created.
          example: '2020-12-10T11:47:39Z'
        updated_at:
          type: string
          description: Date last update of the payment source.
          example: '2020-12-10T11:47:39Z'
    CardholderList:
      type: object
      properties:
        cardholders:
          type: array
          items:
            $ref: '#/components/schemas/CardholderObject'
        has_more:
          description: >-
            Displays whether this is the last element in the set, or if there
            are subsequent elements.
          type: boolean
          default: true
        total:
          type: integer
          default: 23456
    CardholderObject:
      type: object
      properties:
        cardholder:
          properties:
            livemode:
              type: boolean
              default: false
            id:
              type: string
              example: crdhldr_1cd68f70917cb5ed
              description: Unique id of the cardholder
            corporation_id:
              type: string
              example: corp_1cd68f70917cb5ed
              description: This is the cardholder's associated corporation id.
            email:
              type: string
              example: pat@wilson.com
            kyc_passed_at:
              type: string
              example: 2016-10-19T23:20:21.034Z
            kyc_status:
              type: string
              enum:
                - PASSED
                - TEMPORARY_ERROR
                - REJECTED
                - UNDER_REVIEW
                - UPLOAD_FILE
                - RESUBMIT_DETAILS
              example: PASSED
            kyc_identity_reason:
              type: string
              default: null
            kyc_address_reason:
              type: string
              default: null
            kyc_file_reason:
              type: string
              default: null
            first_name:
              type: string
              example: Josh
            last_name:
              type: string
              example: Wilson
            phone:
              type: integer
              example: 6157915911
            custodian_uid:
              type: string
              example: your-external-user-id
            cards:
              type: array
              description: One single element array with the most recent issued card
              items:
                $ref: '#/components/schemas/CardObject'
            created_at:
              type: string
              example: 2016-10-19T23:20:17.000Z
            metadata:
              type: string
              description: >-
                The metadata stored along with this user. This field can contain
                up to 256 characters.
    CardholderSession:
      type: object
      required:
        - type
        - user_id
        - user_token
      properties:
        type:
          type: string
          enum:
            - user_id
        user_id:
          type: string
          pattern: ^crdhldr_[0-9a-f]{20}$
          example: crdhldr_b04f29605a018f7d72a2
        user_token:
          type: string
          pattern: '[0-9a-f]'
          example: E5PWX4T9dcPriIo ... ao0QZLC6YL/dAyaA8
    CashbackAmountObject:
      type: object
      description: >-
        Cashback amounts are just an indication if any part of the transaction
        included cashback to the user. These amounts are already included in the
        billing amount total.
      properties:
        currency:
          type: string
          example: USD
        amount:
          type: number
          format: float
          example: 0
    CitizenshipEnum:
      type: string
      example: us_citizen
      enum:
        - us_citizen
        - permanent_resident
        - non_resident
    CompanyInfo:
      type: object
      properties:
        website:
          type: string
          description: Company's website
        legal_name:
          type: string
          description: Company's legal name
        tax_id:
          type: string
          description: Company's tax id (EIN)
        industry:
          type: string
          description: Company's industry
        description:
          type: string
          description: Free text that describes the company (max 300 characters)
      required:
        - website
        - legal_name
        - tax_id
        - industry
    CurrencyDoNotMatch:
      type: object
      properties:
        code:
          type: number
          default: 200113
        message:
          type: string
          default: Currencies do not match
    DOB:
      type: string
      format: DD/MM/YYY
      example: 20/10/1965
    DOB-ISO8601:
      type: string
      format: YYYY-MM-DD
      example: '1965-10-20'
    Device:
      type: object
      properties:
        name:
          type: string
          example: Wilson*s iPhone
        type:
          type: string
          example: iPhone
        status:
          type: string
          example: ACTIVE
    EntityPermissions:
      type: object
      properties:
        context_entity_type:
          type: string
          description: The entity type
          enum:
            - team
            - project
            - custodian
            - corporation
            - get_started_application
        context_entity_id:
          type: string
          description: ID of the team, project, custodian or corporation
        roles:
          type: array
          description: >-
            Roles (role keys) that the current session has assigned in the
            context of the specified entity (defined by entity_type and
            entity_id).
          example:
            - role_key_1
            - role_key_2
            - role_key_3
          items:
            type: string
        actions:
          type: array
          description: >-
            Actions (action keys) that the current session has assigned in the
            context of the specified entity (defined by entity_type and
            entity_id).
          example:
            - action_key_1
            - action_key_2
            - action_key_3
          items:
            type: string
    EntityType:
      type: string
      enum:
        - team
        - project
        - corporation
        - user
    Error_AttemptExpired:
      type: object
      properties:
        code:
          type: number
          default: 91101
        message:
          type: string
          default: Expired attempt
    Error_CantDeletePreferredPaymentSource:
      type: object
      properties:
        code:
          type: number
          default: 200070
        message:
          type: string
          default: Can't delete the default payment source
    Error_DuplicateCardNumber:
      type: object
      properties:
        code:
          type: number
          default: 200074
        message:
          type: string
          default: Duplicate card account number
    Error_EmptyUserToken:
      type: object
      properties:
        code:
          type: number
          default: 3033
        message:
          type: string
          default: Empty user token. Please set a valid user token value
    Error_ExpiredUserToken:
      type: object
      properties:
        code:
          type: number
          default: 3031
        message:
          type: string
          default: Expired user token. Please login again to obtain a valid token
    Error_ExpiredVerification:
      type: object
      properties:
        code:
          type: number
          default: 1025
        message:
          type: string
          default: Verification has expired and is not usable for creating a user
    Error_Failed_Balance_Transfer_Error:
      type: object
      properties:
        error_code:
          type: integer
          default: 200105
        message:
          type: string
          default: Source and destination balance type pair is not valid
    Error_FeatureNotAllowed:
      type: object
      properties:
        code:
          type: number
          default: 200107
        message:
          type: string
          default: Feature not allowed for the current configuration
    Error_InvalidAmount:
      type: object
      properties:
        code:
          type: integer
          example: 12345
        message:
          type: string
          default: Invalid amount
    Error_InvalidAPIKey:
      type: object
      properties:
        code:
          type: number
          default: 3035
        message:
          type: string
          default: Invalid API key. Please set a valid API key value
    Error_InvalidAttemptId:
      type: object
      properties:
        code:
          type: number
          default: 9100
        message:
          type: string
          default: Invalid attempt_id
    Error_InvalidAuthenticationData:
      type: object
      properties:
        code:
          type: number
          default: 92000
        message:
          type: string
          default: Invalid authentication data
    Error_InvalidAuthenticationType:
      type: object
      properties:
        code:
          type: number
          default: 92000
        message:
          type: string
          default: Invalid authentication type
    Error_InvalidCardPin:
      type: object
      properties:
        code:
          type: number
          default: 200104
        message:
          type: string
          example: Invalid PIN value for card card_12345
    Error_InvalidDestinationId:
      type: object
      properties:
        error_code:
          type: integer
          example: 12345
        message:
          type: string
          default: Invalid destination payment source id or Apto card id
    Error_InvalidEntity:
      type: object
      properties:
        code:
          type: number
          default: 90287
        message:
          type: string
          default: 'Invalid entity. Allowed entities: [''corporation'']'
    Error_InvalidEventType:
      type: object
      properties:
        code:
          type: number
          default: 92000
        message:
          type: string
          default: Invalid authentication data
    Error_InvalidInput:
      type: object
      properties:
        code:
          type: number
          default: 1000
        message:
          type: string
          example: Invalid value (error) for GetStartedApplicationState
    Error_InvalidMetadataLength:
      type: object
      properties:
        code:
          type: number
          default: 90290
        message:
          type: string
          default: 'Metadata too long. Maximum length supported: 256 characters'
    Error_InvalidPaymentSourceAmount:
      type: object
      properties:
        code:
          type: number
          default: 200065
        message:
          type: string
          default: Invalid payment amount
    Error_InvalidPaymentSourceCardAddress:
      type: object
      properties:
        code:
          type: number
          default: 200063
        message:
          type: string
          default: Invalid address
    Error_InvalidPaymentSourceCardCVV:
      type: object
      properties:
        code:
          type: number
          default: 200060
        message:
          type: string
          default: Invalid CVV
    Error_InvalidPaymentSourceCardExpiration:
      type: object
      properties:
        code:
          type: number
          default: 200061
        message:
          type: string
          default: Invalid expiration date
    Error_InvalidPaymentSourceCardLastFour:
      type: object
      properties:
        code:
          type: number
          default: 200071
        message:
          type: string
          default: Invalid last four of card
    Error_InvalidPaymentSourceCardNetwork:
      type: object
      properties:
        code:
          type: number
          default: 200068
        message:
          type: string
          default: Card network not supported
    Error_InvalidPaymentSourceCardNumber:
      type: object
      properties:
        code:
          type: number
          default: 200059
        message:
          type: string
          default: Invalid card account number
    Error_InvalidPaymentSourceCardPostalCode:
      type: object
      properties:
        code:
          type: number
          default: 200062
        message:
          type: string
          default: Invalid postal code
    Error_InvalidPaymentSourceCardType:
      type: object
      properties:
        code:
          type: number
          default: 200058
        message:
          type: string
          default: Card type not supported
    Error_InvalidPaymentSourceCurrency:
      type: object
      properties:
        code:
          type: number
          default: 200066
        message:
          type: string
          default: Invalid currency
    Error_InvalidPaymentSourceEntity:
      type: object
      properties:
        code:
          type: number
          default: 200064
        message:
          type: string
          default: Invalid entity type or id
    Error_InvalidPaymentSourceType:
      type: object
      properties:
        code:
          type: number
          default: 92000
        message:
          type: string
          default: Invalid payment source type
    Error_InvalidSourceId:
      type: object
      properties:
        error_code:
          type: integer
          example: 12345
        message:
          type: string
          default: Invalid source payment source id or Apto card id
    Error_InvalidUrl:
      type: object
      properties:
        code:
          type: number
          default: 92000
        message:
          type: string
          default: Invalid URL
    Error_InvalidUserToken:
      type: object
      properties:
        code:
          type: number
          default: 3032
        message:
          type: string
          default: Invalid user token. Please set a valid user token value
    Error_InvalidAge:
      type: object
      properties:
        code:
          type: number
          default: 200035
        message:
          type: string
          default: User Must be at least 18 years old
    Error_NoApplicationOnDevAccount:
      type: object
      properties:
        code:
          type: number
          default: 90294
        message:
          type: string
          default: Could not find application on developer account
    Error_NoDevAccountOnUserToken:
      type: object
      properties:
        code:
          type: number
          default: 90293
        message:
          type: string
          default: Could not find developer account from user token
    Error_PaymentLimit:
      type: object
      properties:
        code:
          type: number
          default: 200069
        message:
          type: string
          example: >-
            Request of 6000 USD is over daily load funds limit of 5000 USD by
            1000 USD
    Error_PaymentSourceLimit:
      type: object
      properties:
        code:
          type: number
          default: 200067
        message:
          type: string
          default: Payment source limit reached
    Error_PaymentSourceOwner:
      type: object
      properties:
        code:
          type: number
          default: 200073
        message:
          type: string
          default: Provided entity is not the payment source owner
    Error_PaymentSourceType:
      type: object
      properties:
        code:
          type: number
          default: 200072
        message:
          type: string
          default: Payment source type not valid
    Error_RateLimiter:
      type: object
      properties:
        code:
          type: number
          default: 90061
        message:
          type: string
          default: Request rate limit exceed, only 1 requests per 30 second(s)
    Error_Unauthorised:
      type: object
      properties:
        code:
          type: number
          default: 3035
        message:
          type: string
          default: Operation not allowed for the current user
    EventRecipientContainer:
      type: object
      properties:
        event_recipient:
          $ref: ../shared/general_shared.yaml#/components/schemas/EventRecipient
    EventRecipient:
      type: object
      properties:
        id:
          type: string
          description: >-
            The event recipient id. Can be used to update or delete the event
            recipient afterwards.
          example: evt_asjnakjhf293yi
        created_at:
          type: string
          description: >-
            The date where this event recipient was created, in ISO8601 format
            (date time in UTC).
          example: '2020-06-08T14:54:36Z'
        updated_at:
          type: string
          description: >-
            The date where this event recipient was last updated, in ISO8601
            format (date time in UTC).
          example: '2020-06-08T14:54:36Z'
        description:
          type: string
          description: >-
            The description to be assigned to the new Webhook endpoint
            (optional).
          example: ACME webhook
        is_active:
          type: boolean
          description: Use this field to enable / disable a given event recipient.
          example: true
        url:
          type: string
          description: The url to which the events will be sent.
          example: https://api.acme.com/webhooks
        authentication:
          type: object
          properties:
            auth_type:
              type: string
              description: >-
                The type of authentication to be used when sending events to the
                specified url.
              enum:
                - basic_http
                - header
            data:
              oneOf:
                - $ref: '#/components/schemas/EventTypeHTTPAuthentication'
                - $ref: '#/components/schemas/EventTypeHeaderAuthentication'
          required:
            - auth_type
        event_types:
          type: array
          items:
            type: string
            example:
              - card_sent
              - card_update
              - pin_update
              - status_update
            enum:
              - card_sent
              - card_update
              - pin_update
              - status_update
              - identity_update
              - kyc_status_update
              - user_update
              - transaction_update
    EventRecipients_Response:
      type: object
      properties:
        event_recipients:
          type: array
          items:
            $ref: '#/components/schemas/EventRecipientContainer'
        has_more:
          description: >-
            Displays whether this is the last element in the set, or if there
            are subsequent elements.
          type: boolean
          example: false
        total:
          type: integer
          example: 11
    EventTypeHeaderAuthentication:
      type: object
      properties:
        name:
          type: string
          description: The name of the header field that will be sent for authentication.
        value:
          type: string
          description: The value that will be sent in the previous header field.
    EventTypeHTTPAuthentication:
      type: object
      properties:
        username:
          type: string
          description: >-
            The username to be used to authenticate against the target url
            (using standard basic http authentication)
        password:
          type: string
          description: >-
            The password to be used to authenticate against the target url
            (using standard basic http authentication)
    ExternalCard:
      type: object
      required:
        - type
        - pan
        - cvv
        - exp_date
        - last_four
        - postal_code
      properties:
        type:
          type: string
          enum:
            - card
        pan:
          type: string
          description: The card's number. Only digits, without spaces.
          example: '4294800988908792'
        cvv:
          type: string
          description: The card's CVV. Only digits, without spaces.
        exp_date:
          type: string
          description: The card's expiration date, in format YYYY-MM
          example: 2025-07
        last_four:
          type: string
          description: The card's PAN last four digits
          example: '8792'
        postal_code:
          type: string
          description: The card's billing postal code
          example: '12345'
    FeeAmountObject:
      type: object
      description: |-
        Fee amounts are added through program configuration.<br /><br />
        These amounts are already included in the billing amount total.
      properties:
        currency:
          type: string
          example: USD
        amount:
          type: number
          format: float
          example: -2.5
    HoldAmountObject:
      type: object
      description: >-
        Hold amounts are the indication of what a merchant is holding on the
        transaction.
      properties:
        currency:
          type: string
          example: USD
        amount:
          type: number
          format: float
          example: 0
    IdDocument:
      type: object
      properties:
        type:
          type: string
          description: Type of id document. Initially, we support only SSN.
          example: ssn
          enum:
            - ssn
        country:
          type: string
          description: The 3-letter ISO 3166-1 country code.
          example: USA
        value:
          type: string
          description: Document number
        issue_date:
          type: string
          format: DD/MM/YYYY
          example: 20/10/1965
        expiry_date:
          type: string
          format: DD/MM/YYYY
          example: 20/10/1965
      required:
        - type
        - country
        - value
    LocalAmountObject:
      type: object
      description: >
        Local amount is the amount in the currency that is local to the
        merchant.<br /><br />

        This is usually the amount you would show the customer in their
        transaction reporting.<br /><br />

        Often this amount is lower than the pending billing amount due to
        surplus holds on a transaction.
      properties:
        currency:
          type: string
          example: EUR
        amount:
          type: number
          format: float
          example: -20.44
    NotFoundError:
      type: object
      properties:
        error:
          properties:
            type:
              type: string
              description: Error type
              example: invalid_request_error
            message:
              type: string
              description: Returned when trying to access an object with an invalid id.
              example: The specified object has not been found.
            error_code:
              type: integer
              example: 404
    P2pTransfer:
      type: object
      properties:
        id:
          type: string
          pattern: ^balxfr_[0-9a-f]{16}
          example: balxfr_XXXXXXXXXXXXXXXX
        status:
          type: string
          enum:
            - processed
            - pending
            - failed
        source_id:
          type: string
          pattern: ^bal_[0-9a-f]{16}
          example: bal_XXXXXXXXXXXXXXXX
        amount:
          type: object
          allOf:
            - $ref: '#/components/schemas/Amount'
        recipient:
          type: object
          properties:
            name:
              type: object
              properties:
                first_name:
                  type: string
                  example: John
                last_name:
                  type: string
                  example: Smith
        created_at:
          type: string
          example: 2016-10-19T23:20:17.000Z
    PaymentSources_Response:
      type: object
      properties:
        payment_sources:
          type: array
          items:
            anyOf:
              - $ref: '#/components/schemas/CardPaymentSourceContainer'
              - $ref: '#/components/schemas/BankAccountPaymentSourceContainer'
        has_more:
          description: >-
            Displays whether this is the last element in the set, or if there
            are subsequent elements.
          type: boolean
          example: false
        total:
          type: integer
          example: 11
    Payments_Response_Pull:
      type: object
      properties:
        id:
          type: string
          pattern: payment_[0-9af]{16}
          example: payment_98hnhu9sc7i9ay73375
        status:
          type: string
          enum:
            - processed
            - pending
            - cancelled
            - failed
        amount:
          $ref: ../shared/general_shared.yaml#/components/schemas/Amount
        source_id:
          type: string
          description: The balance id that funds will be transferred from.
        destination:
          oneOf:
            - $ref: '#/components/schemas/CardPaymentSource'
            - $ref: '#/components/schemas/BankAccountPaymentSource'
          description: The payment source that funds will be transferred to.
        created_at:
          type: string
          example: 2016-10-19T23:20:17.000Z
          description: The payment creation time.
    Payments_Response_Push:
      type: object
      properties:
        id:
          type: string
          pattern: payment_[0-9af]{16}
          example: payment_98hnhu9sc7i9ay73375
        status:
          type: string
          enum:
            - processed
            - pending
            - cancelled
            - failed
        amount:
          $ref: ../shared/general_shared.yaml#/components/schemas/Amount
        source:
          oneOf:
            - $ref: '#/components/schemas/CardPaymentSource'
            - $ref: '#/components/schemas/BankAccountPaymentSource'
          description: The payment source that funds will be transferred from.
        destination_id:
          type: string
          description: The balance id that funds will be transferred to.
        created_at:
          type: string
          example: 2016-10-19T23:20:17.000Z
          description: The payment creation time.
    Permissions:
      type: object
      description: Roles and actions available in the current session.
      properties:
        global:
          type: array
          description: Actions that this session has available on a global scope.
          items:
            type: string
            example:
              - list_users
        restricted:
          type: array
          description: >-
            Actions that this session has available in different entities
            (teams, projects, custodians, corporations)
          items:
            $ref: '#/components/schemas/EntityPermissions'
    PersonalName:
      type: object
      properties:
        first_name:
          type: string
          example: Josh
        last_name:
          type: string
          example: Wilson
    PhoneNumber:
      type: object
      properties:
        country_code:
          type: number
          description: The phone's country code, without the + sign
          example: 1
        phone_number:
          type: string
          description: The phone number, only digits (no spaces, no symbols)
          example: 9366666715
    PhoneObject:
      type: object
      properties:
        country_code:
          type: number
          example: 1
        number:
          type: string
          example: 9366666780
    RequestFailedError:
      type: object
      properties:
        error:
          properties:
            type:
              type: string
              description: invalid_request_error
              example: invalid_request_error
            message:
              type: string
              description: Example Invalid Request Description
              example: Example Invalid Request Description
            error_code:
              type: integer
              example: 12345
    Response_Push_Funds:
      type: object
      properties:
        id:
          type: string
          pattern: payment_[0-9af]{16}
          example: payment_98hnhu9sc7i9ay73375
        status:
          type: string
          enum:
            - processed
            - pending
            - cancelled
            - failed
        amount:
          $ref: ../shared/general_shared.yaml#/components/schemas/Amount
        source:
          $ref: ../shared/general_shared.yaml#/components/schemas/Balance_Object
          description: The balance source that funds will be transferred from.
        destination:
          type: object
          properties:
            id:
              type: string
              pattern: crd_[0-9af]{16}
              example: crd_98hnhu9sc7i9ay73375
              description: The card id that funds will be transferred to.
            network:
              type: string
              enum:
                - visa
                - mastercard
            last_four:
              type: string
              example: 1234
            design_key:
              type: string
              description: design_key fo the card.
        created_at:
          type: string
          example: 2016-10-19T23:20:17.000Z
          description: The transfer creation time.
    Transfer:
      type: object
      properties:
        status:
          type: string
          enum:
            - processed
            - pending
            - failed
        amount:
          type: object
          allOf:
            - $ref: '#/components/schemas/Amount'
        destination:
          type: object
          properties:
            id:
              type: string
              pattern: ^crd_[0-9a-f]{16}
              example: crd_XXXXXXXXXXXXXXXX
            network:
              type: string
              enum:
                - visa
                - mastercard
            last_four:
              type: string
              example: '2334'
            design_key:
              type: string
              pattern: ^design_[0-9a-f]{16}
              example: design_12931283
        created_at:
          type: string
          example: 2016-10-19T23:20:17.000Z
    UnauthorizedBasicAuthError:
      type: object
      properties:
        error:
          properties:
            type:
              type: string
              description: invalid_request_error
              example: invalid_request_error
            message:
              type: string
              description: Authentication to the API occurs via HTTP Basic Auth
              example: Authentication to the API occurs via HTTP Basic Auth
            error_code:
              type: integer
              example: null
    UserData:
      type: object
      description: User's basic data (name, email).
      properties:
        first_name:
          type: string
          description: User's first name
          example: Josh
        last_name:
          type: string
          description: User's last name
          example: Wilson
        email:
          type: string
          description: User's email address
          example: pat@wilson.com
    UserSession:
      type: object
      description: Current user's session data, including the session token and user id.
      properties:
        user_token:
          type: string
          description: User session token, to be used in subsequent api requests.
          example: kshlkashleihkjnc$akjshdasd_·lakjsdh123ASDAS
        user_id:
          type: string
          description: User id.
          example: usr_123jhkasdf98734
        user_data:
          $ref: '#/components/schemas/UserData'
        permissions:
          $ref: '#/components/schemas/Permissions'
  securitySchemes:
    B2CEndpoint:
      description: >-
        The B2C endpoints use a combination of two headers: the Api-Key header
        contains the public api key of the project, and the Authorization header
        contains the user's bearer token obtained via the login or create user
        endpoints.
      type: http
      scheme: bearer
  parameters:
    PageParams:
      in: query
      name: page
      description: The page to be returned
      required: false
      schema:
        type: integer
        default: '0'
    ParamCorporationId:
      in: path
      name: corporation_id
      description: Corporation id
      required: true
      schema:
        type: string
    ParamCustodianId:
      in: path
      name: custodian_id
      description: Custodian id
      required: true
      schema:
        type: string
    ParamEndingBefore:
      in: query
      name: ending_before
      description: Return the page ending right before the specified element.
      required: false
      schema:
        type: string
    ParamLimit:
      in: query
      name: limit
      description: >-
        A limit on the number of objects to be returned. Default value is 25.
        Max allowed value is 50.
      required: false
      schema:
        type: string
    ParamStartingAfter:
      in: query
      name: starting_after
      description: Return the page starting right after the specified element.
      required: false
      schema:
        type: string
    ProjectId:
      in: path
      name: project_id
      description: Project public id
      required: true
      schema:
        type: string
    RowsParams:
      in: query
      name: rows
      description: A limit on the number of objects to be returned
      required: false
      schema:
        type: integer
        default: 25
        maximum: 50
paths: {}
tags: []
