---
openapi: 3.0.0
info:
  description: >
    Welcome to the Apto Mobile API Reference. The Apto platform provides a set
    of Mobile APIs that allow user applications, such as websites and native
    mobile apps (iOS and Android), to interact with the Apto platform.


    We've tried to make this documentation as straightforward as possible,
    providing clear code examples, but please [contact
    us](https://www.aptopayments.com/support/kb-tickets/new) with any questions
    you may have.

      **Note:** If you would like to perform a backend integration with the Apto platform, see the [Apto Core API docs](https://docs.aptopayments.com/api/core-api).

    # Core concepts

      The Apto Mobile API is a REST API that uses:

      * HTTP verbs and unique URI's to access the various endpoints.

      * HTTP response codes to indicate statuses and errors.

      * Standard JSON format for all responses.


    The Apto Mobile API is served over HTTPS to ensure data privacy. **HTTP is
    not supported.**


    ## Workflow

    When working with the Apto Mobile API, some requests must be made in a
    certain order. For example, a user's credentials must be verified before the
    user can be created or logged into the system.


    **A step-by-step guide for this workflow can be found in our [developer
    guides](https://docs.aptopayments.com/docs/guides/Users/creating-users-guide)**
    but, roughly, here are the API requests your application must make to issue
    a card for a new user:

    1. [Start the verification process](#operation/StartVerification). In a
    basic workflow, this must be a phone verification rather than an email one.

    2. [Complete the verification process](#operation/CompleteVerification).

    3. [Create the user](#operation/CreateUser) who has been verified, saving
    the `user_token` from the response to authenticate the remaining requests.

    4. [List the card programs](#operation/GetCardPrograms) that are available
    to the user.

    5. Choose a card program and [apply for a card](#operation/ApplyCard).

    6. [Accept the cardholder agreement](#operation/AcceptAgreement).

    7. [Check the application status](#operation/GetApplication).

    8. [Issue a card](#operation/IssueCard) to the user.


    Again, you can find a step-by-step guide for this workflow in our [Developer
    Guides](https://docs.aptopayments.com/docs/guides/Users/creating-users-guide).


    ## Verifications expiration


    The Apto Mobile API sets an expiration time of 1h for the verifications, In
    case it passed more than 1h between steps 2 ([Complete the verification
    process](#operation/CompleteVerification)) and 3 ([Create the
    user](#operation/CreateUser)); the user creation call will return an error
    response of type [verification
    expired](#/components/schemas/Error_ExpiredVerification)


    ## Rate limits

    The Apto Mobile API has a rate limit of 1 request per 30 seconds for the
    verification and login endpoints.


    # Authentication

    <SecurityDefinitions />

    All Mobile API endpoints require a **Mobile API Key (PublicKey)**, which
    identifies your card program and can be obtained by registering for an
    account or logging into the [Apto Developer
    Portal](https://developer.aptopayments.com). See our [getting API keys
    guide] for more information on how to obtain it.<br /><br />

    Most endpoints expect as well the user to be logged in to be able to call
    them. For this, you'll need to supply a **Session Token** which identifies
    the session of the user. To know more on how to obtain a Session Token, see
    our [authenticating users
    guide](/docs/guides/Users/authenticating-users-guide#mobile-api).<br /><br
    />

    The Mobile API Key is placed in a header for each request like this:<br />
    ``` -H "Api-Key: Bearer {{MOBILE_API_KEY}}" ``` <br /><br /> For endpoints
    that expect a Session Token as well, it's placed in a header too for each
    request like this:<br /> ``` -H "Authorization: Bearer {{SESSION_TOKEN}}"
    ``` <br /><br /> Remember, you can find the Session Token in the response
    when [creating](/api/mobile-api#operation/CreateUser) or [logging
    in](/api/mobile-api#tag/Users/paths/~1v1~1user~1login/post) a user. <br
    /><br /> The default **TTL (time to live)** for the session token is
    31,536,000 seconds (365 days). However, this can be configured based on each
    customer needs by contacting customer support.
  title: Apto Mobile API
  version: '1.0'
  termsOfService: https://www.aptopayments.com/#/privacy
  contact:
    email: customersupport@aptopayments.com
  x-logo:
    url: https://docs.aptopayments.com/img/logo-header.svg
tags:
  - name: Instant Debit Card Transfers
    description: >
      Use the `/instant_debit_transfer` group of endpoints to provision cards
      and manage instant debit transfers.
  - name: Agreements
    description: >-
      Use these endpoints to record whether an Agreement was accepted or
      declined (e.g. Cardholder Agreement, Privacy Policy).
  - name: Balance transfer subscriptions
    description: >
      Balance transfer subscriptions allow your cardholders to subscribe their
      card to a balance transfer template that you’ve created.

      When a cardholder subscribes their card to a balance transfer template,
      every purchase made on their card will trigger an additional debit
      transaction for an amount that is automatically transferred to your
      program’s funding account balance. The amount that is debited following
      each purchase is defined by the rules of the particular balance transfer
      template. To learn more about balance transfer templates, please refer to
      the <a
      href="https://docs.aptopayments.com/api/core-api/#tag/Balance-transfer-templates">balance
      transfer template documentation for the Core API</a>.
  - name: Balance transfer templates
    description: >
      Use this endpoint to get the list of available balance transfer templates.
      To learn more about balance transfer templates, please refer to the <a
      href="https://docs.aptopayments.com/api/core-api/#tag/Balance-transfer-templates">balance
      transfer template documentation for the Core API</a>.
  - name: Balances
    description: Use these endpoints to manage the funding source balances for cards.
  - name: Card applications
    description: Use these endpoints to issue cards.
  - name: Card programs
    description: Use these endpoints to manage card programs.
  - name: Cards
    description: Use these endpoints to create and manage cards.
  - name: Configurations
    description: >-
      Use these endpoint to verify your account configuration, and to see which
      types of user verifications are required.
  - name: Monthly statements
    description: Use these endpoints to retrieve monthly statements for card transactions.
  - name: P2P transfer
    description: >-
      Use this endpoint to to transfer funds to other cardholders in the same
      card program.
  - name: Transactions
  - name: Users
    description: >-
      Use these endpoints to manage users, including obtaining the session token
      that is required to access API resources.
  - name: Verifications
    description: Use these endpoints to verify a user's credentials.
x-tagGroups:
  - name: Resources
    tags:
      - Configurations
      - Verifications
      - Users
      - Card programs
      - Card applications
      - Agreements
      - Cards
      - Balances
      - Transactions
      - P2P transfer
      - Balance transfer templates
      - Balance transfer subscriptions
      - Monthly statements
      - Instant Debit Card Transfers
paths:
  /v1/instant_debit_transfer/authorization:
    post:
      tags:
        - Instant Debit Card Transfers
      summary: Start authorization
      description: >-
        Use this endpoint to start the process of authorizing your users to
        access the Instant Debit Card Transfers function in the Apto platform.
        This is the first step to allow your users to load funds into their Apto
        cards. When calling this endpoint, an authorization URL will be
        returned. This URL must be presented to your user so the process can be
        completed within the web flow.
      operationId: start_authorization
      security:
        - PublicKey: []
          SessionToken: []
      responses:
        '200':
          description: success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AuthorizationSchema'
        '401':
          description: unauthorized
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/ErrorInvalidApiKey'
                  - $ref: '#/components/schemas/ErrorExpiredUserToken'
                  - $ref: '#/components/schemas/ErrorInvalidUserToken'
                  - $ref: '#/components/schemas/ErrorEmptyUserToken'
                  - $ref: '#/components/schemas/ErrorFeatureNotAllowed'
                  - $ref: '#/components/schemas/ErrorInvalidAccessToken'
  /v1/instant_debit_transfer/authorization/{authorization_id}:
    get:
      tags:
        - Instant Debit Card Transfers
      summary: Get authorization details
      description: >-
        This endpoint returns the details (including status) of a previously
        started authorization.
      operationId: get_authorization
      security:
        - PublicKey: []
          SessionToken: []
      parameters:
        - $ref: '#/components/parameters/AuthorizationIdParam'
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AuthorizationSchema'
        '401':
          description: unauthorized
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/ErrorInvalidApiKey'
                  - $ref: '#/components/schemas/ErrorExpiredUserToken'
                  - $ref: '#/components/schemas/ErrorInvalidUserToken'
                  - $ref: '#/components/schemas/ErrorEmptyUserToken'
                  - $ref: '#/components/schemas/ErrorFeatureNotAllowed'
                  - $ref: '#/components/schemas/ErrorUnauthorized'
                  - $ref: '#/components/schemas/ErrorInvalidAccessToken'
        '404':
          description: Authorization attempt not found
  /v1/instant_debit_transfer/linked_cards:
    post:
      tags:
        - Instant Debit Card Transfers
      summary: Start link card attempt
      description: >-
        Use this endpoint to start the process of linking a non Apto issued
        card. When calling this endpoint, a link card flow URL will be returned.
        This URL must be presented to your user so the process can be completed
        within the web flow.
      operationId: add_linked_card
      security:
        - PublicKey: []
          SessionToken: []
      responses:
        '200':
          description: success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LinkCardSchema'
        '401':
          description: unauthorized
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/ErrorInvalidApiKey'
                  - $ref: '#/components/schemas/ErrorExpiredUserToken'
                  - $ref: '#/components/schemas/ErrorInvalidUserToken'
                  - $ref: '#/components/schemas/ErrorEmptyUserToken'
                  - $ref: '#/components/schemas/ErrorFeatureNotAllowed'
                  - $ref: '#/components/schemas/ErrorUnauthorized'
                  - $ref: '#/components/schemas/ErrorInvalidAccessToken'
    get:
      tags:
        - Instant Debit Card Transfers
      summary: List linked cards
      description: >-
        Returns the list of linked cards that can be used as source/target of
        Instant Debit Card Transfers for the current cardholder. We'll identify
        the cardholder id from the incoming session token (present in the
        Authorization header)
      operationId: get_linked_cards
      security:
        - PublicKey: []
          SessionToken: []
      parameters:
        - $ref: '#/components/parameters/StartingAfterParam'
        - $ref: '#/components/parameters/EndingBeforeParam'
        - $ref: '#/components/parameters/PageLimitParam'
      responses:
        '200':
          description: success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LinkedCardsList'
        '401':
          description: unauthorized
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/ErrorInvalidApiKey'
                  - $ref: '#/components/schemas/ErrorExpiredUserToken'
                  - $ref: '#/components/schemas/ErrorInvalidUserToken'
                  - $ref: '#/components/schemas/ErrorEmptyUserToken'
                  - $ref: '#/components/schemas/ErrorFeatureNotAllowed'
                  - $ref: '#/components/schemas/ErrorUnauthorized'
                  - $ref: '#/components/schemas/ErrorInvalidAccessToken'
  /v1/instant_debit_transfer/linked_cards/{link_card_id}:
    delete:
      tags:
        - Instant Debit Card Transfers
      summary: Delete linked card
      description: >-
        Use this endpoint to initiate the deletion of a linked card. Please be
        aware that users can only delete non-Apto issued cards provided that the
        card has no pending transfers associated with it.
      operationId: delete_link_card_attempt
      security:
        - PublicKey: []
          SessionToken: []
      parameters:
        - $ref: '#/components/parameters/LinkedCardIdParam'
      responses:
        '200':
          description: OK
        '401':
          description: unauthorized
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/ErrorInvalidApiKey'
                  - $ref: '#/components/schemas/ErrorExpiredUserToken'
                  - $ref: '#/components/schemas/ErrorInvalidUserToken'
                  - $ref: '#/components/schemas/ErrorEmptyUserToken'
                  - $ref: '#/components/schemas/ErrorFeatureNotAllowed'
                  - $ref: '#/components/schemas/ErrorUnauthorized'
                  - $ref: '#/components/schemas/ErrorInvalidAccessToken'
        '404':
          description: Link card attempt not found
  /v1/instant_debit_transfer/inbound:
    post:
      tags:
        - Instant Debit Card Transfers
      summary: Initiate inbound transfer
      description: >-
        Use this endpoint to sends funds from a linked external card to an Apto
        card.
      operationId: add_inbound_instant_debit_transfer
      security:
        - PublicKey: []
          SessionToken: []
      requestBody:
        $ref: '#/components/requestBodies/CreateInboundTransferBody'
      responses:
        '200':
          description: success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DebitTransferSchema'
        '401':
          description: unauthorized
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/ErrorInvalidApiKey'
                  - $ref: '#/components/schemas/ErrorExpiredUserToken'
                  - $ref: '#/components/schemas/ErrorInvalidUserToken'
                  - $ref: '#/components/schemas/ErrorEmptyUserToken'
                  - $ref: '#/components/schemas/ErrorFeatureNotAllowed'
                  - $ref: '#/components/schemas/ErrorUnauthorized'
                  - $ref: '#/components/schemas/ErrorInvalidAccessToken'
  /v1/instant_debit_transfer:
    get:
      tags:
        - Instant Debit Card Transfers
      summary: List all transfers
      description: >-
        Returns the list of transfers (inbound and outbound) created by the
        current cardholder. We'll identify the cardholder from the incoming
        session token (present in the Authorization header)
      operationId: get_instant_debit_transfers
      security:
        - PublicKey: []
          SessionToken: []
      parameters:
        - $ref: '#/components/parameters/StartingAfterParam'
        - $ref: '#/components/parameters/EndingBeforeParam'
        - $ref: '#/components/parameters/PageLimitParam'
      responses:
        '200':
          description: success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DebitTransferList'
        '401':
          description: unauthorized
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/ErrorInvalidApiKey'
                  - $ref: '#/components/schemas/ErrorExpiredUserToken'
                  - $ref: '#/components/schemas/ErrorInvalidUserToken'
                  - $ref: '#/components/schemas/ErrorEmptyUserToken'
                  - $ref: '#/components/schemas/ErrorFeatureNotAllowed'
                  - $ref: '#/components/schemas/ErrorUnauthorized'
                  - $ref: '#/components/schemas/ErrorInvalidAccessToken'
  /v1/instant_debit_transfer/{transfer_id}:
    get:
      tags:
        - Instant Debit Card Transfers
      summary: Get the details for a transfer
      description: >-
        This endpoint returns the details (including status) of a previously
        started inbound/outbound instant debit transfer.
      operationId: get_instant_debit_single_transfer
      security:
        - PublicKey: []
          SessionToken: []
      parameters:
        - $ref: '#/components/parameters/TransferIdParam'
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DebitTransferSchema'
        '401':
          description: unauthorized
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/ErrorInvalidApiKey'
                  - $ref: '#/components/schemas/ErrorExpiredUserToken'
                  - $ref: '#/components/schemas/ErrorInvalidUserToken'
                  - $ref: '#/components/schemas/ErrorEmptyUserToken'
                  - $ref: '#/components/schemas/ErrorFeatureNotAllowed'
                  - $ref: '#/components/schemas/ErrorUnauthorized'
                  - $ref: '#/components/schemas/ErrorInvalidAccessToken'
        '404':
          description: Direct deposit not found
  /v1/agreements:
    post:
      tags:
        - Agreements
      summary: Set an agreement status
      description: Records whether a user accepted or declined a certain agreement.
      operationId: recordAgreementDecision
      security:
        - PublicKey: []
          SessionToken: []
      requestBody:
        $ref: '#/components/requestBodies/SetAgreementStatusBody'
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AgreementsList'
        '400':
          description: Invalid request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AgreementError'
  /v1/disclaimers/accept:
    post:
      tags:
        - Agreements
      summary: Accept an agreement
      description: Accepts an agreement such as a disclaimer.
      operationId: AcceptAgreement
      security:
        - PublicKey: []
          SessionToken: []
      requestBody:
        $ref: '#/components/requestBodies/AcceptAgreementsBody'
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: object
        '400':
          description: Invalid request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /v1/balances/{balance_id}/balance_transfer_subscriptions:
    get:
      tags:
        - Balance transfer subscriptions
      summary: List all balance transfer subscriptions
      description: Retrieves a list of a user's balance transfer subscriptions.
      parameters:
        - $ref: '#/components/parameters/StartingAfterParam'
        - $ref: '#/components/parameters/EndingBeforeParam'
        - $ref: '#/components/parameters/PageLimitParam'
        - $ref: '#/components/parameters/BalanceIdParam'
      security:
        - PublicKey: []
          SessionToken: []
      responses:
        '200':
          description: Successful operation.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BalanceTransferSubscriptionList'
        '400':
          description: Invalid request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Invalid request due to incorrect permissions.
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/ErrorInvalidApiKey'
                  - $ref: '#/components/schemas/ErrorExpiredUserToken'
                  - $ref: '#/components/schemas/ErrorInvalidUserToken'
                  - $ref: '#/components/schemas/ErrorEmptyUserToken'
        '404':
          description: Balance does not exist.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
    post:
      tags:
        - Balance transfer subscriptions
      summary: Create a balance transfer subscription
      description: Creates a new balance transfer subscription.
      parameters:
        - $ref: '#/components/parameters/BalanceIdParam'
      requestBody:
        $ref: '#/components/requestBodies/CreateTransferSubscriptionBody'
      security:
        - PublicKey: []
          SessionToken: []
      responses:
        '200':
          description: Successful operation.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BalanceTransferSubscription'
        '400':
          description: Invalid request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Invalid request due to incorrect permissions.
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/ErrorInvalidApiKey'
                  - $ref: '#/components/schemas/ErrorExpiredUserToken'
                  - $ref: '#/components/schemas/ErrorInvalidUserToken'
                  - $ref: '#/components/schemas/ErrorEmptyUserToken'
        '404':
          description: Balance does not exist.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /v1/balances/{balance_id}/balance_transfer_subscriptions/{balance_transfer_subscription_id}:
    get:
      tags:
        - Balance transfer subscriptions
      summary: Retrieve a balance transfer subscription
      description: Retrieves a single balance transfer subscription.
      operationId: get_balance_transfer_subscription
      parameters:
        - $ref: '#/components/parameters/BalanceIdParam'
        - $ref: '#/components/parameters/BalanceTransferSubscriptionIdParam'
      security:
        - PublicKey: []
          SessionToken: []
      responses:
        '200':
          description: Successful operation.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BalanceTransferSubscription'
        '400':
          description: Invalid request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Invalid request due to permissions.
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/ErrorInvalidApiKey'
                  - $ref: '#/components/schemas/ErrorExpiredUserToken'
                  - $ref: '#/components/schemas/ErrorInvalidUserToken'
                  - $ref: '#/components/schemas/ErrorEmptyUserToken'
        '404':
          description: Balance does not exist.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
    delete:
      tags:
        - Balance transfer subscriptions
      summary: Delete a balance transfer subscription
      description: Deletes a balance transfer subscription.
      operationId: delete_balance_transfer_subscription
      parameters:
        - $ref: '#/components/parameters/BalanceIdParam'
        - $ref: '#/components/parameters/BalanceTransferSubscriptionIdParam'
      security:
        - PublicKey: []
          SessionToken: []
      responses:
        '200':
          description: Successful operation.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BalanceTransferSubscription'
        '400':
          description: Invalid request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Invalid request due to incorrect permissions.
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/ErrorInvalidApiKey'
                  - $ref: '#/components/schemas/ErrorExpiredUserToken'
                  - $ref: '#/components/schemas/ErrorInvalidUserToken'
                  - $ref: '#/components/schemas/ErrorEmptyUserToken'
        '404':
          description: Balance does not exist.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
    put:
      tags:
        - Balance transfer subscriptions
      summary: Update a balance transfer subscription
      description: Updates a balance transfer subscription.
      operationId: update_balance_transfer_subscription
      parameters:
        - $ref: '#/components/parameters/BalanceIdParam'
        - $ref: '#/components/parameters/BalanceTransferSubscriptionIdParam'
      requestBody:
        $ref: '#/components/requestBodies/UpdateTransferSubscriptionBody'
      security:
        - PublicKey: []
          SessionToken: []
      responses:
        '200':
          description: Successful operation.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BalanceTransferSubscription'
        '400':
          description: Invalid request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Invalid request due to incorrect permissions.
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/ErrorInvalidApiKey'
                  - $ref: '#/components/schemas/ErrorExpiredUserToken'
                  - $ref: '#/components/schemas/ErrorInvalidUserToken'
                  - $ref: '#/components/schemas/ErrorEmptyUserToken'
        '404':
          description: Balance does not exist.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /v1/balance_transfer_templates:
    get:
      tags:
        - Balance transfer templates
      summary: List all balance transfer templates
      description: Retrieves a list of the available balance transfer templates.
      parameters:
        - $ref: '#/components/parameters/StartingAfterParam'
        - $ref: '#/components/parameters/EndingBeforeParam'
        - $ref: '#/components/parameters/PageLimitParam'
      security:
        - PublicKey: []
          SessionToken: []
      responses:
        '200':
          description: Successful operation.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BalanceTransferTemplateList'
        '400':
          description: Invalid request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Invalid request due to incorrect permissions.
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/ErrorInvalidApiKey'
                  - $ref: '#/components/schemas/ErrorExpiredUserToken'
                  - $ref: '#/components/schemas/ErrorInvalidUserToken'
                  - $ref: '#/components/schemas/ErrorEmptyUserToken'
  /v1/user/accounts/{account_id}/balance:
    post:
      tags:
        - Balances
      summary: Set a card's active balance
      description: >
        Assigns an existing funding source to a card. The funding source may be
        retrieved from the [card's available funding
        sources](#operation/availableFundingSources).
      security:
        - PublicKey: []
          SessionToken: []
      parameters:
        - $ref: '#/components/parameters/AccountIdParam'
      requestBody:
        $ref: '#/components/requestBodies/SetFundingSourceBody'
      responses:
        '200':
          description: Successful operation.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Balance'
        '400':
          description: Invalid request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Card does not exist.
    get:
      tags:
        - Balances
      summary: Retrieve a card's active balance
      description: Retrieves the current funding source attached to the card.
      parameters:
        - $ref: '#/components/parameters/AccountIdParam'
      security:
        - PublicKey: []
          SessionToken: []
      responses:
        '200':
          description: Successful operation.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Balance'
        '400':
          description: Invalid request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Card does not exist.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /v1/user/accounts/{account_id}/balances:
    get:
      tags:
        - Balances
      summary: List available balances
      description: >-
        Retrieves a list of available funding sources that can be assigned to a
        card.
      operationId: availableFundingSources
      security:
        - PublicKey: []
          SessionToken: []
      parameters:
        - $ref: '#/components/parameters/AccountIdParam'
      responses:
        '200':
          description: Successful operation.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BalancesList'
        '400':
          description: Invalid request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Card does not exist.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /v1/balances/{balance_id}/ach:
    get:
      tags:
        - Balances
      summary: Retrieve the ACH data attached to a balance
      description: >-
        ![Orange or Blue Programs only
        banner](https://docs.aptopayments.com/img/enterprise-only-banner-short.svg)

        Retrieves the bank account and routing number associated with this
        balance.
      security:
        - PublicKey: []
          SessionToken: []
      parameters:
        - $ref: '#/components/parameters/BalanceIdParam'
      responses:
        '200':
          description: Ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BankAccountDetails'
        '404':
          description: Account not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BankAccountBalanceError'
    post:
      tags:
        - Balances
      summary: Create ACH data for a balance
      description: >-
        ![Orange or Blue Programs only
        banner](https://docs.aptopayments.com/img/enterprise-only-banner-short.svg)

        Assigns a bank account and routing number to a balance.<br/><br/>

        You might need the user to accept some agreements before the bank
        account can be associated to the card balance. If so, the response when
        calling this endpoint will let you know which agreements need to be
        accepted.

        You can accept the agreements by calling the [accept agreements
        endpoint](#operation/recordAgreementDecision).
      security:
        - PublicKey: []
          SessionToken: []
      parameters:
        - $ref: '#/components/parameters/BalanceIdParam'
      responses:
        '200':
          description: Ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BankAccountDetails'
        '400':
          description: Invalid request
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/ErrorBankAccountAgreement'
                  - $ref: '#/components/schemas/ErrorBankAccountAlreadyIssued'
  /v1/user/accounts/apply:
    post:
      tags:
        - Card applications
      operationId: ApplyCard
      summary: Apply for card
      description: >-
        Starts a card application process for a user. The response will contain
        a `status` field indicating the application status. When the `status`
        field is `pending`, the response might contain a `next_action` field
        indicating which next action should be taken. More information about
        this flow can be found on the [issuing
        cards](https://docs.aptopayments.com/docs/overview/getting%20started/cards)
        guide.
      security:
        - PublicKey: []
          SessionToken: []
      requestBody:
        $ref: '#/components/requestBodies/ApplyForCardBody'
      responses:
        '200':
          description: Successful operation.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CardApplication'
        '400':
          description: Invalid request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /v1/user/accounts/applications/{application_id}/status:
    get:
      tags:
        - Card applications
      summary: Retrieve an application status
      description: >
        Retrieves the application object for an existing application, allowing
        you to identify its status, workflow, and next action.
      operationId: GetApplication
      security:
        - PublicKey: []
          SessionToken: []
      parameters:
        - $ref: '#/components/parameters/ApplicationIdParam'
      responses:
        '200':
          description: Successful operation.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CardApplication'
        '400':
          description: Invalid request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /v1/user/accounts/issuecard:
    post:
      tags:
        - Card applications
      summary: Issue a card
      description: Issues a card for an existing application.
      operationId: IssueCard
      security:
        - PublicKey: []
          SessionToken: []
      requestBody:
        $ref: '#/components/requestBodies/IssueCardBody'
      responses:
        '200':
          description: Successful operation.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Card'
        '400':
          description: Invalid request.
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/Error'
                  - $ref: '#/components/schemas/Error_NotEnoughFunds'
                  - $ref: '#/components/schemas/ErrorCardIssuanceBlockedOnCardProgram'
                  - $ref: '#/components/schemas/ErrorCardIssuanceBlockedOnCustomer'
  /v1/config/cardproducts:
    get:
      tags:
        - Card programs
      summary: List all card programs
      description: >-
        Retrieves all the available card programs for the user applying for a
        card.
      operationId: GetCardPrograms
      security:
        - PublicKey: []
          SessionToken: []
      responses:
        '200':
          description: Successful operation.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CardProgramList'
        '400':
          description: Invalid request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /v1/config/cardproducts/{card_program_id}:
    get:
      tags:
        - Card programs
      summary: Card program details
      description: Returns the details of the specified card program.
      operationId: GetCardProgram
      security:
        - PublicKey: []
          SessionToken: []
      parameters:
        - $ref: '#/components/parameters/CardProgramIdParam'
      responses:
        '200':
          description: Successful operation.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CardConfiguration'
        '400':
          description: Invalid request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /v1/user/accounts:
    get:
      tags:
        - Cards
      summary: List all cards
      description: >
        Retrieves all of the user's cards. Available returned states can be:
        created, activated, deactivated and cancelled
      operationId: list_cards
      parameters:
        - $ref: '#/components/parameters/StartingAfterParam'
        - $ref: '#/components/parameters/EndingBeforeParam'
        - $ref: '#/components/parameters/PageLimitParam'
      security:
        - PublicKey: []
          SessionToken: []
      responses:
        '200':
          description: Successful operation.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CardList'
        '401':
          description: invalid_request_error
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/ErrorInvalidApiKey'
                  - $ref: '#/components/schemas/ErrorExpiredUserToken'
                  - $ref: '#/components/schemas/ErrorInvalidUserToken'
                  - $ref: '#/components/schemas/ErrorEmptyUserToken'
  /v1/user/accounts/{account_id}:
    get:
      tags:
        - Cards
      summary: Retrieve a card
      description: Retrieves the card’s information.
      parameters:
        - $ref: '#/components/parameters/AccountIdParam'
      security:
        - PublicKey: []
          SessionToken: []
      responses:
        '200':
          description: Successful operation.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Card'
        '400':
          description: Invalid request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Card does not exist.
  /v1/user/accounts/{account_id}/order_physical/config:
    get:
      tags:
        - Cards
      summary: Retrieve physical card order
      description: >
        Retrieves configuration related to ordering a physical card, like
        current user address and physical card issuance fee.
      parameters:
        - $ref: '#/components/parameters/AccountIdParam'
      security:
        - PublicKey: []
          SessionToken: []
      responses:
        '200':
          description: Successful operation.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OrderPhysicalCardConfig'
        '400':
          description: Invalid request.
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/Error'
        '404':
          description: Card does not exist.
  /v1/user/accounts/{account_id}/order_physical:
    post:
      tags:
        - Cards
      summary: Order a physical card
      description: >
        Orders a physical card with the same PAN as the current virtual card and
        the card will be sent by mail to the cardholder.
      parameters:
        - $ref: '#/components/parameters/AccountIdParam'
      security:
        - PublicKey: []
          SessionToken: []
      responses:
        '200':
          description: Successful operation.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Card'
        '400':
          description: Invalid request.
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/Error'
                  - $ref: '#/components/schemas/Error_OrderPhysicalCardNotSupported'
                  - $ref: '#/components/schemas/Error_PhysicalCardAlreadyOrdered'
                  - $ref: '#/components/schemas/Error_NotEnoughFunds'
        '404':
          description: Card does not exist.
  /v1/user/accounts/{account_id}/activate_physical:
    post:
      tags:
        - Cards
      summary: Activate a physical card
      description: >
        Activates a card with the code from the carrier. Once a card is
        activated, the user can perform transactions with the card.
      parameters:
        - $ref: '#/components/parameters/AccountIdParam'
      security:
        - PublicKey: []
          SessionToken: []
      requestBody:
        $ref: '#/components/requestBodies/ActivatePhysicalCardBody'
      responses:
        '200':
          description: >
            The API in this case will always return a 200 status response. It'll
            use the "result" field ( "activated" or "error" ) to indicate
            whether the request was successful or not.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ActivateCardResult'
        '400':
          description: Invalid request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Card does not exist.
  /v1/user/accounts/{account_id}/enable:
    post:
      tags:
        - Cards
      summary: Enable a card
      description: Enables a previously disabled card.
      operationId: enableCard
      parameters:
        - $ref: '#/components/parameters/AccountIdParam'
      security:
        - PublicKey: []
          SessionToken: []
      responses:
        '200':
          description: Successful operation.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Card'
        '400':
          description: Invalid request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Card does not exist
  /v1/user/accounts/{account_id}/disable:
    post:
      tags:
        - Cards
      summary: Disable a card
      description: >-
        Temporarily disables a card. This can be reverted by invoking the
        [`/enable` endpoint](#operation/enableCard).
      parameters:
        - $ref: '#/components/parameters/AccountIdParam'
      security:
        - PublicKey: []
          SessionToken: []
      responses:
        '200':
          description: Successful operation.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Card'
        '400':
          description: Invalid request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Card does not exist.
  /v1/user/accounts/{account_id}/pin:
    post:
      tags:
        - Cards
      summary: Set card PIN
      description: >
        Changes the card's 4 digit PIN value.<br /><br />

        **Note:** The 4 digit PIN is considered PCI data, only if your
        integration is [PCI compliant](/docs/concepts/compliance) you'll be able
        to send directly the PIN as in the example. Otherwise, you'll need to
        use [Apto's PCI SDK](/docs/sdks/Web/pci_sdk_web) for [this
        operation](/docs/sdks/Web/pci_sdk_web#set-the-pin).
      security:
        - PublicKey: []
          SessionToken: []
      requestBody:
        $ref: '#/components/requestBodies/SetCardPinBody'
      parameters:
        - $ref: '#/components/parameters/AccountIdParam'
      responses:
        '200':
          description: Successful operation.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Card'
        '400':
          description: Invalid request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: unauthorized
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/Error_SetPinRequiresVerification'
        '404':
          description: Card does not exist.
  /v1/user/accounts/{account_id}/passcode:
    post:
      tags:
        - Cards
      summary: Set card passcode
      description: >-
        Sets the card's passcode. This is used in 3DS SCA, when making online
        payments it may be asked as an extra security step.
      operationId: set_3ds_passcode
      parameters:
        - $ref: '#/components/parameters/AccountIdParam'
      security:
        - PublicKey: []
          SessionToken: []
      requestBody:
        $ref: '#/components/requestBodies/SetCard3dsPasscodeBody'
      responses:
        '200':
          description: Successful operation.
        '400':
          description: invalid_request_error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/3dsPasscodeError'
        '401':
          description: invalid_request_error
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/ErrorInvalidApiKey'
                  - $ref: '#/components/schemas/ErrorExpiredUserToken'
                  - $ref: '#/components/schemas/ErrorInvalidUserToken'
                  - $ref: '#/components/schemas/ErrorEmptyUserToken'
        '404':
          description: Card does not exist.
  /v1/user/accounts/{account_id}/stats/monthly_spending:
    get:
      tags:
        - Cards
      summary: Summarize monthly spending
      description: Retrieves a summary of the card's monthly spending.
      parameters:
        - $ref: '#/components/parameters/AccountIdParam'
        - $ref: '#/components/parameters/MonthlySpendingMonthParam'
        - $ref: '#/components/parameters/MonthlySpendingYearParam'
      security:
        - PublicKey: []
          SessionToken: []
      responses:
        '200':
          description: Successful operation.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MonthlySpending'
        '400':
          description: Invalid request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Card does not exist
  /v1/user/accounts/{account_id}/provision/googlepay:
    post:
      tags:
        - Cards
      summary: Retrieve Google IAP data
      operationId: provision_google_pay
      description: >
        This endpoint provides the needed data to start the in app provisioning
        process.<br /><br />

        **Warning:** In order to start the in-app provisioning with Google Pay
        in your app you need to request access to their documents and contact
        them to enable your apps package to use Google Pay.<br /><br />

        You can find more information in [this
        guide](https://developers.google.com/pay/issuers/apis/push-provisioning/android/wallet-operations#client_side_push_provisioning).
      parameters:
        - $ref: '#/components/parameters/AccountIdParam'
      security:
        - PublicKey: []
          SessionToken: []
      responses:
        '200':
          description: Successful operation.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GooglePayProvisioning'
        '400':
          description: Invalid request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: invalid_request_error
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/ErrorInvalidApiKey'
                  - $ref: '#/components/schemas/ErrorExpiredUserToken'
                  - $ref: '#/components/schemas/ErrorInvalidUserToken'
                  - $ref: '#/components/schemas/ErrorEmptyUserToken'
        '404':
          description: Card does not exist
  /v1/user/accounts/{account_id}/provision/applepay:
    post:
      tags:
        - Cards
      summary: Retrieve Apple in-app provisioning data
      operationId: provision_apple_pay
      description: >
        This endpoint provides the needed data to start the in-app provisioning
        process.<br /><br />

        **Warning:** In order to start the provisioning with Apple Pay in your
        app you need to set up Apple Pay.<br /><br />

        You can find more information [in this
        guide](https://developer.apple.com/documentation/passkit/apple_pay/setting_up_apple_pay).
      parameters:
        - $ref: '#/components/parameters/AccountIdParam'
      security:
        - PublicKey: []
          SessionToken: []
      requestBody:
        $ref: '#/components/requestBodies/ApplePayProvisioningBody'
      responses:
        '200':
          description: Successful operation.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApplePayProvisioning'
        '400':
          description: Invalid request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: invalid_request_error
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/ErrorInvalidApiKey'
                  - $ref: '#/components/schemas/ErrorExpiredUserToken'
                  - $ref: '#/components/schemas/ErrorInvalidUserToken'
                  - $ref: '#/components/schemas/ErrorEmptyUserToken'
        '404':
          description: Card does not exist
  /v1/config:
    get:
      tags:
        - Configurations
      summary: Retrieve a configuration
      description: >
        Retrieves the configuration for your account, including the credentials
        required for each user.
      security:
        - PublicKey: []
      responses:
        '200':
          description: Successful operation.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Credentials'
        '400':
          description: Invalid request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: No existing account
  /v1/user/statements:
    post:
      tags:
        - Monthly statements
      summary: Generate a monthly statement
      description: >
        Generates a statement for the specified month and year. Once generated,

        the statement can be downloaded from the `download_url` provided in the
        response object.

        This URL is valid until it expires (`url_expiration`).
      operationId: GenerateMonthlyStatement
      security:
        - PublicKey: []
          SessionToken: []
      requestBody:
        $ref: '#/components/requestBodies/GenerateMonthlyStatementBody'
      responses:
        '200':
          description: Successful response.
          content:
            application/json:
              schema:
                items:
                  $ref: '#/components/schemas/MonthlyStatementsReport'
        '400':
          description: Invalid request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /v1/user/statements/period:
    get:
      tags:
        - Monthly statements
      summary: Retrieve a monthly statement period
      operationId: retrieveMonthlyReportAvailability
      security:
        - PublicKey: []
          SessionToken: []
      responses:
        '200':
          description: Successful response.
          content:
            application/json:
              schema:
                items:
                  $ref: '#/components/schemas/MonthlyStatementsPeriod'
        '400':
          description: Invalid request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Cardholder does not exist
  /v1/p2p/recipient:
    get:
      tags:
        - P2P transfer
      summary: Retrieves a valid cardholder to send funds
      description: >-
        Retrieves a cardholder's data to do a P2P transfer in case it exist,
        otherwise returns a not found error
      security:
        - PublicKey: []
          SessionToken: []
      parameters:
        - $ref: '#/components/parameters/PhoneCountryCodeParam'
        - $ref: '#/components/parameters/PhoneNumberParam'
        - $ref: '#/components/parameters/EmailParam'
      responses:
        '200':
          description: Successful operation.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/P2PCardholder'
        '400':
          description: Invalid request.
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/InvalidEmail'
                  - $ref: '#/components/schemas/InvalidPhone'
                  - $ref: >-
                      #/components/schemas/ParameterDefinedIsNotPrimaryCredential
                  - $ref: '#/components/schemas/ErrorSameRecipientAndSender'
        '401':
          description: Invalid request due to incorrect permissions.
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/ErrorInvalidApiKey'
                  - $ref: '#/components/schemas/ErrorExpiredUserToken'
                  - $ref: '#/components/schemas/ErrorInvalidUserToken'
                  - $ref: '#/components/schemas/ErrorEmptyUserToken'
        '404':
          description: Cardholder does not exist
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserNotFound'
  /v1/p2p/transfer:
    post:
      tags:
        - P2P transfer
      summary: P2P transfer
      description: Execute the P2P transfer
      security:
        - PublicKey: []
          SessionToken: []
      requestBody:
        $ref: '#/components/requestBodies/SendP2PTransferBody'
      responses:
        '200':
          description: Successful operation.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/P2pTransfer'
        '400':
          description: Invalid request.
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/BalanceTypeNotPair'
                  - $ref: '#/components/schemas/BalanceTransferError'
                  - $ref: '#/components/schemas/ErrorCurrencyDoNotMatch'
        '401':
          description: Invalid request due to incorrect permissions.
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/ErrorInvalidApiKey'
                  - $ref: '#/components/schemas/ErrorExpiredUserToken'
                  - $ref: '#/components/schemas/ErrorInvalidUserToken'
                  - $ref: '#/components/schemas/ErrorEmptyUserToken'
                  - $ref: '#/components/schemas/ErrorFeatureNotAllowed'
        '404':
          description: Not found.
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/BalanceNotFound'
                  - $ref: '#/components/schemas/CardholderNotFound'
                  - $ref: '#/components/schemas/CardNotFound'
  /v1/user/accounts/{account_id}/transactions:
    get:
      tags:
        - Transactions
      summary: List all card transactions
      description: Retrieves a list of the card’s transactions.
      parameters:
        - $ref: '#/components/parameters/AccountIdParam'
        - $ref: '#/components/parameters/RowsQueryParam'
        - $ref: '#/components/parameters/LastTransactionIdQueryParam'
        - $ref: '#/components/parameters/StartDateQueryParam'
        - $ref: '#/components/parameters/EndDateQueryParam'
        - $ref: '#/components/parameters/MCCQueryParam'
        - $ref: '#/components/parameters/TransactionStateQueryParam'
      security:
        - PublicKey: []
          SessionToken: []
      responses:
        '200':
          description: Successful operation.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TransactionList'
        '400':
          description: Invalid request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Card does not exist.
  /v1/user:
    post:
      tags:
        - Users
      summary: Create a user
      description: >-
        Creates a new user. Be sure the user's credentials have been
        [verified](#tag/Verifications). <br /><br />

        **Note 1:** For the **Green Program**, the primary verification
        credential is always the user's phone number and the secondary
        verification credential is the user's date of birth. <br /><br />

        **Note 2:** Apto expects you to send the payload signed as a JWT token.
        For this to work you'll need to supply a `application/jwt` header as
        well. Learn more about **Signed Payloads** by reading the [relevant
        guide](/docs/overview/getting%20started/signed_payloads/).<br /><br />
      operationId: CreateUser
      security:
        - PublicKey: []
      requestBody:
        $ref: '#/components/requestBodies/CreateUserBody'
      responses:
        '200':
          description: Successful operation.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserCreated'
        '400':
          description: Invalid request.
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/Error'
                  - $ref: '#/components/schemas/Error_PrimaryCredentialNotDefined'
                  - $ref: '#/components/schemas/Error_NewUserCreationProhibited'
                  - $ref: >-
                      shared/general_shared.yaml#/components/schemas/Error_InvalidMetadataLength
        '401':
          description: Unauthorized.
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/SessionExpiredError'
                  - $ref: '#/components/schemas/Error_SignedPayloadVerification'
        '404':
          description: No existing verification.
    put:
      tags:
        - Users
      summary: Update a user
      description: >-
        Updates a user with the specified information. Only the specified fields
        are updated.
      security:
        - PublicKey: []
          SessionToken: []
      requestBody:
        $ref: '#/components/requestBodies/UpdateUserBody'
      responses:
        '200':
          description: Successful operation.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/User'
        '400':
          description: Invalid request.
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/Error'
                  - $ref: >-
                      shared/general_shared.yaml#/components/schemas/Error_InvalidAge
        '404':
          description: User does not exist.
    get:
      tags:
        - Users
      summary: Retrieve a user
      description: >
        Retrieve the user associated to the current session, identified by the
        [session
        token](https://docs.aptopayments.com/api/mobile-api/#section/Authentication/SessionToken).
      security:
        - PublicKey: []
          SessionToken: []
      responses:
        '200':
          description: Successful operation.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/User'
        '400':
          description: Invalid request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: User does not exist.
  /v1/user/login:
    post:
      tags:
        - Users
      summary: Login a user
      description: >
        Logs an existing user into the system and returns its ID and access
        token. Be sure the user's

        credentials have been [verified](#tag/Verifications).
      security:
        - PublicKey: []
      requestBody:
        $ref: '#/components/requestBodies/UserLoginBody'
      responses:
        '200':
          description: Successful operation.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CardholderSession'
        '400':
          description: Invalid request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /v1/verifications/start:
    post:
      tags:
        - Verifications
      summary: Start verification process
      description: >
        Starts the verification process using the user's phone number or email
        as a primary verification credential.<br /><br />

        Users cannot be created or logged in until the `/finish` endpoint
        [completes the verification
        process](#operation/CompleteVerification).<br /><br />

        **Note:** For the **Green Program**, the primary verification credential
        is always the user's phone number.<br /><br />
      operationId: StartVerification
      security:
        - PublicKey: []
      requestBody:
        $ref: '#/components/requestBodies/StartVerificationBody'
      responses:
        '200':
          description: Successful operation.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Verification1'
        '400':
          description: Invalid request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /v1/verifications/{verification_id}/finish:
    post:
      tags:
        - Verifications
      summary: Complete verification process
      description: >
        Completes the verification process. When specifying a secret that was
        sent to the user's phone or email, **include numerical values only**
        (e.g., exclude dashes).<br /><br />

        The `status` field on the response will indicate whether the user still
        needs to pass more verifications or not (`status: "pending"` vs `status:
        "passed"`).<br /><br />

        In case the user already exists, the secondary verification will start
        automatically and the response will contain a `secondary_credential`
        object indicating what to supply again to this endpoint as a
        `secret`.<br /><br />

        For a better understanding of the requests flow, see the [authenticating
        users
        guide](https://docs.aptopayments.com/docs/guides/Users/authenticating-users-guide/#mobile-api).
      operationId: CompleteVerification
      parameters:
        - $ref: '#/components/parameters/VerificationIdParam'
      security:
        - PublicKey: []
      requestBody:
        $ref: '#/components/requestBodies/FinishVerificationBody'
      responses:
        '200':
          description: Successful operation.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Verification2'
        '400':
          description: Invalid request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: No existing verification.
  /v1/verifications/{verification_id}/restart:
    post:
      tags:
        - Verifications
      summary: Restart verification process
      description: >
        Restarts a phone or email verification using the `verification_id` that
        was returned when the verification process was started. Returns a new
        verification ID and status.<br /><br />

        **Note:** This endpoint can be used for phone number or email address
        verifications only.
      parameters:
        - $ref: '#/components/parameters/VerificationIdParam'
      security:
        - PublicKey: []
      responses:
        '200':
          description: Successful operation.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Verification1'
        '400':
          description: Invalid request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: No existing verification.
  /v1/verifications/{verification_id}/status:
    get:
      tags:
        - Verifications
      summary: Retrieve a verification
      description: Retrieves a verification, including its status.
      parameters:
        - $ref: '#/components/parameters/VerificationIdParam'
      security:
        - PublicKey: []
      responses:
        '200':
          description: Successful operation.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Verification2'
        '400':
          description: Invalid request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: No existing verification.
servers:
  - url: https://api.aptopayments.com
    description: Production
  - url: https://api.sbx.aptopayments.com
    description: Sandbox
components:
  schemas:
    3dsPasscodeError:
      type: object
      properties:
        code:
          type: number
          default: 200103
        message:
          type: string
          default: Passcode is not valid. It should be a 4 number passcode
    AcceptAgreementRequest:
      type: object
      required:
        - workflow_object_id
        - action_id
      properties:
        workflow_object_id:
          type: string
          description: >
            Identifies the flow, or list of actions, being executed.

            Find `workflow_object_id` in the response of the [apply for a card
            endpoint](#operation/ApplyCard) or the [retrieve card application
            endpoint](#operation/GetApplication).
          example: entity_a35b2e3fd633d187
        action_id:
          type: string
          description: >
            Identifier of the action within a workflow.

            Find `action_id` in the response of the [apply for a
            card](#operation/ApplyCard) endpoint or the [retrieve card
            application](#operation/GetApplication) endpoint (it'll be
            `next_action.action_id`).
          example: entity_188e0f731604d8d5
    ActivateCardResult:
      type: object
      properties:
        type:
          type: string
          description: The type of result returned for the API call.
          example: physical_activation_result
          enum:
            - physical_activation_result
        result:
          type: string
          description: The status of the card activation.
          example: activated
          enum:
            - activated
            - error
        error_code:
          type: integer
          nullable: true
          description: Code associated with the error if result is "error"
          example: null
        error_message:
          type: string
          nullable: true
          description: Message associated with the error if result is "error"
          example: null
    CollectUserDataAction:
      type: object
      properties:
        type:
          type: string
          enum:
            - action_collect_user_data_config
        required_datapoint_groups:
          $ref: '#/components/schemas/DataPointGroup'
    GetUserTokenAction:
      type: object
      properties:
        type:
          type: string
          enum:
            - action_get_user_token_config
    IssueCardAction:
      type: object
      properties:
        type:
          type: string
          enum:
            - action_issue_card_config
        legal_notice:
          type: object
          properties:
            type:
              type: string
              enum:
                - content
            format:
              type: string
              enum:
                - external_url
            value:
              type: string
              example: https://path/to/legal_notice
        error_asset:
          type: string
          example: https://path/to/icon
    SelectBalanceStoreAction:
      type: object
      properties:
        type:
          type: string
          enum:
            - select_balance_store_configuration
        action_asset:
          type: string
          example: https://path/to/icon
        allowed_balance_types:
          type: object
          allOf:
            - $ref: '#/components/schemas/Pagination'
            - type: object
              properties:
                items:
                  type: array
                  items:
                    type: object
                    properties:
                      type:
                        type: string
                        enum:
                          - allowed_balance_type
                      balance_type:
                        type: string
                        example: Balance type
                      balance_uri:
                        type: string
                        example: https://path/to/balance
    ShowDisclaimersAction:
      type: object
      properties:
        type:
          type: string
          enum:
            - action_disclaimer_config
        disclaimer:
          type: object
          properties:
            type:
              type: string
              enum:
                - content
            format:
              type: string
              enum:
                - external_url
            value:
              type: string
              example: https://path/to/disclaimer
        agreements_keys:
          type: array
          items:
            type: string
            enum:
              - evolve_eua
              - evolve_privacy
              - apto_cha
              - apto_privacy
    ShowGenericMessageAction:
      type: object
      properties:
        type:
          type: string
          enum:
            - action_generic_message_config
        title:
          type: string
          example: Message title
        content:
          type: object
          properties:
            type:
              type: string
              enum:
                - content
            format:
              type: string
              enum:
                - plain_text
            value:
              type: string
              example: Some message
        image:
          type: string
          example: https://path/to/img
        tracker_event_name:
          type: string
          example: https://path/to/img
        tracker_increment_name:
          type: string
          example: https://path/to/img
    ShowWaitlistAction:
      type: object
      properties:
        type:
          type: string
          enum:
            - action_waitlist_config
        background_image:
          type: string
          example: https://path/to/bg/image
        background_color:
          type: string
          example: ff0000
        dark_background_color:
          type: string
          example: 0000ff
        asset:
          type: string
          example: https://path/to/asset
        filter:
          type: string
          example: some filter
    UploadDocumentsAction:
      type: object
      properties:
        type:
          type: string
          enum:
            - action_upload_documents_config
        revision_status:
          type: string
          enum:
            - pending_document_submission
            - in_progress
            - passed
            - rejected
        required_user_datapoint_groups:
          $ref: '#/components/schemas/DataPointGroup'
    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
    AddressDataPoint:
      type: object
      properties:
        type:
          type: string
          description: Type of datapoint.
          enum:
            - address
        street_one:
          type: string
          description: User’s street address.
          example: Malibu Point 10880
        street_two:
          type: string
          description: User’s secondary street address.
          nullable: true
          example: ''
        locality:
          type: string
          description: User’s city / locale.
          example: Malibu
        region:
          type: string
          description: User’s state / region.
          example: CA
        postal_code:
          type: string
          description: User’s postal code.
          example: '90265'
        country:
          type: string
          description: The 3-letter ISO 3166-1 country code.
          example: USA
        primary:
          type: boolean
          description: Indicates if this is the user's primary address.
          example: true
        verified:
          type: boolean
          description: Indicates if the user's address is verified.
          example: false
        not_specified:
          type: boolean
          description: Indicates if the user's address is unspecified.
          example: false
    AddressDatapointConfiguration:
      type: object
      required:
        - type
        - sync_country
      properties:
        type:
          type: string
          enum:
            - address_datapoint_configuration
        sync_country:
          type: boolean
          example: true
        allowed_countries:
          type: array
          description: The 3-letter ISO 3166-1 country code.
          items:
            type: string
            example: USA
        page:
          type: integer
          description: Indicates the dataset page.
          example: 0
        rows:
          type: integer
          example: 1
        has_more:
          description: >-
            Displays whether this is the last element in the set, or if there
            are subsequent elements.
          type: boolean
          example: false
        total_count:
          type: integer
          example: 1
    AuthorizationSchema:
      type: object
      properties:
        id:
          type: string
          example: auth_abcde46376482478
          description: The user authorization ID
        url:
          type: string
          example: >-
            https://app.astra.finance/login/oauth/authorize?client_id=1234&redirect_uri=1234&response_type=code&user_intent_id=1234
          description: The url of the authorization flow that must be shown to your user.
        status:
          type: string
          description: >-
            The status of the authorization. The response will contain a
            `status`` field indicating the authorization status. When the
            `status` field is set to `pending``, the response will include a
            redirect URL. Your users should be redirected to this URL to proceed
            with the authorization process.
          example: completed
          enum:
            - pending
            - completed
            - expired
            - rejected
    LinkCardSchema:
      type: object
      properties:
        id:
          type: string
          example: card_att_abcde46376482478
          description: The link card attempt ID
        url:
          type: string
          example: >-
            https://app.astra.finance/cards/connect?client_id=1234d&redirect_uri=1234
          description: The url of the link card flow that must be shown to your user.
        status:
          type: string
          description: >-
            The status of the link card attempt. The response will contain a
            `status` field indicating the status of the attempt. When the
            `status` field is set to `pending`, the response will include a
            redirect URL. Your users should be redirected to this URL to proceed
            with the card linking process.
          example: approved
          enum:
            - pending
            - completed
            - expired
    LinkedCardSchema:
      type: object
      properties:
        id:
          type: string
          example: link_card_abcde46376482478
          description: >-
            The ID for the linked card. This ID is used to designate the source
            or target card for a transfer.
        last_four:
          type: string
          example: '8792'
          description: The 4 last digits of the PAN of the card.
        expiration:
          type: string
          example: 03/26
          description: Card's Expiration.
        created_at:
          type: string
          description: Timestamp that indicates when the card was linked.
          example: '2020-12-10T11:47:39Z'
        card_network:
          type: string
          description: The card's network.
          example: VISA
          enum:
            - VISA
            - MASTERCARD
    LinkedCardsList:
      type: object
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/LinkedCardSchema'
        has_more:
          type: boolean
          example: false
          enum:
            - true
            - false
        total:
          type: number
          format: int32
          example: 1
    DebitTransferList:
      type: object
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/DebitTransferSchema'
        has_more:
          type: boolean
          example: false
          enum:
            - true
            - false
        total:
          type: number
          format: int32
          example: 1
    DebitTransferSchema:
      type: object
      properties:
        id:
          type: string
          example: aft_abcde46376482478
          description: The instant debit card transfer identifier.
        description:
          type: string
          description: An optional field to provide a description for the transfer.
        amount:
          allOf:
            - $ref: shared/general_shared.yaml#/components/schemas/Amount
        source:
          type: string
          description: >-
            ID of the external linked card from where the funds will be pulled
            from.
          example: linked_card_4dd7746a17e98456
        target:
          type: string
          description: ID of the Apto card from where the funds will be deposited to.
          example: crd_12aa2c96a548d7d2
        status:
          type: string
          description: >-
            Status of this transfer. The response will contain a status field
            indicating the status.
          example: completed
          enum:
            - pending
            - completed
            - expired
            - rejected
        transfer_type:
          type: string
          description: The type of instant debit card transfer.
          example: inbound
          enum:
            - inbound
            - outbound
    Agreement:
      type: object
      description: Details about how/when the agreement was accepted or declined.
      properties:
        user_agreement:
          type: object
          properties:
            id_str:
              type: string
              example: agreement_629adb2cc537cdf9
            agreement_key:
              type: string
              example: evolve_eua
            user_action:
              type: string
              example: ACCEPTED
            recorded_at:
              type: string
              example: '2020-11-20T01:56:24.543-05:00'
              description: Date in ISO format of when the agreement was recorded.
    AgreementError:
      type: object
      properties:
        message:
          type: string
          example: 'Invalid user_action: accept. Valid values are [ACCEPTED, DECLINED]'
        error_code:
          type: integer
          example: 1000
    AgreementInput:
      type: object
      required:
        - agreements_keys
        - user_action
      properties:
        agreements_keys:
          type: array
          description: Keys that represents the agreements that were accepted or declined.
          items:
            type: string
            enum:
              - apto_cha
              - apto_privacy
              - evolve_eua
              - evolve_privacy
          example:
            - evolve_eua
        user_action:
          type: string
          description: 'Action that the user took on the agreement: accepted or declined.'
          enum:
            - ACCEPTED
            - DECLINED
          example: ACCEPTED
    AgreementKeys:
      type: array
      description: Keys that represents the agreements that were accepted or declined.
      items:
        type: string
        enum:
          - apto_cha
          - apto_privacy
          - evolve_eua
          - evolve_privacy
      example:
        - evolve_eua
    AgreementsList:
      type: object
      properties:
        user_agreements:
          type: array
          items:
            $ref: '#/components/schemas/Agreement'
        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: 1
    Amount:
      type: object
      required:
        - currency
        - amount
      properties:
        currency:
          type: string
          example: USD
        amount:
          type: number
          example: '1457.87'
    ApplePayProvisioning:
      type: object
      properties:
        encrypted_pass_data:
          type: string
          description: >-
            The ciphertext containing the card data, nonce, and nonce signature
            generated by the Issuer Server.
        activation_data:
          type: string
          description: The cryptographic OTP required to activate the card by the Network.
        ephemeral_public_key:
          type: string
          description: >-
            The bytes of the ephemeral public key which is required as a part of
            PKEncryptionSchemeECC_V2.
    Balance:
      type: object
      required:
        - type
        - id
        - state
        - balance
        - amount_spendable
        - amount_held
        - details
      properties:
        type:
          type: string
          enum:
            - balance
            - funding_source
        id:
          type: string
          pattern: ^bal_[0-9a-f]{16}
          example: bal_XXXXXXXXXXXXXXXX
        state:
          type: string
          enum:
            - valid
            - invalid
        funding_source_type:
          type: string
          enum:
            - custodian_wallet
        balance:
          type: object
          allOf:
            - $ref: '#/components/schemas/TransactionAmount'
        amount_spendable:
          type: object
          allOf:
            - $ref: '#/components/schemas/TransactionAmount'
        amount_held:
          type: object
          allOf:
            - $ref: '#/components/schemas/TransactionAmount'
        details:
          type: object
          allOf:
            - $ref: '#/components/schemas/CustodianWallet'
    BalanceNotFound:
      type: object
      description: Error response for an API call.
      required:
        - message
      properties:
        message:
          type: string
          description: Description of the error.
          example: Balance bal_xxxxxxxxxx is inexistent or invalid.
        error_code:
          type: number
          default: 90214
    BalanceTransferError:
      type: object
      description: Error response for an API call.
      required:
        - message
        - code
      properties:
        message:
          type: string
          description: Description of the error.
          example: >-
            Balance transfer is not approved with following response type: debit
            declined
        code:
          type: integer
          description: Code associated with the error.
          example: 200105
    BalanceTransferSubscription:
      type: object
      properties:
        id:
          type: string
          example: balxfrsubs_3bc9dcf557975fe4
        balance_transfer_template_id:
          type: string
          example: balxfrtmpl_3bc9dcf557975fe4
        created_at:
          type: string
          example: 2018-07-04T15:15:51.000Z
        updated_at:
          type: string
          example: 2018-07-04T15:15:51.000Z
    BalanceTransferSubscriptionList:
      type: object
      properties:
        balance_transfer_subscriptions:
          type: array
          items:
            $ref: '#/components/schemas/BalanceTransferSubscription'
        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: 10
    BalanceTransferTemplateList:
      type: object
      properties:
        balance_transfer_templates:
          type: array
          items:
            $ref: '#/components/schemas/BalanceTransferTemplateObject'
        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: 1
    BalanceTransferTemplateObject:
      type: object
      properties:
        balance_transfer_template:
          properties:
            id:
              type: string
              example: balxfrtmpl_3bc9dcf557975fe4
            name:
              type: string
              example: Save the Children Charity
            description:
              type: string
              example: >-
                Subscribe to this template to round up each transaction you make
                to the nearest dollar and donate the difference to Save the
                Children.
    BalanceTypeNotPair:
      type: object
      description: Error response for an API call.
      required:
        - message
        - code
      properties:
        message:
          type: string
          description: Description of the error.
          example: Source and destination balance type pair is not valid
        code:
          type: integer
          description: Code associated with the error.
          example: 200105
    BalancesList:
      type: object
      required:
        - type
        - data
        - page
        - rows
        - has_more
        - total_count
      properties:
        type:
          type: string
          enum:
            - list
        data:
          type: array
          items:
            $ref: '#/components/schemas/Balance'
        page:
          type: integer
          description: Indicates the dataset page.
          deprecated: true
          default: 0
        rows:
          type: integer
          deprecated: true
          example: 5
        has_more:
          type: boolean
          description: >-
            Displays whether this is the last element in the set, or if there
            are subsequent elements.
          deprecated: true
          default: false
        total_count:
          type: integer
          example: 5
    BankAccountBalanceError:
      type: object
      properties:
        error:
          type: object
          properties:
            type:
              type: string
              example: invalid_request_error
            message:
              type: string
              example: No account found for balance bal_d72e609ec7bbfd2b
            error_code:
              type: integer
              example: null
    BankAccountDetails:
      type: object
      description: 'ACH data: Bank account number and routing number.'
      properties:
        account_details:
          type: object
          properties:
            routing_number:
              type: string
              example: '123000789'
            account_number:
              type: string
              example: '1234567890'
    Card:
      type: object
      required:
        - type
        - account_id
        - last_four
        - card_network
        - card_brand
        - card_issuer
        - expiration
        - pan
        - cvv
        - state
        - kyc_status
        - kyc_reason
        - spendable_today
        - native_spendable_today
        - total_balance
        - native_total_balance
        - ordered_status
        - cardholder_first_name
        - cardholder_last_name
        - issued_at
        - name_on_card
      properties:
        type:
          type: string
          enum:
            - card
        account_id:
          type: string
          pattern: ^crd_[0-9a-f]{16}$
          example: crd_98hnhu9sc7i9ay73375
        last_four:
          type: string
          pattern: ^\d{4}
          example: '1234'
        card_network:
          type: string
          enum:
            - VISA
            - MASTERCARD
            - AMEX
        card_brand:
          type: string
          nullable: true
          example: Marvel Card
        card_issuer:
          type: string
          example: shift
        expiration:
          type: string
          pattern: \d{4}-\d{2}
          example: 2021-03
          nullable: true
        pan:
          type: string
          example: tok_XXXXXXXXXX
        cvv:
          type: string
          pattern: \d{3}
          example: tok_XXXXXXXXXX
        state:
          type: string
          enum:
            - created
            - active
            - inactive
            - cancelled
            - unknown
          description: >-
            * `created`  card created but not still activated.

            * `active`  card activated, open to transactions.

            * `inactive`  card temporarily deactivated but can be activated
            again. Card operations are disabled.

            * `cancelled`  card closed, blocked for doing operations, this is
            final state.

            * `unknown`  not finished card application, process stopped before
            finished.
        kyc_status:
          type: string
          enum:
            - resubmit_details
            - upload_file
            - under_review
            - passed
            - rejected
            - temporary_error
            - unknown
        kyc_reason:
          type: string
          example: Please contact customer service to verify your ID documents
        features:
          type: object
          properties:
            add_funds:
              type: object
              properties:
                status:
                  type: string
                  description: >-
                    Indicates if the add funds functionality is supported for
                    the card.
                  enum:
                    - enabled
                    - disabled
                soft_descriptor:
                  type: string
                  description: Software description for the funding.
                  example: USER_SBXr
                card_networks:
                  type: array
                  description: >-
                    List of card networks supported for adding funds to this
                    card.
                  example:
                    - MASTERCARD
                    - VISA
                  items:
                    type: string
                    enum:
                      - VISA
                      - MASTERCARD
                limits:
                  type: object
                  properties:
                    daily:
                      type: object
                      properties:
                        max:
                          $ref: >-
                            ./shared/general_shared.yaml#/components/schemas/Amount
            passcode:
              type: object
              required:
                - status
                - passcode_set
                - verification_required
              properties:
                status:
                  type: string
                  description: Card passcode configuration
                  enum:
                    - enabled
                    - disabled
                passcode_set:
                  type: boolean
                  description: Defines whether passcode is set or not.
                  enum:
                    - true
                    - false
                verification_required:
                  type: boolean
                  description: >-
                    Defines whether a verification is needed to set the
                    passcode.
                  enum:
                    - true
                    - false
            ach:
              type: object
              required:
                - status
              properties:
                status:
                  type: string
                  description: >-
                    Indicates whether the custodian has enabled ach
                    functionality.
                  enum:
                    - enabled
                    - disabled
                account_provisioned:
                  type: boolean
                  description: Indicates whether the customer has setup ach account.
                disclaimer:
                  type: object
                  required:
                    - agreement_keys
                    - content
                  properties:
                    agreement_keys:
                      $ref: '#/components/schemas/AgreementKeys'
                    content:
                      $ref: '#/components/schemas/Content'
                account_details:
                  type: object
                  required:
                    - routing_number
                    - account_number
                  properties:
                    routing_number:
                      type: string
                      description: The ach routing number.
                      example: '123000789'
                    account_number:
                      type: string
                      example: '1234567890'
                      description: The ach account number.
            in_app_provisioning:
              type: object
              properties:
                status:
                  type: string
                  description: >-
                    Indicates if the in app provisioning functionality is
                    supported for the card.
                  enum:
                    - enabled
                    - disabled
            supports_p2p_transfers:
              type: object
              properties:
                status:
                  type: string
                  description: Indicates if this card supports P2P transfers.
                  enum:
                    - enabled
                    - disabled
            get_pin:
              type: object
              properties:
                status:
                  type: string
                  description: >-
                    Indicates if the get PIN functionality is supported for the
                    card.
                  enum:
                    - enabled
                    - disabled
                type:
                  type: string
                  description: >-
                    If the get PIN functionality is supported, use this field to
                    determine if the support applies to a phone call, API
                    request, or VoIP call.
                  enum:
                    - ivr
                    - api
                    - voip
                    - none
                ivr_phone:
                  $ref: ./shared/general_shared.yaml#/components/schemas/PhoneNumber
            set_pin:
              type: object
              properties:
                status:
                  type: string
                  description: >-
                    Indicates if the set PIN functionality is supported for the
                    card.
                  enum:
                    - enabled
                    - disabled
                type:
                  type: string
                  description: >-
                    If set PIN functionality is supported, use this field to
                    determine if the support applies to a phone call, API
                    request, or VoIP call.
                  enum:
                    - ivr
                    - api
                    - voip
                    - none
                ivr_phone:
                  $ref: ./shared/general_shared.yaml#/components/schemas/PhoneNumber
            select_balance_store:
              type: object
              properties:
                allowed_balance_types:
                  type: string
                  nullable: true
            activation:
              type: object
              properties:
                success_asset:
                  type: string
                ivr_phone:
                  $ref: ./shared/general_shared.yaml#/components/schemas/PhoneNumber
                type:
                  type: string
                  enum:
                    - ivr
                    - none
                status:
                  type: string
                  enum:
                    - enabled
                    - disabled
            support:
              type: object
              properties:
                status:
                  type: string
                  description: >-
                    Indicates if the support functionality is available for the
                    specific card.
                  enum:
                    - enabled
                    - disabled
                type:
                  type: string
                  description: >-
                    If the support functionality is enabled, use this field to
                    determine the type of support channel.
                  enum:
                    - ivr
                    - none
                ivr_phone:
                  $ref: ./shared/general_shared.yaml#/components/schemas/PhoneNumber
        spendable_today:
          allOf:
            - $ref: '#/components/schemas/Amount'
        native_spendable_today:
          allOf:
            - $ref: '#/components/schemas/Amount'
        total_balance:
          allOf:
            - $ref: '#/components/schemas/Amount'
        native_total_balance:
          allOf:
            - $ref: '#/components/schemas/Amount'
        ordered_status:
          type: string
          enum:
            - ordered
            - received
            - not_applicable
            - available
        format:
          $ref: '#/components/schemas/CardFormat'
        card_style:
          type: object
          $ref: '#/components/schemas/CardStyle'
        cardholder_first_name:
          type: string
          example: Anthony
        cardholder_last_name:
          type: string
          example: Stark
        issued_at:
          type: string
          format: date-time
          example: '2019-07-30T07:03:55+00:00'
        wait_list:
          type: boolean
          example: false
        name_on_card:
          type: string
          example: TONY STARK
        card_product_id:
          type: string
          description: Identifier of the card program that the user is applying to.
        metadata:
          type: string
          description: >-
            Metadata associated with the card. This field can contain up to 256
            characters.
        shipping_address:
          description: >-
            Card shipping address <br /><br />

            **Note:** Only available for those customer configurations which
            allow shipping address specification, otherwise it will be empty.
          $ref: '#/components/schemas/ShippingAddress'
    CardApplication:
      type: object
      required:
        - application_type
        - id
      properties:
        type:
          type: string
          enum:
            - application
        id:
          type: string
          pattern: ^entity_[0-9a-f]{16}$
          description: Identifier of the card application.
          example: entity_9b5ed37c22616418
        application_type:
          type: string
          enum:
            - card
        status:
          type: string
          description: >-
            Status of this card application. The response will contain a
            `status` field indicating the application status. When the `status`
            field is `pending`, the response might contain a `next_action` field
            indicating which next action should be taken. More information about
            this flow can be found on the [issuing
            cards](https://docs.aptopayments.com/docs/overview/getting%20started/cards)
            guide.
          example: approved
          enum:
            - unknown
            - created
            - pending
            - approved
            - rejected
        create_time:
          type: number
          description: Application creation date as a UNIX timestamp.
          example: '1601665324'
        workflow_object_id:
          type: string
          pattern: ^entity_[0-9a-f]{16}$
          description: Identifier of the workflow object.
          example: entity_9b5ed37c22616418
        next_action:
          type: object
          $ref: '#/components/schemas/NextActionApplyForCard'
    CardConfiguration:
      type: object
      properties:
        type:
          type: string
          enum:
            - card_configuration
        card_product:
          type: object
          properties:
            type:
              type: string
              enum:
                - card_product
            id:
              type: string
              description: Identifier of the card program.
              example: entity_ff3b08a7cd962910
            team_id:
              type: string
              description: Identifier of the team.
              example: entity_ff3b08a7cd962910
            name:
              type: string
              example: Headlight Corporation
            status:
              type: string
              enum:
                - enabled
                - disabled
            shared:
              type: string
              enum:
                - true
                - false
            card_issuer:
              type: string
              description: the issuer of the card
              example: shift
            website:
              type: string
              example: https://www.acme.com
            cardholder_agreement:
              $ref: '#/components/schemas/Content'
            privacy_policy:
              $ref: '#/components/schemas/Content'
            terms_of_service:
              $ref: '#/components/schemas/Content'
            faq:
              $ref: '#/components/schemas/Content'
            exchange_rates:
              $ref: '#/components/schemas/Content'
            wait_list_background_image:
              type: string
              example: https://server/path/waitlist_background_image.png
            wait_list_background_color:
              type: string
              example: '000000'
            wait_list_dark_background_color:
              type: string
              example: '000000'
            wait_list_asset:
              type: string
              example: https://server/path/waitlist_asset.png
            allowed_countries:
              type: array
              items:
                $ref: '#/components/schemas/Country'
            labels:
              type: object
              properties:
                resource_key:
                  type: string
                  example: resource_value
    CardFormat:
      type: string
      example: virtual
      enum:
        - virtual
        - physical
      description: >-
        Indicates if the card is virtual (no plastic card printed) or physical
        (plastic card printed).
    CardList:
      type: object
      properties:
        type:
          type: string
          enum:
            - list
        data:
          type: array
          items:
            $ref: '#/components/schemas/Card'
        page:
          type: integer
          description: Indicates the dataset page.
          example: 0
        rows:
          type: integer
          example: 0
        has_more:
          description: >-
            Displays whether this is the last element in the set, or if there
            are subsequent elements.
          type: boolean
          example: false
        total_count:
          type: integer
          example: 11
    CardProgram:
      type: object
      properties:
        type:
          type: string
          enum:
            - card_product
        id:
          type: string
          description: Identifier of the card program.
          example: entity_ff3b08a7cd962910
        name:
          type: string
          example: Headlight Corporation
        summary:
          type: string
          example: Card program summary
        website:
          type: string
          example: https://www.acme.com
        cardholder_agreement:
          $ref: '#/components/schemas/Content'
        privacy_policy:
          $ref: '#/components/schemas/Content'
        terms_of_service:
          $ref: '#/components/schemas/Content'
        faq:
          $ref: '#/components/schemas/Content'
        exchange_rates:
          $ref: '#/components/schemas/Content'
    CardProgramList:
      type: object
      properties:
        type:
          type: string
          enum:
            - list
        data:
          type: array
          items:
            $ref: '#/components/schemas/CardProgramSummary'
        page:
          type: integer
          description: Indicates the dataset page.
          example: 0
        rows:
          type: integer
          example: 0
        has_more:
          description: >-
            Displays whether this is the last element in the set, or if there
            are subsequent elements.
          type: boolean
          example: false
        total_count:
          type: integer
          example: 1
    CardProgramSummary:
      type: object
      properties:
        type:
          type: string
          enum:
            - card_product_summary
        name:
          type: string
          example: Headlight Corporation
        id:
          type: string
          description: Identifier of the card program.
          example: entity_ff3b08a7cd962910
        allowed_countries:
          type: array
          items:
            type: string
            example: US
    CardStyle:
      type: object
      properties:
        background:
          type: object
          properties:
            type:
              type: string
              enum:
                - card_background_style
            background_type:
              type: string
              description: Card's background type used to render the card on the screen.
              enum:
                - COLOR
                - IMAGE
            background_color:
              type: string
              description: >-
                Card’s background color used when the background type is
                ‘COLOR’.
            background_image:
              type: string
              description: >-
                URL of the image used as the card background if the background
                type is ‘IMAGE’.
            card_logo:
              type: string
              description: URL of the image to use as logo for the card.
        text_color:
          type: string
          description: >-
            Text color used for the text rendered on top of the card’s
            background.
        balance_selector_asset:
          type: string
          description: Asset to show as a balance selector
    CardholderNotFound:
      type: object
      description: Error response for an API call.
      required:
        - message
        - code
      properties:
        message:
          type: string
          default: Cardholder does not exist in platform.
        code:
          type: integer
          default: 90006
    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
    CategorySpending:
      type: object
      required:
        - type
        - category_id
        - spending
        - difference
      properties:
        type:
          type: string
          enum:
            - category_spending
        category_id:
          type: string
          enum:
            - plane
            - car
            - glass
            - finance
            - food
            - gas
            - bed
            - medical
            - camera
            - card
            - cart
            - road
            - other
        spending:
          type: object
          allOf:
            - $ref: '#/components/schemas/TransactionAmount'
        difference:
          type: number
          description: Difference (percentage) from the previous month’s data.
          example: '11.22'
    CategorySpendingList:
      type: object
      required:
        - type
        - data
        - rows
        - has_more
        - total_count
      properties:
        type:
          type: string
          enum:
            - list
        data:
          type: array
          items:
            $ref: '#/components/schemas/CategorySpending'
        rows:
          type: integer
          example: 5
        has_more:
          description: >-
            Displays whether this is the last element in the set, or if there
            are subsequent elements.
          type: boolean
          example: false
        total_rows:
          type: integer
          example: 5
    ContenMarkdown:
      format: markdown
      value: >-
        # h1 Heading 8-) ## h2 Heading ### h3 Heading #### h4 Heading ##### h5
        Heading ###### h6 Heading
    Content:
      type: object
      required:
        - type
        - format
        - value
      properties:
        type:
          type: string
          example: content
        format:
          type: string
          enum:
            - plain_text
            - markdown
            - external_url
            - native_content
          example: native_content
        value:
          oneOf:
            - $ref: '#/components/schemas/ContentPlainText'
            - $ref: '#/components/schemas/ContenMarkdown'
            - $ref: '#/components/schemas/ContentExternalUrl'
            - $ref: '#/components/schemas/ContentNativeContent'
    ContentExternalUrl:
      format: external_url
      value: >-
        https://s3-us-west-1.amazonaws.com/media.aptopayments.com/coinbaseuk/waitlist/waitlist-card%403x.png
    ContentNativeContent:
      type: object
      required:
        - format
        - value
      properties: null
      format: native_content
      value: '#/components/schemas/ContentNativeContentValue'
    ContentNativeContentValue:
      type: object
      properties:
        background_image:
          type: string
          example: >-
            https://s3-us-west-1.amazonaws.com/media.aptopayments.com/coinbaseuk/waitlist/waitlist-background%403x.png
        dark_background_color:
          type: string
        background_color:
          type: string
        asset:
          type: string
          example: >-
            https://s3-us-west-1.amazonaws.com/media.aptopayments.com/coinbaseuk/waitlist/waitlist-card%403x.png
        version:
          type: integer
          example: 2
    ContentPlainText:
      format: plain_text
      value: This is a plain text content
    Country:
      type: string
      description: The 3-letter ISO 3166-1 country code.
      example: USA
    Credentials:
      type: object
      description: Account configuration information.
      required:
        - type
        - team
        - project
      properties:
        type:
          type: string
          description: Type of credentials.
          enum:
            - context_configuration
        team:
          type: object
          description: >-
            Company / team configuration, which includes the card design
            settings. **Note:** This property has been deprecated, and is not
            recommended for code use.
          deprecated: true
          properties:
            type:
              type: string
              description: >-
                Type of team information. **Note:** This property has been
                deprecated, and is not recommended for code use.
              enum:
                - team_configuration
            name:
              type: string
              description: Label for the team.
              example: XXXXXXXX_SBX
            logo_url:
              type: string
              description: URL for the card logo.
            primary_color:
              type: string
              description: Primary hex color for the card.
              example: 388e3c
            secondary_color:
              type: string
              description: Secondary hex color for the card.
              example: 90caf9
        project:
          type: object
          description: >-
            The account holder’s personal information and the verification and
            login settings for the account.
          properties:
            type:
              type: string
              description: Type of project.
              enum:
                - project_configuration
            name:
              type: string
              example: Example project
            primary_color:
              type: string
              example: 388e3c
            secondary_color:
              type: string
              example: 90caf9
            logo_url:
              type: string
              example: http://path/to/logo
            project_branding:
              $ref: '#/components/schemas/ProjectBranding'
            gross_income_min:
              type: number
              format: int32
              example: 0
            gross_income_max:
              type: number
              format: int32
              example: 100000
            gross_income_increments:
              type: number
              format: int32
              example: 100000
            gross_income_default:
              type: number
              format: int32
              example: 25000
            income_types:
              type: object
              allOf:
                - $ref: '#/components/schemas/Pagination'
                - type: object
                  required:
                    - data
                  properties:
                    data:
                      type: array
                      items:
                        type: object
                        required:
                          - type
                          - income_type_id
                          - description
                        properties:
                          type:
                            type: string
                            enum:
                              - income_type
                          income_type_id:
                            type: number
                            format: int32
                            example: 1
                          description:
                            type: string
                            example: Self Employed
            employment_time_values:
              type: object
              allOf:
                - $ref: '#/components/schemas/Pagination'
                - type: object
                  required:
                    - data
                  properties:
                    data:
                      type: array
                      items:
                        type: object
                        required:
                          - type
                          - employment_time_id
                          - description
                        properties:
                          type:
                            type: string
                            enum:
                              - employment_time_option
                          employment_time_id:
                            type: number
                            format: int32
                            example: 1
                          description:
                            type: string
                            example: 6 to 12 months
            housing_types:
              type: object
              allOf:
                - $ref: '#/components/schemas/Pagination'
                - type: object
                  required:
                    - data
                  properties:
                    data:
                      type: array
                      items:
                        type: object
                        required:
                          - type
                          - housing_type_id
                          - description
                        properties:
                          type:
                            type: string
                            enum:
                              - housing_type
                          housing_type_id:
                            type: number
                            format: int32
                            example: 1
                          description:
                            type: string
                            example: Rent
            salary_frequencies:
              type: object
              allOf:
                - $ref: '#/components/schemas/Pagination'
                - type: object
                  required:
                    - data
                  properties:
                    data:
                      type: array
                      items:
                        type: object
                        required:
                          - type
                          - salary_frequency_id
                          - description
                        properties:
                          type:
                            type: string
                            enum:
                              - salary_frequency
                          salary_frequency_id:
                            type: number
                            format: int32
                            example: 1
                          description:
                            type: string
                            example: Twice Monthly
            time_at_address_values:
              type: object
              allOf:
                - $ref: '#/components/schemas/Pagination'
                - type: object
                  required:
                    - data
                  properties:
                    data:
                      type: array
                      items:
                        type: object
                        required:
                          - type
                          - time_at_address_id
                          - description
                        properties:
                          type:
                            type: string
                            enum:
                              - time_at_address_option
                          time_at_address_id:
                            type: number
                            format: int32
                            example: 1
                          description:
                            type: string
                            example: Less than 6 months
            employment_types:
              type: object
              allOf:
                - $ref: '#/components/schemas/Pagination'
                - type: object
                  required:
                    - data
                  properties:
                    data:
                      type: array
                      items:
                        type: object
                        required:
                          - type
                          - employment_type_id
                          - description
                        properties:
                          type:
                            type: string
                            enum:
                              - employment_type
                          employment_type_id:
                            type: number
                            format: int32
                            example: 1
                          description:
                            type: string
                            example: Food service
            products:
              type: object
              allOf:
                - $ref: '#/components/schemas/Pagination'
                - type: object
                  required:
                    - data
                  properties:
                    data:
                      type: array
                      items:
                        type: object
                        required:
                          - type
                          - key
                          - name
                        properties:
                          type:
                            type: string
                            enum:
                              - product
                          name:
                            type: string
                            example: LINK
                          key:
                            type: string
                            example: link
            language:
              type: string
              example: en
            email_source_address:
              type: string
              example: hello@aptopayments.com
            support_source_address:
              type: string
              example: hello@aptopayments.com
            summary:
              type: string
              summary: Configuration summary
            tracker_access_token:
              type: string
              nullable: true
            tracker_active:
              type: string
              nullable: true
            required_signed_payloads:
              type: boolean
              enum:
                - true
                - false
              example: false
            chatbot_access_token:
              type: string
              nullable: true
            chatbot_active:
              type: boolean
              enum:
                - true
                - false
              example: false
            time_in_country_values:
              type: object
              allOf:
                - $ref: '#/components/schemas/Pagination'
                - type: object
                  required:
                    - data
                  properties:
                    data:
                      type: array
                      items:
                        type: object
                        required:
                          - type
                          - time_in_country_id
                          - description
                        properties:
                          type:
                            type: string
                            enum:
                              - time_in_country_option
                          time_in_country_id:
                            type: number
                            format: int32
                            example: 1
                          description:
                            type: string
                            example: Less than 1 year
            payment_types:
              type: object
              allOf:
                - $ref: '#/components/schemas/Pagination'
                - type: object
                  required:
                    - data
                  properties:
                    data:
                      type: array
                      items:
                        type: object
                        required:
                          - type
                          - payment_type_id
                          - description
                        properties:
                          type:
                            type: string
                            enum:
                              - payment_type
                          payment_type_id:
                            type: number
                            format: int32
                            example: 1
                          description:
                            type: string
                            example: Deposit
            credit_score_values:
              type: object
              allOf:
                - $ref: '#/components/schemas/Pagination'
                - type: object
                  required:
                    - data
                  properties:
                    data:
                      type: array
                      items:
                        type: object
                        required:
                          - type
                          - credit_score_id
                          - description
                        properties:
                          type:
                            type: string
                            enum:
                              - credit_score_option
                          credit_score_id:
                            type: number
                            format: int32
                            example: 1
                          description:
                            type: string
                            example: Excellent (760+)
            references_relationship_values:
              type: object
              allOf:
                - $ref: '#/components/schemas/Pagination'
                - type: object
                  required:
                    - data
                  properties:
                    data:
                      type: array
                      items:
                        type: object
                        required:
                          - type
                          - relationship_id
                          - description
                        properties:
                          type:
                            type: string
                            enum:
                              - reference_relationship
                          relationship_id:
                            type: number
                            format: int32
                            example: 1
                          description:
                            type: string
                            example: Landlord
            primary_auth_credential:
              type: string
              description: Type of credential used in the first step of user verification.
              example: phone
            secondary_auth_credential:
              type: string
              description: Type of credential used to complete the user verification.
              example: birthdate
            welcome_screen_action:
              $ref: '#/components/schemas/WelcomeScreenAction'
            allowed_countries:
              type: array
              items:
                type: string
                example: US
            labels:
              type: object
              nullable: true
              example: null
            branding:
              type: object
              required:
                - light
                - dark
              properties:
                light:
                  $ref: '#/components/schemas/ProjectBranding'
                dark:
                  $ref: '#/components/schemas/ProjectBranding'
    Custodian:
      type: object
      required:
        - type
        - custodian_type
        - name
      properties:
        type:
          type: string
          enum:
            - custodian
        custodian_type:
          type: string
          enum:
            - coinbase
            - uphold
            - apto
        name:
          type: string
          example: USER's Account (USD)
        external_id:
          type: string
          nullable: true
    CustodianWallet:
      type: object
      required:
        - type
        - custodian
        - balance
        - external_id
      properties:
        type:
          type: string
          enum:
            - custodian_wallet
        custodian:
          type: object
          allOf:
            - $ref: '#/components/schemas/Custodian'
        balance:
          type: object
          allOf:
            - $ref: '#/components/schemas/TransactionAmount'
        external_id:
          type: string
          example: cb38b59607bda3763a8d-7832af
    DataPointVerification:
      type: object
      required:
        - verification_id
      properties:
        verification_id:
          type: string
          format: entity_[0-9af]{16}
          example: entity_9b5ed37c22616418
    DatapointGroup:
      type: object
      required:
        - type
        - datapoint_group_id
        - datapoint_group_type
        - datapoints
      properties:
        type:
          type: string
          enum:
            - datapoint_group
        datapoint_group_id:
          type: string
          pattern: ^entity_[0-9a-f]{16}$
          description: Identifier of the datapoint group.
          example: entity_9b5ed37c22616418
        datapoint_group_type:
          type: string
          enum:
            - user_basic_info
            - user_address
            - user_verify_id
        name:
          type: string
          example: User Basic Info Group
        description:
          type: string
          example: User Basic Info Group
        order:
          type: integer
          example: 1
        datapoints:
          type: object
          required:
            - type
            - data
          properties:
            type:
              type: string
              enum:
                - list
            data:
              type: array
              items:
                $ref: '#/components/schemas/Datapoint'
            page:
              type: integer
              description: Indicates the dataset page.
              example: 1
            rows:
              type: integer
              example: 1
            has_more:
              description: >-
                Displays whether this is the last element in the set, or if
                there are subsequent elements.
              type: boolean
              example: false
            total_count:
              type: integer
              example: 2
        page:
          type: integer
          description: Indicates the dataset page.
          example: 0
        rows:
          type: integer
          example: 1
        has_more:
          description: >-
            Displays whether this is the last element in the set, or if there
            are subsequent elements.
          type: boolean
          example: false
        total_count:
          type: integer
          example: 1
    Datapoint:
      type: object
      required:
        - type
        - required_datapoint_id
        - datapoint_type
        - verification_required
        - min_required_datapoints
      properties:
        type:
          type: string
          enum:
            - required_datapoint
        required_datapoint_id:
          type: string
          pattern: ^entity_[0-9a-f]{16}$
          description: Identifier of the required datapoint.
          example: entity_9b5ed37c22616418
        datapoint_type:
          type: string
          enum:
            - name
            - email
            - address
            - birthdate
            - id_document
        verification_required:
          type: boolean
          example: false
        not_specified_allowed:
          type: boolean
          example: false
        title:
          type: string
          example: Name
        description:
          type: string
          example: Description
        min_required_datapoints:
          type: integer
          example: 1
        datapoint_configuration:
          type: object
          anyOf:
            - $ref: '#/components/schemas/AddressDatapointConfiguration'
            - $ref: '#/components/schemas/IdDocumentDatapointConfiguration'
    DataPointGroup:
      type: object
      properties:
        type:
          type: string
          enum:
            - datapoint_group
        datapoint_group_id:
          type: string
          example: some_id
        datapoint_group_type:
          type: string
          enum:
            - loan_data
            - user_phone
            - user_basic_info
            - user_address
            - user_income
            - user_additional_address
            - user_additional_info
            - user_credit_score
            - user_verify_id
            - user_monthly_expenses
            - user_member_of_armed_forces
            - user_income_source
            - user_family
            - user_has_bank_account
            - user_references
            - load_documents
            - user_username
            - user_time_otp
        name:
          type: string
          example: datapoint group name
        description:
          type: string
          example: datapoint group description
        order:
          type: number
          format: int32
          example: 1
        datapoints:
          type: object
          allOf:
            - $ref: '#/components/schemas/Pagination'
            - type: object
              properties:
                items:
                  type: array
                  items:
                    type: object
                    properties:
                      type:
                        type: string
                        enum:
                          - phone
                          - email
                          - name
                          - address
                          - housing
                          - time_at_address
                          - income
                          - payday_loan
                          - member_of_armed_forces
                          - credit_score
                          - birthdate
                          - id_document
                          - income_source
                          - monthly_expenses
                          - time_in_country
                          - family
                          - has_bank_account
                          - reference
                          - file
                          - bank_account
                          - card_account
                          - external_credentials
                          - au10tix
                          - custodian_uid
                          - username
                          - time_otp
                      name:
                        type: string
                        example: datapoint name
                      datapoint_type:
                        type: string
                        enum:
                          - action_collect_user_data_config
                      verification_allowed:
                        type: boolean
                        enum:
                          - true
                          - false
                        example: true
                      optional_allowed:
                        type: boolean
                        enum:
                          - true
                          - false
                        example: true
    DobDataPoint:
      type: object
      description: Date of birth information datapoint.
      properties:
        type:
          type: string
          description: Type of datapoint.
          enum:
            - birthdate
        date:
          type: string
          description: Date of birth for the user.
          format: YYYY-DD-MM
          example: '1965-10-20'
        verified:
          type: boolean
          description: Indicates if the date of birth is verified.
          example: false
        not_specified:
          type: boolean
          description: Indicates if the date of birth is unspecified.
          example: false
    EmailDataPoint:
      type: object
      description: Email information datapoint.
      properties:
        type:
          type: string
          description: Type of datapoint.
          enum:
            - email
        email:
          type: string
          description: Email for the user.
          format: email
          example: tony.stark@aptopayments.com
        verified:
          type: boolean
          description: Indicates if the email is verified.
          example: true
        not_specified:
          type: boolean
          description: Indicates if the email is unspecified.
          example: false
    ErrorInvalidShippingAddress:
      type: object
      properties:
        code:
          type: number
          default: 200120
        message:
          type: string
          example: Shipping address cannot be a public PO box
    ErrorShippingAddressMaxRetries:
      type: object
      properties:
        code:
          type: number
          default: 200121
        message:
          type: string
          example: >-
            Exceeded maximum number of attempts for shipping address validation.
            Please contact support.
    Error:
      type: object
      description: Error response for an API call.
      required:
        - message
        - code
      properties:
        message:
          type: string
          description: Description of the error.
          example: Bad request.
        code:
          type: integer
          description: Code associated with the error.
          example: 90069
    ErrorInvalidAccessToken:
      type: object
      properties:
        code:
          type: number
          default: 91004
        message:
          type: string
          default: Invalid token, please, authorize again
    ErrorBankAccountAgreement:
      type: object
      description: >-
        Bank account agreements still need to be accepted. Agreements can be
        accepted by calling the [accept agreements
        endpoint](#operation/recordAgreementDecision).
      properties:
        message:
          type: string
          example: Required agreements have not been accepted.
        code:
          type: integer
          example: 200101
    ErrorBankAccountAlreadyIssued:
      type: object
      properties:
        message:
          type: string
          example: >-
            Balance bal_d72e609ec7bbfd2b already associated with an open bank
            account.
        code:
          type: integer
          example: 200106
    ErrorCardIssuanceBlockedOnCardProgram:
      type: object
      properties:
        code:
          type: number
          default: 200125
        message:
          type: string
          default: Card issuance blocked on card program
    ErrorCardIssuanceBlockedOnCustomer:
      type: object
      properties:
        code:
          type: number
          default: 200124
        message:
          type: string
          default: Card issuance blocked on customer
    CardNotFound:
      type: object
      description: Error response for an API call.
      required:
        - message
      properties:
        message:
          type: string
          description: Description of the error.
          example: Could not find card with ID crd_xxxxxxxxx
    ErrorCurrencyDoNotMatch:
      type: object
      properties:
        code:
          type: number
          default: 200113
        message:
          type: string
          default: Currencies do not match
    ErrorEmptyUserToken:
      type: object
      properties:
        code:
          type: number
          default: 3033
        message:
          type: string
          default: Empty user token. Please set a valid user token value
    ErrorExpiredUserToken:
      type: object
      properties:
        code:
          type: number
          default: 3031
        message:
          type: string
          default: Expired user token. Please login again to obtain a valid token
    ErrorFeatureNotAllowed:
      type: object
      properties:
        code:
          type: number
          default: 200107
        message:
          type: string
          default: Feature not allowed for the current configuration
    ErrorInvalidAmount:
      type: object
      properties:
        code:
          type: integer
          example: 12345
        message:
          type: string
          default: Invalid amount
    ErrorInvalidApiKey:
      type: object
      properties:
        code:
          type: number
          default: 3035
        message:
          type: string
          default: Invalid API key. Please set a valid API key value
    ErrorInvalidSourceId:
      type: object
      properties:
        error_code:
          type: integer
          example: 12345
        message:
          type: string
          default: Invalid source payment source id or Apto card id
    ErrorInvalidUserToken:
      type: object
      properties:
        code:
          type: number
          default: 3032
        message:
          type: string
          default: Invalid user token. Please set a valid user token value
    Error_NotEnoughFunds:
      type: object
      required:
        - message
        - code
      properties:
        code:
          type: number
          default: 90196
        message:
          type: string
          example: Not enough funds to do this operation
    Error_PhysicalCardAlreadyOrdered:
      type: object
      required:
        - message
        - code
      properties:
        code:
          type: number
          default: 90230
        message:
          type: string
          example: Physical card already ordered
    Error_OrderPhysicalCardNotSupported:
      type: object
      required:
        - message
        - code
      properties:
        code:
          type: number
          default: 90231
        message:
          type: string
          example: Physical card order not supported
    Error_PrimaryCredentialNotDefined:
      type: object
      required:
        - message
        - code
      properties:
        code:
          type: number
          default: 3046
        message:
          type: string
          example: Cannot create a user without a verified primary credential
    ErrorSameRecipientAndSender:
      type: object
      description: Error response for an API call.
      required:
        - message
        - code
      properties:
        message:
          type: string
          default: The recipient is the user.
        code:
          type: integer
          default: 200115
    Error_SetPinRequiresVerification:
      type: object
      properties:
        code:
          type: number
          default: 90300
        message:
          type: string
          default: 'Set PIN: needs a verification'
    Error_SignedPayloadVerification:
      type: object
      required:
        - message
        - code
      properties:
        message:
          type: string
          default: >-
            Something went wrong with your signed payload. Read our docs on
            Signed Payloads.
        code:
          type: number
          format: int32
          example: 3047
    ErrorUnauthorized:
      type: object
      properties:
        code:
          type: number
          default: 3035
        message:
          type: string
          default: Operation not allowed for the current user
    Error_NewUserCreationProhibited:
      type: object
      required:
        - message
        - code
      properties:
        code:
          type: number
          default: 90301
        message:
          type: string
          default: New user account creation prohibited
    GooglePayProvisioning:
      type: object
      properties:
        user_address:
          $ref: '#/components/schemas/GooglePayProvisioningAddressObject'
        card_network:
          type: string
          enum:
            - VISA
            - MASTERCARD
            - AMEX
        token_service_provider:
          type: string
          enum:
            - VISA
            - MASTERCARD
            - AMEX
        display_name:
          type: string
          example: My card program
          description: Suggested name for the card.
        last_four:
          type: string
          pattern: ^\d{4}
          example: '1234'
          description: Cards PAN last 4 numbers.
        opaque_payment_card:
          type: string
          description: Tokenized card data provided by our Token Service Provider
    GooglePayProvisioningAddressObject:
      type: object
      properties:
        name:
          type: string
          example: Matias Example
          description: The name of the person.
        address1:
          type: string
          example: Malibu Point 10880
          description: The first line of the address.
        address2:
          type: string
          example: appartment 1
          description: The second line of the address.
        city:
          type: string
          example: Malibu
          description: The city, town, etc.
        state:
          type: string
          example: CA
          description: The state, province, etc.
        postal_code:
          type: string
          example: '90265'
          description: The postal code or ZIP code.
        country:
          type: string
          example: USA
          description: The 3-letter ISO 3166-1 country code.
        phone:
          type: string
          example: '3202476962'
          description: The phone number associated with the card.
    IdDocumentDataPoint:
      type: object
      description: ID document information datapoint.
      properties:
        data_type:
          type: string
          description: Type of datapoint.
          enum:
            - id_document
        value:
          type: string
          description: The ID document number.
          example: '111223333'
        country:
          type: string
          description: 3 character country code.
          example: USA
        doc_type:
          type: string
          description: The type of ID document. Currently only SSN is supported.
          example: SSN
          enum:
            - SSN
        verified:
          type: boolean
          description: Indicates if the ID document number is verified.
          example: false
        not_specified:
          type: boolean
          description: Indicates if the ID document number is unspecified.
          example: false
    IdDocumentDatapointConfiguration:
      type: object
      required:
        - type
        - sync_country
      properties:
        type:
          type: string
          enum:
            - id_document_datapoint_configuration
        allowed_document_types:
          type: object
          properties:
            US:
              type: array
              items:
                type: string
                enum:
                  - passport
                  - ssn
                  - drivers_license
        page:
          type: integer
          description: Indicates the dataset page.
          example: 0
        rows:
          type: integer
          example: 1
        has_more:
          description: >-
            Displays whether this is the last element in the set, or if there
            are subsequent elements.
          type: boolean
          example: false
        total_count:
          type: integer
          example: 1
    InvalidEmail:
      type: object
      description: Error response for an API call.
      required:
        - message
        - code
      properties:
        message:
          type: string
          default: Invalid email.
        code:
          type: integer
          default: 200023
    InvalidPhone:
      type: object
      description: Error response for an API call.
      required:
        - message
        - code
      properties:
        message:
          type: string
          default: Invalid phone.
        code:
          type: integer
          default: 200014
    MonthOfPeriod:
      type: object
      description: Month definition for a period interval.
      properties:
        type:
          type: string
          enum:
            - month
        year:
          type: integer
          example: 2019
        month:
          type: integer
          example: 4
    MonthlyExpensesDataPoint:
      type: object
      required:
        - data_type
        - housing_expenses
        - car_expenses
        - telephone_expenses
        - utilities_expenses
      properties:
        data_type:
          type: string
          description: Type of datapoint.
          enum:
            - time_at_address
        housing_expenses:
          type: number
          description: Value of the user’s housing expenses.
          example: 3000.3
        car_expenses:
          type: number
          description: Value of the user’s car expenses.
          example: 250.5
        telephone_expenses:
          type: number
          description: Value of the user’s telephone expenses.
          example: 100.7
        utilities_expenses:
          type: number
          description: Value of the user’s utility expenses.
          example: 1890.4
    MonthlySpending:
      type: object
      required:
        - type
        - prev_spending_exists
        - next_spending_exists
        - spending
      properties:
        type:
          type: string
          enum:
            - monthly_spending
        prev_spending_exists:
          type: boolean
          example: false
        next_spending_exists:
          type: boolean
          example: true
        spending:
          type: object
          allOf:
            - $ref: '#/components/schemas/CategorySpendingList'
    MonthlyStatementsPeriod:
      type: object
      description: Time of interval for the available monthly statements.
      properties:
        type:
          type: string
          enum:
            - monthly_statements_period
        start:
          $ref: '#/components/schemas/MonthOfPeriod'
        end:
          $ref: '#/components/schemas/MonthOfPeriod'
    MonthlyStatementsReport:
      type: object
      description: Monthly statement report data.
      properties:
        type:
          type: string
          enum:
            - monthly_statement_report
        id:
          type: string
          example: monthly_statement_d412ebe699769cd9
        month:
          type: integer
          example: 4
        year:
          type: integer
          example: 2019
        download_url:
          type: string
          example: >-
            https://private-media-prd-usw1-shift.s3.amazonaws.com:443/coinbase-uk-mvp/crdhldr_4dd83aa225ab9139756d/monthly_statements/2019/entity_9b5ed37c22616418X?Signature=zcIvQzhbkWACdriOYNuHJZHNoSs%3D&Expires=1578987164&AWSAccessKeyId=AKIAINPADEF2356ADZKLA
        url_expiration:
          type: string
          example: '2020-01-14T07:32:44.000+00:00'
    NameDataPoint:
      type: object
      description: Name information datapoint.
      properties:
        type:
          type: string
          description: Type of datapoint.
          enum:
            - name
        first_name:
          type: string
          description: User’s first name.
          example: Tony
        last_name:
          type: string
          description: User’s last name.
          example: Stark
        verified:
          type: boolean
          description: Indicates if the name information is verified.
          example: false
        not_specified:
          type: boolean
          description: Indicates if the name information is unspecified.
          example: false
    NextAction:
      type: object
      required:
        - type
        - action_id
        - status
        - action_type
        - configuration
      properties:
        type:
          type: string
          enum:
            - action
        action_id:
          type: string
          pattern: ^entity_[0-9a-f]{16}$
          description: Identifier of the action.
          example: entity_9b5ed37c22616418
        name:
          type: string
          enum:
            - collect_user_data
        order:
          type: integer
          example: 1
        status:
          type: integer
          example: 1
        editable_status:
          type: boolean
          example: true
        action_type:
          type: string
          enum:
            - collect_user_data
        owner_module:
          type: string
          enum:
            - pl_uservault
        configuration:
          type: object
          properties:
            type:
              type: string
              enum:
                - action_collect_user_data_config
            required_datapoint_groups:
              type: object
              required:
                - type
                - data
              properties:
                type:
                  type: string
                  enum:
                    - list
                data:
                  type: array
                  $ref: '#/components/schemas/DatapointGroup'
        labels:
          type: object
    NextActionApplyForCard:
      type: object
      required:
        - type
        - action_id
        - status
        - action_type
        - configuration
      properties:
        type:
          type: string
          enum:
            - action
        action_id:
          type: string
          pattern: ^entity_[0-9a-f]{16}$
          description: Identifier of the action.
          example: entity_9b5ed37c22616418
        name:
          type: string
          description: >-
            Indicates which next action should be taken. `collect_user_data`
            indicates the cardholder needs to supply more data in order to apply
            for a card. `show_cardholder_agreement` indicates a terms agreement
            should be shown to the cardholder (
            `next_action.configuration.disclaimer`). `issue_card` indicates a
            [card can be issued](/api/mobile-api#operation/IssueCard) for the
            cardholder.
          enum:
            - collect_user_data
            - shipping_address
            - show_cardholder_agreement
            - issue_card
        order:
          type: integer
          example: 1
        status:
          type: integer
          example: 1
        editable_status:
          type: boolean
          example: true
        action_type:
          type: string
          enum:
            - collect_user_data
            - shipping_address
            - show_disclaimer
            - issue_card
        owner_module:
          type: string
          enum:
            - pl_uservault
        configuration:
          type: object
          properties:
            type:
              type: string
              enum:
                - action_disclaimer_config
            disclaimer:
              type: object
              required:
                - type
                - data
              properties:
                type:
                  type: string
                  enum:
                    - content
                format:
                  type: string
                  enum:
                    - external_url
                value:
                  type: string
                  example: https://url/to/disclaimers/instance_issuance_disclaimer.html
            agreements_keys:
              type: array
              items:
                type: string
                enum:
                  - apto_cha
                  - apto_privacy
                  - evolve_eua
                  - evolve_privacy
        labels:
          type: object
          nullable: true
          example: null
    OrderPhysicalCardConfig:
      type: object
      required:
        - type
        - issuance_fee
        - user_addresses
      properties:
        type:
          type: string
          enum:
            - order_physical_card_config
        issuance_fee:
          $ref: '#/components/schemas/Amount'
        user_address:
          $ref: '#/components/schemas/AddressDataPoint'
    P2PCardholder:
      type: object
      properties:
        name:
          type: object
          properties:
            first_name:
              type: string
              example: John
            last_name:
              type: string
              example: Smith
        cardholder_id:
          type: string
          example: crdhlr_1234567890abcdef
    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
    Pagination:
      type: object
      required:
        - type
        - page
        - rows
        - has_more
        - total_count
      properties:
        type:
          type: string
          enum:
            - list
        page:
          type: number
          format: int32
          example: 0
        rows:
          type: number
          format: int32
          example: 1
        has_more:
          type: boolean
          enum:
            - true
            - false
          example: false
        total_count:
          type: number
          format: int32
          example: 1
    ParameterDefinedIsNotPrimaryCredential:
      type: object
      description: Error response for an API call.
      required:
        - message
        - code
      properties:
        message:
          type: string
          default: Parameter defined is not the primary credential.
        code:
          type: integer
          default: 90105
    PhoneDataPoint:
      type: object
      description: Phone information datapoint.
      properties:
        type:
          type: string
          description: Type of datapoint.
          enum:
            - phone
        country_code:
          type: string
          description: Country code for the user’s phone number.
          example: '1'
        phone_number:
          type: string
          description: Phone number of the user.
          example: '3202476962'
        verified:
          type: boolean
          description: Indicates if the datapoint is verified.
          example: false
        not_specified:
          type: boolean
          description: Indicates if the phone is unspecified.
          example: false
        verification:
          type: object
          allOf:
            - $ref: '#/components/schemas/Verification1'
    ProjectBranding:
      type: object
      description: Project branding information.
      required:
        - type
      properties:
        type:
          type: string
          description: Type of project.
          enum:
            - project_branding
        icon_primary_color:
          type: string
          example: e4eaf2
        icon_secondary_color:
          type: string
          example: 8494a5
        icon_tertiary_color:
          type: string
          example: 3c4a5b
        text_primary_color:
          type: string
          example: 3c4a5b
        text_secondary_color:
          type: string
          example: 8494a5
        text_tertiary_color:
          type: string
          example: 8494a5
        text_link_color:
          type: string
          example: 0055FF
        text_link_font_weight:
          type: string
          example: regular
        text_link_underlined:
          type: boolean
          enum:
            - true
            - false
          example: false
        text_topbar_color:
          type: string
          example: 3c4a5b
        text_topbar_primary_color:
          type: string
          example: 3c4a5b
        text_topbar_secondary_color:
          type: string
          example: 3c4a5b
        ui_primary_color:
          type: string
          example: 0055FF
        ui_secondary_color:
          type: string
          example: ffffff
        ui_tertiary_color:
          type: string
          example: e4eaf2
        ui_error_color:
          type: string
          example: ff673d
        ui_success_color:
          type: string
          example: 0055FF
        ui_bg_primary_color:
          type: string
          example: ffffff
        ui_bg_secondary_color:
          type: string
          example: ffffff
        ui_bg_overlay_color:
          type: string
          example: 3c4a5b
        ui_nav_primary_color:
          type: string
          example: ffffff
        ui_nav_secondary_color:
          type: string
          example: ffffff
        text_message_color:
          type: string
          example: ffffff
        text_button_color:
          type: string
          example: ffffff
        ui_status_bar_style:
          type: string
          example: auto
        ui_theme:
          type: string
          example: theme_2
        badge_bg_positive_color:
          type: string
          example: 61ca00
        badge_bg_negative_color:
          type: string
          example: '326700'
        button_corner_radius:
          type: number
          format: int32
          example: 12
        show_toast_title:
          type: boolean
          enum:
            - true
            - false
          example: false
        txn_details_collapsable:
          type: boolean
          enum:
            - true
            - false
          example: false
        disclaimer_background_color:
          type: string
          example: ffffff
        logo_url:
          type: string
          example: https://path/to/logo
          nullable: true
        alternate_logo_url:
          type: string
          example: https://path/to/logo/2
          nullable: true
        card_background_color:
          type: string
          example: ffffff
    SecondaryCredential:
      type: object
      description: Credentials for the secondary verification.
      properties:
        type:
          type: string
          description: Type of credential.
          example: verification
        verification_id:
          type: string
          description: Identifier of the verification object.
          format: entity_[0-9af]{16}
          example: entity_9b5ed37c22616418
        status:
          type: string
          description: Verification status.
          enum:
            - pending
            - passed
            - failed
            - expired
          example: pending
        verification_type:
          type: string
          description: Type of verification.
          example: birthdate
    SessionExpiredError:
      type: object
      description: Error for an expired user session.
      required:
        - message
        - code
      properties:
        message:
          type: string
          description: Description of the error.
          example: Expired user token. Please login again to obtain a valid token.
        code:
          type: integer
          description: Code associated with the error.
          example: 3031
    ShippingAddress:
      type: object
      description: >-
        Card shipping address <br /><br />

        **Note:** Only available for those customer configurations which allow
        shipping address specification, otherwise it will be empty.
      properties:
        id:
          type: string
          example: shipaddr_fde2d61d233455b9
          pattern: ^shipaddr_[0-9a-f]{16}$
          description: Unique ID of the shipping address.
        status:
          type: string
          enum:
            - valid
            - invalid
        error:
          type: string
          nullable: true
          example: ''
          description: >-
            Description of the error when the status of the address is
            `invalid`, otherwise it will be empty
        address:
          $ref: '#/components/schemas/Address'
      required:
        - id
        - status
        - error
        - address
    Transaction:
      type: object
      required:
        - type
        - id
        - transaction_type
        - created_at
        - iso_created_at
        - description
        - decline_code
        - decline_reason
        - merchant
        - store
        - local_amount
        - billing_amount
        - hold_amount
        - cashback_amount
        - fee_amount
        - native_balance
        - settlement
        - ecommerce
        - international
        - card_present
        - emv
        - network
        - funding_source_name
        - state
        - adjustments
      properties:
        type:
          type: string
          enum:
            - transaction
        id:
          type: string
          pattern: ^txn_[0-9a-f]{16}
          example: txn_3bc9dcf557975fe4
        transaction_type:
          type: string
          enum:
            - credit
        created_at:
          type: number
          description: Transaction date as a UNIX timestamp.
          example: '1564568537.0'
        iso_created_at:
          type: string
          description: Settlement date in ISO format.
          pattern: ^YYYY-MM-DD$
          example: '2019-07-24'
        description:
          type: string
          example: Australian Airlines
        decline_code:
          nullable: true
          type: string
          example: decline_60
          description: >-
            Decline code indicating the decline reason. Only present when the
            transaction is declined. For a list of decline codes, please see the
            [declines code
            table](https://docs.aptopayments.com/api/core-api/#tag/Authorizations)
        decline_reason:
          nullable: true
          type: string
          example: Invalid Transaction (CVC1/CVV2/CID/iCVV Format Error)
          description: >-
            Short description indicating the decline reason. `null` unless the
            transaction is declined.
        merchant:
          type: object
          $ref: '#/components/schemas/TransactionMerchant'
        store:
          type: object
          $ref: '#/components/schemas/TransactionStore'
        local_amount:
          type: object
          $ref: '#/components/schemas/TransactionLocalAmount'
        billing_amount:
          type: object
          $ref: '#/components/schemas/TransactionBillingAmount'
        hold_amount:
          type: object
          $ref: '#/components/schemas/TransactionHoldAmount'
        cashback_amount:
          type: object
          $ref: '#/components/schemas/TransactionCashbackAmount'
        fee_amount:
          type: object
          $ref: '#/components/schemas/TransactionFeeAmount'
        native_balance:
          type: object
          $ref: '#/components/schemas/TransactionNativeBalanceAmount'
        settlement:
          type: object
          $ref: '#/components/schemas/TransactionSettlement'
        ecommerce:
          type: boolean
          example: false
        international:
          type: boolean
          example: false
        card_present:
          type: boolean
          example: false
        emv:
          type: boolean
          example: false
        network:
          type: boolean
          enum:
            - VISA
            - MASTERCARD
            - AMEX
            - TABAPAY
        funding_source_name:
          type: string
          example: USER's Account (USD)
        state:
          type: string
          enum:
            - pending
            - declined
            - complete
            - rejected
        adjustments:
          type: object
          allOf:
            - $ref: '#/components/schemas/TransactionAdjustmentsList'
    TransactionAdjustments:
      type: object
      required:
        - type
        - id
        - external_id
        - created_at
        - iso_created_at
        - adjustment_type
        - billing_amount
        - fee
        - native_amount
        - funding_source_name
        - exchange_rate
      properties:
        type:
          type: string
          enum:
            - transaction_adjustment
        id:
          type: string
          pattern: ^adj_[0-9a-f]{16}
          example: adj_3bc9dcf557975fe4
        external_id:
          nullable: true
          type: string
          example: 5447cbb1-9d8a-4f37-5715-4aef3238641e
          description: >
            Transaction identification in the external ledger, will allow to
            correlate Apto transaction identifier with external ledger
            transaction (transfer) identifier.
        created_at:
          type: number
          description: Transaction date as a UNIX timestamp.
          example: '1564568537.0'
        iso_created_at:
          type: string
          description: Settlement date in ISO format.
          pattern: ^YYYY-MM-DD$
          example: '2019-07-24'
        adjustment_type:
          type: string
          example: capture
          enum:
            - capture
            - refund
            - hold
            - release
        billing_amount:
          type: object
          allOf:
            - $ref: '#/components/schemas/TransactionBillingAmount'
        native_amount:
          type: object
          allOf:
            - $ref: '#/components/schemas/TransactionNativeAmount'
        fee:
          type: object
          allOf:
            - $ref: '#/components/schemas/TransactionNativeFeeAmount'
        funding_source_name:
          nullable: true
          type: string
          example: My BTC wallet
          description: >
            Balance/wallet name in the external ledger, this is the name the
            user assigned in the external ledger to its wallet.
        exchange_rate:
          type: string
          format: float
          example: 9385.42
          description: >
            The exchange rate between the billing amount and the native amount.
            It will be 1.0 unless the native currency in the external ledger is
            different from the billing currency (for example, in cards attached
            to crypto wallets).
    TransactionAdjustmentsList:
      type: object
      allOf:
        - $ref: '#/components/schemas/Pagination'
        - type: object
          properties:
            data:
              type: array
              items:
                $ref: '#/components/schemas/TransactionAdjustments'
    TransactionAmount:
      type: object
      properties:
        type:
          type: string
          enum:
            - money
        currency:
          nullable: true
          type: string
          description: ISO4217 currency code
          example: USD
        amount:
          nullable: true
          type: number
          format: float
          example: 1874.89
    TransactionBillingAmount:
      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:
        type:
          type: string
          enum:
            - money
        currency:
          nullable: true
          type: string
          description: ISO4217 currency code
          example: USD
        amount:
          nullable: true
          type: number
          format: float
          example: 1874.89
    TransactionCashbackAmount:
      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:
        type:
          type: string
          enum:
            - money
        currency:
          nullable: true
          type: string
          description: ISO4217 currency code
          example: USD
        amount:
          nullable: true
          type: number
          format: float
          example: 1874.89
    TransactionFeeAmount:
      type: object
      description: |-
        Fee amounts are added through program configuration.<br /><br />
        These amounts are already included in the billing amount total.
      properties:
        type:
          type: string
          enum:
            - money
        currency:
          nullable: true
          type: string
          description: ISO4217 currency code
          example: USD
        amount:
          nullable: true
          type: number
          format: float
          example: 1874.89
    TransactionHoldAmount:
      type: object
      description: >-
        Hold amounts are the indication of what a merchant is holding on the
        transaction.
      properties:
        type:
          type: string
          enum:
            - money
        currency:
          nullable: true
          type: string
          description: ISO4217 currency code
          example: USD
        amount:
          nullable: true
          type: number
          format: float
          example: 1874.89
    TransactionList:
      type: object
      allOf:
        - $ref: '#/components/schemas/Pagination'
        - type: object
          properties:
            data:
              type: array
              items:
                $ref: '#/components/schemas/Transaction'
    TransactionLocalAmount:
      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:
        type:
          type: string
          enum:
            - money
        currency:
          nullable: true
          type: string
          description: ISO4217 currency code
          example: USD
        amount:
          nullable: true
          type: number
          format: float
          example: 1874.89
    TransactionMerchant:
      type: object
      required:
        - type
        - id
        - key
        - name
        - mcc
      properties:
        type:
          type: string
          enum:
            - merchant
        id:
          type: string
        key:
          type: string
        name:
          type: string
        mcc:
          type: object
          allOf:
            - $ref: '#/components/schemas/TransactionMerchantMcc'
    TransactionMerchantMcc:
      type: object
      required:
        - type
        - code
        - name
        - icon
      properties:
        type:
          type: string
          enum:
            - mcc
        code:
          type: number
          example: 7299
        name:
          type: string
          example: Airplane
        icon:
          type: string
          enum:
            - plane
            - car
            - glass
            - finance
            - food
            - gas
            - bed
            - medical
            - camera
            - card
            - cart
            - road
            - other
    TransactionNativeAmount:
      type: object
      description: >-
        Can be ignored for most integrations, native amount is only specific
        when a balance is holding a different currency to the billing amount.
      required:
        - type
        - currency
        - amount
      properties:
        type:
          nullable: true
          type: string
          enum:
            - money
        currency:
          type: string
          description: ISO4217 currency code
          example: USD
        amount:
          nullable: true
          type: number
          example: '1874.89'
    TransactionNativeBalanceAmount:
      type: object
      description: >-
        Defines the amount of funds available in the native wallet in the
        external ledger. This feature is only available for external ledgers
        that allow knowing its wallet balance.
      properties:
        type:
          type: string
          enum:
            - money
        currency:
          nullable: true
          type: string
          description: ISO4217 currency code
          example: USD
        amount:
          nullable: true
          type: number
          format: float
          example: 1874.89
    TransactionNativeFeeAmount:
      type: object
      description: >-
        Can be ignored for most integrations, native amount is only specific
        when a balance is holding a different currency to the billing amount.
      required:
        - type
        - currency
        - amount
      properties:
        type:
          type: string
          enum:
            - money
        currency:
          nullable: true
          type: string
          description: ISO4217 currency code
          example: USD
        amount:
          nullable: true
          type: number
          example: '1874.89'
    TransactionSettlement:
      type: object
      required:
        - type
        - date
        - iso_date
        - amount
      properties:
        type:
          type: string
          enum:
            - settlement
        date:
          type: number
          description: Settlement date as a UNIX timestamp.
          example: '1564568537.0'
        iso_date:
          type: string
          description: Settlement date in ISO format.
          pattern: ^YYYY-MM-DD$
          example: '2019-07-24'
        amount:
          type: object
          $ref: '#/components/schemas/TransactionAmount'
    TransactionStore:
      type: object
      required:
        - type
        - id
        - key
        - name
        - address
        - location
      properties:
        type:
          type: string
          enum:
            - store
        id:
          type: string
        key:
          type: string
        name:
          type: string
          example: USER_SBX Apto Cred
        address:
          type: object
          allOf:
            - $ref: '#/components/schemas/TransactionStoreAddress'
        location:
          type: object
          allOf:
            - $ref: '#/components/schemas/TransactionStoreLocation'
    TransactionStoreAddress:
      type: object
      required:
        - type
        - street
        - apt
        - city
        - state
        - zip_code
        - country
      properties:
        type:
          type: string
          enum:
            - address
        street:
          type: string
          example: 123 Main Street
        apt:
          type: string
          example: 'Apt. #234'
        city:
          type: string
          example: San Francisco
        state:
          type: string
          example: CA
        zip_code:
          type: string
          example: '12345'
        country:
          type: string
          description: The 3-letter ISO 3166-1 country code.
          example: USA
    TransactionStoreLocation:
      type: object
      required:
        - type
        - longitude
        - latitude
      properties:
        type:
          type: string
          enum:
            - geo_location
        longitude:
          type: number
        latitude:
          type: number
    User:
      type: object
      description: Object containing user data.
      properties:
        type:
          type: string
          description: Type of user.
          enum:
            - user
        user_id:
          type: string
          description: Identifier of the user.
          pattern: ^crdhldr_[0-9a-f]{20}$
          example: crdhldr_b04f29605a018f7d72a2
        user_data:
          type: object
          description: User’s information.
          required:
            - type
            - data
            - page
            - rows
            - has_more
            - total_rows
          properties:
            type:
              type: string
              description: Type of user.
              enum:
                - list
            data:
              type: array
              description: Information about the user.
              items:
                anyOf:
                  - $ref: '#/components/schemas/EmailDataPoint'
                  - $ref: '#/components/schemas/DobDataPoint'
                  - $ref: '#/components/schemas/PhoneDataPoint'
                  - $ref: '#/components/schemas/NameDataPoint'
                  - $ref: '#/components/schemas/AddressDataPoint'
                  - $ref: '#/components/schemas/IdDocumentDataPoint'
            page:
              type: integer
              description: Dataset page.
              example: 0
            rows:
              type: integer
              description: Number of rows to show per page.
              example: 5
            has_more:
              description: >-
                Displays whether this is the last element in the set, or if
                there are subsequent elements.
              type: boolean
              example: true
            total_rows:
              type: integer
              example: 10
        metadata:
          type: string
          description: >-
            Metadata associated with the user. This field can contain up to 256
            characters.
    UserCreated:
      type: object
      description: Object containing user data.
      properties:
        type:
          type: string
          description: Type of user.
          enum:
            - user
        user_id:
          type: string
          description: Identifier of the user.
          pattern: ^crdhldr_[0-9a-f]{20}$
          example: crdhldr_b04f29605a018f7d72a2
        user_token:
          type: string
          description: Unique token for the user’s session.
          example: E5PWX4T9dcPriIo ... ao0QZLC6YL/dAyaA8
        user_data:
          type: object
          description: User’s information.
          required:
            - type
            - data
            - page
            - rows
            - has_more
            - total_rows
          properties:
            type:
              type: string
              description: Type of user.
              enum:
                - list
            data:
              type: array
              description: Information about the user.
              items:
                anyOf:
                  - $ref: '#/components/schemas/EmailDataPoint'
                  - $ref: '#/components/schemas/DobDataPoint'
                  - $ref: '#/components/schemas/PhoneDataPoint'
                  - $ref: '#/components/schemas/NameDataPoint'
                  - $ref: '#/components/schemas/AddressDataPoint'
                  - $ref: '#/components/schemas/IdDocumentDataPoint'
            page:
              type: integer
              description: Dataset page.
              example: 0
            rows:
              type: integer
              description: Number of rows to show per page.
              example: 5
            has_more:
              description: >-
                Displays whether this is the last element in the set, or if
                there are subsequent elements.
              type: boolean
              example: true
            total_rows:
              type: integer
              example: 10
        metadata:
          type: string
          description: >-
            Metadata associated with the user. This field can contain up to 256
            characters.
    UserIdentification:
      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
          example: E5PWX4T9dcPriIo ... ao0QZLC6YL/dAyaA8
    UserNotFound:
      type: object
      description: Error response for an API call.
      required:
        - message
        - code
      properties:
        message:
          type: string
          default: User not found.
        code:
          type: integer
          default: 200116
    Verification1:
      type: object
      description: >-
        Object containing information for the primary verification, included
        verification status.
      required:
        - type
        - verification_id
        - status
      properties:
        type:
          type: string
          description: Type of object.
          example: verification
        verification_type:
          type: string
          description: Type of verification.
          example: phone
        verification_mechanism:
          type: string
          description: Method used for verification.
          example: phone
        verification_id:
          type: string
          description: Identifier of the verification object.
          format: entity_[0-9af]{16}
          example: entity_9b5ed37c22616418
        status:
          type: string
          description: >-
            This field indicates whether the user still needs to pass more
            verifications or not (`status: "pending"` vs `status: "passed"`).
            For a better understanding of the requests flow, see the
            [authenticating users
            guide](https://docs.aptopayments.com/docs/guides/Users/authenticating-users-guide/#mobile-api).
          enum:
            - pending
            - passed
            - failed
            - expired
    Verification2:
      type: object
      description: >-
        Object containing information for the primary and second verification,
        included verification status.
      required:
        - type
        - verification_id
        - status
      properties:
        type:
          type: string
          description: Type of object.
          example: verification
        verification_id:
          type: string
          description: Identifier of the verification object.
          format: entity_[0-9af]{16}
          example: entity_9b5ed37c22616418
        status:
          type: string
          description: >-
            This field indicates whether the user still needs to pass more
            verifications or not (`status: "pending"` vs `status: "passed"`).
            For a better understanding of the requests flow, see the
            [authenticating users
            guide](https://docs.aptopayments.com/docs/guides/Users/authenticating-users-guide/#mobile-api).
          enum:
            - pending
            - passed
            - failed
            - expired
        verification_type:
          type: string
          description: Type of verification.
          example: phone
        verification_mechanism:
          type: string
          description: Method used for verification.
          example: phone
        secondary_credential:
          allOf:
            - $ref: '#/components/schemas/SecondaryCredential'
    VerificationDobDataPoint:
      type: object
      description: Object containing the date of birth verification information.
      required:
        - datapoint_type
        - datapoint
      properties:
        datapoint_type:
          type: string
          description: Verification type.
          enum:
            - birthdate
        datapoint:
          type: object
          description: Object containing the verification information.
          required:
            - date
          properties:
            data_type:
              type: string
              description: Type of verification.
              enum:
                - birthdate
            verified:
              type: boolean
              description: Indicates if the the date of birth is verified.
              example: false
            not_specified:
              type: boolean
              description: Indicates if the date of birth is unspecified.
              example: true
            date:
              type: string
              description: Date of birth for the verification.
              format: YYYY-MM-DD
              example: '1965-10-20'
    VerificationEmailDataPoint:
      type: object
      description: Object containing the email verification information.
      required:
        - datapoint_type
        - datapoint
      properties:
        datapoint_type:
          type: string
          description: Verification type.
          enum:
            - email
        datapoint:
          type: object
          description: Object containing the verification information.
          required:
            - email
          properties:
            data_type:
              type: string
              description: Type of verification.
              enum:
                - email
            verified:
              type: boolean
              description: Indicates if the the email is verified.
              example: true
            not_specified:
              type: boolean
              description: Indicates if the email is unspecified.
              example: false
            email:
              type: string
              description: Email for the verification.
              example: user@gmail.com
          corporation_id:
            pattern: ^corp_[0-9a-f]{16}$
            example: corp_cbeca56e86517700
            description: >-
              Indicate the corporation_id if you might have the same users under
              multiple corporations.
    VerificationPhoneDataPoint:
      type: object
      description: Object containing the phone verification information.
      required:
        - datapoint_type
        - datapoint
      properties:
        datapoint_type:
          type: string
          description: Verification type.
          enum:
            - phone
        datapoint:
          type: object
          description: Object containing the verification information.
          required:
            - country_code
            - phone_number
          properties:
            data_type:
              type: string
              description: Type of verification.
              enum:
                - phone
            country_code:
              type: string
              description: Country code for the phone verification.
              example: '1'
            phone_number:
              type: string
              description: Phone number for the verification.
              example: '5551230000'
        corporation_id:
          pattern: ^corp_[0-9a-f]{16}$
          example: corp_cbeca56e86517700
          description: >-
            Indicate the corporation_id if you might have the same users under
            multiple corporations.
    WelcomeScreenAction:
      type: object
      required:
        - type
        - action_id
        - status
        - action_type
        - configuration
      properties:
        type:
          type: string
          enum:
            - action
        action_id:
          type: string
          pattern: ^entity_[0-9a-f]{16}$
          description: Identifier of the action.
          example: entity_9b5ed37c22616418
        name:
          type: string
          example: Project Welcome Screen
        order:
          type: integer
          example: 1
        status:
          type: integer
          example: 1
        editable_status:
          type: boolean
          example: true
        action_type:
          type: string
          enum:
            - action_get_user_token_config
            - action_collect_user_data_config#
            - action_disclaimer_config
            - action_generic_message_config
            - action_issue_card_config
            - action_upload_documents_config
            - action_waitlist_config
            - select_balance_store_configuration
        owner_module:
          type: string
          enum:
            - none
        configuration:
          oneOf:
            - $ref: '#/components/schemas/GetUserTokenAction'
            - $ref: '#/components/schemas/CollectUserDataAction'
            - $ref: '#/components/schemas/ShowDisclaimersAction'
            - $ref: '#/components/schemas/ShowGenericMessageAction'
            - $ref: '#/components/schemas/UploadDocumentsAction'
            - $ref: '#/components/schemas/SelectBalanceStoreAction'
            - $ref: '#/components/schemas/IssueCardAction'
            - $ref: '#/components/schemas/ShowWaitlistAction'
  securitySchemes:
    PublicKey:
      type: apiKey
      in: header
      name: Api-Key
    SessionToken:
      type: apiKey
      in: header
      name: Authorization
  parameters:
    AccountIdParam:
      in: path
      name: account_id
      description: >-
        Identifier of the card. You can find a card's ID in the response of the
        [list all cards](#operation/list_cards) endpoint.
      required: true
      schema:
        type: string
        pattern: ^crd_[0-9a-f]{16}$
        example: crd_cbeca56e86517700
    AuthorizationIdParam:
      in: path
      name: authorization_id
      description: The id of the authorization that will be retrieved.
      required: true
      schema:
        type: string
        pattern: ^auth_[0-9a-f]{16}$
    TransferIdParam:
      in: path
      name: transfer_id
      description: The id of the instant debit card transfer that will be retrieved.
      required: true
      schema:
        type: string
        pattern: ^aft_[0-9a-f]{16}$
    LinkedCardIdParam:
      in: path
      name: linked_card_id
      description: The id of the linked card.
      required: true
      schema:
        type: string
        pattern: ^link_card_[0-9a-f]{16}$
    ApplicationIdParam:
      in: path
      name: application_id
      description: >-
        Identifier of the application. The identifier can be found in the
        response of the [apply for a card endpoint](#operation/ApplyCard).
      required: true
      schema:
        type: string
    BalanceIdParam:
      in: path
      name: balance_id
      description: >-
        Balance ID to use as a filter. You can retrieve a list of available
        balances by calling the [list available funding
        sources](#operation/availableFundingSources) endpoint.
      required: true
      schema:
        type: string
        pattern: ^bal_[0-9a-f]{16}$
    BalanceTransferSubscriptionIdParam:
      in: path
      description: >
        Identifier of the balance transfer subscription to be retrieved. You can
        retrieve the available balance transfer subscriptions by calling the
        [list balance transfer subscriptions
        endpoint](#tag/Balance-transfer-subscriptions/paths/~1v1~1balances~1{balance_id}~1balance_transfer_subscriptions/get).
      name: balance_transfer_subscription_id
      required: true
      schema:
        type: string
        example: balxfrsubs_3bc9dcf557975fe4
        pattern: ^balxfrsubs_[0-9a-f]{16}$
    CardProgramIdParam:
      in: path
      description: >-
        The ID of your card program. You can obtain the ID of your card program
        by calling the [list card programs
        endpoint](#operation/GetCardPrograms).
      name: card_program_id
      required: true
      schema:
        type: string
        example: entity_12e15384f30y2i43
    EmailParam:
      in: query
      name: email
      description: Email of the target recipient of the funds.
      required: false
      schema:
        type: string
        example: user.test@gmail.com
    EndDateQueryParam:
      in: query
      name: end_date
      description: Maximum date value for the retrieved transactions.
      required: false
      schema:
        type: string
        pattern: ^YYYY-MM-DD$
        example: '2019-08-20'
    EndingBeforeParam:
      in: query
      name: ending_before
      description: Return the page ending right before the specified element.
      required: false
      schema:
        type: string
    LastTransactionIdQueryParam:
      in: query
      name: last_transaction_id
      description: Starting transaction ID for the row count.
      required: false
      schema:
        type: string
        pattern: ^txn_[0-9a-f]{16}$
        example: txn_98hnhu9sc7i9ay73375
    MCCQueryParam:
      in: query
      name: mcc
      description: >-
        The [Merchant Category
        Code](https://www.investopedia.com/terms/m/merchant-category-codes-mcc.asp)
        for the retrieved transactions.
      required: false
      schema:
        type: string
        enum:
          - plane
          - car
          - glass
          - finance
          - food
          - gas
          - bed
          - medical
          - camera
          - card
          - cart
          - road
          - other
    MonthlySpendingMonthParam:
      in: query
      name: month
      description: Month of the spending data.
      required: true
      schema:
        type: string
        enum:
          - january
          - february
          - march
          - april
          - may
          - june
          - july
          - august
          - september
          - october
          - november
          - december
    MonthlySpendingYearParam:
      in: query
      name: year
      description: Year of the spending data.
      required: true
      schema:
        type: integer
        example: 2019
    PageLimitParam:
      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
    PhoneCountryCodeParam:
      in: query
      name: phone_country_code
      description: Country code for the phone number
      required: false
      schema:
        type: string
        example: '1'
    PhoneNumberParam:
      in: query
      name: phone_number
      description: Phone number of the target recipient of funds.
      required: false
      schema:
        type: string
        example: '3202476962'
    RowsQueryParam:
      in: query
      name: rows
      description: Number of transactions to retrieve.
      required: false
      schema:
        type: number
        default: 25
        minimum: 1
        maximum: 50
    StartDateQueryParam:
      in: query
      name: start_date
      description: Minimum date value for the retrieved transactions.
      required: false
      schema:
        type: string
        pattern: ^YYYY-MM-DD$
        example: '2019-07-31'
    StartingAfterParam:
      in: query
      name: starting_after
      description: Return the page starting right after the specified element.
      required: false
      schema:
        type: string
    TransactionStateQueryParam:
      in: query
      name: state
      description: Type for the retrieved transactions.
      required: false
      schema:
        type: array
        items:
          minItems: 1
          maxItems: 2
          type: string
          enum:
            - declined
            - complete
    VerificationIdParam:
      in: path
      name: verification_id
      description: >-
        Identifier of the verification that was returned when the verification
        process was [started](#operation/StartVerification) or
        [restarted](#tag/Verifications/paths/~1v1~1verifications~1{verification_id}~1restart/post),
        present in the response as `verification_id`.
      required: true
      schema:
        type: string
        format: entity_[0-9af]{16}
  requestBodies:
    AcceptAgreementsBody:
      required: true
      content:
        application/json:
          schema:
            type: object
            required:
              - workflow_object_id
              - action_id
            properties:
              workflow_object_id:
                type: string
                description: >
                  Identifies the flow, or list of actions, being executed.

                  Find `workflow_object_id` in the response of the [apply for a
                  card endpoint](#operation/ApplyCard) or the [retrieve card
                  application endpoint](#operation/GetApplication).
                example: entity_a35b2e3fd633d187
              action_id:
                type: string
                description: >
                  Identifier of the action within a workflow.

                  Find `action_id` in the response of the [apply for a
                  card](#operation/ApplyCard) endpoint or the [retrieve card
                  application](#operation/GetApplication) endpoint (it'll be
                  `next_action.action_id`).
                example: entity_188e0f731604d8d5
    ActivatePhysicalCardBody:
      required: true
      content:
        application/json:
          schema:
            type: object
            properties:
              code:
                type: string
                example: '123456'
                description: >-
                  The activation code that came with the physical card received
                  by mail.
    CreateInboundTransferBody:
      required: true
      content:
        application/json:
          schema:
            properties:
              description:
                type: string
                description: >-
                  An optional field to provide a description for the inbound
                  transfer.
              amount:
                allOf:
                  - $ref: shared/general_shared.yaml#/components/schemas/Amount
              source:
                type: string
                description: >-
                  ID of the external linked card from where the funds will be
                  pulled.
                example: linked_card_4dd7746a17e98456
                pattern: linked_card_[0-9af]{16}
              target:
                type: string
                description: >-
                  ID of the internal Apto card where the funds will be
                  deposited.
                example: crd_12aa2c96a548d7d2
                pattern: crd_[0-9af]{16}
            required:
              - amount
              - target
              - source
    ApplePayProvisioningBody:
      required: true
      content:
        application/json:
          schema:
            type: object
            properties:
              data:
                type: object
                properties:
                  certificates:
                    type: array
                    description: >-
                      An array of [NSData
                      objects](https://developer.apple.com/documentation/foundation/nsdata)..
                      Each object contains a [DER encoded
                      X.509](https://developer.apple.com/documentation/security/seccertificate)
                      certificate, with the leaf first and root last. You must
                      download the root CA to validate the entire chain.
                    example:
                      - >-
                        MIID/TCCA6OgAwIBAgIIMKKNZA6F9o0wCgYIKoZIzj0EAwIwgYAxNDAQQ...7MDkwNJsZdaeiTujAiEAhpVgo+we+5UvpPnc9fZmfRP8O3jSnTo3FZZ5TKpzjJU=
                      - >-
                        MIIC9zCCAnygAwIBAgIIb+/Y9emjp+4wCgYIKoZIzj0EAwIwZzEbMBkGA...1UEAwwSQXBwbGUgUm9vdCwIxAPxkUolLPF2/axzCiZgvcq61m6oaCyNUd1ToFUO=
                  nonce:
                    type: string
                    description: A one-time nonce value generated by Apple’s servers.
                    example: 4hIFEtS=
                  nonce_signature:
                    type: string
                    description: The device-specific signature for the nonce.
                    example: >-
                      WkkX6WaM62LG2KR18X2a21q4pDLQUflUvrlHNj48PWRVLVaEl9lEJ3OlYVFrrMP7Fq2aALLiMf2l6xpn0ePScBvCxlKS7FEE24/FFS6JcWo7
    ApplyForCardBody:
      required: true
      content:
        application/json:
          schema:
            type: object
            required:
              - card_product_id
            properties:
              card_product_id:
                type: string
                pattern: entity_[0-9af]{16}
                example: entity_9b5ed37c22616418
                description: >-
                  Identifier of the card program the user is applying to. You
                  can obtain the card program ID by calling the [list card
                  programs endpoint](#operation/GetCardPrograms).
              metadata:
                type: string
                description: >-
                  Metadata associated with the issued card. This field can
                  contain up to 256 characters.
    CreateTransferSubscriptionBody:
      required: true
      content:
        application/json:
          schema:
            type: object
            properties:
              balance_transfer_template_id:
                type: string
                example: balxfrtmpl_3bc9dcf557975fe4
                pattern: ^balxfrtmpl_[0-9a-f]{16}$
                description: >
                  The template to use for the new subscription. You can retrieve
                  the available templates by calling the [list balance transfer
                  templates endpoint](#tag/Balance-transfer-templates).
    CreateUserBody:
      required: true
      description: >
        This needs to be encoded using a JWT token acting as the signed payload.
        You can learn more about **Signed Payloads** by reading the [relevant
        guide](/docs/overview/getting%20started/signed_payloads/).<br /><br />

        Don't forget to add the verification data to identify your verified
        phone or email datapoints. [**Read more in our
        guide**](https://docs.aptopayments.com/docs/overview/Getting%20Started/users#send-a-verification-code-to-a-new-user).
      content:
        application/jwt:
          schema:
            example: >-
              eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c
            type: object
            properties:
              data_points:
                type: object
                description: Datapoint object for the user.
                required:
                  - type
                  - data
                properties:
                  type:
                    type: string
                    description: Type of datapoint.
                    enum:
                      - list
                  data:
                    type: array
                    description: >
                      Array of DataPoint objects (phone, email, date of birth,
                      name, and address).

                      All of these datapoint objects must be included in the
                      request.
                    items:
                      - $ref: '#/components/payloadSchemas/CreateUserPhoneDataPoint'
                      - $ref: '#/components/payloadSchemas/CreateUserEmailDataPoint'
                      - $ref: '#/components/payloadSchemas/DobDataPoint'
                      - $ref: '#/components/payloadSchemas/NameDataPoint'
                      - $ref: '#/components/payloadSchemas/AddressDataPoint'
                      - $ref: '#/components/payloadSchemas/IdDocumentDataPoint'
              metadata:
                type: string
                description: >-
                  Optional metadata associated with the user. This field can
                  contain up to 256 characters. You can use this filed to
                  associate custom data to the user.
                example: '{ "user": { "data": 123 } }'
              custodian_uid:
                type: string
                description: >-
                  An optional string identifying the user inside your company's
                  database.
                example: user_company_4353252
              corporation_id:
                pattern: ^corp_[0-9a-f]{16}$
                example: corp_cbeca56e86517700
                description: >-
                  Indicate the corporation_id if you might have the same users
                  under multiple corporations.
            required:
              - data_points
              - verification
    FinishVerificationBody:
      required: true
      content:
        application/json:
          schema:
            type: object
            required:
              - secret
            properties:
              secret:
                type: string
                description: >
                  * For phone number and email verifications, specify the
                  6-digit number sent to the phone number or email. Include
                  numerical values only. * For date of birth verifications,
                  specify the user's date of birth in `YYYY-MM-DD` format.
                example: '123456'
    GenerateMonthlyStatementBody:
      description: The month and the year for which to generate the monthly statement.
      required: true
      content:
        application/json:
          schema:
            type: object
            properties:
              month:
                type: number
                description: >-
                  Month for the generated monthly statement. For example,
                  `month: 1` to select January or `month: 6` to select June.
                format: int32
                minimum: 1
                maximum: 12
                example: 11
              year:
                type: number
                description: Year for the generated monthly statement.
                format: int32
                example: 2021
    IssueCardBody:
      required: true
      content:
        application/json:
          schema:
            type: object
            required:
              - application_id
            properties:
              application_id:
                type: string
                description: >-
                  Identifier of the card application. The identifier can be
                  found in the response of the [apply for a card
                  endpoint](#operation/ApplyCard).
                pattern: entity_[0-9af]{16}
                example: entity_9b5ed37c22616418
              metadata:
                type: string
                description: >-
                  Metadata associated with this card. This field can contain up
                  to 256 characters.
              design:
                type: object
                description: Group of fields to define a particular design for the card.
                properties:
                  design_key:
                    type: string
                    example: my_design_key
                    description: >-
                      A string that will identify the design applied to the
                      card. This key will be defined by Apto and will be unique
                      to you as a customer.
                  qr_code:
                    type: string
                    example: http://url-to-qr-code
                    description: >
                      Defines the URL for the QR code image to be printed in the
                      card. Additional config on Apto side is needed to define
                      the location and position of this item, please contact
                      support.
                  extra_embossing_line:
                    type: string
                    example: Other data under cardholder name
                    description: >-
                      Defines the extra-embossing line content on the card
                      (under the cardholder name).
                  image_url:
                    type: string
                    example: http://url-to-main-image
                    description: >
                      Defines a main image to be inserted to the card.
                      Additional config on Apto side is needed to define the
                      location and position of this item, please contact
                      support.
                  additional_image_url:
                    type: string
                    example: http://url-to-secondary-image
                    description: >
                      Defines an additional (secondary) image to be inserted to
                      the card. Additional config on Apto side is needed to
                      define the location and position of this item, please
                      contact support.
    SendP2PTransferBody:
      required: true
      content:
        application/json:
          schema:
            type: object
            properties:
              source_id:
                type: string
                description: >
                  Identifier of the balance acting as the source of the funds
                  for the transfer. You can find the `balance_id` you want by
                  calling the [list available funding sources
                  endpoint](#operation/availableFundingSources).
                example: bal_1234567890abcdef
              recipient_id:
                type: string
                description: >
                  Recipient cardholder ID. You can get recipient ID by calling
                  the [retrieve val id p2p recipient
                  endpoint](#tag/P2P-transfer/paths/~1v1~1p2p~1recipient/get)
                  and grabbing `cardholder_id` from the response.
                example: crdhldr_1234567890abcdef
              amount:
                allOf:
                  - $ref: shared/general_shared.yaml#/components/schemas/Amount
    SetAgreementStatusBody:
      required: true
      content:
        application/json:
          schema:
            type: object
            properties:
              agreements_keys:
                type: array
                description: >-
                  Keys that represents the agreements that were accepted or
                  declined.
                items:
                  type: string
                  enum:
                    - apto_cha
                    - apto_privacy
                    - evolve_eua
                    - evolve_privacy
                example:
                  - evolve_eua
              user_action:
                type: string
                description: >-
                  Action that the user took on the agreement: accepted or
                  declined.
                enum:
                  - ACCEPTED
                  - DECLINED
                example: ACCEPTED
    SetCard3dsPasscodeBody:
      required: true
      content:
        application/json:
          schema:
            type: object
            description: 4 digits card passcode data
            required:
              - passcode
            properties:
              passcode:
                type: string
                pattern: ^[0-9]
                example: '5863'
                description: >-
                  The new passcode (4 digits) for the card that might be asked
                  to the cardholder when making online payments as an extra
                  security step.
              verification_id:
                type: string
                pattern: entity_[0-9af]{16}
                example: entity_c02e8ba40058dece
                description: >-
                  And ID representing a successful verification pass. You'll
                  need to [start a verification
                  process](#operation/StartVerification) and [complete
                  it](#operation/CompleteVerification) and then supply the
                  `verification_id` here.
    SetCardPinBody:
      description: New card PIN.
      required: true
      content:
        application/json:
          schema:
            type: object
            required:
              - pin
            properties:
              pin:
                type: string
                description: 4 digit PIN to associate with the card.
                pattern: ^[0-9]
                example: '3568'
    SetExternalBalanceBoddy:
      required: true
      content:
        application/json:
          schema:
            type: object
            required:
              - funding_source_data
            properties:
              funding_source_data:
                type: object
                nullable: true
                required:
                  - custodian_type
                  - access_token
                  - refresh_token
                properties:
                  custodian_type:
                    type: string
                    enum:
                      - coinbase
                      - uphold
                  access_token:
                    type: string
                    example: >-
                      3a1psty6xga9qhbbjp7j95sisw69pqfl02zxmwlfg2ryqnoz23ucygxfusfw7qvb
                  refresh_token:
                    type: string
                    example: >-
                      nllp1sr5p2jzqhx4geosztae63rk3hqe5dfbe254dil0wr5boe7bpinuhjqku17f
    SetFundingSourceBody:
      required: true
      content:
        application/json:
          schema:
            type: object
            required:
              - funding_source_id
            properties:
              funding_source_id:
                description: >-
                  Identifier of the balance to attach to the card. You can find
                  the `founding_source_id` you want by calling the [list
                  available funding sources
                  endpoint](#operation/availableFundingSources).
                type: string
                pattern: ^bal_[0-9a-f]{16}$
                example: bal_cbeca56e86517700
    StartVerificationBody:
      required: true
      content:
        application/json:
          schema:
            oneOf:
              - $ref: '#/components/schemas/VerificationPhoneDataPoint'
              - $ref: '#/components/schemas/VerificationEmailDataPoint'
    UpdateTransferSubscriptionBody:
      required: true
      content:
        application/json:
          schema:
            type: object
            properties:
              balance_transfer_template_id:
                type: string
                example: balxfrtmpl_3bc9dcf557975fe4
                pattern: ^balxfrtmpl_[0-9a-f]{16}$
                description: >
                  The template to use for the new subscription. You can retrieve
                  the available templates by calling the [list balance transfer
                  templates endpoint](#tag/Balance-transfer-templates).
    UpdateUserBody:
      required: true
      content:
        application/json:
          schema:
            type: object
            required:
              - data_points
            properties:
              data_points:
                type: object
                description: Datapoint object for the user.
                required:
                  - type
                  - data
                properties:
                  type:
                    type: string
                    description: Type of DataPoint.
                    enum:
                      - list
                  data:
                    type: array
                    description: DataPoint information.
                    items:
                      anyOf:
                        - $ref: '#/components/payloadSchemas/EmailDataPoint'
                        - $ref: '#/components/payloadSchemas/DobDataPoint'
                        - $ref: '#/components/payloadSchemas/PhoneDataPoint'
                        - $ref: '#/components/payloadSchemas/NameDataPoint'
                        - $ref: '#/components/payloadSchemas/AddressDataPoint'
                        - $ref: '#/components/payloadSchemas/IdDocumentDataPoint'
    UserLoginBody:
      required: true
      content:
        application/json:
          schema:
            type: object
            required:
              - verifications
            properties:
              verifications:
                type: object
                required:
                  - type
                  - data
                properties:
                  type:
                    type: string
                    enum:
                      - list
                  data:
                    type: array
                    description: >-
                      Array 2 items: primary and secondary credential
                      verifications
                    minItems: 2
                    maxItems: 2
                    items:
                      type: object
                      required:
                        - verification_id
                      properties:
                        verification_id:
                          type: string
                          example: entity_15624c56ad4aebc7
  payloadSchemas:
    AddressDataPoint:
      title: AddressDataPoint
      type: object
      description: User's address information datapoint.
      required:
        - type
        - street_one
        - street_two
        - locality
        - region
        - postal_code
        - country
      properties:
        type:
          type: string
          description: Type of datapoint.
          enum:
            - address
        street_one:
          type: string
          description: User’s street address.
          example: Malibu Point 10880
        street_two:
          type: string
          description: User’s secondary street address.
          nullable: true
          example: ''
        locality:
          type: string
          description: User’s city / locale.
          example: Malibu
        region:
          type: string
          description: User’s state / region.
          example: CA
        postal_code:
          type: string
          description: User’s postal code.
          example: '90265'
        country:
          type: string
          description: The 3-letter ISO 3166-1 country code.
          example: USA
    CreateUserEmailDataPoint:
      title: EmailDataPoint
      type: object
      description: Email information datapoint.
      required:
        - type
        - email
      properties:
        type:
          type: string
          description: Type of datapoint.
          enum:
            - email
        email:
          type: string
          description: Email for the user.
          format: email
          example: tony.stark@aptopayments.com
        verification:
          type: object
          description: >-
            Object obtained in previous steps to verify the email associated
            with the user. [**Read more in our
            guide**](https://docs.aptopayments.com/docs/overview/Getting%20Started/users#send-a-verification-code-to-a-new-user).
          properties:
            verification_id:
              type: string
              required: true
              example: entity_a0097e70d07cebf2
          required:
            - verification_id
    CreateUserPhoneDataPoint:
      title: PhoneDataPoint
      type: object
      description: Phone information datapoint.
      required:
        - type
        - country_code
        - phone_number
      properties:
        type:
          type: string
          description: Type of datapoint.
          enum:
            - phone
        country_code:
          type: string
          description: Country code for the user’s phone number.
          example: '1'
        phone_number:
          type: string
          description: Phone number of the user.
          example: '3202476962'
        verification:
          type: object
          description: >-
            Object obtained in previous steps to verify the phone associated
            with the user. [**Read more in our
            guide**](https://docs.aptopayments.com/docs/overview/Getting%20Started/users#send-a-verification-code-to-a-new-user).
          properties:
            verification_id:
              type: string
              required: true
              example: entity_a0097e70d07cebf2
          required:
            - verification_id
    DobDataPoint:
      title: DobDataPoint
      type: object
      description: Date of birth information datapoint.
      required:
        - type
        - date
      properties:
        type:
          type: string
          description: Type of datapoint.
          enum:
            - birthdate
        date:
          type: string
          description: Date of birth for the user.
          format: YYYY-DD-MM
          example: '1965-10-20'
    EmailDataPoint:
      title: EmailDataPoint
      type: object
      description: Email information datapoint.
      required:
        - type
        - email
      properties:
        type:
          type: string
          description: Type of datapoint.
          enum:
            - email
        email:
          type: string
          description: Email for the user.
          format: email
          example: tony.stark@aptopayments.com
    IdDocumentDataPoint:
      title: IdDocumentDataPoint
      type: object
      description: ID document information datapoint.
      required:
        - type
        - value
        - country
        - doc_type
      properties:
        type:
          type: string
          description: Type of datapoint.
          enum:
            - id_document
        value:
          type: string
          description: The ID document number.
          example: '111223333'
        country:
          type: string
          description: 3 character country code.
          example: USA
        doc_type:
          type: string
          description: The type of ID document. Currently only SSN is supported.
          example: SSN
          enum:
            - SSN
    NameDataPoint:
      title: NameDataPoint
      type: object
      description: Name information datapoint.
      required:
        - type
        - first_name
        - last_name
      properties:
        type:
          type: string
          description: Type of datapoint.
          enum:
            - name
        first_name:
          type: string
          description: User’s first name.
          example: Tony
        last_name:
          type: string
          description: User’s last name.
          example: Stark
    PhoneDataPoint:
      title: PhoneDataPoint
      type: object
      description: Phone information datapoint.
      required:
        - type
        - country_code
        - phone_number
      properties:
        type:
          type: string
          description: Type of datapoint.
          enum:
            - phone
        country_code:
          type: string
          description: Country code for the user’s phone number.
          example: '1'
        phone_number:
          type: string
          description: Phone number of the user.
          example: '3202476962'
