openapi: 3.0.0
info:
  version: '1.1'
  title: Client API IBANFIRST
  description: ''
tags:
  - name: Wallets
    description: >
      In the IBANFIRST API, what we call a "wallet" account can be either a
      physical iban account, or a virtual iban account with IBANFIRST. 

      A virtual account is an administrative "subaccount" of one physical iban
      account (the "masteraccount"). Cash can be earmarked as belonging to a
      virtual account so that you can easily allocate funds per business unit,
      per client, or incoming/outgoing transactions).
  - name: Financial movements
    description: >
      The IBANFIRST Rest API allows you to get all financial movements from your
      Wallets.
  - name: External bank account
    description: >
      In the IBANFIRST API, what we call `external bank` account, can be either
      your own account in another bank or a third party recipient account.
  - name: Payments
    description: >
      Sending funds from your IBANFIRST wallet account to your own bank account
      or a third-party recipient involves two steps:


      1. Generate the payment object with the Submit Payment method. 

      When you submit a payment to be scheduled, you assign a unique id to that
      payment.  

      **Caution:** The payment created will be automatically rolled to the next
      closest working days if not confirmed in the scheduled date of operation.


      2. Confirm the payment to the API for processing, using the Confirm
      Payment method. 

      When you confirm a payment for processing, make sure you have sufficient
      funds in your wallet account balance.  

      **Caution:** If the balance of your wallet account is not sufficient to
      cover the payment amount, funds may be locked-in by IBANFIRST.
  - name: Trades
    description: >
      IBANFIRST provides a deliverable FX facility and deliverable FX liquidity
      via the IBANFIRST-REST API. You will become counterparty to IBANFIRST and
      can market and sell deliverable FX services to corporate and private
      clients as well as using such services on their behalf.  


      The IBANFIRST-rest API supports online trading for the following
      contracts: TOD (Same-day), TOM (next-day), SPOT (T+2) and forward
      contracts up to one year.


      FX trades are always made between two wallet accounts of a unique
      counterparty. IBANFIRST will automatically debit the source wallet account
      and credit the delivery wallet account at the date specified in the FX
      trade instructions. If the delivery date has been scheduled, the delivery
      is automatically processed in the morning before 00:30 am Paris time. If
      the delivery date is today (TOD), the funds is available on your wallet
      account by the next 20mn.


      A FX trades also involves an amount, which includes both the numeric
      amount and the currency in order to define if this amount is the nominal
      to be bought or sold, for example: '100000.00+GBP'.
  - name: Documents
    description: >
      The IBANFIRST API let you acces your online documents stored on the
      IBANFIRST platform.  

      Note that the API do not send the document content, but a one-time link to
      access it.  

      This one-time link is only available once. So if you need another access
      to the document, you have to request another link by listing documents or
      getting document result.
  - name: Logs
    description: >
      As a developper, you might want to go further than sending request and
      recieve responses.  

      The IBANFIRST API allows you to access the logs of its own services, to
      provide you some details about what you send, and what it's done on the
      platform.


      You can retrieve informations during a certain time.  

      This time passed, your log entry will be lost.


      | HTTP Method | Time |

      |-------------|------|

      | GET | 1 hour |

      | POST, PUT | 1 week |
  - name: Auth
    description: >
      This service is intended to authenticate users on the API for certain
      cases
paths:
  /wallets/:
    post:
      summary: Submit a new wallet
      tags:
        - Wallets
      description: >
        This request allows you to submit a new wallet.  

        **Caution :** The holder object in the parameters will only be
        considered if you suscribed to the `Multi account per currency with
        holder` wallet option.
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
                - currency
              properties:
                currency:
                  $ref: '#/components/schemas/Currency'
                tag:
                  type: string
                  description: |
                    Custom data.
                holder:
                  $ref: '#/components/schemas/Holder'
        description: |
          The wallet to create
        required: true
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Wallet'
        default:
          description: ERROR
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
    get:
      summary: Get wallet list
      tags:
        - Wallets
      description: >
        With the Retrieve wallet list service, you can list obtain the list of
        all wallet account hold with IBANFIRST. The object return in the Array
        is a simplified version of the Wallet providing you the main information
        on the wallet without any additional request. 
      parameters:
        - name: page
          in: query
          description: |
            Index of the page.
          required: false
          schema:
            type: string
            default: '1'
        - name: per_page
          in: query
          description: |
            Inumber of items returned.
          required: false
          schema:
            type: string
            default: '50'
        - name: sort
          in: query
          description: >
            A string representing the rendering order of objects. For wallet
            objects, the sorting is made by wallet's creation date.
          required: false
          schema:
            type: string
            enum:
              - ASC
              - DESC
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: array
                description: |
                  An Array of objects representing wallets.
                items:
                  type: object
                  description: |
                    A shorter version of the wallet
                  properties:
                    id:
                      $ref: '#/components/schemas/ID'
                    tag:
                      type: string
                      description: |
                        The custom wording of the wallet.
                    currency:
                      $ref: '#/components/schemas/Currency'
                    bookingAmount:
                      $ref: '#/components/schemas/Amount'
                    valueAmount:
                      $ref: '#/components/schemas/Amount'
                    dateLastFinancialMovement:
                      $ref: '#/components/schemas/Date'
        default:
          description: ERROR
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /wallets/-{id}:
    get:
      summary: Get wallet details
      tags:
        - Wallets
      description: >
        This request allows you to see the details related to a specific
        wallet. 
      parameters:
        - name: id
          in: path
          description: |
            The code identifying the external bank account you want.
          required: true
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Wallet'
        default:
          description: ERROR
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /wallets/-{id}/balance/{date}:
    get:
      summary: Retrieve wallet balance for a given date
      tags:
        - Wallets
      description: >
        This request allows you to see the details of a wallet balance at a
        given date. 
      parameters:
        - name: id
          in: path
          description: |
            The code identifying the external bank account you want.
          required: true
          schema:
            type: string
        - name: date
          in: path
          description: |
            The date used to retrieve the balance of the wallet.
          required: true
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    $ref: '#/components/schemas/ID'
                  balance:
                    $ref: '#/components/schemas/Balance'
        default:
          description: ERROR
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /financialMovements/:
    get:
      summary: Retrieve financial movements history
      tags:
        - Financial movements
      description: >
        Request the list of financial movements that has been received or sent
        on a specific period of time.
      parameters:
        - name: walletId
          in: query
          description: >
            A wallet ID to specify to retreive only financial movements
            concerning this wallet.
          required: false
          schema:
            type: string
        - name: fromDate
          in: query
          description: |
            The starting date to search financial movements on your wallets.
          required: false
          schema:
            type: string
            format: YYYY-MM-DD
        - name: toDate
          in: query
          description: |
            The ending date to search financial movements on your wallets.
          required: false
          schema:
            type: string
            format: YYYY-MM-DD
        - name: page
          in: query
          description: |
            Index of the page.
          required: false
          schema:
            type: string
            default: '1'
        - name: per_page
          in: query
          description: |
            Inumber of items returned.
          required: false
          schema:
            type: string
            default: '50'
        - name: sort
          in: query
          description: |
            A code representing the order of rendering objects.
          required: false
          schema:
            type: string
            enum:
              - ASC
              - DESC
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
                  properties:
                    id:
                      $ref: '#/components/schemas/ID'
                    bookingDate:
                      $ref: '#/components/schemas/Datetime'
                    walletId:
                      $ref: '#/components/schemas/ID'
                    valueDate:
                      $ref: '#/components/schemas/Date'
                    amount:
                      $ref: '#/components/schemas/Amount'
        default:
          description: ERROR
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /financialMovements/-{id}:
    get:
      summary: Retrieve financial movements details
      tags:
        - Financial movements
      description: >-
        Request information on a particular financial movement that has been
        credited or debited to a wallet.

        The `typeLabel` field may contain these values:
         - **rejectOperation**: Payment returned by the bank counterparty
         - **DebitForExchange**: Debit for an FX operation
         - **DebitForTransfer**: Debit linked to a transfer
         - **CreditForExchange**: Credit linked to an FX operation
         - **Immobilize**: Payment registered but not debited on value date
         - **ExternalCounterpartCredit**: Account credit
         - **debitForAccountGuaranteeCredit**: Movement related to the deposit for forward exchange transaction
         - **debitAccountGuarantee**: Movement related to the deposit for forward exchange transaction
         - **internalGuaranteeTransfer**: Movement related to the deposit for forward exchange transaction
         - **corrective**: Corrective
         - **rejectCreditDepositAccount**: Rejection of a flow credited to the account / after liquidation
         - **returnFund**: Payment returned by the recipient counterparty
         - **rejectDebit**: Rejection of an automatic debit on iBanFirst account (SDD)
         - **PrepaidCardDepositAccountDebit**: Initialization of a virtual payment card
         - **PrepaidCardDepositAccountCredit**: Recredit funds stored on a virtual payment card that expires
         - **clientFee**: Fees for using iBanFirst accounts
         - **cancelClientFee**: Commercial gesture
         - **DirectDebit**: Direct debit on iBanFirst account
      parameters:
        - name: id
          in: path
          description: |
            The ID referring the financial movement.
          required: true
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FinancialMovement'
        default:
          description: ERROR
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /externalBankAccounts/:
    post:
      summary: Submit a new external bank account
      tags:
        - External bank account
      description: >
        By submitting a new `external bank` account, you must supply the
        relevant details in order to pay a beneficiary.

        **Caution.** All your `physical` iban accounts hold with IBANFIRST will
        be automatically created when subscribing with us.


        The Submit External Bank Account service allows to reference `external
        bank` accounts which can be either your own accounts in another bank or
        a third party account.


        Adding an external bank has some rules :


        * If you have the BIC/SWIFT of the bank, just submit it, and we will
        recover informations of the bank on our own.

        * If you do not have the BIC/SWIFT of the bank, you have to refer at
        least its clearing code type, its clearing code and its name.

        * In both cases, if values are not mentionned above, they are not
        required.


        This service include verifications on the format of the account created.

        The API has been made in order to accept local specification of
        cross-boarder payments.


        The API accepts the following formats of `external bank` accounts :

          - Austrian Bankleitzahl
          - Australian Bank State Branch
          - German Bankleitzahl
          - Canadian Payments Association Payment Routing Number
          - Spanish Domestic Interbanking Code
          - Fedwire Routing Number
          - HEBIC (Hellenic Bank Identification Code)
          - Bank Code of Hong Kong
          - Irish National Clearing Code (NSC)
          - Indian Financial System Code (IFSC)
          - Italian Domestic Identification Code
          - New Zealand National Clearing Code
          - Polish National Clearing Code (KNR)
          - Portuguese National Clearing Code
          - Russian Central Bank Identification Code
          - UK Domestic Sort Code
          - Swiss Clearing Code
          - South African National Clearing Code

        Of course, it is possible to reference third party `wallet` accounts and
        execute an instant and free `wallet2wallet` payment at this
        destination. 
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
                - accountNumber
                - currency
                - holderBank
                - holder
              properties:
                accountNumber:
                  type: string
                  maxLength: 50
                  description: |
                    The recipient account number or Iban.
                currency:
                  $ref: '#/components/schemas/Currency'
                holderBank:
                  $ref: '#/components/schemas/HolderBank'
                holder:
                  $ref: '#/components/schemas/Holder'
                tag:
                  type: string
                  maxLength: 50
                  description: |
                    Custom Data.
                correspondentBic:
                  type: string
                  maxLength: 50
                  description: |
                    The intermediary bank identifier code.
        description: the account to post
        required: true
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ExternalBankAccount'
        default:
          description: ERROR
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
    get:
      summary: Get external bank accounts list
      tags:
        - External bank account
      description: >
        With the IBANFIRST API, you can list all the external bank accounts
        referenced with your account.
      parameters:
        - name: sort
          in: query
          description: >
            A code representing the order of rendering external bank accounts
            with their creation date.
          required: false
          schema:
            type: string
            enum:
              - ASC
              - DESC
        - name: page
          in: query
          description: |
            Index of the page.
          required: false
          schema:
            type: string
            default: '1'
        - name: per_page
          in: query
          description: |
            Inumber of items returned.
          required: false
          schema:
            type: string
            default: '50'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: array
                description: >
                  An array containing [External Bank Account
                  Object](../objects/objects.md#account_object) describing
                  requested external bank accounts.
                items:
                  $ref: '#/components/schemas/ExternalBankAccount'
        default:
          description: ERROR
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /externalBankAccounts/-{id}:
    get:
      summary: Get external bank account details
      tags:
        - External bank account
      description: >
        This request allows you to see the details related to an external bank
        account.
      parameters:
        - name: id
          in: path
          description: >
            The ID of the external bank account you want. As ID's are listed
            with the External Bank Account Objects, You can retrieve this by
            listing all external bank accounts for the current user. 
          required: true
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ExternalBankAccount'
        default:
          description: ERROR
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
    delete:
      summary: Delete an external bank account
      tags:
        - External bank account
      description: |
        Delete an external bank account. 
      parameters:
        - name: id
          in: path
          description: |
            The ID of the external bank account you want to delete.
          required: true
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProcessResult'
        default:
          description: ERROR
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /payments/:
    post:
      summary: Submit a payment
      tags:
        - Payments
      description: >
        You can use this request in order to schedule a new payment. 


        You may want to use the GET
        `/payments/options/-{walletId}/-{externalBankAccountId}/` before calling
        this service to get proper values for `feePaymentOption` and
        `priorityPaymentOption` concerning your payment.


        You can also use this request to get the cost of a payment.
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
                - sourceWalletId
                - externalBankAccountId
                - amount
                - desiredExecutionDate
                - feeCurrency
                - feePaymentOption
                - priorityPaymentOption
              properties:
                sourceWalletId:
                  $ref: '#/components/schemas/ID'
                externalBankAccountId:
                  $ref: '#/components/schemas/ID'
                amount:
                  $ref: '#/components/schemas/Amount'
                desiredExecutionDate:
                  $ref: '#/components/schemas/Date'
                feeCurrency:
                  $ref: '#/components/schemas/Currency'
                feePaymentOption:
                  description: >
                    A code representing the charges option to be applied to this
                    payment.
                  type: string
                  enum:
                    - BEN
                    - OUR
                    - SHARE
                    - SEPA
                    - DSP
                    - RTGS
                priorityPaymentOption:
                  description: >
                    A code representing whether this payment as a standard
                    priority, or a priority treatment in IBANFIRST an
                    correspondent bank systems.
                  type: string
                  enum:
                    - 48H
                    - 24H
                    - 1H
                tag:
                  description: >
                    A custom reference that you want to be related to this
                    payment in the system. This tag is not communicated to the
                    beneficiary.
                  type: string
                  maxLength: 50
                communication:
                  description: >
                    A Free format string representing the communication for the
                    beneficiary.
                  type: string
                  maxLength: 76
        description: |
          The payment to post
        required: true
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Payment'
        default:
          description: ERROR
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /payments/options/-{walletId}/-{externalBankAccountId}/:
    get:
      summary: Get payment options for a wallet and an external bank account
      tags:
        - Payments
      description: >
        Before doing any payments, you may use this request to get payments
        options for the payment you want to do. 

        This will give you the `priorityPaymentOption` and `feePaymentOption`
        available for the given wallet and external bank account.

        You will also get fee cost for each `priorityPaymentOption` and
        `feePaymentOption` combinations, and minimal source and target amount to
        use this combination.
      parameters:
        - name: walletId
          in: path
          description: |
            The source wallet ID you want to put your payment debit on.
          required: true
          schema:
            type: string
        - name: externalBankAccountId
          in: path
          description: >
            The target external bank account ID you want to put your payment
            credit on.
          required: true
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaymentOption'
        default:
          description: ERROR
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /payments/_{status}/:
    get:
      summary: Get payment list by status
      tags:
        - Payments
      description: >
        Request the list of payments that has been created on a specific period
        of time.
      parameters:
        - name: status
          in: path
          description: |
            A code representing the status of the payments you want to get.
          required: true
          schema:
            type: string
            enum:
              - all
              - planified
              - rejected
              - finalized
              - canceled
              - refused
              - blocked
              - waitingconfirmation
        - name: fromDate
          in: query
          description: |
            The starting date to search payments.
          required: false
          schema:
            type: string
            format: YYYY-MM-DD
        - name: toDate
          in: query
          description: |
            The ending date to search payments.
          required: false
          schema:
            type: string
            format: YYYY-MM-DD
        - name: page
          in: query
          description: |
            Index of the page.
          required: false
          schema:
            type: string
            default: '1'
        - name: per_page
          in: query
          description: |
            Inumber of items returned.
          required: false
          schema:
            type: string
            default: '50'
        - name: sort
          in: query
          description: |
            A code representing the order of rendering objects.
          required: false
          schema:
            type: string
            enum:
              - ASC
              - DESC
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Payment'
        default:
          description: ERROR
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /payments/-{id}:
    get:
      summary: Get payment details
      tags:
        - Payments
      description: |
        Retrieve the details of a specific payment.
      parameters:
        - name: id
          in: path
          description: |
            The code identifying the payment you want.
          required: true
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Payment'
        default:
          description: ERROR
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
    delete:
      summary: Delete a payemt
      tags:
        - Payments
      description: |
        The code identifying the payment you want to delete.
      parameters:
        - name: id
          in: path
          description: |
            The code identifying the payment you want to delete.
          required: true
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Payment'
        default:
          description: ERROR
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /payments/-{id}/confirm:
    put:
      summary: Confirm a payment
      tags:
        - Payments
      description: >
        Payments that has been scheduled must be confirmed in order to be
        released.

        If the payment is not confirmed before the end of scheduled date of
        operation, it will be automatically postponed to the next operation date
        available.
      parameters:
        - name: id
          in: path
          description: |
            The code identifying the payment you want to confirm.
          required: true
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Payment'
        default:
          description: ERROR
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /payments/-{id}/proofOfTransaction/:
    put:
      summary: Upload a proof of transaction for a payment
      tags:
        - Payments
      description: >
        We may ask you to provide a proof of transaction under specific terms.
        You can anticipate our request and send us your invoice or the ID of the
        beneficiary to avoid any request from us and fully automate your payment
        process.

        To send a file with this request, you have to extract the content of the
        file with a binary format, and encode it with a base64 algorithm to put
        in in the “file” field.
      parameters:
        - name: id
          in: path
          description: |
            The code identifying the payment you want to confirm.
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
                - documentType
                - tag
                - file
              properties:
                documentType:
                  description: |
                    The type of document to submit for a transaction. 
                  type: string
                  enum:
                    - invoice
                    - identity
                tag:
                  description: |
                    The name of the document to be attached.
                  type: string
                file:
                  description: >
                    The binary content of the file, encoded with a base64
                    algorithm.
                  type: string
        description: |
          The proof of transaction to upload
        required: true
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Payment'
        default:
          description: ERROR
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /rates/{currencies}:
    get:
      summary: Retrieve Rates
      tags:
        - Trades
      description: >
        The IBANFIRST-REST API provides a FX Data Feed. The Rates service is a
        read-only service, it provides "gross" rates: this is mid-market rates
        but usually with 5mn delays. You can use these rates for your internal
        needs (charts, consolidation etc..).  
      parameters:
        - name: currencies
          in: path
          description: >
            A code representing a list of CurrencyPair. Crosses must be
            separated with commas. 

            You can chain as many crosses as you want, as long as they're
            separated with commas.
          required: true
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Rate'
        default:
          description: ERROR
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /quotes/:
    post:
      summary: Create quotes (beta)
      tags:
        - Trades
      description: >-
        The Create Quote service is a read-only service permitting to ask for a
        real-time rate.
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
                - currencyPair
                - side
                - amount
                - deliveryDate
              properties:
                currencyPair:
                  $ref: '#/components/schemas/CurrencyPair'
                side:
                  description: >
                    The side repressenting the quote. `S` to sell and `B` to
                    buy.
                  type: string
                  enum:
                    - B
                    - S
                amount:
                  $ref: '#/components/schemas/Amount'
                deliveryDate:
                  $ref: '#/components/schemas/Date'
        required: true
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Quote'
        default:
          description: ERROR
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /trades/:
    post:
      summary: ' Execute trade (beta)'
      tags:
        - Trades
      description: |
        This service allows you to execute trade on the real-time Forex market.
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
                - currencyPair
                - side
                - amount
                - deliveryDate
              properties:
                currencyPair:
                  $ref: '#/components/schemas/CurrencyPair'
                side:
                  description: >
                    The side repressenting the trade. `S` to sell and `B` to
                    buy.
                  type: string
                  enum:
                    - B
                    - S
                amount:
                  $ref: '#/components/schemas/Amount'
                deliveryDate:
                  $ref: '#/components/schemas/Date'
                sourceWalletId:
                  $ref: '#/components/schemas/ID'
                deliveryWalletId:
                  $ref: '#/components/schemas/ID'
                tag:
                  type: string
                  maxLength: 76
                  description: |
                    A custom wording for the trade.
        required: true
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Trade'
        default:
          description: ERROR
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /trades/_{status}/:
    get:
      summary: Retrieve trade book (beta)
      tags:
        - Trades
      description: |
        Retrieve the list of trades executed.
      parameters:
        - name: status
          in: path
          description: |
            A code representing the status of the trades you want to get.
          required: true
          schema:
            type: string
            enum:
              - all
              - planified
              - rejected
              - finalized
              - canceled
              - refused
              - blocked
              - waitingconfirmation
        - name: fromDate
          in: query
          description: |
            The starting date to search trades.
          required: false
          schema:
            type: string
            format: YYYY-MM-DD
        - name: toDate
          in: query
          description: |
            The ending date to search trades.
          required: false
          schema:
            type: string
            format: YYYY-MM-DD
        - name: page
          in: query
          description: |
            Index of the page.
          required: false
          schema:
            type: string
            default: '1'
        - name: per_page
          in: query
          description: |
            Inumber of items returned.
          required: false
          schema:
            type: string
            default: '50'
        - name: sort
          in: query
          description: |
            A code representing the order of rendering objects.
          required: false
          schema:
            type: string
            enum:
              - ASC
              - DESC
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Trade'
        default:
          description: ERROR
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /trades/-{id}:
    get:
      summary: Retrieve trade details (beta)
      tags:
        - Trades
      description: |
        Retrieve the trade details.
      parameters:
        - name: id
          in: path
          description: |
            The code identifying the trade you want.
          required: true
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Trade'
        default:
          description: ERROR
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /documents/:
    get:
      summary: Retrieve documents list
      tags:
        - Documents
      description: >
        The IBANFIRST-REST API allows you to retrieve your documents from the
        IBANFIRST platform. This request gives you a more simple view than the
        document detail request.
      parameters:
        - name: page
          in: query
          description: |
            Index of the page.
          required: false
          schema:
            type: string
            default: '1'
        - name: per_page
          in: query
          description: |
            Inumber of items returned.
          required: false
          schema:
            type: string
            default: '50'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
                  properties:
                    id:
                      $ref: '#/components/schemas/ID'
                    name:
                      description: |
                        The name of the document.
                      type: string
                    type:
                      description: |
                        Teh type of the document.
                      type: string
                    createdDate:
                      $ref: '#/components/schemas/Datetime'
                    link:
                      description: |
                        The one-time link to the document.
                      type: string
        default:
          description: ERROR
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /documents/-{id}:
    get:
      summary: Retrieve documents details
      tags:
        - Documents
      description: |
        Retrieve details from a given document.
      parameters:
        - name: id
          in: path
          description: |
            The unique identifier of the document you want.
          required: true
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Document'
        default:
          description: ERROR
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /documents/RIB/:
    get:
      summary: Retrieve RIB
      tags:
        - Documents
      description: |
        Retrieve details of the RIB for the wallet
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Document'
        default:
          description: ERROR
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /documents/upload/{object}/{objectId}/{typeOfDocumentation}/:
    get:
      summary: Upload a document for an API object
      tags:
        - Documents
      description: >
        This service allows you to upload a document on a given object of a
        certain type. You can, for example, upload identity for you
        externalBankAccount, or invoices for your payments.


        For `externalBankAccount` object type, you can only upload `identity`
        type of documents.


        For `payment` object type, you can only upload `identity` and `invoice`
        type of documents.


        To send a file with this request, you have to extract the content of the
        file with a binary format, and encode it with a base64 algorithm to put 
        in the “file” field.
      parameters:
        - name: object
          in: path
          description: |
            The type of object you want to upload a document on.
          required: true
          schema:
            type: string
            enum:
              - externalBankAccount
              - payment
        - name: objectId
          in: path
          description: >
            The unique identifier of the object you want to upload a document
            on.
          required: true
          schema:
            type: string
        - name: typeOfDocumentation
          in: path
          description: |
            The type document you want to upload on your object.
          required: true
          schema:
            type: string
            enum:
              - identity
              - invoice
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
                - tag
                - file
              properties:
                tag:
                  description: |
                    The name of the document to be attached.
                  type: string
                file:
                  description: >
                    The binary content of the file, encoded with a base64
                    algorithm.
                  type: string
        description: |
          The document to upload
        required: true
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Document'
        default:
          description: ERROR
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /logs/:
    get:
      summary: Retrieve log list
      tags:
        - Logs
      description: >
        The IBANFIRST-REST API provides a log feed about request you made,
        allowing you to know exactly what your request do on the platform.  

        This request uses the login sent in your header to get logs about this
        user's actions.
      parameters:
        - name: page
          in: query
          description: |
            Index of the page.
          required: false
          schema:
            type: string
            default: '1'
        - name: per_page
          in: query
          description: |
            Inumber of items returned.
          required: false
          schema:
            type: string
            default: '50'
        - name: sort
          in: query
          description: |
            A code representing the order of rendering objects.
          required: false
          schema:
            type: string
            enum:
              - ASC
              - DESC
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Log'
        default:
          description: ERROR
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /logs/-{nonce}:
    get:
      summary: Retrieve log details
      tags:
        - Logs
      description: >
        In case of somewhat happens during the request, the IBANFIRST API allows
        you to retrive a log entry by its nonce.  
      parameters:
        - name: nonce
          in: path
          description: >
            The nonce used to authenticate the request. As the one in the
            header, this nonce has to be Base64 encoded. The nonce you get with
            `GET /logs` is already encoded.
          required: true
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Log'
        default:
          description: ERROR
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /APIHelpers/Auth/WithToken/{token}/:
    get:
      summary: Authenticate user and getting informations
      tags:
        - Auth
      description: >-
        This request authenticates a user and returns information about them.


        Unlike other requests, this one does not use the "api" prefix, so you
        must call it directly with
        `<url_root>/APIHelpers/Auth/WithToken/{token}/`.


        In case of an error, the error message format is different: it consists
        only of a string indicating the error.
      parameters:
        - name: token
          in: path
          description: |
            The API token of the user.
          required: true
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserInformation'
        default:
          description: ERROR
          content:
            application/json:
              schema:
                type: object
                description: |
                  Container of the error message.
                properties:
                  message:
                    type: string
                    description: |
                      The description of the error
  /APIHelpers/Auth/Invalidate/Token/{token}/:
    get:
      summary: Invalidate a token
      tags:
        - Auth
      description: >
        This request allows you to invalidate a user API token.


        Unless other requests, this request do not use the prefix "api", so you
        must call it directly with
        `<url_root>/APIHelpers/Auth/WithToken/{token}/`. Also, in case of error,
        the type of error message is different. It is only made of a string
        indicating the error.
      parameters:
        - name: token
          in: path
          description: |
            The API token of the user.
          required: true
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProcessResult'
        default:
          description: ERROR
          content:
            application/json:
              schema:
                type: object
                description: |
                  Container of the error message.
                properties:
                  message:
                    type: string
                    description: |
                      The description of the error
servers:
  - url: https://sandbox.ibanfirst.com/api
components:
  schemas:
    ExternalBankAccount:
      type: object
      properties:
        id:
          $ref: '#/components/schemas/ID'
        currency:
          $ref: '#/components/schemas/Currency'
        tag:
          type: string
          maxLength: 50
          description: |
            Custom reference of the account.
        accountNumber:
          type: string
          maxLength: 40
          description: >
            The code specifying the account (can be either an Iban or an account
            number).
        correspondentBank:
          $ref: '#/components/schemas/CorrespondantBank'
        holderBank:
          $ref: '#/components/schemas/HolderBank'
        holder:
          $ref: '#/components/schemas/Holder'
    Wallet:
      type: object
      description: |
        Representation of a Wallet
      properties:
        id:
          $ref: '#/components/schemas/ID'
        currency:
          $ref: '#/components/schemas/Currency'
        tag:
          type: string
          maxLength: 50
          description: >
            Custom reference associated to this wallet. (For internal use only,
            not communicated to any beneficiary).
        status:
          type: string
          description: |
            The code identifying the status of the account.
          enum:
            - authorized
            - locked
            - not authorized
        accountNumber:
          type: string
          maxLength: 40
          description: |
            Iban or account number.
        correspondentBank:
          $ref: '#/components/schemas/CorrespondantBank'
        holderBank:
          $ref: '#/components/schemas/HolderBank'
        holder:
          $ref: '#/components/schemas/Holder'
    Address:
      type: object
      description: |
        Representation of an address
      required:
        - country
      properties:
        street:
          type: string
          maxLength: 255
          description: |
            The street and street number for the address described.
        postCode:
          type: string
          maxLength: 15
          description: |
            The ZIP/Post code for the address described.
        city:
          type: string
          maxLength: 35
          description: |
            The city for the address described.
        province:
          type: string
          maxLength: 2
          description: >
            The province code for the address described. This field could be
            required if the country use a province system, like United States or
            Canada. To see a full list of province code, please refer to
            http://www.mapability.com/ei8ic/contest/states.php.
        country:
          type: string
          maxLength: 8
          description: >
            The two-letters abbreviation for the country, following the ISO-3166
            for the address described.
    Amount:
      type: object
      description: |
        Representation of an amount.
      required:
        - value
        - currency
      properties:
        value:
          $ref: '#/components/schemas/QuotedDecimal'
        currency:
          $ref: '#/components/schemas/Currency'
    Balance:
      type: object
      description: |
        Representation of a balance.
      properties:
        closingDate:
          $ref: '#/components/schemas/Date'
        bookingAmount:
          $ref: '#/components/schemas/Amount'
        valueAmount:
          $ref: '#/components/schemas/Amount'
    HolderBank:
      type: object
      description: |
        Representation of a beneficiary bank.
      properties:
        bic:
          type: string
          maxLength: 11
          description: >-
            Eight or eleven-digit ISO 9362 Business Identifier Code specifying
            the Recipient Bank.

            This field is optional only when the account number does not have an
            Iban format.
        clearingCodeType:
          type: string
          maxLength: 2
          description: |-
            The two-digit code specifying the local clearing network.
            If you does not have a bic, this field is required.
        clearingCode:
          type: string
          maxLength: 15
          description: >-
            The code identifying the branch number on the local clearing
            network.

            If you does not have a bic, this field is required.
        name:
          type: string
          maxLength: 120
          description: |
            The beneficiary bank name.
        address:
          $ref: '#/components/schemas/Address'
    Holder:
      type: object
      description: >
        What we call a Holder can be either an Individual or an Organisation
        that own the account.

        May also be referred to as: Beneficiary/Supplier/Vendor/Payee/Recipient.


        In the beneficiary address, only the Country is mandatory, but you can
        specify all fields to be more precise.
      required:
        - name
        - type
      properties:
        name:
          type: string
          maxLength: 100
          description: |
            The name of the account owner.
        type:
          type: string
          maxLength: 10
          description: |
            The code identifying the type of account owner.
          enum:
            - Individual
            - Corporate
        address:
          $ref: '#/components/schemas/Address'
    CorrespondantBank:
      type: object
      description: |
        Representation of a correspondant bank.
      properties:
        bic:
          type: string
          maxLength: 11
          description: >
            Eight or eleven-digit ISO 9362 Business Identifier Code specifying
            the Recipient Bank.
        name:
          type: string
          maxLength: 120
          description: |
            The beneficiary bank name.
        address:
          $ref: '#/components/schemas/Address'
    Payment:
      type: object
      description: |
        Representation of a payment.
      properties:
        id:
          $ref: '#/components/schemas/ID'
        status:
          type: string
          description: |
            The code identifying the payment status.
          enum:
            - planified
            - rejected
            - finalized
            - canceled
            - refused
            - blocked
            - waitingconfirmation
        createdDate:
          $ref: '#/components/schemas/Datetime'
        desiredExecutionDate:
          $ref: '#/components/schemas/Date'
        executionDate:
          $ref: '#/components/schemas/Date'
        amount:
          $ref: '#/components/schemas/Amount'
        counterValue:
          $ref: '#/components/schemas/Amount'
        rate:
          $ref: '#/components/schemas/Rate'
        tag:
          type: string
          maxLength: 50
          description: >
            The custom reference related to the payment. (For internal use only,
            not communicated to the beneficiary).
        externalBankAccountId:
          $ref: '#/components/schemas/ID'
        sourceWalletId:
          $ref: '#/components/schemas/ID'
        communication:
          type: string
          maxLength: 50
          description: |
            The wording of the payment.
        priorityPaymentOption:
          type: string
          description: >
            The code representing whether this payment as a normal priority or
            if it as to be treated with a priority status by all the routing
            banks.
          enum:
            - 48H
            - 24H
            - 1H
        feePaymentOption:
          type: string
          description: |
            The code identifying the charges option for this payment.
          enum:
            - BEN
            - OUR
            - SHARE
            - SEPA
            - DSP
            - RTGS
        feePaymentAmount:
          $ref: '#/components/schemas/Amount'
    PaymentOption:
      type: object
      description: >
        The representation of a payment option object. This object contains
        information about priorityPaymentOption and feePaymentOption for a
        payment.
      properties:
        paymentOption:
          type: object
          properties:
            externalBankAccountId:
              $ref: '#/components/schemas/ID'
            sourceWalletId:
              $ref: '#/components/schemas/ID'
            options:
              description: >
                An array containing all priorityPaymentOptions for the payment,
                and then, all the feePaymentOptions for this
                priorityPaymentOptions
              type: array
              items:
                type: object
                properties:
                  priorityPaymentOption:
                    description: The piority concerning the departure of the payment.
                    type: string
                    enum:
                      - 48H
                      - 24H
                      - 1H
                  feePaymentOption:
                    description: The fee option
                    type: string
                    enum:
                      - BEN
                      - OUR
                      - SHARE
                      - SEPA
                      - DSP
                      - RTGS
                  priorityCost:
                    $ref: '#/components/schemas/Amount'
                  feeCost:
                    $ref: '#/components/schemas/Amount'
                  minimumAmountSource:
                    $ref: '#/components/schemas/Amount'
                  minimumAmountTarget:
                    $ref: '#/components/schemas/Amount'
    Trade:
      type: object
      description: |
        Representation of a Trade.
      properties:
        id:
          $ref: '#/components/schemas/ID'
        appliedRate:
          $ref: '#/components/schemas/QuotedDecimal'
        currencyPair:
          $ref: '#/components/schemas/CurrencyPair'
        sourceAmount:
          $ref: '#/components/schemas/Amount'
        deliveredAmount:
          $ref: '#/components/schemas/Amount'
        createdDate:
          $ref: '#/components/schemas/Datetime'
        deliveryDate:
          $ref: '#/components/schemas/Date'
        tag:
          type: string
          maxLength: 76
          description: |
            A custom wording for the trade.
    FinancialMovement:
      type: object
      description: |
        Representation of a financial movement
      properties:
        id:
          $ref: '#/components/schemas/ID'
        bookingDate:
          $ref: '#/components/schemas/Date'
        valueDate:
          $ref: '#/components/schemas/Date'
        orderingAccountNumber:
          type: string
          maxLength: 40
          description: |
            The number referring the ordering account of the transfer.
        orderingCustomer:
          type: string
          description: >
            A free formatted String representing the ordering customer with it's
            name and it's address.
        orderingInstitution:
          type: string
          description: >
            A free formatted String representing the ordering institution with
            it's name and it's address.
        orderingAmount:
          $ref: '#/components/schemas/Amount'
        beneficiaryAccountNumber:
          type: string
          maxLength: 40
          description: |
            The number referring the beneficiary account.
        beneficiaryCustomer:
          type: string
          description: >
            A free formatted String representing the beneficiary customer with
            it's name and it's address.
        beneficiaryInstitution:
          type: string
          description: >
            A free formatted String representing the beneficiary institution
            with it's name and it's address.
        beneficiaryAmount:
          $ref: '#/components/schemas/Amount'
        remittanceInformation:
          type: string
          description: |
            The communication field.
        chargesDetails:
          type: string
          description: |
            The charges details related to the transfer.
        exchangeRate:
          type: number
          format: float
          description: |
            The exchange rate applied on the transfer.
        typeLabel:
          type: string
          description: |
            The type of the financial movement.
        internalReference:
          type: string
          description: |
            Internal Reference of the financial movement.
        description:
          type: string
          description: |
            Description of the financial movement.
    Rate:
      type: object
      description: |
        Representation of a Rate.
      properties:
        currencyPair:
          $ref: '#/components/schemas/CurrencyPair'
        midMarket:
          $ref: '#/components/schemas/QuotedDecimal'
        date:
          $ref: '#/components/schemas/Datetime'
        coreAsk:
          $ref: '#/components/schemas/QuotedDecimal'
        coreBid:
          $ref: '#/components/schemas/QuotedDecimal'
        appliedAsk:
          $ref: '#/components/schemas/QuotedDecimal'
        appliedBid:
          $ref: '#/components/schemas/QuotedDecimal'
    Quote:
      type: object
      description: |
        Representation of a quote.
      properties:
        id:
          $ref: '#/components/schemas/ID'
        appliedRate:
          $ref: '#/components/schemas/QuotedDecimal'
        currencyPair:
          $ref: '#/components/schemas/CurrencyPair'
        sourceAmount:
          $ref: '#/components/schemas/Amount'
        deliveredAmount:
          $ref: '#/components/schemas/Amount'
        createdDate:
          $ref: '#/components/schemas/Datetime'
        deliveryDate:
          $ref: '#/components/schemas/Date'
    Log:
      type: object
      description: |
        Representation of a log.
      properties:
        id:
          $ref: '#/components/schemas/ID'
        createdAt:
          $ref: '#/components/schemas/Datetime'
        closedAt:
          $ref: '#/components/schemas/Datetime'
        tokenNonce:
          type: string
          description: |
            The nonce used in the HTTP header to authenticate the request.
        remoteAddress:
          type: string
          maxLength: 15
          description: |
            The IP address of the request's emiter.
        requestMethod:
          type: string
          maxLength: 6
          description: |
            The HTTP method of the request
        uriRequested:
          type: string
          description: |
            The Universal Resource Identifier given for this request.
        parametersGiven:
          type: string
          description: |
            The optional parameters *(e.g. after the ?)* given for this request.
        requestBody:
          type: string
          description: |
            The HTTP request body.
        httpResponseCode:
          type: number
          format: int
          description: |
            The HTTP response code.
        responseBody:
          type: string
          description: |
            The text sent by the server as a result for the request.
        restErrorTypeId:
          type: number
          format: integer
          description: >
            If there is an error during the processing the request, this id
            could be used to find this error.
        login:
          type: string
          description: |
            The login used for the request.
        legalname:
          type: string
          description: |
            The legal name of the client used for the request.
    ProcessResult:
      type: object
      description: >
        As some of our process just need to send you back the confirmation that
        this process is successful, the API will send you a ProcessResult.
      properties:
        result:
          type: boolean
          description: >
            The result of the operation. `true` if the operation is successful,
            else `false`
    VirtualIBAN:
      type: object
      description: |
        Representation of a virtual IBAN.
      properties:
        IBAN:
          type: string
          maxLength: 16
          description: |
            The virtual IBAN requested.
    Error:
      type: object
      description: |
        Representation of an error.
      properties:
        errorCode:
          type: number
          format: int
          description: |
            The code referring the error.
        errorType:
          type: string
          description: >
            A short description identifying a general category for the error
            that occurred.
        link:
          type: string
          description: >
            An hyperlink to access the page that describes more accurately the
            error.
    Document:
      type: object
      description: |
        Representation of a document.
      properties:
        id:
          $ref: '#/components/schemas/ID'
        name:
          description: |
            The name of the document.
          type: string
        type:
          description: |
            The type of the document.
          type: string
        createdDate:
          $ref: '#/components/schemas/Datetime'
        lastOpennedDate:
          $ref: '#/components/schemas/Datetime'
        mimeType:
          description: |
            The MIME type of the document.
          type: string
        link:
          description: |
            The one-time link to access or download the document.
          type: string
    UserInformation:
      type: object
      description: >
        Representation of a set of user informations got by the Authentication
        service.
      properties:
        username:
          type: string
          description: |
            The username of the user.
        pass:
          type: string
          description: |
            The encrypted pass of the user.
        civility:
          type: string
          description: |
            The civility of the user.
        firstname:
          type: string
          description: |
            The first name of the user.
        lastname:
          type: string
          description: |
            The last name of the user.
        entityname:
          type: string
          description: |
            The the user's company's name.
        roles:
          type: array
          description: |
            An array describing the roles of the user.
          items:
            type: string
            description: |
              A string containing the name of the role of the user.
    ID:
      type: string
      pattern: ^[A-Za-z0-9]{*}$
      format: ^[A-Za-z0-9]{*}$
      example: Na5Dv6E
      description: >
        A String representing the id of an object. This string contains
        alpha-numeric characters, including the capital ones.
    QuotedDecimal:
      type: string
      pattern: ^((\-){?})[0-9]{12}((\.[0-9]{1-7}){?})$
      format: ^((\-){?})[0-9]{12}((\.[0-9]{1-7}){?})$
      example: '2.257'
      description: |
        A String representing a formatted floating number.
    Currency:
      type: string
      pattern: ^[A-Z]{3}$
      format: ^[A-Z]{3}$
      example: USD
      description: >
        A String representing the Three-digit ISO 4217 Currency Code of a
        currency. This String only contains capitalized letters.
    Date:
      type: string
      pattern: ^[0-9]{4}\-[0-9]{2}\-[0-9]{2}$
      format: ^[0-9]{4}\-[0-9]{2}\-[0-9]{2}$
      example: '2016-01-01'
      description: |
        A String representing a date by its year, month and day in month.
            
    Datetime:
      type: string
      pattern: >-
        ^((19[0,99]|2[0-9]{3})\-(0[1-9]|1[012])\-([012][0-9]|3[01])\
        ([01][0-9]|2[0-3])\:([0-5][0-9])\:([0-5][0-9]))$
      format: >-
        ^((19[0,99]|2[0-9]{3})\-(0[1-9]|1[012])\-([012][0-9]|3[01])\
        ([01][0-9]|2[0-3])\:([0-5][0-9])\:([0-5][0-9]))$
      example: '2016-01-01 00:00:00'
      description: >
        A String representing a date by its year, month, day in month, hour,
        minute and second.
    CurrencyPair:
      type: string
      pattern: ^[A-Z]{6}$
      format: ^[A-Z]{6}$
      example: EURUSD
      description: >
        A String representing two concatenated Three-digit ISO 4217 Currency
        Code of a currency. This String only contains capitalized letters.
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
