diff --git a/api.yaml b/api.yaml index f8340e4..789f090 100644 --- a/api.yaml +++ b/api.yaml @@ -68,6 +68,8 @@ paths: $ref: "./resources/logs/log.yml" /logs/{id}: $ref: "./resources/logs/log_by_id.yml" + /monthly_installments/validate: + $ref: "./resources/monthly_installments/monthly_installments_validate.yml" /orders: $ref: "./resources/orders/order.yml" /orders/{id}: diff --git a/requestBodies/monthly_installments/monthly_installments_validate.yml b/requestBodies/monthly_installments/monthly_installments_validate.yml new file mode 100644 index 0000000..d5133c7 --- /dev/null +++ b/requestBodies/monthly_installments/monthly_installments_validate.yml @@ -0,0 +1,6 @@ +description: requested field for monthly installments validate +content: + application/json: + schema: + $ref: '../../schemas/monthly_installments/monthly_installments_validate.yml' +required: true diff --git a/resources/monthly_installments/monthly_installments_validate.yml b/resources/monthly_installments/monthly_installments_validate.yml new file mode 100644 index 0000000..56fd8bb --- /dev/null +++ b/resources/monthly_installments/monthly_installments_validate.yml @@ -0,0 +1,51 @@ +post: + tags: + - Monthly Installments + operationId: validateMonthlyInstallments + summary: Validate Monthly Installments + description: | + Returns the interest-free monthly installment plans available for a card BIN and an amount, so a checkout can offer only the plans a later charge will accept. Requires monthly installments to be enabled on the company. + responses: + 200: + description: successful operation + content: + application/vnd.conekta-v2.3.0+json: + schema: + $ref: '../../schemas/monthly_installments/monthly_installments_validate_response.yml' + headers: + Date: + description: The date and time that the response was sent + schema: + type: string + example: "Fri, 03 Feb 2023 16:57:48 GMT" + Content-Type: + description: The format of the response body + schema: + type: string + example: "application/json; charset=utf-8" + Content-Length: + description: The length of the response body in bytes + schema: + type: string + example: "245" + Connection: + description: The type of connection used to transfer the response + schema: + type: string + example: "keep-alive" + Conekta-Media-Type: + schema: + type: string + example: conekta-v2.3.0; format=application/json + 401: + $ref: '../errors/401.yml' + 422: + $ref: '../errors/422.yml' + 500: + $ref: '../errors/500.yml' + security: + - bearerAuth: [] + requestBody: + $ref: '../../requestBodies/monthly_installments/monthly_installments_validate.yml' + parameters: + - $ref: '../../parameters/commons/headers/accept_language.yml' diff --git a/schemas/monthly_installments/monthly_installments_validate.yml b/schemas/monthly_installments/monthly_installments_validate.yml new file mode 100644 index 0000000..71c7b8e --- /dev/null +++ b/schemas/monthly_installments/monthly_installments_validate.yml @@ -0,0 +1,18 @@ +title: monthly installments validate request +description: BIN and amount to evaluate for interest-free monthly installments +type: object +required: + - bin + - amount +properties: + bin: + type: string + description: "First 6 or 8 digits of the card number (Bank Identification Number). An 8 digit BIN that yields no match is retried with its first 6 digits." + example: "411111" + minLength: 6 + maxLength: 8 + pattern: '^[0-9]{6}(?:[0-9]{2})?$' + amount: + type: integer + description: "Amount to charge in the smallest currency unit (cents for MXN). Used to compute the monthly fee of each available plan." + example: 350000 diff --git a/schemas/monthly_installments/monthly_installments_validate_response.yml b/schemas/monthly_installments/monthly_installments_validate_response.yml new file mode 100644 index 0000000..2e15515 --- /dev/null +++ b/schemas/monthly_installments/monthly_installments_validate_response.yml @@ -0,0 +1,44 @@ +title: monthly_installments_validate_response +description: monthly installments validate response +type: object +required: + - available_installments + - bin_info +properties: + available_installments: + title: monthly_installments_validate_response_available_installments + type: array + description: "Interest-free monthly installment plans available for this card and amount. Empty when the card does not qualify for monthly installments, for example a debit card or a credit card not issued in Mexico. An empty array is not an error." + items: + type: object + required: + - months + - amount + properties: + months: + type: integer + description: "Number of monthly installments of the plan. One of 3, 6, 9, 12, 18 or 24." + example: 3 + amount: + type: integer + description: "Amount of each monthly installment in the smallest currency unit, rounded up." + example: 116667 + bin_info: + type: object + required: + - country + - scheme + - issuer + properties: + country: + type: string + description: "Country that issued the card. Monthly installments only apply to mx, with the exception of American Express." + example: "mx" + scheme: + type: string + description: "Card scheme. Monthly installments only apply to credit." + example: "credit" + issuer: + type: string + description: "Bank that issued the card." + example: "banamex"