openapi: 3.1.0
info:
  description: Binco Backend Payins API
  version: 0.0.1
  title: Binco Backend Payins API
  contact:
    email: integrations@binco.io
  license:
    name: Apache 2.0
    url: http://www.apache.org/licenses/LICENSE-2.0.html
tags:
  - name: Merchant
  - name: Payer
  - name: Payment intent
  - name: Payment instrument
  - name: Link
security:
  - B2BAuth: []
  - UserAuth: []
paths:
  /payins:
    get:
      tags:
        - Payin
      summary: Get Payins
      description: Retrieve a list of payins
      parameters:
        - in: query
          name: status
          schema:
            $ref: '#/components/schemas/TransactionStatus'
        - in: query
          name: currency
          schema:
            $ref: '#/components/schemas/Currency'
        - in: query
          name: minAmount
          schema:
            type: number
        - in: query
          name: maxAmount
          schema:
            type: number
        - in: query
          name: dateFrom
          schema:
            type: Date
        - in: query
          name: dateUntil
          schema:
            type: Date
        - in: query
          name: merchantId
          schema:
            type: string
            format: uuid
        - in: query
          name: order
          schema:
            $ref: '#/components/schemas/OrderBy'
        - in: query
          name: sort
          schema:
            $ref: '#/components/schemas/SortBy'
        - in: query
          name: page
          schema:
            type: number
        - in: query
          name: limit
          schema:
            type: number
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/GetPayinsResponse'
        '400':
          description: Error getting the payins
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorGettingPayins'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/UnauthorizedError'
                  - $ref: '#/components/schemas/ErrorBadApiKey'
                  - $ref: '#/components/schemas/ErrorBadSignature'
  /payins/status-summary:
    get:
      tags:
        - Payin
      summary: Get Status Summary
      description: get a summary of transactions
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetSummaryResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/UnauthorizedError'
                  - $ref: '#/components/schemas/ErrorBadApiKey'
                  - $ref: '#/components/schemas/ErrorBadSignature'
  /merchants:
    get:
      tags:
        - Merchant
      summary: Get merchants
      description: Retrieve a list of merchants
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/GetMerchantsResponse'
        '400':
          description: Error getting the merchants
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorGettingMerchants'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/UnauthorizedError'
                  - $ref: '#/components/schemas/ErrorBadApiKey'
                  - $ref: '#/components/schemas/ErrorBadSignature'
  /merchants/{merchantId}:
    get:
      tags:
        - Merchant
      summary: Get a merchant
      description: Retrieve the requested merchant
      parameters:
        - name: merchantId
          in: path
          required: true
          description: The id of the merchant
          schema:
            type: string
            format: uuid
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MerchantDTO'
        '400':
          description: Error getting the merchant
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorGettingMerchant'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/UnauthorizedError'
                  - $ref: '#/components/schemas/ErrorBadApiKey'
                  - $ref: '#/components/schemas/ErrorBadSignature'
    put:
      tags:
        - Merchant
      summary: Update a merchant
      description: Update data of the requested merchant
      parameters:
        - name: merchantId
          in: path
          required: true
          description: The id of the merchant
          schema:
            type: string
            format: uuid
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MerchantRequest'
        description: General information data about merchant
        required: true
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MerchantDTO'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/UnauthorizedError'
                  - $ref: '#/components/schemas/ErrorBadApiKey'
                  - $ref: '#/components/schemas/ErrorBadSignature'
        '500':
          description: Error updating the merchant
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorUpdatingMerchant'
    delete:
      tags:
        - Merchant
      summary: Delete a merchant
      description: Delete the requested merchant
      parameters:
        - name: merchantId
          in: path
          required: true
          description: The id of the merchant
          schema:
            type: string
            format: uuid
      responses:
        '200':
          description: Successful operation
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/UnauthorizedError'
                  - $ref: '#/components/schemas/ErrorBadApiKey'
                  - $ref: '#/components/schemas/ErrorBadSignature'
        '500':
          description: Error deleting the merchant
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorDeletingMerchant'
  /merchants/{merchantId}/payment-methods:
    get:
      tags:
        - Merchant
      summary: Get the payment methods
      description: Get the payment methods related to a merchant
      parameters:
        - name: merchantId
          in: path
          required: true
          description: The id of the merchant
          schema:
            type: string
            format: uuid
      responses:
        '200':
          description: successful operation
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/ProviderPaymentMethodDTO'
        '400':
          description: Error getting the payment methods
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorGettingPaymentMethods'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/UnauthorizedError'
                  - $ref: '#/components/schemas/ErrorBadApiKey'
                  - $ref: '#/components/schemas/ErrorBadSignature'
  /merchants/{merchantId}/configuration:
    get:
      tags:
        - Merchant
      summary: Get merchant configuration
      description: Get merchant configuration
      parameters:
        - name: merchantId
          in: path
          required: true
          description: The id of the merchant
          schema:
            type: string
            format: uuid
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MerchantConfigurationDTO'
        '400':
          description: Error getting the merchant configuration
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorGettingMerchantConfiguration'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/UnauthorizedError'
                  - $ref: '#/components/schemas/ErrorBadApiKey'
                  - $ref: '#/components/schemas/ErrorBadSignature'
    post:
      tags:
        - Merchant
      summary: Create or update configuration for a merchant
      description: Create or update configuration for a merchant
      parameters:
        - name: merchantId
          in: path
          required: true
          description: The id of the merchant
          schema:
            type: string
            format: uuid
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MerchantConfigurationRequest'
        required: true
      responses:
        '200':
          description: Successful operation
        '400':
          description: Error updating the merchant configuration
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorUpdatingMerchantConfiguration'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/UnauthorizedError'
                  - $ref: '#/components/schemas/ErrorBadApiKey'
                  - $ref: '#/components/schemas/ErrorBadSignature'
  /merchants/merchant-country-processor:
    get:
      tags:
        - Merchant
      summary: Get country processor
      description: Get country processors related to a merchant
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetMerchantCountryProcessorResponse'
        '400':
          description: Error getting the merchant
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorGettingMerchant'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/UnauthorizedError'
                  - $ref: '#/components/schemas/ErrorBadApiKey'
                  - $ref: '#/components/schemas/ErrorBadSignature'
    post:
      tags:
        - Merchant
      summary: Merchant country processors
      description: Create a relationship between a merchant and a payment processors in a country
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateMerchantCountryProcessorsRequest'
        description: MerchantCountryProcessors data
        required: true
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MerchantCountryProcessorsResponse'
        '500':
          description: Error creating the merchant country processors
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorCreatingMerchantCountryProcessors'
  /merchants/merchant-country-processor/{merchantCountryProcessorId}:
    put:
      tags:
        - Merchant country processors
      summary: Update merchant country processors
      description: Update merchant country processors, it is possible to update the status of the relationship and the country processor
      parameters:
        - name: merchantCountryProcessorId
          in: path
          required: true
          description: The merchant country processor id
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateMerchantCountryProcessorsRequest'
        description: Data to update the merchant country processor
        required: true
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MerchantCountryProcessorDTO'
        '500':
          description: Error updating the merchant country processor
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorUpdatingMerchantCountryProcessors'
  /merchants/payment-methods:
    get:
      tags:
        - Merchant
      summary: Get the available payment methods
      description: Get the available payment methods
      responses:
        '200':
          description: successful operation
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/ProviderPaymentMethodDTO'
        '400':
          description: Error getting the payment methods
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorGettingPaymentMethods'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/UnauthorizedError'
                  - $ref: '#/components/schemas/ErrorBadApiKey'
                  - $ref: '#/components/schemas/ErrorBadSignature'
  /merchants/short-name/{shortName}:
    get:
      tags:
        - Merchant
      summary: Get merchant public data by short name
      description: Get merchant public data by short name
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetMerchantPublicDataResponse'
        '400':
          description: Error getting the merchant
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorGettingMerchant'
  /payers:
    get:
      tags:
        - Payer
      summary: Get payers
      description: Retrieve a list of payers
      parameters:
        - in: query
          name: searchTerm
          schema:
            type: string
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/GetPayersResponse'
        '400':
          description: Error getting the payers
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorGettingPayers'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/UnauthorizedError'
                  - $ref: '#/components/schemas/ErrorBadApiKey'
                  - $ref: '#/components/schemas/ErrorBadSignature'
    post:
      tags:
        - Payer
      summary: Create a payer
      description: Create a payer (is the one who will make the payment)
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PayerRequest'
        description: General information data about payer
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PayerDTO'
        '400':
          description: Error creating payer
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorCreatingPayer'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/UnauthorizedError'
                  - $ref: '#/components/schemas/ErrorBadApiKey'
                  - $ref: '#/components/schemas/ErrorBadSignature'
  /payers/{payerId}:
    get:
      tags:
        - Payer
      summary: Get a payer
      description: Retrieve the requested payer
      parameters:
        - name: payerId
          in: path
          required: true
          description: The id of the payer
          schema:
            type: string
            format: uuid
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PayerDTO'
        '400':
          description: Error getting payer
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorGettingPayer'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/UnauthorizedError'
                  - $ref: '#/components/schemas/ErrorBadApiKey'
                  - $ref: '#/components/schemas/ErrorBadSignature'
    put:
      tags:
        - Payer
      summary: Update a payer
      description: Update data of the requested payer
      parameters:
        - name: payerId
          in: path
          required: true
          description: The id of the payer
          schema:
            type: string
            format: uuid
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdatePayerRequest'
        description: General information data about payer
        required: true
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PayerDTO'
        '400':
          description: Error updating payer
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorUpdatingPayer'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/UnauthorizedError'
                  - $ref: '#/components/schemas/ErrorBadApiKey'
                  - $ref: '#/components/schemas/ErrorBadSignature'
    delete:
      tags:
        - Payer
      summary: Delete a payer
      description: Delete the requested payer
      parameters:
        - name: payerId
          in: path
          required: true
          description: The id of the payer
          schema:
            type: string
            format: uuid
      responses:
        '200':
          description: Successful operation
        '400':
          description: Error deleting payer
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorDeletingPayer'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/UnauthorizedError'
                  - $ref: '#/components/schemas/ErrorBadApiKey'
                  - $ref: '#/components/schemas/ErrorBadSignature'
  /payers/{payerId}/payment-instruments:
    get:
      tags:
        - Payer
        - Payment instrument
      summary: Get payer's payment instruments
      description: Retrieve a list of payer's payment instruments
      parameters:
        - name: payerId
          in: path
          required: true
          description: The id of the payer
          schema:
            type: string
            format: uuid
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/PaymentInstrumentDTO'
        '400':
          description: Error getting payment instruments for the payer
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorGetingPayerPaymentInstruments'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/UnauthorizedError'
                  - $ref: '#/components/schemas/ErrorBadApiKey'
                  - $ref: '#/components/schemas/ErrorBadSignature'
  /payment-intents:
    post:
      tags:
        - Payment intent
      summary: Create a payment intent
      description: Create a payment intent with an option to create a payment instrument and charge it automatically
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PaymentIntentRequest'
        description: General information data about payment intent, if paymentInstrumentData is sent and paymentInstrumentId is not, tries to create paymentInstrument and after charge it
        required: true
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreatePaymentIntentResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/UnauthorizedError'
                  - $ref: '#/components/schemas/ErrorBadApiKey'
                  - $ref: '#/components/schemas/ErrorBadSignature'
        '500':
          description: Error registering payment intent
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/ErrorRegisteringPaymentIntent'
                  - $ref: '#/components/schemas/ErrorRegisteringExpressCheckoutPaymentIntent'
  /payment-intents/fast-payment:
    post:
      tags:
        - Payment intent
      summary: Create a fast payment intent
      description: Create a fast payment intent using the default vatPercentage configured to the country
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/FastPaymentIntentRequest'
        description: General information data about payment intent
        required: true
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreatePaymentIntentResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/UnauthorizedError'
                  - $ref: '#/components/schemas/ErrorBadApiKey'
                  - $ref: '#/components/schemas/ErrorBadSignature'
        '500':
          description: Error registering payment intent
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/ErrorRegisteringPaymentIntent'
                  - $ref: '#/components/schemas/ErrorRegisteringExpressCheckoutPaymentIntent'
  /payment-intents/get-payment-data/{paymentIntentId}:
    get:
      tags:
        - Payment intent
      summary: Get payment intent
      description: Retrieve a payment intent
      parameters:
         - name: paymentIntentId
           in: path
           required: true
           description: The id of the paymentIntent
           schema:
            type: string
            format: uuid
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                 $ref: '#/components/schemas/PaymentIntentDTO'
        '400':
          description: Error getting the payment intent
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorGettingPaymentIntent'
  /payment-intents/get-payment-methods/:paymentIntentId:
    get:
      tags:
        - Payment intent
      summary: Get the payment methods of a payment intent
      description: Retrieve the payment methods of a payment intent
      parameters:
         - name: paymentIntentId
           in: path
           required: true
           description: The id of the paymentIntent
           schema:
            type: string
            format: uuid
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                 $ref: '#/components/schemas/GetPaymentIntentPaymentMethodsResponse'
        '400':
          description: Error getting the payment intent
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorGettingPaymentIntent'
  /payment-intents/initialize-payment-b2b/:paymentIntentId:
    post:
      tags:
        - Payment intent
      summary: Initialize payment b2b with the provided payment method
      description: Initialize payment b2b with the provided payment method
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/InitializePaymentIntentB2BRequest'
        description: Request to initialize a payment intent B2B
        required: true
      parameters:
         - name: paymentIntentId
           in: path
           required: true
           description: The id of the paymentIntent
           schema:
            type: string
            format: uuid
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                 $ref: '#/components/schemas/InitializePaymentIntentB2BResponse'
        '500':
          description: Error initializing the payment
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorInitializingB2BPayment'
  /payment-intents/{paymentIntentId}/refund:
    put:
      parameters:
        - name: paymentIntentId
          in: path
          required: true
          description: The id of the paymentIntent
          schema:
            type: string
            format: uuid
      tags:
        - Payment intent
      summary: Refund a payment intent
      description: Refund a payment intent
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RefundPaymentIntentRequest'
        description: Request to refund the payment intent, if empty the refund will be total
        required: true
      responses:
        '200':
          description: Successful operation
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/UnauthorizedError'
                  - $ref: '#/components/schemas/ErrorBadApiKey'
                  - $ref: '#/components/schemas/ErrorBadSignature'
        '500':
          description: Error refunding payment intent
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/ErrorRefundingPaymentIntent'
  /payment-intents/{paymentIntentId}/manual-refund/status:
    put:
      parameters:
        - name: paymentIntentId
          in: path
          required: true
          description: The id of the paymentIntent
          schema:
            type: string
            format: uuid
      tags:
        - Payment intent
      summary: Refund a payment intent (manual refund)
      description: Refund a payment intent (manual refund)
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ManualRefundPaymentIntentRequest'
        description: Request to refund the payment intent
        required: true
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaymentIntentDTO'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                - $ref: '#/components/schemas/UnauthorizedError'
        '500':
          description: Error refunding payment intent
          content:
            application/json:
              schema:
                - $ref: '#/components/schemas/ErrorRefundingPaymentIntent'
  /payment-intents/link-payment/{linkId}:
    post:
      tags:
        - Payment intent
      summary: Create a payment intent from a link
      description: Create a payment intent from a link
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/LinkPaymentIntentRequest'
        description: General information data about payment intent
        required: true
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreatePaymentIntentResponse'
        '500':
          description: Error registering payment intent
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorRegisteringExpressCheckoutPaymentIntent'
  /payment-instruments:
    get:
      tags:
        - Payment instrument
      summary: Get payment instruments
      description: Retrieve a list of payment instruments
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/PaymentInstrumentDTO'
        '400':
          description: Error getting payment instruments
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorGetingPaymentInstruments'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/UnauthorizedError'
                  - $ref: '#/components/schemas/ErrorBadApiKey'
                  - $ref: '#/components/schemas/ErrorBadSignature'
    post:
      tags:
        - Payment instrument
      summary: Create payment instrument
      description: Create payment instrument (it is possible to use existing or create one in this step)
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PaymentInstrumentRequest'
        description: Payment instrument data
        required: true
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaymentInstrumentDTO'
        '400':
          description: Error creating payment instrument
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorCreatingPaymentInstrument'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/UnauthorizedError'
                  - $ref: '#/components/schemas/ErrorBadApiKey'
                  - $ref: '#/components/schemas/ErrorBadSignature'
  /payment-instruments/{paymentInstrumentId}:
    get:
      tags:
        - Payment instrument
      summary: Get payment instrument
      description: Retrieve the requested payment instrument
      parameters:
        - name: paymentInstrumentId
          in: path
          required: true
          description: The id of the payment instrument
          schema:
            type: string
            format: uuid
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaymentInstrumentDTO'
        '400':
          description: Error getting payment instrument
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorGetingPaymentInstrument'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/UnauthorizedError'
                  - $ref: '#/components/schemas/ErrorBadApiKey'
                  - $ref: '#/components/schemas/ErrorBadSignature'
  /business/business-country-processor:
    get:
      tags:
        - Business
      summary: Get business country processors
      description: Get country processors related to a business
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetBusinessCountryProcessorsResponse'
        '500':
          description: Error getting the business country processors
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorGettingBusinessCountryProcessors'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/UnauthorizedError'
                  - $ref: '#/components/schemas/ErrorBadApiKey'
                  - $ref: '#/components/schemas/ErrorBadSignature'
  /links:
    get:
      tags:
        - Link
      summary: Get Links
      description: Get Links
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/LinkDTO'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/UnauthorizedError'
                  - $ref: '#/components/schemas/ErrorBadApiKey'
                  - $ref: '#/components/schemas/ErrorBadSignature'
        '500':
          description: Error getting Links
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorGettingLinks'
    post:
      tags:
        - Link
      summary: Create Link
      description: Create Link
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateLinkRequest'
        description: Create link data
        required: true
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LinkDTO'
        '500':
          description: Error creating Link
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorCreatingLink'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/UnauthorizedError'
                  - $ref: '#/components/schemas/ErrorBadApiKey'
                  - $ref: '#/components/schemas/ErrorBadSignature'
    put:
      tags:
        - Link
      summary: Update Link
      description: Update Link
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateLinkRequest'
        description: Update link data
        required: true
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LinkDTO'
        '500':
          description: Error updating Link
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorCreatingLink'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/UnauthorizedError'
                  - $ref: '#/components/schemas/ErrorBadApiKey'
                  - $ref: '#/components/schemas/ErrorBadSignature'
  /links/validate/{linkId}:
    get:
      tags:
        - Link
      summary: Validate Link
      description: Validate Link
      parameters:
        - name: linkId
          in: path
          required: true
          description: The id of the link
          schema:
            type: string
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LinkDTO'
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaymentIntentAlreadyRefunded'
        '409':
          description: Conflict
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/LinkAlreadyUsed'
                  - $ref: '#/components/schemas/LinkExpired'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/UnauthorizedError'
                  - $ref: '#/components/schemas/ErrorBadApiKey'
                  - $ref: '#/components/schemas/ErrorBadSignature'
        '404':
          description: Link not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LinkDoesNotExist'
        '500':
          description: Error getting Link
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorGettingLink'
  /links/{linkId}:
    get:
      tags:
        - Link
      summary: Get Link
      description: Get Link
      parameters:
        - name: linkId
          in: path
          required: true
          description: The id of the link
          schema:
            type: string
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LinkDTO'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/UnauthorizedError'
                  - $ref: '#/components/schemas/ErrorBadApiKey'
                  - $ref: '#/components/schemas/ErrorBadSignature'
        '500':
          description: Error getting Link
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorGettingLink'
    post:
      tags:
        - Link
      summary: Share Link
      description: Share Link
      parameters:
        - name: linkId
          in: path
          required: true
          description: The id of the link
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ShareLinkRequest'
        description: Share link data
        required: true
      responses:
        '200':
          description: Successful operation
        '500':
          description: Error sharing Link
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorCreatingLink'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/UnauthorizedError'
                  - $ref: '#/components/schemas/ErrorBadApiKey'
                  - $ref: '#/components/schemas/ErrorBadSignature'
    delete:
      tags:
        - Link
      summary: Delete a link
      description: Delete the requested link
      parameters:
        - name: linkId
          in: path
          required: true
          description: The id of the link
          schema:
            type: string
      responses:
        '200':
          description: Successful operation
        '400':
          description: Error deleting link
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorDeletingLink'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/UnauthorizedError'
                  - $ref: '#/components/schemas/ErrorBadApiKey'
                  - $ref: '#/components/schemas/ErrorBadSignature'
servers:
  - url: https://payins-qa.binco.io/api/v1
    description: Sandbox server
components:
  securitySchemes:
    B2BAuth:
      type: apiKey
      in: header
      name: api-key
      description: |
        Additionally, include the signature of the request body using the 'signature' header,
        should be encrypted with HMAC-SHA256 using api-secret.
        api-key and api-secret can be obtained by registering through the authentication API.
    UserAuth:
      type: http
      scheme: basic
      description: |
        Provide your email and password using the Basic authentication scheme after registering
        and confirming your email through the authentication API.
  schemas:
    Currency:
      type: string
      enum:
        - ARS
        - BRL
        - CLP
        - COP
        - MXN
        - PEN
        - PYG
        - USD
        - UYU
    BusinessType:
      type: string
      enum:
        - SOLE_PROPRIETORSHIP_CORPORATION
        - SA
        - SAS
        - SRL_LIMITED
        - NON_PROFIT
        - CIVIL_ASSOCIATION
        - DE_FACTO_ASSOCIATION
    MerchantStatus:
      type: string
      enum:
        - ONBOARDING
        - APPROVED
        - BLOCKED
        - IN_REVIEW
        - CLOSED
    PayinType:
      type: string
      enum:
        - DEFAULT
        - TRANSFER
    PaymentIntentStatus:
      type: string
      enum:
        - REQUIRES_PAYMENT_INSTRUMENT
        - REQUIRES_CONFIRMATION
        - REQUIRES_ACTION
        - PENDING
        - SUCCESSFUL
        - MANUAL_REFUND_PENDING
        - MANUAL_REFUND_CONFIRMED
    ConfirmationMethod:
      type: string
      enum:
        - MANUAL
        - AUTOMATIC
    PaymentInstrumentType:
      type: string
      enum:
        - CREDIT_CARD
        - DEBIT_CARD
        - PREPAID_CARD
        - CASH
        - BANK_TRANSFER
        - A2A
        - PIX
        - WALLETS
        - CRYPTO
    PaymentMethod:
      type: string
      enum:
        - VISA
        - MASTER_CARD
        - AMERICAN_EXPRESS
        - OCA
        - SANTANDER
        - HSBC
        - BBVA
        - ITAU
        - SCOTIABANK
        - BROU
        - PIX
        - APPLE_PAY
        - GOOGLE_WALLET
        - MERCADO_PAGO
    DocumentType:
      type: string
      enum:
        - PASSPORT
        - IDENTITY_DOCUMENT
        - DNI
    BankAccount:
      type: object
      properties:
        accountNumber:
          type: string
          description: Bank account where funds will be transferred
          maxLength: 255
        bank:
          type: string
          format: uuid
        accountCurrency:
          $ref: '#/components/schemas/Currency'
    Account:
      type: object
      properties:
        bincoAccount:
          type: string
          format: uuid
        settlementBank:
          $ref: '#/components/schemas/SettlementBank'
    SettlementBank:
      type: object
      properties:
        settlementBankId:
          type: string
          format: uuid
        bankId:
          type: string
          format: uuid
        accountNumber:
          type: string
        currency:
          $ref: '#/components/schemas/Currency'
    TransactionType:
      type: string
      enum:
        - PAYOUT
        - PAYIN
        - CARD_TRANSACTION
    TransactionStatus:
      type: string
      enum:
        - PENDING
        - SCHEDULED
        - APPROVED
        - CANCELLED
        - REJECTED
        - EXPIRED
    ConceptCode:
      type: string
      enum:
        - TRN
        - TDD
        - PAP
        - PSS
        - PHP
    OrderBy:
      type: string
      enum:
        - ASC
        - DESC
    SortBy:
      type: string
      enum:
        - AMOUNT
        - DATE
        - STATUS
    TransfersType:
      type: string
      enum:
        - L2L
        - CROSSBORDER
    CountryCode:
      type: string
      enum:
        - URY
        - ARG
    Continent:
      type: string
      enum:
        - AMERICA
        - ASIA
        - AFRICA
        - EUROPE
        - OCEANIA
    PayinDTO:
      type: object
      properties:
        transactionId:
          type: string
          format: uuid
        accountId:
          type: string
          format: uuid
        merchantId:
          type: string
          format: uuid
        payoutRequestId:
          type: string
          format: uuid
        paymentIntentId:
          type: string
          format: uuid
        merchantName:
          type: string
        status:
          $ref: '#/components/schemas/TransactionStatus'
        externalId:
          type: string
        externalStatus:
          type: string
        transactionSyncDate:
          type: date
        transactionType:
          $ref: '#/components/schemas/TransactionType'
        currency:
          $ref: '#/components/schemas/Currency'
        amount:
          type: number
        subtotalAmount:
          type: number
        taxAmount:
          type: number
        tipAmount:
          type: number
        receivedAmount:
          type: number
        description:
          type: string
        conceptCode:
          $ref: '#/components/schemas/ConceptCode'
        liquidationDate:
          type: date
        cancelledAt:
          type: date
        cancellationReason:
          type: string
        createdAt:
          type: date
        person:
          type: object
          properties:
            lastName:
              type: string
            firstName:
              type: string
        paymentInstrumentData:
          type: object
          properties:
            maskedPan:
              type: string
            cardType:
              type: string
        paymentIntentInitiator:
          type: string
          enum:
            - LINK
            - B2B
            - ON_SITE
            - FAST_PAYMENT
    GetPayinsResponse:
      type: object
      properties:
        currentPage:
          type: string
        pageSize:
          type: string
        rowCount:
          type: integer
        pageCount:
          type: integer
        results:
          type: array
          items:
            $ref: '#/components/schemas/PayinDTO'
    GetSummaryResponse:
      type: object
      properties:
        pending:
          type: integer
        successful:
          type: integer
        failed:
          type: integer
    MerchantRequest:
      type: object
      properties:
        account:
          $ref: '#/components/schemas/Account'
        merchantName:
          type: string
          maxLength: 128
        transfersType:
          $ref: '#/components/schemas/TransfersType'
        email:
          type: string
          maxLength: 128
        phone:
          type: string
          maxLength: 128
        address:
          $ref: '#/components/schemas/AddressRequest'
        metadata:
          type: string
        currencies:
          type: array
          items:
            $ref: '#/components/schemas/Currency'
        countryProcessorsId:
          type: array
          items:
            type: string
            format: uuid
    MerchantConfigurationRequest:
      type: object
      properties:
        shortName:
          type: string
        notificationEmails:
          type: array
          items:
            type: string
        paymentSuccessNotification:
          type: boolean
        paymentErrorNotification:
          type: boolean
        fastPaymentsEnabled:
          type: boolean
        merchantCountryConfigurations:
          type: array
          items:
            $ref: '#/components/schemas/MerchantCountryConfigurationsRequest'
    MerchantDTO:
      type: object
      properties:
        merchantId:
          type: string
          format: uuid
        type:
          $ref: '#/components/schemas/BusinessType'
        merchantName:
          type: string
        phone:
          type: string
        taxIdNumber:
          type: string
        fantasyName:
          type: string
        email:
          type: string
        webSite:
          type: string
        dateOfFoundation:
          type: string
          format: date-time
        monthlyLoad:
          type: number
        monthlyLoadUsd:
          type: number
        monthlyTpvUsd:
          type: number
        averageTransactionUsd:
          type: number
        averageAnnualBilling:
          type: number
        status:
          $ref: '#/components/schemas/MerchantStatus'
        approvedAt:
          type: string
          format: date-time
        metadata:
          type: string
        businessId:
          type: string
          format: uuid
        accountCurrencies:
          type: string
        transfersType:
          $ref: '#/components/schemas/TransfersType'
        apiKey:
          type: string
        apiSecret:
          type: string
        account:
          $ref: '#/components/schemas/Account'
    GetMerchantsResponse:
      type: object
      properties:
        currentPage:
          type: string
        pageSize:
          type: string
        rowCount:
          type: integer
        pageCount:
          type: integer
        results:
          type: array
          items:
            $ref: '#/components/schemas/MerchantDTO'
    CountryProcessorDTO:
      type: object
      properties:
        countryProcessorId:
          type: string
          format: uuid
        paymentInstrumentTypeId:
          type: string
          format: uuid
        paymentInstrumentType:
          $ref: '#/components/schemas/PaymentInstrumentTypeDTO'
        paymentMethodId:
          type: string
          format: uuid
        paymentMethod:
          $ref: '#/components/schemas/PaymentMethodDTO'
        active:
          type: boolean
        currency:
          type: array
          items:
            type: string
    GetMerchantCountryProcessorResponse:
      type: array
      items:
        $ref: '#/components/schemas/MerchantCountryProcessorDTO'
    PayerDTO:
      type: object
      properties:
        payerId:
          type: string
          format: uuid
        externalId:
          type: string
          format: uuid
        firstName:
          type: string
        lastName:
          type: string
        documentType:
          $ref: '#/components/schemas/DocumentType'
        documentNumber:
          type: string
        email:
          type: string
        phone:
          type: string
        address:
          $ref: '#/components/schemas/AddressRequest'
        businessId:
          type: string
        merchantId:
          type: string
    PayerRequest:
      type: object
      properties:
        firstName:
          type: string
          maxLength: 128
        lastName:
          type: string
          maxLength: 128
        documentType:
          $ref: '#/components/schemas/DocumentType'
        document:
          type: string
          maxLength: 128
        email:
          type: string
          maxLength: 128
        merchantId:
          type: string
          format: uuid
        address:
          $ref: '#/components/schemas/AddressRequest'
        phone:
          type: string
          maxLength: 128
        country:
          $ref: '#/components/schemas/CountryCode'
    PaymentIntentMetadata:
      type: object
      properties:
        limitIssuers:
          type: array
          items:
            type: string
            examples:
              - 'MasterCard'
              - 'Visa'
              - 'Pix'
    GetPayersResponse:
      type: object
      properties:
        currentPage:
          type: string
        pageSize:
          type: string
        rowCount:
          type: integer
        pageCount:
          type: integer
        results:
          type: array
          items:
            $ref: '#/components/schemas/PayerDTO'
    UpdatePayerRequest:
      type: object
      properties:
        merchantExternalId:
          type: string
          format: uuid
        email:
          type: string
          maxLength: 128
        address:
          $ref: '#/components/schemas/AddressRequest'
        phone:
          type: string
          maxLength: 128
    PaymentIntentRequest:
      type: object
      required: [currency, amount, payinType, externalReference, offSession, invoiceNumber, country]
      properties:
        currency:
          $ref: '#/components/schemas/Currency'
        amount:
          type: number
        payinType:
          $ref: '#/components/schemas/PayinType'
        merchantId:
          type: string
          format: uuid
        externalReference:
          type: string
          maxLength: 128
        paymentInstrumentId:
          type: string
          format: uuid
        paymentInstrumentData:
          $ref: '#/components/schemas/PaymentInstrumentExpressCheckoutRequest'
        confirm:
          type: boolean
        payerId:
          type: string
          format: uuid
        payerData:
          $ref: '#/components/schemas/PayerRequest'
        setupFutureUsage:
          type: boolean
        offSession:
          type: boolean
        metadata:
          $ref: '#/components/schemas/PaymentIntentMetadata'
        invoiceNumber:
          type: number
        description:
          type: string
        tipAmount:
          type: number
        country:
          $ref: '#/components/schemas/CountryCode'
        vatPercentage:
          type: number
      anyOf:
        - required: ['payerId']
          not:
            required: ['payerData']
        - required: ['payerData']
          not:
            required: ['payerId']
        - required: ['paymentInstrumentId']
          not:
            required: ['paymentInstrumentData']
        - required: ['paymentInstrumentData']
          not:
            required: ['paymentInstrumentId']
    LinkPaymentIntentRequest:
      type: object
      required: [paymentInstrumentTypeName, paymentMethodName]
      properties:
        amount:
          type: number
        description:
          type: string
        paymentInstrumentTypeName:
          $ref: '#/components/schemas/PaymentInstrumentType'
        paymentMethodName:
          $ref: '#/components/schemas/PaymentMethod'
        paymentIntentAdditionalInfo:
          $ref: '#/components/schemas/PaymentIntentAdditionalInfo'
    PaymentInstrumentExpressCheckoutRequest:
      type: object
      properties:
        paymentInstrumentTypeName:
          $ref: '#/components/schemas/PaymentInstrumentType'
        paymentMethodName:
          $ref: '#/components/schemas/PaymentMethod'
        countries:
          type: array
          items:
            type: string
            format: uuid
        metadata:
          type: object
        merchantId:
          type: string
          format: uuid
      required:
        - paymentInstrumentTypeName
    CreatePaymentIntentResponse:
      type: object
      properties:
        paymentIntent:
          $ref: '#/components/schemas/PaymentIntentDTO'
        confirmationMethod:
          $ref: '#/components/schemas/ConfirmationMethod'
        status:
          $ref: '#/components/schemas/PaymentIntentStatus'
        nextAction:
          type: string
    FastPaymentIntentRequest:
      type: object
      properties:
        amount:
          type: number
        currency:
          $ref: '#/components/schemas/Currency'
        comment:
          type: string
        paymentInstrumentTypeName:
          $ref: '#/components/schemas/PaymentInstrumentType'
        paymentMethodName:
          $ref: '#/components/schemas/PaymentMethod'
        merchantShortName:
          type: string
        countryCode:
          $ref: '#/components/schemas/CountryCode'
        paymentIntentAdditionalInfo:
          $ref: '#/components/schemas/PaymentIntentAdditionalInfo'
      required:
        - [amount, currency, paymentInstrumentTypeName, paymentMethodName, merchantShortName, countryCode]
    PaymentIntentDTO:
      type: object
      properties:
        paymentIntentId:
          type: string
          format: uuid
        businessId:
          type: string
          format: uuid
        payerId:
          type: string
          format: uuid
        paymentInstrumentId:
          type: string
          format: uuid
        payinType:
          $ref: '#/components/schemas/PayinType'
        paymentIntentStatus:
          $ref: '#/components/schemas/PaymentIntentStatus'
        lastPaymentError:
          type: string
        externalReference:
          type: string
        externalChargeId:
          type: string
        externalInvoiceId:
          type: string
        invoiceEmail:
          type: string
        description:
          type: string
        currency:
          $ref: '#/components/schemas/Currency'
        subtotalAmount:
          type: number
        taxAmount:
          type: number
        tipAmount:
          type: number
        totalAmount:
          type: number
        receivedAmount:
          type: number
        confirmationInstrument:
          type: number
        nextAction:
          type: number
        statementDescriptor:
          type: number
        cancelledAt:
          type: string
          format: date-time
        cancellationReason:
          type: string
        receiptEmail:
          type: string
        setupFutureUsage:
          type: string
        metadata:
          type: string
        linkId:
          type: string
        createdAt:
          type: string
          format: date-time
        exchangeRate:
          type: number
    PaymentInstrumentRequest:
      type: object
      properties:
        payerId:
          type: string
          format: uuid
        payerData:
          $ref: '#/components/schemas/PayerRequest'
        paymentMethodName:
          $ref: '#/components/schemas/PaymentMethod'
        countries:
          type: array
          items:
            type: string
        metadata:
          type: object
        country:
          $ref: '#/components/schemas/CountryCode'
      required:
        - paymentMethodName
        - country
      anyOf:
        - required: ['payerId']
          not:
            required: ['payerData']
        - required: ['payerData']
          not:
            required: ['payerId']
    PaymentInstrumentDTO:
      type: object
      properties:
        paymentInstrumentId:
          type: string
          format: uuid
        merchantId:
          type: string
          format: uuid
        payerId:
          type: string
          format: uuid
        paymentInstrumentStatus:
          type: string
        paymentMethodId:
          type: string
          format: uuid
        externalId:
          type: string
        active:
          type: boolean
        validated:
          type: boolean
        countries:
          type: string
          format: array
        metadata:
          type: object
        nextAction:
          type: string
    AddressRequest:
      type: object
      properties:
        country:
          type: string
          format: uuid
        state:
          type: string
          maxLength: 128
        city:
          type: string
          maxLength: 128
        street:
          type: string
          maxLength: 128
        doorNumber:
          type: string
          maxLength: 128
        apartmentNumber:
          type: string
          maxLength: 128
        zipCode:
          type: string
          maxlength: 128
    ProviderPaymentMethodDTO:
      type: object
      properties:
        paymentMethodId:
          type: string
          format: uuid
        paymentMethodName:
          type: string
        imageUrl:
          type: string
        mayHaveAsyncPayments:
          type: boolean
        mayHavePaymentsLimits:
          type: boolean
        supportsReserve:
          type: boolean
    CreateMerchantCountryProcessorsRequest:
      type: object
      required: [countryProcessorsId]
      properties:
        countryProcessorsId:
          type: array
          items:
            type: string
            format: uuid
    UpdateMerchantCountryProcessorsRequest:
      type: object
      properties:
        countryProcessorId:
          type: string
          format: uuid
        active:
          type: boolean
    MerchantCountryProcessorsResponse:
      type: array
      items:
        $ref: '#/components/schemas/MerchantCountryProcessorDTO'
    MerchantCountryProcessorDTO:
      type: object
      properties:
        merchantCountryProcessorId:
          type: string
          format: uuid
        countryProcessor:
          $ref: '#/components/schemas/CountryProcessorDTO'
        merchant:
          type: object
          properties:
            merchantId:
              type: string
              format: uuid
        onboardingStatus:
          $ref: '#/components/schemas/MerchantStatus'
    ErrorGettingPaymentMethods:
      type: object
      properties:
        message:
          type: string
          examples: ['Error getting the payment methods']
        showMessage:
          type: object
          properties:
            EN:
              type: string
              examples: ['Error getting the payment methods']
            ES:
              type: string
              examples: ['Error al obtener los métodos de pago']
        needUpdate:
          type: boolean
          examples: [false]
        errorId:
          type: string
          examples: ['Payins.ERROR_IN_GET_PAYMENT_METHODS']
    UnauthorizedError:
      type: object
      properties:
        message:
          type: string
          examples: ['Unauthorized']
        showMessage:
          type: object
          properties:
            EN:
              type: string
              examples: ['Unauthorized']
            ES:
              type: string
              examples: ['No autorizado']
        needUpdate:
          type: boolean
          examples: [false]
        errorId:
          type: string
          examples: ['Auth:UNAUTHORIZED']
    ErrorBadApiKey:
      type: object
      properties:
        message:
          type: string
          examples: ['The provided api-key is incorrect']
        showMessage:
          type: object
          properties:
            EN:
              type: string
              examples: ['The provided api-key is incorrect']
            ES:
              type: string
              examples: ['La api-key proporcionada es incorrecta']
        needUpdate:
          type: boolean
          examples: [false]
        errorId:
          type: string
          examples: ['Auth:BAD_API_KEY']
    ErrorBadSignature:
      type: object
      properties:
        message:
          type: string
          examples: ['The provided signature is incorrect']
        showMessage:
          type: object
          properties:
            EN:
              type: string
              examples: ['The provided signature is incorrect']
            ES:
              type: string
              examples: ['La firma proporcionada es incorrecta']
        needUpdate:
          type: boolean
          examples: [false]
        errorId:
          type: string
          examples: ['Auth:BAD_SIGNATURE']
    ErrorGettingPayins:
      type: object
      properties:
        message:
          type: string
          examples: ['Error getting the payins']
        showMessage:
          type: object
          properties:
            EN:
              type: string
              examples: ['Error getting the payins']
            ES:
              type: string
              examples: ['Error al obtener los pagos']
        needUpdate:
          type: boolean
          examples: [false]
        errorId:
          type: string
          examples: ['Payins:ERROR_IN_GET_PAYINS']
    ErrorGettingPaymentIntent:
      type: object
      properties:
        message:
          type: string
          examples: ['Error getting payment intent']
        showMessage:
          type: object
          properties:
            EN:
              type: string
              examples: ['Error getting payment intent']
            ES:
              type: string
              examples: ['Error obteniendo el intento de pago']
        needUpdate:
          type: boolean
          examples: [false]
        errorId:
          type: string
          examples: ['Payins:ERROR_GETTING_PAYMENT_INTENT']
    ErrorGettingMerchants:
      type: object
      properties:
        message:
          type: string
          examples: ['Error getting the merchants']
        showMessage:
          type: object
          properties:
            EN:
              type: string
              examples: ['Error getting the merchants']
            ES:
              type: string
              examples: ['Error al obtener los merchants']
        needUpdate:
          type: boolean
          examples: [false]
        errorId:
          type: string
          examples: ['Payins:ERROR_IN_GET_MERCHANTS']
    ErrorGettingMerchant:
      type: object
      properties:
        message:
          type: string
          examples: ['Error getting the merchant']
        showMessage:
          type: object
          properties:
            EN:
              type: string
              examples: ['Error getting the merchant']
            ES:
              type: string
              examples: ['Error al obtener el merchant']
        needUpdate:
          type: boolean
          examples: [false]
        errorId:
          type: string
          examples: ['Payins:ERROR_IN_GET_MERCHANT']
    ErrorUpdatingMerchant:
      type: object
      properties:
        message:
          type: string
          examples: ['Error updating the merchant']
        showMessage:
          type: object
          properties:
            EN:
              type: string
              examples: ['Error updating the merchant']
            ES:
              type: string
              examples: ['Ocurrió un error en la actualización del merchant']
        needUpdate:
          type: boolean
          examples: [false]
        errorId:
          type: string
          examples: ['Payins:ERROR_IN_UPDATE_MERCHANT']
    ErrorDeletingMerchant:
      type: object
      properties:
        message:
          type: string
          examples: ['Error deleting the merchant']
        showMessage:
          type: object
          properties:
            EN:
              type: string
              examples: ['Error deleting the merchant']
            ES:
              type: string
              examples: ['Ocurrió un error al intentar borrar el merchant']
        needUpdate:
          type: boolean
          examples: [false]
        errorId:
          type: string
          examples: ['Payins:ERROR_IN_DELETE_MERCHANT']
    ErrorGettingPayers:
      type: object
      properties:
        message:
          type: string
          examples: ['Error getting payers']
        showMessage:
          type: object
          properties:
            EN:
              type: string
              examples: ['Error getting payers']
            ES:
              type: string
              examples: ['Error al obtener los pagadores']
        needUpdate:
          type: boolean
          examples: [false]
        errorId:
          type: string
          examples: ['Payins:ERROR_IN_GET_PAYERS']
    ErrorCreatingPayer:
      type: object
      properties:
        message:
          type: string
          examples: ['Error creating payer']
        showMessage:
          type: object
          properties:
            EN:
              type: string
              examples: ['Error creating payer']
            ES:
              type: string
              examples: ['Ocurrió un error en la creación del pagador']
        needUpdate:
          type: boolean
          examples: [false]
        errorId:
          type: string
          examples: ['Payins:ERROR_IN_CREATE_PAYER']
    ErrorGettingPayer:
      type: object
      properties:
        message:
          type: string
          examples: ['Error getting payer']
        showMessage:
          type: object
          properties:
            EN:
              type: string
              examples: ['Error getting payer']
            ES:
              type: string
              examples: ['Error al obtener el pagador']
        needUpdate:
          type: boolean
          examples: [false]
        errorId:
          type: string
          examples: ['Payins:ERROR_IN_GET_PAYER']
    ErrorUpdatingPayer:
      type: object
      properties:
        message:
          type: string
          examples: ['Error updating payer']
        showMessage:
          type: object
          properties:
            EN:
              type: string
              examples: ['Error updating payer']
            ES:
              type: string
              examples: ['Ocurrió un error en la actualización del pagador']
        needUpdate:
          type: boolean
          examples: [false]
        errorId:
          type: string
          examples: ['Payins:ERROR_IN_UPDATE_PAYER']
    ErrorDeletingPayer:
      type: object
      properties:
        message:
          type: string
          examples: ['Error deleting payer']
        showMessage:
          type: object
          properties:
            EN:
              type: string
              examples: ['Error deleting payer']
            ES:
              type: string
              examples: ['Ocurrió un error al intentar borrar el pagador']
        needUpdate:
          type: boolean
          examples: [false]
        errorId:
          type: string
          examples: ['Payins:ERROR_IN_DELETE_PAYER']
    ErrorGetingPayerPaymentInstruments:
      type: object
      properties:
        message:
          type: string
          examples: ['Error getting payment instruments for the payer']
        showMessage:
          type: object
          properties:
            EN:
              type: string
              examples: ['Error getting payment instruments for the payer']
            ES:
              type: string
              examples: ['Error al obtener los instrumentos de pago del pagador']
        needUpdate:
          type: boolean
          examples: [false]
        errorId:
          type: string
          examples: ['Payins:ERROR_IN_GET_PAYER_PAYMENT_INSTRUMENTS']
    ErrorRegisteringPaymentIntent:
      type: object
      properties:
        message:
          type: string
          examples: ['Error registering payment intent']
        showMessage:
          type: object
          properties:
            EN:
              type: string
              examples: ['Error registering payment intent']
            ES:
              type: string
              examples: ['Error en el registro del intento de pago']
        needUpdate:
          type: boolean
          examples: [false]
        errorId:
          type: string
          examples: ['Payins:ERROR_IN_CREATE_EXPRESS_CHECKOUT_PAYMENT_INTENT']
    ErrorCancellingPaymentIntent:
      type: object
      properties:
        message:
          type: string
          examples: ['Error cancelling payment intent']
        showMessage:
          type: object
          properties:
            EN:
              type: string
              examples: ['Error cancelling payment intent']
            ES:
              type: string
              examples: ['Error cancelando el intento de pago']
        needUpdate:
          type: boolean
          examples: [false]
        errorId:
          type: string
          examples: ['Payins:ERROR_CANCELLING_PAYMENT_INTENT']
    ErrorRefundingPaymentIntent:
      type: object
      properties:
        message:
          type: string
          examples: ['Error refunding payment intent']
        showMessage:
          type: object
          properties:
            EN:
              type: string
              examples: ['Error refunding payment intent']
            ES:
              type: string
              examples: ['Error reintegrando el intento de pago']
        needUpdate:
          type: boolean
          examples: [false]
        errorId:
          type: string
          examples: ['Payins:ERROR_REFUNDING_PAYMENT_INTENT']
    ErrorRegisteringExpressCheckoutPaymentIntent:
      type: object
      properties:
        message:
          type: string
          examples: ['Error on Express Checkout payment intent']
        showMessage:
          type: object
          properties:
            EN:
              type: string
              examples: ['Error on Express Checkout payment intent']
            ES:
              type: string
              examples: ['Error en intento de pago de Express Checkout']
        needUpdate:
          type: boolean
          examples: [false]
        errorId:
          type: string
          examples: ['Payins:ERROR_IN_CREATE_PAYMENT_INTENT']
    ErrorGetingPaymentInstruments:
      type: object
      properties:
        message:
          type: string
          examples: ['Error getting payment instruments']
        showMessage:
          type: object
          properties:
            EN:
              type: string
              examples: ['Error getting payment instruments']
            ES:
              type: string
              examples: ['Error al obtener los instrumentos de pago']
        needUpdate:
          type: boolean
          examples: [false]
        errorId:
          type: string
          examples: ['Payins:ERROR_IN_GET_PAYMENT_INSTRUMENTS']
    ErrorCreatingPaymentInstrument:
      type: object
      properties:
        message:
          type: string
          examples: ['Error creating the payment instrument']
        showMessage:
          type: object
          properties:
            EN:
              type: string
              examples: ['Error creating the payment instrument']
            ES:
              type: string
              examples: ['Ocurrió un error en la creación del instrumento de pago']
        needUpdate:
          type: boolean
          examples: [false]
        errorId:
          type: string
          examples: ['Payins:ERROR_IN_CREATE_PAYMENT_INSTRUMENT']
    ErrorGetingPaymentInstrument:
      type: object
      properties:
        message:
          type: string
          examples: ['Error getting payment instrument']
        showMessage:
          type: object
          properties:
            EN:
              type: string
              examples: ['Error getting payment instrument']
            ES:
              type: string
              examples: ['Error al obtener el instrumento de pago']
        needUpdate:
          type: boolean
          examples: [false]
        errorId:
          type: string
          examples: ['Payins:ERROR_IN_GET_PAYMENT_INSTRUMENT']
    ErrorCreatingMerchantCountryProcessors:
      type: object
      properties:
        message:
          type: string
          examples: ['Error creating the merchant country processors']
        showMessage:
          type: object
          properties:
            EN:
              type: string
              examples: ['Error creating the merchant country processors']
            ES:
              type: string
              examples: ['Error al asociar el comercio con los procesadores de los paices']
        needUpdate:
          type: boolean
          examples: [false]
        errorId:
          type: string
          examples: ['Payins:ERROR_IN_CREATE_MERCHANT_COUNTRY_PROCESSORS']
    ErrorUpdatingMerchantCountryProcessors:
      type: object
      properties:
        message:
          type: string
          examples: ['Error updating the merchant country processor']
        showMessage:
          type: object
          properties:
            EN:
              type: string
              examples: ['Error updating the merchant country processor']
            ES:
              type: string
              examples: ['Error al actualizar el procesador de pagos de la empresa']
        needUpdate:
          type: boolean
          examples: [false]
        errorId:
          type: string
          examples: ['Payins:ERROR_UPDATING_MERCHANT_COUNTRY_PROCESSOR']
    ErrorGettingMerchantConfiguration:
      type: object
      properties:
        message:
          type: string
          examples: ['Error getting merchant configuration']
        showMessage:
          type: object
          properties:
            EN:
              type: string
              examples: ['Error getting merchant configuration']
            ES:
              type: string
              examples: ['Error al obtener la configuracion del comercio']
        needUpdate:
          type: boolean
          examples: [false]
        errorId:
          type: string
          examples: ['Payins:ERROR_IN_GET_MERCHANT_CONFIGURATION']
    ErrorUpdatingMerchantConfiguration:
      type: object
      properties:
        message:
          type: string
          examples: ['Error updating merchant configuration']
        showMessage:
          type: object
          properties:
            EN:
              type: string
              examples: ['Error updating merchant configuration']
            ES:
              type: string
              examples: ['Error al actualizar la configuracion del comercio']
        needUpdate:
          type: boolean
          examples: [false]
        errorId:
          type: string
          examples: ['Payins:ERROR_IN_UPDATE_MERCHANT_CONFIGURATION']
    MerchantConfigurationDTO:
      type: object
      properties:
        merchantConfigurationId:
          type: string
          format: uuid
        paymentSuccessNotification:
          type: boolean
        paymentErrorNotification:
          type: boolean
        notificationEmails:
          type: array
          items:
            type: string
        shortName:
          type: string
        fastPaymentsEnabled:
          type: boolean
        merchantId:
          type: string
          format: uuid
        merchantCountryConfigurations:
          type: array
          items:
            $ref: '#/components/schemas/MerchantCountryConfigurationDTO'
    BusinessCountryProcessorDTO:
      type: object
      properties:
        businessCountryProcessorId:
          type: string
          format: uuid
        countryProcessor:
          $ref: '#/components/schemas/CountryProcessorDTO'
    GetBusinessCountryProcessorsResponse:
      type: array
      items:
        $ref: '#/components/schemas/BusinessCountryProcessorDTO'
    ErrorGettingBusinessCountryProcessors:
      type: object
      properties:
        message:
          type: string
          examples: ['Error getting business country processors']
        showMessage:
          type: object
          properties:
            EN:
              type: string
              examples: ['Error getting business country processors']
            ES:
              type: string
              examples: ['Error al obtener los procesadores de pago de la empresa']
        needUpdate:
          type: boolean
          examples: [false]
        errorId:
          type: string
          examples: ['Payins:ERROR_GETTING_BUSINESS_COUNTRY_PROCESSORS']
    ErrorGettingLinks:
      type: object
      properties:
        message:
          type: string
          examples:
            - Error getting links
        showMessage:
          type: object
          properties:
            EN:
              type: string
              examples:
                - Error getting links
            ES:
              type: string
              examples:
                - Error al obtener los links
        needUpdate:
          type: boolean
          examples:
            - false
        errorId:
          type: string
          examples:
            - Payins:ERROR_GETTING_LINKS
    CreateLinkRequest:
      type: object
      properties:
        amount:
          type: number
          format: float
        vatPercentage:
          type: number
        description:
          type: string
        reference:
          type: string
        currency:
          $ref: '#/components/schemas/Currency'
        merchantCountryProcessors:
          type: array
          items:
            type: string
            format: uuid
        country:
          $ref: '#/components/schemas/CountryCode'
        expirationDate:
          type: string
          format: date-time
      required:
        - amount
        - country
        - currency
        - vatPercentage
        - merchantCountryProcessors
    UpdateLinkRequest:
      type: object
      properties:
        amount:
          type: number
          format: float
        vatPercentage:
          type: number
        description:
          type: string
        reference:
          type: string
        currency:
          $ref: '#/components/schemas/Currency'
        merchantCountryProcessors:
          type: array
          items:
            type: string
            format: uuid
        expirationDate:
          type: string
          format: date-time
    ShareLinkRequest:
      type: object
      properties:
        receiverEmail:
          type: string
        receiverName:
          type: string
      required:
        - receiverEmail
        - receiverName
    LinkDTO:
      type: object
      properties:
        linkId:
          type: string
          format: uuid
        description:
          type: string
        currency:
          $ref: '#/components/schemas/Currency'
        amount:
          type: number
        vatPercentage:
          type: number
        merchantId:
          type: string
          format: uuid
        countryId:
          type: string
          format: uuid
        expirationDate:
          type: string
          format: date-time
        used:
          type: boolean
        paymentIntentId:
          type: string
          format: uuid
        usedAt:
          type: string
          format: date-time
        linkCountryProcessors:
          type: array
          items:
            $ref: '#/components/schemas/LinkCountryProcessorDTO'
    ErrorGettingLink:
      type: object
      properties:
        message:
          type: string
          examples: ['Error getting link']
        showMessage:
          type: object
          properties:
            EN:
              type: string
              examples: ['Error getting link']
            ES:
              type: string
              examples: ['Error al obtener el link']
        needUpdate:
          type: boolean
          examples: [false]
        errorId:
          type: string
          examples: ['Payins:ERROR_GETTING_LINK']
    LinkDoesNotExist:
      type: object
      properties:
        message:
          type: string
          examples: ['Link does not exist']
        showMessage:
          type: object
          properties:
            EN:
              type: string
              examples: ['Link does not exist']
            ES:
              type: string
              examples: ['El link no existe']
        needUpdate:
          type: boolean
          examples: [false]
        errorId:
          type: string
          examples: ['Payins:LINK_DOES_NOT_EXIST']
    PaymentIntentAlreadyRefunded:
      type: object
      properties:
        message:
          type: string
          examples: ['Payment intent already refunded']
        showMessage:
          type: object
          properties:
            EN:
              type: string
              examples: ['Payment intent already refunded']
            ES:
              type: string
              examples: ['El intento de pago ya fue reintegrado']
        needUpdate:
          type: boolean
          examples: [false]
        errorId:
          type: string
          examples: ['Payins:PAYMENT_INTENT_ALREADY_REFUNDED']
    LinkAlreadyUsed:
      type: object
      properties:
        message:
          type: string
          examples: ['Link already used']
        showMessage:
          type: object
          properties:
            EN:
              type: string
              examples: ['Link already used']
            ES:
              type: string
              examples: ['Link ya utilizado']
        needUpdate:
          type: boolean
          examples: [false]
        errorId:
          type: string
          examples: ['Payins:LINK_ALREADY_USED']
    LinkExpired:
      type: object
      properties:
        message:
          type: string
          examples: ['Link expired']
        showMessage:
          type: object
          properties:
            EN:
              type: string
              examples: ['Link expired']
            ES:
              type: string
              examples: ['Link expirado']
        needUpdate:
          type: boolean
          examples: [false]
        data:
          schema:
            $ref: '#/components/schemas/LinkDTO'
        errorId:
          type: string
          examples: ['Payins:ERROR_LINK_EXPIRED']
    ErrorCreatingLink:
      type: object
      properties:
        message:
          type: string
          examples: ['Error creating link']
        showMessage:
          type: object
          properties:
            EN:
              type: string
              examples: ['Error creating link']
            ES:
              type: string
              examples: ['Error creando el link']
        needUpdate:
          type: boolean
          examples: [false]
        errorId:
          type: string
          examples: ['Payins:ERROR_CREATING_LINK']
    ErrorUpdatingLink:
      type: object
      properties:
        message:
          type: string
          examples: ['Error updating link']
        showMessage:
          type: object
          properties:
            EN:
              type: string
              examples: ['Error updating link']
            ES:
              type: string
              examples: ['Error al actualizar link']
        needUpdate:
          type: boolean
          examples: [false]
        errorId:
          type: string
          examples: ['Payins:ERROR_UPDATING_LINK']
    ErrorSharingLink:
      type: object
      properties:
        message:
          type: string
          examples: ['Error sharing link']
        showMessage:
          type: object
          properties:
            EN:
              type: string
              examples: ['Error sharing link']
            ES:
              type: string
              examples: ['Error compartiendo link']
        needUpdate:
          type: boolean
          examples: [false]
        errorId:
          type: string
          examples: ['Payins:ERROR_SHARING_LINK']
    LinkCountryProcessorDTO:
      type: object
      properties:
        linkCountryProcessorId:
          type: string
          format: uuid
        linkId:
          type: string
          format: uuid
        countryProcessorId:
          type: string
          format: uuid
        countryProcessor:
          $ref: '#/components/schemas/CountryProcessorDTO'
    ErrorDeletingLink:
      type: object
      properties:
        message:
          type: string
          examples: ['Error deleting link']
        showMessage:
          type: object
          properties:
            EN:
              type: string
              examples: ['Error deleting link']
            ES:
              type: string
              examples: ['Error eliminando el link']
        needUpdate:
          type: boolean
          examples: [false]
        errorId:
          type: string
          examples: ['Payins:ERROR_DELETING_LINK']
    PaymentMethodDTO:
      type: object
      properties:
        paymentMethodId:
          type: string
          format: uuid
        paymentMethodName:
          type: string
        paymentInstrumentTypeId:
          type: string
          format: uuid
    PaymentInstrumentTypeDTO:
      type: object
      properties:
        paymentInstrumentTypeId:
          type: string
          format: uuid
        paymentInstrumentTypeName:
          type: string
    RefundPaymentIntentRequest:
      type: object
      properties:
        requestedRefundAmount:
          type: number
    CountryDTO:
      type: object
      properties:
        countryId:
          type: string
          format: uuid
        name:
          type: string
        nameEs:
          type: string
        iso31662AlphabeticalCode:
          type: string
        iso31663AlphabeticalCode:
          type: string
        iso3166NumericCode:
          type: number
        iso4217CurrencyCode:
          type: string
        phoneCode:
          type: number
        continent:
          $ref: '#/components/schemas/Continent'
        vatPercentage:
          type: array
          items:
            type: number
        currency:
          type: array
          items:
            type: string
    MerchantCountryConfigurationDTO:
      type: object
      properties:
        merchantCountryConfigurationId:
          type: string
          format: uuid
        merchantId:
          type: string
          format: uuid
        countryId:
          type: string
          format: uuid
        country:
          $ref: '#/components/schemas/CountryDTO'
        vatPercentage:
          type: number
    MerchantCountryConfigurationsRequest:
      type: object
      properties:
        countryIsoAlpha3:
          type: string
          format: uuid
        vatPercentage:
          type: number
    PaymentIntentAdditionalInfo:
      type: object
      properties:
        paymentInfo:
          type: object
          properties:
            cbu:
              type: string
            alias:
              type: string
        payerInfo:
          type: object
          properties:
            dni:
              type: string
            email:
              type: string
    GetMerchantPublicDataResponse:
      type: object
      properties:
        fantasyName:
          type: string
    GetPaymentIntentPaymentMethodsResponse:
      type: object
      properties:
        paymentIntentAvailablePaymentMethods:
          type: array
          items:
            $ref: '#/components/schemas/CountryProcessorDTO'
        paymentData:
          type: object
          properties:
            reference:
              type: string
            description:
              type: string
            countryId:
              type: string
              format: uuid
            currency:
              $ref: '#/components/schemas/Currency'
            amount:
              type: number
            vatAmount:
              type: number
            merchantFantasyName:
              type: string
    InitializePaymentIntentB2BRequest:
      type: object
      properties:
        countryProcessorId:
          type: string
          format: uuid
        paymentIntentAdditionalInfo:
          $ref: '#/components/schemas/PaymentIntentAdditionalInfo'
    InitializePaymentIntentB2BResponse:
      type: object
      properties:
        paymentIntent:
          $ref: '#/components/schemas/PaymentIntentDTO'
        gatewayReferenceId:
          type: string
        gatewayUrl:
          type: string
    ErrorInitializingB2BPayment:
      type: object
      properties:
        message:
          type: string
          examples:
            - Error initializing B2B payment
        showMessage:
          type: object
          properties:
            EN:
              type: string
              examples:
                - Error initializing B2B payment
            ES:
              type: string
              examples:
                - Error iniciando intento de pago
        needUpdate:
          type: boolean
          examples:
            - false
        errorId:
          type: string
          examples:
            - Payins:ERROR_INITIALIZING_PAYMENT_B2B
    ManualRefundPaymentIntentRequest:
      type: object
      properties:
        requestedRefundAmount:
          type: number
        status:
          type: string
          enum:
            - MANUAL_REFUND_PENDING
            - MANUAL_REFUND_CONFIRMED