openapi: 3.0.1
info:
  license:
    name: Khipu Open Data API
    url: https://khipu.com
  title: Santander
  description: ''
  version: v1.0
servers:
  - url: https://api.khipu.com
    description: Production
security:
  - JWT: []
  - Api-Key: []
paths:
  /v1/ar/banking/personal/santander.com.ar/pending/current-day/ACY/balances:
    post:
      summary: Pending Current Day Balances (ACY)
      description: >-
        Este método se conecta a la cuenta especificada por el usuario en
        **Banco Santander Argentina** y retorna el balance de la cuenta del día
        actual. (también conocido como "Saldo en Cuenta").


        El uso del campo `CallbackUrl` desencadenará un proceso asíncrono y los
        datos resultantes se enviarán más tarde al webhook especificado. Esta es
        la forma preferida de interactuar con nuestros servicios, ya que asegura
        que se harán todos los esfuerzos para extraer los datos y cumplir  con
        su solicitud dentro de un plazo razonable. Si desea la respuesta de
        inmediato, omita el campo `CallbackUrl` pero tenga en cuenta que puede
        provocar tiempos de espera dependiendo del tamaño del resultado de los
        datos y las condiciones
      operationId: fetchPendingCurrentDayBalances_1
      parameters: []
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BancoSantanderArgentinaBalanceRequest'
        required: true
      responses:
        '200':
          description: >-
            Successful operation. Returns a JSON object with the pending current
            day balance for the specified account in the `Data` field.
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/BancoSantanderArgentinaBalanceResponseSyncOk
        '202':
          description: >-
            Successful operation. Returns a JSON message informing the result of
            the request operation. The complete response, with the same schema
            as the sync version, will be sent to the callback URL provided.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BalanceResponseAsync'
        '400':
          description: Bad Request
        '401':
          description: Unauthorized - Invalid or missing credentials
        '404':
          description: Not found - Resource not available
        '500':
          description: Remote service error :(
components:
  securitySchemes:
    JWT:
      type: http
      scheme: bearer
      bearerFormat: JWT
    Api-Key:
      type: apiKey
      in: header
      name: x-api-key
  schemas:
    AccountLinkCredential:
      type: object
      description: Use this value to call the service using the pre-generated account link.
      required:
        - AccountLink
      properties:
        AccountLink:
          type: string
          description: Token generated to access the bank account.
          example: >-
            dFyRCVYNM0aGb1LSR/0B8e+eSVr1Zf1xj9YHmMVoiZWk28XtWEyIxEbGXnr1EdvS+QBPzjweau7tbf5QlDv97IQ2jwfUB==
    BancoSantanderArgentinaAuthCredential:
      type: object
      description: >-
        Values needed to authenticate the user in the bank's website. The
        `EnterpriseIdentity` ("RUT") value is only needed when your user has
        more than one representation.
      required:
        - Username
        - Password
        - DocumentNumber
      properties:
        Username:
          maxLength: 12
          minLength: 1
          type: string
          description: User identification with access to the bank's account.
          example: example00
        Password:
          maxLength: 24
          minLength: 1
          type: string
          description: Account password for the website.
          example: wxyz1234!@#$
        DocumentNumber:
          maxLength: 12
          minLength: 1
          type: string
          description: >-
            User's document number identification with access to the bank's
            account (DNI).
          example: '999999999'
    AccountNumber:
      type: string
      maxLength: 20
      description: Bank account number.
      example: '000011887755'
    BancoSantanderArgentinaBalanceRequestData:
      type: object
      description: >-
        Information needed to connect to a bank account and extract data from
        the current balance. Mandatory fields indicates values that are
        necessary to identify the desired account.
      required:
        - AccountNumber
        - Currency
      properties:
        AccountCredential:
          deprecated: true
          description: >-
            Attention: The use of this field is mandatory when using Api Key
            authentication.
          oneOf:
            - $ref: '#/components/schemas/AccountLinkCredential'
            - $ref: '#/components/schemas/BancoSantanderArgentinaAuthCredential'
        AccountNumber:
          $ref: '#/components/schemas/AccountNumber'
    BancoSantanderArgentinaBalanceRequest:
      type: object
      description: Object to make a request to the OpenData service.
      required:
        - RequestData
      properties:
        RequestData:
          $ref: '#/components/schemas/BancoSantanderArgentinaBalanceRequestData'
        CallbackUrl:
          maxLength: 255
          type: string
          description: URL to send the response message using a POST verb.
          example: https://my-api.my-business.com/api/open-data-response
    CreditDebitIndicator:
      type: string
      enum:
        - Credit
        - Debit
      description: Indicates whether the transaction is a credit or a debit entry.
      example: Credit
    AmountBalance:
      type: array
      minItems: 0
      description: Amount of money of the cash balance.
      required:
        - Amount
        - Currency
      items:
        type: object
        required:
          - Amount
          - Currency
        properties:
          Amount:
            type: number
            format: float
            description: >-
              A number of monetary units specified in an active currency where
              the unit of currency is explicit and compliant with ISO 4217.
            example: 10.11
          Currency:
            type: string
            pattern: ^[A-Z]{3,3}$
            description: >-
              A code allocated to a currency by a Maintenance Agency under an
              international identification scheme, as described in the latest
              edition of the international standard ISO 4217 "Codes for the
              representation of currencies and funds".
            example: ARS
    Balance:
      type: array
      minItems: 0
      description: Set of elements used to define the balance details.
      items:
        type: object
        required:
          - AccountId
          - CreditDebitIndicator
          - DateTime
          - Type
          - Amount
        properties:
          AccountId:
            maxLength: 40
            type: string
            description: >-
              A unique and immutable identifier used to identify the account
              resource. This identifier has no meaning to the account owner.
            example: AR-001-00900888777
          CreditDebitIndicator:
            $ref: '#/components/schemas/CreditDebitIndicator'
          DateTime:
            type: string
            format: date-time
            description: Indicates the date (and time) of the balance.
            example: 2022-11-30T01:55:00-0300
          Type:
            type: string
            enum:
              - ClosingAvailable
              - ClosingBooked
              - ClosingCleared
              - Expected
              - ForwardAvailable
              - Information
              - InterimAvailable
              - InterimBooked
              - InterimCleared
              - OpeningAvailable
              - OpeningBooked
              - OpeningCleared
              - PreviouslyClosedBooked
            description: Balance type, in a coded form.
            example: InterimAvailable
          Amount:
            $ref: '#/components/schemas/AmountBalance'
    DataBalance:
      type: object
      nullable: true
      description: Container for Balances. Can be an empty array.
      properties:
        Balance:
          $ref: '#/components/schemas/Balance'
    error:
      type: object
      nullable: true
      description: >-
        Object with the error details, used when `Status=ERROR`. If `Status=OK`
        this field will be null. You can read a complete explanation of this
        object visiting [this link](https://docs.khipu.com/portal/en/errors/)
      example: null
      properties:
        Code:
          type: string
          description: Internal system code that identifies the error.
          example: E201
        Type:
          type: string
          enum:
            - RETRY_IMMEDIATELY
            - DO_NOT_RETRY
            - WAIT_4_HOURS_BEFORE_RETRY
            - RETRY_AFTER_NOTIFICATION
          description: >-
            Indicates how to treat this specific error code, based on the type
            of error.
          example: RETRY_IMMEDIATELY
        Description:
          type: string
          description: Description associated with the error code.
          example: >-
            El servicio destino utilizado para la extracción de datos no se
            encuentra disponible.
    BancoSantanderArgentinaBalanceResponseSyncOk:
      type: object
      description: >-
        Object with the response from OpenData service for the Balance
        operations, in synchronous mode.
      required:
        - OperationId
        - Status
        - Data
        - AdditionalInformation
        - Error
        - LifeSpan
      properties:
        OperationId:
          maxLength: 36
          type: string
          description: Unique identifier of the operation.
          example: 6baf6c19-e485-463b-ae24-a821b025c8a4
        Status:
          type: string
          enum:
            - OK
            - ERROR
          description: >-
            Operation status. `OK` means that the service was executed
            successfully even if it does not return Data. `ERROR` indicates that
            something happened that prevented the successful completion of the
            process.
          example: OK
        Data:
          $ref: '#/components/schemas/DataBalance'
          nullable: true
        AdditionalInformation:
          type: string
          description: >-
            This field can be used to display relevant information specific to
            the response, for instance indicating that the `Data` field is
            incomplete.
          example: null
          nullable: true
        Error:
          $ref: '#/components/schemas/error'
          nullable: true
        LifeSpan:
          type: string
          description: '`null` in sync requests.'
          example: null
          nullable: true
    BalanceResponseAsync:
      type: object
      description: >-
        Object with the response from OpenData service for the Balance
        operations, in asynchronous mode.
      required:
        - OperationId
        - Status
        - Data
        - AdditionalInformation
        - Error
        - LifeSpan
      properties:
        OperationId:
          maxLength: 36
          type: string
          description: Unique identifier of the operation.
          example: 6baf6c19-e485-463b-ae24-a821b025c8a4
        Status:
          type: string
          description: >-
            Operation status. When making async requests it will always return
            `OK`.
          example: OK
        Data:
          type: object
          description: '`null` in async requests.'
          example: null
        AdditionalInformation:
          type: string
          description: Operation message, can be used to display additional information.
          example: Data will be sent to the callback URL.
        Error:
          type: object
          description: '`null` in async requests.'
          example: null
        LifeSpan:
          type: string
          format: date-time
          description: >-
            Max estimated delivery date for async requests, in ISO 8601 date
            format, UTC timezone.
          example: 2017-07-22T00:00:00-0400
