openapi: 3.0.1
info:
  license:
    name: Khipu Open Data API
    url: https://khipu.com
  title: Banca Central Argentina
  description: ''
  version: v1.0
servers:
  - url: https://api.khipu.com
    description: Production
security:
  - JWT: []
  - Api-Key: []
paths:
  /v1/ar/services/bcra.gob.ar/credit-situation:
    post:
      summary: Credit Situation
      description: >-
        Este método se conecta a la **Banca Central Argentina** y retorna la
        situación crediticia del CUIT/CUIL proporcionado.


        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: fetchTransactions_1
      parameters: []
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/NoLoginRequiredRequest'
        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/SituationResponseSyncOk'
        '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:
    DocumentNumber:
      type: string
      maxLength: 20
      description: CUIT/CUIL associated to the entity.
      example: '000011887755'
    NoLoginRequiredData:
      type: object
      description: Information needed to consult for the user.
      required:
        - DocumentNumber
      properties:
        DocumentNumber:
          $ref: '#/components/schemas/DocumentNumber'
    NoLoginRequiredRequest:
      type: object
      description: Object to make a request to the OpenData service.
      required:
        - RequestData
      properties:
        RequestData:
          $ref: '#/components/schemas/NoLoginRequiredData'
        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
    AmountSituation:
      type: object
      description: Amount of money informed by the entity
      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 expressed in thousands of the unit.
          example: 10
        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
    ResponseData:
      type: object
      nullable: true
      description: Container for credit situation.
      properties:
        Situation:
          type: array
          items:
            type: object
            required:
              - Entity
              - Situation
              - Amount
              - Days of Delay
            properties:
              Entity:
                type: string
                description: Denomination of the informant Entity
                example: BANCA CENTRAL DE ARGENTINA
              Situation:
                type: string
                enum:
                  - Normal Situation
                  - With special follow-up
                  - With issues
                  - With high risk of insolvency
                  - Non-recoverable
                  - Non-recoverable due to technical disposition
                description: >-
                  Indicator for the debtor's classification indicated by the
                  Entity
                example: Normal Situation
              Amount:
                $ref: '#/components/schemas/AmountSituation'
              DaysOfDelay:
                type: string
                example: N/A
                description: >-
                  If the debtor belongs to the portfolio for consumption or
                  housing in an abnormal status, is classified by refinancing,
                  obligated recategorization, legal situation -judical or
                  extrajudical concordants, preventive bankrupcy, judical
                  gestion or bankrupcy- or irrecoverable due to technical
                  disposition, the days of delay will be informed, the text
                  'N/A' indicates 'Not Applicable'
    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.
    SituationResponseSyncOk:
      type: object
      description: >-
        Object with the response from OpenData service for BCRA credit
        situation, 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/ResponseData'
          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
    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
