Especificación openAPI de la API de Pago Fácil

Con la finalidad de facilitar la confección de los objetos, disponibilizamos el archivo .yaml con la Especificación openAPI de la API de Pago Fácil.

---
openapi: 3.0.0
info:
  title: API Pago Facil
  description: API de Pago Fácil
  version: 2.1.5
servers:
- url: https://apis.pgf.cl
  description: PRODUCTION
- url: https://apis-dev.pgf.cl
  description: DEVELOPMENT
tags:
- name: auth
- name: remittances
- name: trxs
- name: webhooks
- name: payments
- name: users
- name: indicators
paths:
  /users/login:
    post:
      tags:
      - auth
      summary: Autentificación con usuario y clave.
      description: Retorna un token con el que se deben realizar las llamadas al resto de los endpoints del API. Sin este token no se pueden acceder a los endpoints. <br> Se deben ingresar "user" y "password" válidos, creados a través del dashborad de Pago Fácil <br> No requiere configuración de autorización <br> Endpoints <br> - Producción https://apis.pgf.cl - Desarrollo https://apis-dev.pgf.cl
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/loginBody'
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/login_response'
        "400":
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/inline_response_400'
        "500":
          description: Internal Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/inline_response_500'
        "401":
          description: Invalid user name or password
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/inline_response_401'
  /indicators/remittances:
    get:
      tags:
      - indicators
      summary: Obtiene los datos de los abonos (remittances) realizados en una fecha específica y los futuros, además del saldo disponible
      description: "1.-Requiere el uso del Token rescatado en el LOGIN (autorización heredada) <br> 2.-Se debe configurar los parámetros como \"Query Params\" <br> 3.-Solo los usuarios Administradores pueden obtener información etregando el parámetros \"IdUser\". Para usuarios no Administradores este parámetro no se informa y siempre retronará información del usuario logado. 4.-Se debe informar alguno de los parámetros, de lo contrario la API responde con un error <br>\n    -Setear en true or false los parámetros \"availableBalance\" o \"futureRemittances\" <br>\n    -Entregar una fecha en el parámetro \"remittanceByDate\"<br>\n    "
      parameters:
      - name: idUser
        in: query
        description: ID del usuario a consultar
        required: false
        style: form
        explode: true
        schema:
          $ref: '#/components/schemas/idUser'
        example: 123
      - name: idTrx
        in: query
        description: ID de la transacción a consultar
        required: false
        style: form
        explode: true
        schema:
          $ref: '#/components/schemas/idTrx'
        example: 5500
      - name: availableBalance
        in: query
        description: Define si se desea obtener el saldo disponible del usuario
        required: false
        style: form
        explode: true
        schema:
          type: boolean
      - name: remittanceByDate
        in: query
        description: Fecha de la que se desea obtener información del abono
        required: false
        style: form
        explode: true
        schema:
          $ref: '#/components/schemas/date'
      - name: futureRemittances
        in: query
        description: Define si se desea obtener los abonos futuros
        required: false
        style: form
        explode: true
        schema:
          type: boolean
      responses:
        "200":
          description: Ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/responseBodyRemittances'
        "400":
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/inline_response_400'
        "403":
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/inline_response_403'
        "404":
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/inline_response_404'
      security:
      - JWTToken: []
  /remittances/conciliation:
    get:
      tags:
      - remittances
      description: Permite obtener la conciliación de los abonos
      parameters:
      - name: email
        in: query
        description: Email a consultar
        required: true
        style: form
        explode: true
        schema:
          $ref: '#/components/schemas/email'
        example: [email protected]
      - name: date
        in: query
        description: 'Fecha de consulta año-mes-dia <br> Ej: 2019-12-31'
        required: true
        style: form
        explode: true
        schema:
          $ref: '#/components/schemas/date'
        example: 2020-01-22T00:00:00.000+0000
      responses:
        "200":
          description: Ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/inline_response_200'
        "400":
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/inline_response_400'
        "500":
          description: Internal Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/inline_response_500'
      security:
      - JWTToken: []
  /trxs:
    post:
      tags:
      - trxs
      description: Crea una transaccion en estado pendiente. <br> La respuesta tiene distintos métodos y URLs para pago
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/requestBodyTrx'
      responses:
        "200":
          description: Ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/inline_response_200_1'
        "400":
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/inline_response_400'
        "422":
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/inline_response_400'
        "409":
          description: Recurso ya existe o hay un conflicto
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/inline_response_409'
        "500":
          description: Internal Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/inline_response_500'
  /trxs/{id}:
    get:
      tags:
      - trxs
      summary: Obtiene la informacion de la transacción exitosa, asociada a un id
      description: Retorna información de una transacción asociada a un id, para lo que debe ingresarse en el URL el ID de la transacción a consultar. <br> El token de autorización es el obtenido a través de /Login ("Inherit from parent") <br> Endpoints <br> - Producción https://apis.pgf.cl/trxs/{id} <br> - Desarrollo https://apis-dev.pgf.cl/trxs/{id}
      parameters:
      - name: id
        in: path
        required: true
        style: simple
        explode: false
        schema:
          type: number
      responses:
        "200":
          description: Ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/responseBodyGetTrx'
        "400":
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/inline_response_400'
      security:
      - JWTToken: []
  /trxs/{idTrx}/nullification:
    post:
      tags:
      - trxs
      description: Envía una transacción a anular
      parameters:
      - name: idTrx
        in: path
        required: true
        style: simple
        explode: false
        schema:
          type: number
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/requestBodyNullification'
      responses:
        "200":
          description: Ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/responseBodyNullification'
        "401":
          description: Transacción no existe o no se tienen permisos necesarios
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/inline_response_401_1'
        "422":
          description: Falta token de verificación
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/inline_response_401_1'
        "400":
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/inline_response_400'
      security:
      - JWTToken: []
  /trxs/{idTrx}/nullification/:
    get:
      tags:
      - trxs
      description: Obtiene las anulaciones asociadas a una transacción
      parameters:
      - name: idTrx
        in: path
        required: true
        style: simple
        explode: false
        schema:
          type: number
      responses:
        "200":
          description: Ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/inline_response_200_2'
        "401":
          description: Transacción no existe o no se tienen permisos necesarios
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/inline_response_401_1'
        "422":
          description: Falta token de verificación
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/inline_response_401_1'
        "400":
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/inline_response_400'
      security:
      - JWTToken: []
  /trxs/{idTrx}/nullification/status:
    get:
      tags:
      - trxs
      description: Obtiene el estado de una anulación
      parameters:
      - name: idTrx
        in: path
        required: true
        style: simple
        explode: false
        schema:
          type: number
      - name: verificationToken
        in: query
        required: true
        style: form
        explode: true
        schema:
          $ref: '#/components/schemas/uuid'
      responses:
        "200":
          description: Ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/inline_response_200_3'
        "401":
          description: Transacción no existe o no se tienen permisos necesarios
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/inline_response_401_1'
        "422":
          description: Falta token de verificación
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/inline_response_401_1'
        "400":
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/inline_response_400'
      security:
      - JWTToken: []
  /webhooks:
    post:
      tags:
      - webhooks
      description: Crea un webhook para tus servicios. <br> Se enviará un POST a esta URL cuando se realicen eventos como abonos a tu cuenta.
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/requestBodyWebhook'
      responses:
        "201":
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/inline_response_201'
        "400":
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/inline_response_400'
        "500":
          description: Internal Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/inline_response_500'
        "403":
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/inline_response_403'
  /webhooks/{idUser}/{webhook}:
    put:
      tags:
      - webhooks
      description: 'Actualiza un webhook para tus servicios. '
      parameters:
      - name: idUser
        in: path
        description: ID del usuario a consultar
        required: true
        style: simple
        explode: false
        schema:
          type: string
        example: 123
      - name: webhook
        in: path
        description: Tipo de evento del webhook
        required: true
        style: simple
        explode: false
        schema:
          type: string
        example: remittances
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/idUser_webhook_body'
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/inline_response_201'
        "400":
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/inline_response_400'
        "500":
          description: Internal Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/inline_response_500'
        "403":
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/inline_response_403'
    delete:
      tags:
      - webhooks
      description: Elimina un webhook del usuario y tipo especificados
      parameters:
      - name: idUser
        in: path
        description: ID del usuario a consultar
        required: true
        style: simple
        explode: false
        schema:
          type: string
        example: 123
      - name: webhook
        in: path
        description: Tipo de evento del webhook
        required: true
        style: simple
        explode: false
        schema:
          type: string
        example: remittances
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/inline_response_201'
        "400":
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/inline_response_400'
        "500":
          description: Internal Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/inline_response_500'
        "403":
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/inline_response_403'
  /webhooks/{idUser}:
    get:
      tags:
      - webhooks
      description: 'Obtiene la lista de webhooks de un usuario. '
      parameters:
      - name: idUser
        in: path
        description: ID del usuario a consultar
        required: true
        style: simple
        explode: false
        schema:
          type: string
        example: 123
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/inline_response_200_4'
        "400":
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/inline_response_400'
        "500":
          description: Internal Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/inline_response_500'
        "403":
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/inline_response_403'
  /payments:
    get:
      tags:
      - payments
      description: Obtiene los medios de pago disponible
      parameters:
      - name: Authorization
        in: query
        required: true
        style: form
        explode: true
        schema:
          type: string
      responses:
        "200":
          description: Ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/inline_response_200_5'
        "500":
          description: Internal Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/inline_response_500'
  /users:
    get:
      tags:
      - users
      summary: Obtener informacion del usuario.
      description: Este endpoint retorna la informacion del usuario.
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/inline_response_200_6'
        "400":
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/inline_response_400'
        "401":
          description: Access token is missing or invalid
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/inline_response_401_2'
      security:
      - JWTToken: []
components:
  schemas:
    username:
      type: string
      description: Correo con el cual create tu cuenta
      example: [email protected]
    password:
      type: string
      description: Tu clave en el portal.
      example: claveDeMentira1232
    message:
      type: string
      description: Mensaje de respuesta
      example: Se procesó la solicitud correctamente
    url:
      type: string
      description: Una dirección web válida
      format: uri
      example: https://postman-echo.com/post
    error:
      type: string
      description: Retorna la lista de errores en caso de existir alguno
    x_account_id:
      maxLength: 100
      minLength: 36
      type: string
      description: Corresponde al <u>Token Service</u> relacionado al servicio con el que deseas generar el cobro. Es ditinto para el ambiente de desarrollo y producción.
      example: 4d46656265397746362447447a75681234736f59576e4a384a416d4177444e63
    x_amount:
      minimum: 500
      type: number
      description: Monto de la transacción. Admite decimales si la divisa utilizada los utiliza. El mínimo depende de la divis. En CLP es 500.
      example: 1000
    x_reference:
      maxLength: 100
      minLength: 1
      type: string
      description: \"Tú\" identificador de orden. Este identificador debería ser único por servicio para no tener problema de duplicidad de pagos. Rechazaremos ids duplicados para el mismo servicio.
      example: 0d4ca99a-cfd7-4c85-9832-11205894ef63
    x_customer_email:
      $ref: '#/components/schemas/email'
    x_url_complete:
      $ref: '#/components/schemas/url'
    x_url_callback:
      $ref: '#/components/schemas/url'
    x_url_cancel:
      $ref: '#/components/schemas/url'
    x_shop_country:
      $ref: '#/components/schemas/country_code'
    x_session_id:
      maxLength: 61
      minLength: 5
      type: string
      description: Identificador único de la sesión del usuario que realiza el pago. Se agrega como capa de seguridad para validar la transacción. Max. 61 caracteres.
      example: 0d4ca99a-cfd7-4c85-9832-11205894ef63
    x_signature:
      type: string
      description: Mensaje Firmado. Para más información sobre la creación de la firma revisa https://developers.pagofacil.cl/docs/cómo-funciona-el-proceso-de-firmado
      example: 4a8affcfe9446b07ebdc4ab6b661234743fa454d80d299daf9e28efc99bef934
    idTrx:
      type: integer
      description: ID de la transacción en Pago Fácil
      example: 123
    idUser:
      type: integer
      description: ID del usuario a consultar
      example: 123
    idTienda:
      type: string
      description: ID del comercio para identificar su tienda
      example: c000000
    idService:
      type: integer
      description: ID del servicio
      example: 100
    amount:
      type: number
      description: Monto de la transacción
      example: 1000
    cost:
      type: number
      description: Costo de la transacción
      example: 55
    status:
      type: string
      description: Estado de la transacción
      enum:
      - pending
      - complete
      - failed
    product_name:
      type: string
      description: Nombre del producto
      example: Producto 1
    product_price:
      type: number
      description: Precio de un producto
      example: 5500
    product_quantity:
      type: integer
      description: Cantidad de productos
      example: 1
    product_sku:
      type: string
      description: SKU o código del producto
      example: PROD1
    source:
      type: string
      description: Método de pago
      example: Khipu
    timestamp:
      type: string
      description: uso transbank
      example: transbank
    paymentTypeCode:
      type: string
      description: Forma de pago que usa el cliente
      example: VN
    sharesNumber:
      type: integer
      description: Cuotas de la transacción
      example: 0
    responceCode:
      type: integer
      description: uso transbank
      example: 0
    vci:
      type: string
      description: uso transbank
      example: "0"
    abonos:
      type: array
      description: Abonos relacionados a la transacción
      items:
        type: string
    callbackURL:
      type: string
      description: url a la que se llama una vez la transacción es completada
      example: www.mypage.com/sss
    completeURL:
      type: string
      description: url a la que se redireciona al cliente una vez la transacción es completada
      example: www.mypage.com/sss
    cancelURL:
      type: string
      description: currently out of order
      example: www.mypage.com/sss
    ip:
      type: string
      description: ip adress of the device from where transaction was completed
      example: 192.168.0.0
    browserData:
      type: string
      description: data from the browser where the transaction was completed
      example: important data from the browser
    createdAt:
      type: string
      description: Fecha de creación
      format: date-time
      example: 2019-11-22T01:42:33Z
    updatedAt:
      type: string
      description: Fecha de actualización
      format: date-time
      example: 2019-11-22T01:42:33Z
    uuid:
      maximum: 36
      type: string
      description: Token uuid
      example: f9e79694-6949-4339-9513-c65f9a61498b
    rut:
      type: string
      description: Rut
      example: 11111111-1
    city:
      type: string
      description: Ciudad
      example: Santiago
    company:
      type: string
      description: Empresa
      example: Mi Empresa
    municipality:
      type: string
      description: Municipio
      example: Santiago
    activity:
      type: string
      description: Giro de la emmpresa
    address:
      type: string
      description: Dirección
      example: Una calle bonita
    contact_name:
      type: string
      description: Nombre de contacto
      example: Pepito Grillo
    phone:
      type: string
      description: Número de teléfono
      example: "965874587"
    region:
      type: string
      description: Región
      example: Metropolitana
    country:
      maxLength: 2
      minLength: 2
      type: string
      description: País en donde se encuentra la tienda (dos caracteres)
      example: CL
    zip:
      type: string
      description: Código postal
      example: "8320066"
    document_id:
      type: string
      description: ID del documento
      example: "123"
    document_type:
      type: string
      description: Tipo de documento
      example: "39"
    authCode:
      type: integer
      description: Codigo de autorizacion de la compra
      example: 123
    email:
      pattern: ^[a-z0-9._%+-]+@[a-z0-9.-]+\.[a-z]{2,4}$
      type: string
      description: Email
      format: email
    loginBody:
      required:
      - password
      - username
      type: object
      properties:
        username:
          $ref: '#/components/schemas/username'
        password:
          $ref: '#/components/schemas/password'
      description: Body con los datos para iniciar sesión.
    payUrl:
      type: array
      description: Opciones diferentes de pago. <br> Para mostrar todas las opciones utilizar 'gateway'. <br> Para ir directamente a un metodo de pago, utilizar las demás disponibles
      example:
      - name: gateway
        url: https://gw-dev.pagofacil.online/payTransaction/?Authorization=fgj5i82kdsfj
      - name: Kiphu
        url: https://gw-dev.pagofacil.online/kiphu/payTransaction/?Authorization=fgj5i82kdsfj
      - name: mach
        url: https://gw-dev.pagofacil.online/mach/payTransaction/?Authorization=fgj5i82kdsfj
      items:
        $ref: '#/components/schemas/payUrl_inner'
    products:
      type: array
      description: Productos asociados a la transacción
      items:
        $ref: '#/components/schemas/products_inner'
    remittanceByDate:
      type: object
      properties:
        total:
          $ref: '#/components/schemas/amount'
        trxs:
          $ref: '#/components/schemas/trxs'
      description: Monto del abono relacionado a las transacciones que se debieron pagar el dia indicado y dichas transacciones
    futureRemittances:
      type: object
      properties:
        total:
          $ref: '#/components/schemas/amount'
        remittances:
          type: array
          items:
            $ref: '#/components/schemas/futureRemittances_remittances'
      description: Monto y transacciones de abonos futuros
    trxs:
      type: array
      description: Objeto de transacciones
      items:
        $ref: '#/components/schemas/trxs_inner'
    billing_details:
      required:
      - activity
      - address
      - city
      - company
      - country
      - municipality
      - rut
      type: object
      properties:
        rut:
          $ref: '#/components/schemas/rut'
        city:
          $ref: '#/components/schemas/city'
        company:
          $ref: '#/components/schemas/company'
        municipality:
          $ref: '#/components/schemas/municipality'
        activity:
          $ref: '#/components/schemas/activity'
        address:
          $ref: '#/components/schemas/address'
        country:
          $ref: '#/components/schemas/country'
      description: Datos de facturación
    shippment:
      required:
      - address
      - city
      - contact_name
      - municipality
      - phone
      - region
      - rut
      type: object
      properties:
        contact_name:
          $ref: '#/components/schemas/contact_name'
        phone:
          $ref: '#/components/schemas/phone'
        region:
          $ref: '#/components/schemas/region'
        city:
          $ref: '#/components/schemas/city'
        address:
          $ref: '#/components/schemas/address'
        municipality:
          $ref: '#/components/schemas/municipality'
        rut:
          $ref: '#/components/schemas/rut'
        country:
          $ref: '#/components/schemas/country'
        zip:
          $ref: '#/components/schemas/zip'
      description: Datos de despacho
    document:
      required:
      - id
      - type
      type: object
      properties:
        id:
          $ref: '#/components/schemas/document_id'
        type:
          $ref: '#/components/schemas/document_type'
      description: Documento asociado a transacción
    data_login_response:
      type: object
      properties:
        access_token_jwt:
          type: string
          description: JWT (JSON Web Token) que se usará para las llamadas del API
          example: eyJraWQiOiJ3bnF6dFN3RzNsQ3FNYVQ5T09QMlVxaG5VeU5wVmhnc203SzBKanFKcnh3PSIsImFsZyI6IlJTMjU2In0.eyJzdWIiOiIxMWVmZmU5Ny0wMGE2LTRhODktOTgwNy05MWU0ZWFhZmFlMzYiLCJhdWQiOiI2bWl1MTkzdWw4Zzk1MHNzdDY0MjQ5djRpbSIsImVtYWlsX3ZlcmlmaWVkIjp0cnVlLCJldmVudF9pZCI6IjBiZjUwMmQwLWYzYmMtNDMzOS1iODc0LTgzNDVlMjY2NzY3ZiIsInRva2VuX3VzZSI6ImlkIiwiYXV0aF90aW1lIjoxNTc5MjkyMTI0LCJpc3MiOiJodHRwczpcL1wvY29nbml0by1pZHAudXMtd2VzdC0yLmFtYXpvbmF3cy5jb21cL3VzLXdlc3QtMl9KOGM3QkhLMUYiLCJjb2duaXRvOnVzZXJuYW1lIjoiMTFlZmZlOTctMDBhNi00YTg5LTk4MDctOTFlNGVhYWZhZTM2IiwiZXhwIjoxNTc5Mjk1NzI0LCJpYXQiOjE1NzkyOTIxMjQsImVtYWlsIjoibWFyY2VsYUBwYWdvZmFjaWwuY2wifQ.Yf3jHXjxQ3sS3BysTbFVqdf2_DWGSHtFq2MLcgIFvY2q81H9jobap1Jn47An4rpHeIJB_wwFUxBHifmCBGApsuTLifpvVYUB9f3HYA4341bXEjf-hwqOVJ0RncSlseY6ixdaPvJ6XYllXV491VB38y_GS1AYpiGM5ugN6CdzdLH8eU_EABXh4hbjcMKeT6o1UPZe7MFQyu709U6sMJZgOzVeMXMfAmLOlPXG_FmNZPLwFIYNwVRV8OC-rTncUiVD-mabVjUBE00MKI3ZbLLsUYueMauRwuuaBdF3wYpQnIxhWmGiQnkBWMkzmxQZ4Jo1xFTQaff-FaW6VR9jsZGYWg
        expires_in:
          type: integer
          description: Tiempo por el cual el JWT será valido
          example: 1579295724
        token_type:
          type: string
          description: Tipo de Token
          example: Bearer
      description: Respuesta de login
    login_response:
      required:
      - access_token_jwt
      - expires_in
      - token_type
      type: object
      properties:
        message:
          $ref: '#/components/schemas/message'
        error:
          $ref: '#/components/schemas/error'
        data:
          $ref: '#/components/schemas/data_login_response'
    date:
      type: string
      description: 'Fecha en formato Año - Mes - Dia <br> Ej: 2019-12-31'
      format: date
    timestampUnixSecond:
      maxLength: 10
      type: integer
      description: Timestamp de unix en segundos
    timestampUnixMilisecond:
      maxLength: 13
      type: integer
      description: Timestamp de unix en milisegundos
    currency:
      maxLength: 3
      minLength: 3
      type: string
      description: Codigo de 3 caracteres para paises. <br><br> Info:<a href='https://en.wikipedia.org/wiki/ISO_4217#Active_codes' target=_blank>ISO_4217</a>
      example: CLP
    country_code:
      maxLength: 2
      minLength: 2
      type: string
      description: Codigo de 2 caracteres para paises. <br><br> Info:<a href='https://en.wikipedia.org/wiki/ISO_3166-1#Current_codes'>ISO 3166-1 Alpha2-code</a>
      example: CL
    nullification_status:
      type: string
      description: Estado de la anulación
      example: processing
      enum:
      - processing
      - failed
      - completed
    nullification_get:
      type: array
      description: Anulaciones de la transacción
      items:
        $ref: '#/components/schemas/nullification_get_inner'
    nullification_type:
      type: string
      description: Tipo de anulación
      example: total
      enum:
      - total
      - parcial
    errors:
      type: array
      items:
        type: string
        description: Mensajes de error
        example: No es posible realizar la operación
    requestBodyTrx:
      required:
      - x_account_id
      - x_amount
      - x_currency
      - x_customer_email
      - x_reference
      - x_session_id
      - x_shop_country
      - x_signature
      - x_url_callback
      - x_url_cancel
      - x_url_complete
      type: object
      properties:
        x_account_id:
          $ref: '#/components/schemas/x_account_id'
        x_amount:
          $ref: '#/components/schemas/x_amount'
        x_currency:
          $ref: '#/components/schemas/currency'
        x_reference:
          $ref: '#/components/schemas/x_reference'
        x_customer_email:
          $ref: '#/components/schemas/x_customer_email'
        x_url_complete:
          $ref: '#/components/schemas/x_url_complete'
        x_url_callback:
          $ref: '#/components/schemas/x_url_callback'
        x_url_cancel:
          $ref: '#/components/schemas/x_url_cancel'
        x_shop_country:
          $ref: '#/components/schemas/x_shop_country'
        x_session_id:
          $ref: '#/components/schemas/x_session_id'
        x_products:
          $ref: '#/components/schemas/products'
        x_billing_details:
          $ref: '#/components/schemas/billing_details'
        x_shippment:
          $ref: '#/components/schemas/shippment'
        x_document:
          $ref: '#/components/schemas/document'
        x_signature:
          $ref: '#/components/schemas/x_signature'
    requestBodyNullification:
      required:
      - amount
      - type
      type: object
      properties:
        amount:
          $ref: '#/components/schemas/amount'
        type:
          $ref: '#/components/schemas/nullification_type'
        nullifyTbk:
          type: boolean
          description: Identifica si se desea anular la trasacción en transbank
          example: false
    requestBodyWebhook:
      required:
      - method
      - url
      - webhook
      type: object
      properties:
        url:
          type: string
          description: La url que recibirá un POST para notificaciones
          format: url
          example: https://mipagina.cl/myWebhook
        method:
          type: string
          description: Método HTTP a ser usado durante el callback
          example: POST
          enum:
          - POST
          - GET
        webhook:
          type: string
          description: Tipo de webhook
          example: remittances
          enum:
          - remittances
    responseBodyRemittances:
      type: object
      properties:
        message:
          type: string
          example: Se encontraron los datos
        data:
          $ref: '#/components/schemas/responseBodyRemittances_data'
    responseBodyGetTrx:
      type: object
      properties:
        message:
          type: string
          example: Se encontró trx
        data:
          $ref: '#/components/schemas/responseBodyGetTrx_data'
    responseBodyNullification:
      type: object
      properties:
        message:
          $ref: '#/components/schemas/message'
        data:
          $ref: '#/components/schemas/responseBodyNullification_data'
    inline_response_400:
      type: object
      properties:
        message:
          type: string
          example: Falta uno de los parametros
        errors:
          type: array
          items: {}
        data:
          type: object
    inline_response_500:
      type: object
      properties:
        message:
          type: string
          example: Error interno
        errors:
          type: array
          nullable: true
          items:
            type: string
        data:
          type: object
          nullable: true
    inline_response_401:
      type: object
      properties:
        message:
          type: string
          example: Invalid user name or password
        errors:
          type: array
          items: {}
        data:
          type: object
    inline_response_403:
      type: object
      properties:
        message:
          type: string
          example: Sin permisos y/o acceso prohibido
        errors:
          type: array
          items: {}
        data:
          type: object
    inline_response_404:
      type: object
      properties:
        message:
          type: string
          example: Recurso no encontrado
        errors:
          type: array
          items: {}
        data:
          type: object
    inline_response_200:
      type: object
      properties:
        message:
          $ref: '#/components/schemas/message'
        data:
          $ref: '#/components/schemas/inline_response_200_data'
    inline_response_200_1:
      type: object
      properties:
        statusCode:
          type: number
          example: 200
        body:
          $ref: '#/components/schemas/inline_response_200_1_body'
    inline_response_409:
      type: object
      properties:
        message:
          type: string
          example: Recurso ya existe o hay un conflicto
        errors:
          type: array
          items: {}
        data:
          type: object
    inline_response_401_1:
      type: object
      properties:
        message:
          $ref: '#/components/schemas/message'
        errors:
          $ref: '#/components/schemas/errors'
    inline_response_200_2:
      type: object
      properties:
        message:
          $ref: '#/components/schemas/message'
        data:
          $ref: '#/components/schemas/inline_response_200_2_data'
    inline_response_200_3:
      type: object
      properties:
        message:
          $ref: '#/components/schemas/message'
        data:
          $ref: '#/components/schemas/inline_response_200_3_data'
    inline_response_201:
      type: object
      properties:
        message:
          type: string
          example: Mensaje de éxito
        errors:
          type: array
          items: {}
        data:
          type: object
    idUser_webhook_body:
      required:
      - idUser
      - method
      - url
      - webhook
      type: object
      properties:
        url:
          type: string
          description: La url que recibirá un POST para notificaciones
          format: url
          example: https://mipagina.cl/myWebhook
        method:
          type: string
          description: Método HTTP a ser usado durante el callback
          example: POST
          enum:
          - POST
          - GET
        webhook:
          type: string
          description: Tipo de evento del webhook
          example: remittances
          enum:
          - remittances
        idUser:
          type: string
          description: Id del usuario que quiere crear el webhook
          example: "123"
    inline_response_200_4:
      type: object
      properties:
        message:
          type: string
          example: Mensaje de éxito
        errors:
          type: array
          items: {}
        data:
          type: array
          items:
            $ref: '#/components/schemas/inline_response_200_4_data'
    inline_response_200_5:
      type: object
      properties:
        types:
          type: array
          items:
            $ref: '#/components/schemas/inline_response_200_5_types'
    inline_response_200_6:
      required:
      - bloqueo
      - createdAt
      - email
      - id
      - idAuth0
      - status
      - username
      type: object
      properties:
        id:
          type: integer
          description: Identificador del usuario
        idAuth0:
          type: string
          description: Identificador del usuario
        username:
          type: string
          description: Nombre del usuario
        email:
          type: string
          description: Email del usuario
        status:
          type: integer
          description: Define el estado del usuario en inscripcion
        bloqueo:
          type: boolean
          description: Define si el usuario esta bloqueado
        createdAt:
          type: string
          description: Fecha de creacion del usuario
    inline_response_401_2:
      type: object
      properties:
        message:
          type: string
          example: Unauthorized
        errors:
          type: array
          items: {}
        data:
          type: object
    payUrl_inner:
      type: object
      properties:
        name:
          type: string
        url:
          $ref: '#/components/schemas/url'
    products_inner:
      required:
      - name
      - price
      - quantity
      type: object
      properties:
        name:
          $ref: '#/components/schemas/product_name'
        price:
          $ref: '#/components/schemas/product_price'
        quantity:
          $ref: '#/components/schemas/product_quantity'
        sku:
          $ref: '#/components/schemas/product_sku'
    futureRemittances_date:
      type: object
      properties:
        total:
          $ref: '#/components/schemas/amount'
        trxs:
          $ref: '#/components/schemas/trxs'
    futureRemittances_remittances:
      properties:
        date:
          $ref: '#/components/schemas/futureRemittances_date'
    trxs_inner:
      type: object
      properties:
        idTrx:
          $ref: '#/components/schemas/idTrx'
        amount:
          $ref: '#/components/schemas/amount'
        remittanceDay:
          $ref: '#/components/schemas/date'
    nullification_get_inner:
      type: object
      properties:
        verificationToken:
          $ref: '#/components/schemas/uuid'
        montoAnulado:
          $ref: '#/components/schemas/amount'
        montoDescuento:
          $ref: '#/components/schemas/amount'
        date:
          $ref: '#/components/schemas/date'
        type:
          $ref: '#/components/schemas/nullification_type'
    responseBodyRemittances_data:
      type: object
      properties:
        availableBalance:
          $ref: '#/components/schemas/amount'
        remittanceByDate:
          $ref: '#/components/schemas/remittanceByDate'
        futureRemittances:
          $ref: '#/components/schemas/futureRemittances'
    responseBodyGetTrx_data:
      type: object
      properties:
        idTrx:
          $ref: '#/components/schemas/idTrx'
        idService:
          $ref: '#/components/schemas/idService'
        orderIdTienda:
          $ref: '#/components/schemas/idTienda'
        amount:
          $ref: '#/components/schemas/amount'
        cost:
          $ref: '#/components/schemas/cost'
        email:
          $ref: '#/components/schemas/email'
        authCode:
          $ref: '#/components/schemas/authCode'
        createdAt:
          $ref: '#/components/schemas/createdAt'
        updatedAt:
          $ref: '#/components/schemas/updatedAt'
        callbackURL:
          $ref: '#/components/schemas/callbackURL'
        completeURL:
          $ref: '#/components/schemas/completeURL'
        cancelURL:
          $ref: '#/components/schemas/cancelURL'
        ip:
          $ref: '#/components/schemas/ip'
        browserData:
          $ref: '#/components/schemas/browserData'
        source:
          $ref: '#/components/schemas/source'
        timestamp:
          $ref: '#/components/schemas/timestamp'
        paymentTypeCode:
          $ref: '#/components/schemas/paymentTypeCode'
        sharesNumber:
          $ref: '#/components/schemas/sharesNumber'
        responceCode:
          $ref: '#/components/schemas/responceCode'
        vci:
          $ref: '#/components/schemas/vci'
        abonos:
          $ref: '#/components/schemas/abonos'
        status:
          $ref: '#/components/schemas/status'
    responseBodyNullification_data:
      type: object
      properties:
        verificationToken:
          $ref: '#/components/schemas/uuid'
    inline_response_200_data_document:
      type: object
      properties:
        id:
          type: number
          example: 456657
        type:
          type: string
          example: Boleta
      nullable: true
    inline_response_200_data_items:
      type: object
      properties:
        amount:
          type: number
          example: 2314
        cost:
          type: number
          example: 215
        total:
          type: number
          example: 215
        idTrx:
          type: number
          example: 215
        order_id_tienda:
          type: string
          example: p42_2
        createdAt:
          $ref: '#/components/schemas/timestampUnixMilisecond'
        dateTimeCreatedAt:
          type: string
          format: date-time
        isTotalNullified:
          type: boolean
        isParcialNullified:
          type: boolean
        currency:
          allOf:
          - $ref: '#/components/schemas/currency'
        document:
          $ref: '#/components/schemas/inline_response_200_data_document'
    inline_response_200_data_nullifications:
      type: object
      properties:
        tipo:
          type: string
          example: Completa
        montoAnulado:
          type: number
          example: 5676
        status:
          type: string
          example: PROCESADO
        timestamp:
          $ref: '#/components/schemas/timestampUnixSecond'
        dateTime:
          type: string
          format: date-time
    inline_response_200_data:
      type: object
      properties:
        totalRemittances:
          type: integer
          description: Total de los abonos
        items:
          type: array
          items:
            $ref: '#/components/schemas/inline_response_200_data_items'
        totalTransactions:
          type: integer
          description: Total de transacciones
        totalNullification:
          type: integer
          description: Total de anulaciones
        nullifications:
          type: array
          items:
            $ref: '#/components/schemas/inline_response_200_data_nullifications'
    inline_response_200_1_body_data:
      type: object
      properties:
        idTrx:
          $ref: '#/components/schemas/idTrx'
        payUrl:
          $ref: '#/components/schemas/payUrl'
    inline_response_200_1_body:
      type: object
      properties:
        message:
          $ref: '#/components/schemas/message'
        data:
          $ref: '#/components/schemas/inline_response_200_1_body_data'
    inline_response_200_2_data:
      type: object
      properties:
        nullifications:
          $ref: '#/components/schemas/nullification_get'
    inline_response_200_3_data:
      type: object
      properties:
        status:
          $ref: '#/components/schemas/nullification_status'
    inline_response_200_4_data:
      properties:
        url:
          type: string
          description: Url del webhook
          example: https://mipagina.cl/myWebhook
        method:
          type: string
          description: Método HTTP usado en el webhook
          example: POST
          enum:
          - POST
          - GET
        webhook:
          type: string
          description: Tipo de webhook
          example: remittances
          enum:
          - remittances
    inline_response_200_5_types:
      type: object
      properties:
        codigo:
          type: string
          example: WebPayPST
        nombre:
          type: string
          example: WebPayPlus PST
        descripcion:
          type: string
          example: Paga usando tus tarjetas de crédito o débito.
        url_imagen:
          type: string
          example: https://s3-us-west-2.amazonaws.com/assets.pagofacil.cl/public/images/webpay-300.png
  responses:
    UnauthorizedError:
      description: Access token is missing or invalid
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/inline_response_401_2'
    UnauthorizedLoginError:
      description: Invalid user name or password
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/inline_response_401'
    BadRequestError:
      description: Bad Request
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/inline_response_400'
    ForbiddenError:
      description: Forbidden
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/inline_response_403'
    JWTUnauthorized:
      description: JWT Unauthorized
      content:
        application/json:
          schema:
            type: object
            properties:
              message:
                type: string
                example: JWT no autorizado
              errors:
                type: array
                items: {}
              data:
                type: object
    NotFoundError:
      description: Not Found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/inline_response_404'
    InternalError:
      description: Internal Error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/inline_response_500'
    Conflict:
      description: Recurso ya existe o hay un conflicto
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/inline_response_409'
  securitySchemes:
    JWTToken:
      type: http
      scheme: bearer
      bearerFormat: JWT
    Token:
      type: apiKey
      name: Authorization
      in: header
x-aws-api-id: 6gkh9asu90

Recuerda que puedes unirte a nuestra comunidad de desarrolladores en Discord!