openapi: 3.1.0
info:
  license:
    name: Khipu Open Data API
    url: https://khipu.com
  title: Banco Credicoop
  description: ''
  version: v1.0
servers:
  - url: https://api.khipu.com
    description: Production
security:
  - JWT: []
  - Api-Key: []
paths:
  /v1/ar/banking/business/bancocredicoop.coop/transactions:
    post:
      summary: Transactions
      description: >-
        Este método se conecta a la cuenta especificada por el usuario en
        **Banco  Credicoop-Empresas** y retorna las transacciones del día
        actual.


        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 de la red.
      operationId: fetchTransactions_1
      parameters: []
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Request'
        required: true
      responses:
        '200':
          description: >-
            Successful operation. Returns a JSON object with the transactions
            for the specified account in the `Data` field.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TransactionsResponseSyncOk'
        '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/TransactionsResponseAsync'
        '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==
    AccountAuthCredential:
      type: object
      description: Values needed to authenticate the user in the bank's website.
      required:
        - DocumentNumber
        - Username
        - Password
      properties:
        DocumentNumber:
          maxLength: 10
          type: string
          description: >-
            Document identification (DNI or other identified by the
            `DocumentType` field).
          example: 11.111.111
        Username:
          maxLength: 20
          type: string
          description: User name needed to login in Argentine banks.
          example: aaaa4444
        Password:
          maxLength: 24
          minLength: 1
          type: string
          description: Account password for the website.
          example: wxyz1234!@#$
        DocumentType:
          type: string
          enum:
            - DNI
            - PASAPORTE
            - RENAPER
          description: Type of document used to identify the user
          example: DNI
    AccountNumber:
      type: string
      maxLength: 20
      description: Bank account number.
      example: '000011887755'
    RequestData:
      type: object
      description: >-
        Information needed to connect to the user's bank account and extract
        data. Mandatory fields indicates values that are necessary to identify
        the desired account.
      required:
        - AccountNumber
      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/AccountAuthCredential'
        AccountNumber:
          $ref: '#/components/schemas/AccountNumber'
    Request:
      type: object
      description: Object to make a request to the OpenData service.
      required:
        - RequestData
      properties:
        RequestData:
          $ref: '#/components/schemas/RequestData'
        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
    AmountTransaction:
      type: object
      description: Amount of money in the cash transaction entry.
      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: 10000
        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: CLP
    AmountBalanceTransaction:
      type: object
      description: >-
        Amount of money of the cash balance after a transaction entry is applied
        to the account.
      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: 10000
        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: CLP
    BalanceTransaction:
      type: object
      description: >-
        Set of elements used to define the balance as a numerical representation
        of the net increases and decreases in an account after a transaction
        entry is applied to the account.
      required:
        - CreditDebitIndicator
        - Type
        - Amount
      properties:
        CreditDebitIndicator:
          $ref: '#/components/schemas/CreditDebitIndicator'
        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: ClosingBooked
        Amount:
          $ref: '#/components/schemas/AmountBalanceTransaction'
    BankTransactionCode:
      type: object
      description: >-
        Set of elements used to fully identify the type of underlying
        transaction resulting in an entry.
      required:
        - Code
        - SubCode
      properties:
        Code:
          type: string
          pattern: ^[A-Z]{4,4}$
          description: Specifies the family within a domain.
          example: RCDT
        SubCode:
          type: string
          pattern: ^[A-Z]{4,4}$
          description: Specifies the sub-product family within a specific family.
          example: DMCT
    CardInstrument:
      type: object
      description: Set of elements to describe the card instrument used in the transaction.
      required:
        - CardSchemeName
      properties:
        AuthorisationType:
          type: string
          enum:
            - ConsumerDevice
            - Contactless
            - None
            - PIN
          description: The card authorisation type.
          example: Contactless
        CardSchemeName:
          type: string
          enum:
            - AmericanExpress
            - Diners
            - Discover
            - MasterCard
            - VISA
          description: Name of the card scheme.
          example: AmericanExpress
        Identification:
          maxLength: 34
          type: string
          description: >-
            Identification assigned by an institution to identify the card
            instrument used in the transaction. This identification is known by
            the account owner, and may be masked.
          example: BLACK CARD ****6328
        Name:
          maxLength: 70
          type: string
          description: Name of the cardholder using the card instrument.
          example: JOHN DOE
    ChargeAmount:
      type: object
      description: Transaction charges to be paid by the charge bearer.
      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: 10000
        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: CLP
    CreditorAccount:
      type: object
      description: >-
        Unambiguous identification of the account of the creditor, in the case
        of a debit transaction.
      properties:
        Identification:
          maxLength: 256
          type: string
          description: >-
            Identification assigned by an institution to identify an account.
            This identification is known by the account owner.
          example: '99056723'
        Name:
          maxLength: 350
          type: string
          description: >-
            The account name is the name or names of the account owner(s)
            represented at an account level, as displayed by the ASPSP's online
            channels. Note, the account name is not the product name or the
            nickname of the account.
          example: JOHN DOE
        SchemeName:
          type: string
          description: >-
            Name of the identification scheme, in a coded form as published in
            an external list.
          example: BBAN
        SecondaryIdentification:
          maxLength: 34
          type: string
          description: >-
            This is secondary identification of the account, as assigned by the
            account servicing institution. This can be used by building
            societies to additionally identify accounts with a roll number (in
            addition to a sort code and account number combination).
          example: 1373-86353478
    PostalAddress:
      type: object
      description: >-
        Information that locates and identifies a specific address, as defined
        by postal services.
      properties:
        AddressLine:
          type: array
          maxItems: 7
          minItems: 0
          description: >-
            Information that locates and identifies a specific address, as
            defined by postal services, presented in free format text.
          items:
            maxLength: 70
            type: string
            example: AGUSTINAS 1234, SANTIAGO
        AddressType:
          type: string
          enum:
            - Business
            - Correspondence
            - DeliveryTo
            - MailTo
            - POBox
            - Postal
            - Residential
            - Statement
          description: Identifies the nature of the postal address.
          example: Business
        BuildingNumber:
          maxLength: 16
          type: string
          description: Number that identifies the position of a building on a street.
          example: '1234'
        Country:
          type: string
          pattern: ^[A-Z]{2,2}$
          description: Nation with its own government.
          example: CL
        CountrySubDivision:
          maxLength: 35
          type: string
          description: Identifies a subdivision of a country such as state, region, county.
          example: REGION METROPOLITANA
        Department:
          maxLength: 70
          type: string
          description: Identification of a division of a large organisation or building.
          example: OFICINA SANTIAGO CENTRO
        PostCode:
          maxLength: 16
          type: string
          description: >-
            Identifier consisting of a group of letters and/or numbers that is
            added to a postal address to assist the sorting of mail.
          example: '8340422'
        StreetName:
          maxLength: 70
          type: string
          description: Name of a street or thoroughfare.
          example: CALLE MONEDA
        SubDepartment:
          maxLength: 70
          type: string
          description: >-
            Identification of a sub-division of a large organisation or
            building.
          example: BANCA PERSONAS
        TownName:
          maxLength: 35
          type: string
          description: >-
            Name of a built-up area, with defined boundaries, and a local
            government.
          example: SANTIAGO
    CreditorAgent:
      type: object
      description: Financial institution servicing an account for the creditor.
      properties:
        Identification:
          maxLength: 35
          type: string
          description: >-
            Unique and unambiguous identification of a financial institution or
            a branch of a financial institution.
          example: DEMO BANK
        Name:
          maxLength: 140
          type: string
          description: >-
            Name by which an agent is known and which is usually used to
            identify that agent.
          example: DEMO BANK CHILE
        SchemeName:
          type: string
          description: >-
            Name of the identification scheme, in a coded form as published in
            an external list.
          example: BICFI
        PostalAddress:
          $ref: '#/components/schemas/PostalAddress'
    InstructedAmount:
      type: object
      description: >-
        Amount of money to be moved between the debtor and creditor, before
        deduction of charges, expressed in the currency as ordered by the
        initiating party.
      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: 5000
        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: USD
    CurrencyExchange:
      type: object
      description: Set of elements used to provide details on the currency exchange.
      required:
        - ExchangeRate
        - SourceCurrency
      properties:
        ContractIdentification:
          maxLength: 35
          type: string
          description: >-
            Unique identification to unambiguously identify the foreign exchange
            contract.
          example: '84783113'
        ExchangeRate:
          type: string
          description: >-
            Factor used to convert an amount from one currency into another.
            This reflects the price at which one currency was bought with
            another currency. Usage: ExchangeRate expresses the ratio between
            UnitCurrency and QuotedCurrency (ExchangeRate =
            UnitCurrency/QuotedCurrency).
          example: '691.907186'
        QuotationDate:
          type: string
          format: date-time
          description: Date and time at which an exchange rate is quoted.
          example: 2019-05-15T09:45:00-0400
        SourceCurrency:
          type: string
          pattern: ^[A-Z]{3,3}$
          description: >-
            Currency from which an amount is to be converted in a currency
            conversion.
          example: USD
        TargetCurrency:
          type: string
          pattern: ^[A-Z]{3,3}$
          description: >-
            Currency into which an amount is to be converted in a currency
            conversion.
          example: CLP
        UnitCurrency:
          type: string
          pattern: ^[A-Z]{3,3}$
          description: >-
            Currency in which the rate of exchange is expressed in a currency
            exchange. In the example 1USD = xxxCLP, the unit currency is USD.
          example: USD
        InstructedAmount:
          $ref: '#/components/schemas/InstructedAmount'
    DebtorAccount:
      type: object
      description: >-
        Unambiguous identification of the account of the debtor, in the case of
        a credit transaction.
      properties:
        Identification:
          maxLength: 256
          type: string
          description: >-
            Identification assigned by an institution to identify an account.
            This identification is known by the account owner.
          example: '99056723'
        Name:
          maxLength: 350
          type: string
          description: >-
            The account name is the name or names of the account owner(s)
            represented at an account level, as displayed by the ASPSP's online
            channels. Note, the account name is not the product name or the
            nickname of the account.
          example: JOHN DOE
        SchemeName:
          type: string
          description: >-
            Name of the identification scheme, in a coded form as published in
            an external list.
          example: BBAN
        SecondaryIdentification:
          maxLength: 34
          type: string
          description: >-
            This is secondary identification of the account, as assigned by the
            account servicing institution. This can be used by building
            societies to additionally identify accounts with a roll number (in
            addition to a sort code and account number combination).
          example: 1373-86353478
    DebtorAgent:
      type: object
      description: Financial institution servicing an account for the debtor.
      properties:
        Identification:
          maxLength: 35
          type: string
          description: >-
            Unique and unambiguous identification of a financial institution or
            a branch of a financial institution.
          example: DEMO BANK
        Name:
          maxLength: 140
          type: string
          description: >-
            Name by which an agent is known and which is usually used to
            identify that agent.
          example: DEMO BANK CHILE
        SchemeName:
          type: string
          description: >-
            Name of the identification scheme, in a coded form as published in
            an external list.
          example: BICFI
        PostalAddress:
          $ref: '#/components/schemas/PostalAddress'
    MerchantDetails:
      type: object
      description: Details of the merchant involved in the transaction.
      properties:
        MerchantCategoryCode:
          maxLength: 4
          minLength: 3
          type: string
          description: >-
            Category code conform to ISO 18245, related to the type of services
            or goods the merchant provides for the transaction.
          example: '2741'
        MerchantName:
          maxLength: 350
          type: string
          description: Name by which the merchant is known.
          example: MI COMERCIO
    ProprietaryBankTransactionCode:
      type: object
      description: Set of elements to fully identify a proprietary bank transaction code.
      required:
        - Code
      properties:
        Code:
          maxLength: 35
          type: string
          description: >-
            Proprietary bank transaction code to identify the underlying
            transaction.
          example: TRANSFERENCIA
        Issuer:
          maxLength: 35
          type: string
          description: >-
            Identification of the issuer of the proprietary bank transaction
            code.
          example: DEMO BANK
    Transaction:
      type: array
      minItems: 0
      description: Provides further details on an entry in the report.
      items:
        type: object
        required:
          - AccountId
          - BookingDateTime
          - CreditDebitIndicator
          - Status
          - 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: '873458'
          AddressLine:
            maxLength: 70
            type: string
            description: >-
              Information that locates and identifies a specific address for a
              transaction entry, that is presented in free format text.
            example: SUCURSAL SANTIAGO CENTRO
          BookingDateTime:
            type: string
            format: date-time
            description: >-
              Date and time when a transaction entry is posted to an account on
              the account servicer's books. Usage: Booking date is the expected
              booking date, unless the status is booked, in which case it is the
              actual booking date.
            example: 2017-07-22T00:00:00-0400
          CreditDebitIndicator:
            $ref: '#/components/schemas/CreditDebitIndicator'
          StatementReference:
            type: array
            minItems: 0
            description: >-
              Unique reference for the statement. This reference may be
              optionally populated if available.
            items:
              maxLength: 35
              type: string
              example: a2c557c63450
          Status:
            type: string
            enum:
              - Booked
              - Pending
              - Rejected
            description: >-
              Status of a transaction entry on the books of the account
              servicer.
            example: Booked
          TransactionId:
            maxLength: 210
            type: string
            description: >-
              Unique identifier for the transaction within an servicing
              institution. This identifier is both unique and immutable.
            example: c830d0c9a0904ea6badbaf8e25ff6e87
          TransactionInformation:
            maxLength: 500
            type: string
            description: >-
              Further details of the transaction. This is the transaction
              narrative, which is unstructured text.
            example: PAGO DE CUENTAS
          TransactionMutability:
            type: string
            enum:
              - Mutable
              - Immutable
            description: Specifies the Mutability of the Transaction record.
            example: Immutable
          TransactionReference:
            maxLength: 210
            type: string
            description: Unique reference for the transaction.
            example: 09cce92d-494b-4f29-8584-6a0409a052c7
          ValueDateTime:
            type: string
            format: date-time
            description: >-
              Date and time at which assets become available to the account
              owner in case of a credit entry, or cease to be available to the
              account owner in case of a debit transaction entry. Usage: If
              transaction entry status is pending and value date is present,
              then the value date refers to an expected/requested value date.
              For transaction entries subject to availability/float and for
              which availability information is provided, the value date must
              not be used. In this case the availability component identifies
              the number of availability days.
            example: 2017-07-21T17:32:28-0400
          Amount:
            $ref: '#/components/schemas/AmountTransaction'
          Balance:
            $ref: '#/components/schemas/BalanceTransaction'
          BankTransactionCode:
            $ref: '#/components/schemas/BankTransactionCode'
          CardInstrument:
            $ref: '#/components/schemas/CardInstrument'
          ChargeAmount:
            $ref: '#/components/schemas/ChargeAmount'
          CreditorAccount:
            $ref: '#/components/schemas/CreditorAccount'
          CreditorAgent:
            $ref: '#/components/schemas/CreditorAgent'
          CurrencyExchange:
            $ref: '#/components/schemas/CurrencyExchange'
          DebtorAccount:
            $ref: '#/components/schemas/DebtorAccount'
          DebtorAgent:
            $ref: '#/components/schemas/DebtorAgent'
          MerchantDetails:
            $ref: '#/components/schemas/MerchantDetails'
          ProprietaryBankTransactionCode:
            $ref: '#/components/schemas/ProprietaryBankTransactionCode'
          SupplementaryData:
            type: array
            description: >-
              Additional information that can not be captured in the structured
              fields and/or any other specific block.
            items: {}
    DataTransaction:
      type: object
      description: Container for Transactions. Can be an empty array.
      properties:
        Transaction:
          $ref: '#/components/schemas/Transaction'
    error:
      type: object
      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.
    TransactionsResponseSyncOk:
      type: object
      description: >-
        Object with the response from OpenData service for the Transactions
        operations, in synchronous mode, when `Status` is "OK".
      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/DataTransaction'
        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
        Error:
          $ref: '#/components/schemas/error'
        LifeSpan:
          type: string
          description: '`null` in sync requests.'
          example: null
    TransactionsResponseAsync:
      type: object
      description: >-
        Object with the response from OpenData service for the Transactions
        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
