From 44e4d612ff6eadb5dc9e1051060610105e73271a Mon Sep 17 00:00:00 2001 From: franklin Date: Wed, 21 Oct 2026 14:49:37 -0500 Subject: [PATCH] feat: add GET /settings/payment-methods endpoint to Companies Document the payment method settings endpoint, which returns the admin, merchant and effective enablement flags for each payment method of the authenticated company. Co-Authored-By: Claude Fable 5.1 --- _build/api.yaml | 183 ++++++++++++++++++ api.yaml | 2 + .../companies/payment_method_settings.yml | 76 ++++++++ schemas/companies/payment_method_setting.yml | 20 ++ .../payment_method_settings_response.yml | 26 +++ 5 files changed, 307 insertions(+) create mode 100644 resources/companies/payment_method_settings.yml create mode 100644 schemas/companies/payment_method_setting.yml create mode 100644 schemas/companies/payment_method_settings_response.yml diff --git a/_build/api.yaml b/_build/api.yaml index 0b40bfd..a1fcb46 100644 --- a/_build/api.yaml +++ b/_build/api.yaml @@ -3443,6 +3443,140 @@ paths: summary: Get Company Documents tags: - Companies + /settings/payment-methods: + get: + description: "Retrieves the enablement status of each payment method for the\ + \ currently authenticated company. For every payment method the response indicates\ + \ whether it is enabled by Conekta (`admin`), enabled by the merchant (`merchant`),\ + \ and the resulting state (`effective`)." + operationId: getPaymentMethodSettings + parameters: + - description: Use for knowing which language to use + examples: + es: + summary: for spanish request/response + value: es + en: + summary: for english request/response + value: en + explode: false + in: header + name: Accept-Language + required: false + schema: + default: es + enum: + - es + - en + type: string + style: simple + responses: + "200": + content: + application/vnd.conekta-v2.3.0+json: + example: + card_payment: + admin: true + merchant: true + effective: true + apple_payment: + admin: true + merchant: true + effective: true + google_payment: + admin: true + merchant: true + effective: true + cash_payment: + admin: true + merchant: true + effective: true + bank_transfer_payment: + admin: true + merchant: true + effective: true + bnpl_payment: + admin: true + merchant: false + effective: false + pay_by_bank_payment: + admin: false + merchant: true + effective: false + schema: + $ref: "#/components/schemas/payment_method_settings_response" + description: successful + headers: + Date: + description: The date and time that the response was sent + explode: false + schema: + example: "Fri, 03 Feb 2023 16:57:48 GMT" + type: string + style: simple + Content-Type: + description: The format of the response body + explode: false + schema: + example: application/json; charset=utf-8 + type: string + style: simple + Content-Length: + description: The length of the response body in bytes + explode: false + schema: + example: "512" + type: string + style: simple + Connection: + description: The type of connection used to transfer the response + explode: false + schema: + example: keep-alive + type: string + style: simple + Conekta-Media-Type: + description: The version of the API used to process the request and + the format of the response body + explode: false + schema: + example: conekta-v2.3.0; format=application/json + type: string + style: simple + "401": + content: + application/vnd.conekta-v2.3.0+json: + example: + details: + - message: Please include your access key in your request. + code: conekta.errors.authentication.missing_key + log_id: 507f1f77bcf86cd799439011 + object: error + type: authentication_error + schema: + $ref: "#/components/schemas/error" + description: authentication error + "500": + content: + application/vnd.conekta-v2.3.0+json: + example: + details: + - debug_message: There was a runtime error and Conekta engineers have + been notified. + message: There was a runtime error and Conekta engineers have been + notified. + code: conekta.errors.api.system.general_failure + object: error + type: api_error + log_id: 641b6f2b3cd9a50001515098 + schema: + $ref: "#/components/schemas/error" + description: internal server error + security: + - bearerAuth: [] + summary: Get Payment Method Settings + tags: + - Companies /customers: get: description: "The purpose of business is to create and maintain a client, you\ @@ -18255,6 +18389,55 @@ components: - file_name - status title: CompanyDocumentResponse + payment_method_setting: + description: Enablement flags for a single payment method. + properties: + admin: + description: Indicates if the payment method is enabled by Conekta for the + company. + example: true + type: boolean + merchant: + description: Indicates if the payment method is enabled by the merchant + in its own settings. + example: true + type: boolean + effective: + description: Final state of the payment method. It is only true when both + `admin` and `merchant` are enabled. + example: true + type: boolean + required: + - admin + - effective + - merchant + title: payment_method_setting + payment_method_settings_response: + description: Enablement status of each payment method available for the company. + properties: + card_payment: + $ref: "#/components/schemas/payment_method_setting" + apple_payment: + $ref: "#/components/schemas/payment_method_setting" + google_payment: + $ref: "#/components/schemas/payment_method_setting" + cash_payment: + $ref: "#/components/schemas/payment_method_setting" + bank_transfer_payment: + $ref: "#/components/schemas/payment_method_setting" + bnpl_payment: + $ref: "#/components/schemas/payment_method_setting" + pay_by_bank_payment: + $ref: "#/components/schemas/payment_method_setting" + required: + - apple_payment + - bank_transfer_payment + - bnpl_payment + - card_payment + - cash_payment + - google_payment + - pay_by_bank_payment + title: payment_method_settings_response customer_antifraud_info_response: nullable: true properties: diff --git a/api.yaml b/api.yaml index 4a99d7a..4c9c98e 100644 --- a/api.yaml +++ b/api.yaml @@ -56,6 +56,8 @@ paths: $ref: './resources/companies/company_document.yml' '/companies/{company_id}/documents': $ref: './resources/companies/company_documents.yml' + /settings/payment-methods: + $ref: "./resources/companies/payment_method_settings.yml" /customers: $ref: "./resources/customers/create_customer.yml" /customers/{id}: diff --git a/resources/companies/payment_method_settings.yml b/resources/companies/payment_method_settings.yml new file mode 100644 index 0000000..228d7ec --- /dev/null +++ b/resources/companies/payment_method_settings.yml @@ -0,0 +1,76 @@ +get: + tags: + - Companies + operationId: getPaymentMethodSettings + summary: Get Payment Method Settings + description: Retrieves the enablement status of each payment method for the currently authenticated company. For every payment method the response indicates whether it is enabled by Conekta (`admin`), enabled by the merchant (`merchant`), and the resulting state (`effective`). + responses: + 200: + description: successful + content: + application/vnd.conekta-v2.3.0+json: + schema: + $ref: '../../schemas/companies/payment_method_settings_response.yml' + example: + card_payment: + admin: true + merchant: true + effective: true + apple_payment: + admin: true + merchant: true + effective: true + google_payment: + admin: true + merchant: true + effective: true + cash_payment: + admin: true + merchant: true + effective: true + bank_transfer_payment: + admin: true + merchant: true + effective: true + bnpl_payment: + admin: true + merchant: false + effective: false + pay_by_bank_payment: + admin: false + merchant: true + effective: false + 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: "512" + Connection: + description: The type of connection used to transfer the response + schema: + type: string + example: "keep-alive" + Conekta-Media-Type: + description: The version of the API used to process the request and the format of the response body + schema: + type: string + example: conekta-v2.3.0; format=application/json + 401: + $ref: '../errors/401.yml' + 500: + $ref: '../errors/500.yml' + security: + - bearerAuth: [] + parameters: + - $ref: '../../parameters/commons/headers/accept_language.yml' diff --git a/schemas/companies/payment_method_setting.yml b/schemas/companies/payment_method_setting.yml new file mode 100644 index 0000000..7e30a44 --- /dev/null +++ b/schemas/companies/payment_method_setting.yml @@ -0,0 +1,20 @@ +type: object +title: payment_method_setting +description: Enablement flags for a single payment method. +properties: + admin: + type: boolean + description: Indicates if the payment method is enabled by Conekta for the company. + example: true + merchant: + type: boolean + description: Indicates if the payment method is enabled by the merchant in its own settings. + example: true + effective: + type: boolean + description: Final state of the payment method. It is only true when both `admin` and `merchant` are enabled. + example: true +required: + - admin + - merchant + - effective diff --git a/schemas/companies/payment_method_settings_response.yml b/schemas/companies/payment_method_settings_response.yml new file mode 100644 index 0000000..f7c0a9e --- /dev/null +++ b/schemas/companies/payment_method_settings_response.yml @@ -0,0 +1,26 @@ +type: object +title: payment_method_settings_response +description: Enablement status of each payment method available for the company. +properties: + card_payment: + $ref: './payment_method_setting.yml' + apple_payment: + $ref: './payment_method_setting.yml' + google_payment: + $ref: './payment_method_setting.yml' + cash_payment: + $ref: './payment_method_setting.yml' + bank_transfer_payment: + $ref: './payment_method_setting.yml' + bnpl_payment: + $ref: './payment_method_setting.yml' + pay_by_bank_payment: + $ref: './payment_method_setting.yml' +required: + - card_payment + - apple_payment + - google_payment + - cash_payment + - bank_transfer_payment + - bnpl_payment + - pay_by_bank_payment