openapi: 3.0.3
info:
  license:
    name: Khipu Operation Descriptor API
    url: https://khipu.com
  title: Operation Descriptor Generator API
  description: >-
    The Operation Descriptor Generator API (v1.0) from Khipu allows merchants to
    create a unique  operation identifier along with an encrypted descriptor for
    initiating new bank transfer  operations. Using a single endpoint (POST
    /v1/descriptor/payment), you submit the  origin bank ID and detailed
    transaction parameters—like transfer amount, currency,  payer information,
    and recipient account details. On a successful call, the API returns  a JSON
    object containing an operation.id (a UUID) and an operation.description
    field:  a Base64‑encoded encrypted descriptor designed for use in secure
    bank transfer flows. Authentication is handled via the x-api-key header.
  version: v1.0
  x-logo:
    url: https://s3.amazonaws.com/static.khipu.com/2021/logo-transparent.png
    altText: Logo de Khipu
    href: https://khipu.com
servers:
  - url: https://api.khipu.com
    description: Production
security:
  - Api-Key: []
paths:
  /v1/descriptor/payment:
    post:
      summary: Create payment operation descriptor
      description: >-
        This method creates a new operation Id and a operation descriptor for a
        new transfer
      operationId: createPayment
      parameters: []
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/paymentDescriptorRequest'
        required: true
      responses:
        '200':
          description: >-
            Successful operation. Returns a JSON object with a new operation id
            and the encrypted descriptor.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/paymentDescriptorResult'
        '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:
    Api-Key:
      type: apiKey
      in: header
      name: x-api-key
  schemas:
    paymentDescriptorRequest:
      type: object
      description: Object to post a request for a new Operation Descriptor.
      required:
        - bank
        - params
      properties:
        bank:
          maxLength: 255
          type: string
          description: The id of the origin bank for this operation.
          example: dSXgfesd
        params:
          type: object
          description: required parameters for this operation
          properties:
            subject:
              type: string
              description: A description of the transfer operation
              example: Some transfer example
            amount:
              type: number
              description: The amount of the transfer
              example: 1000
            currency_code:
              type: string
              description: The currency code in the ISO 4217.
              example: CLP
            payer_email:
              type: string
              description: E-mail address of the person doing the transfer
              example: someone@example.com
            payer_name:
              type: string
              description: The name of the person doing the transfer
              example: Jane Doe
            target_account_bank:
              type: string
              description: The name of the target bank as seen in the origin bank
              example: Awesome Bank
            target_account_alias:
              type: string
              description: >-
                An alias to use for the new account in case it is the first
                transfer
              example: My friend
            target_account_name:
              type: string
              description: The real name of the destinatary
              example: John Doe
            target_account_number:
              type: string
              description: The target bank account identifier
              example: 123459876
            target_account_personal_identifier:
              type: string
              description: The identifier of the target account
              example: 12.345.678-9
    paymentDescriptorResult:
      type: object
      description: Object with the result of a Payment Operation Descriptor request.
      required:
        - operation
      properties:
        operation:
          type: object
          properties:
            id:
              type: string
              description: Unique subscription identifier.
              example: 13a0f1aa-5e47-4894-aa8b-282dd19593ec
            description:
              type: string
              description: The encrypted descriptor to send encoded in Base64
              example: >-
                eyJtIjoicVlvQU92VllMWm5NVDg2UEovNjNJcGFtRnFQUUNDY
                lNDcHZBZ283OFNlM01VWVBJZU1sZk05a0NzSWVwRkJPcnZlbG
                FwSCtaS3pCRmd3YTBybkVKamtaV3gxYm1iTjd2ZzhhNGtuV1N
                FV3BwclhtVHBkcXRQRXlsVHlhSGtsdTdYTkRtVHZadzlGZlox
                NFgvRDI3dDFvVkFaVWdKN2JqcXdOQXdsYUM0ZmZSL2xmQzJiR
                C9kVElJcGtJc0NTVGxDS1YyTThsbDNYV1dUZFFwdXlzN0xiNU
                FvNVRvVW54NlB0V0Zzd2hxQkVEVmdUWXRhclFqdFBNbUFvRzQ
                1akdKdUk2cmhDU25taG9weEVFM0YwOVgzY0hHSDZzSzVsMl==
