Payment Methods

Crear Payment Method

Changed on

Inscribe un Payment Method para un Customer.

La respuesta depende de si la inscripción alcanzó a resolverse en la misma llamada. Cuando se resuelve, responde 201 y detail trae los identificadores del Payment Method creado, de sus intentos de inscripción y del Payment Instrument asociado. Cuando queda agendada para procesarse de forma asíncrona, responde 202 y todavía no hay identificadores que devolver.

post/payment-methods

Request

  • Base URL
    https://api.trytoku.com
  • URL
    https://api.trytoku.com/payment-methods
  • Auth
    API key in header x-api-key

Request body

checkout_session_idstring
engine'GATEWAY' | 'SAAS' | 'SAAS_UNRESTRICTED_AMOUNT' | 'SAAS_MULTIPLE_CUSTOMERS'

Motor que ejecuta los cobros de un medio de pago. GATEWAY los cursa por una integración de gateway; las tres variantes SAAS_* corresponden a los modos en que Toku opera el cobro como servicio, y se distinguen entre sí por las restricciones de monto y de cliente del medio de pago inscrito.

exclude_from_recurringboolean
external_idstring
gateway'transbank_oneclick' | 'klap_oneclick' | 'patpass' | 'toku_pac' | 'fintoc_pac' | 'universo_pac' | 'external_pac' | 'ecert_pac' | 'manual_pac' | 'internal_psp' | 'domiciliation' | 'mx_banco_bbva' | 'mx_banco_bancomer' | 'mx_banco_banbajio' | 'mx_banco_banorte' | 'mx_banco_banorte_h2h' | 'mx_banco_banregio' | 'mx_banco_bbva_bancomer' | 'mx_banco_citibanamex' | 'mx_banco_santander' | 'mx_banco_scotiabank' | 'mx_banco_scotiabank_h2h_external' | 'evo_payments' | 'conekta' | 'stripe' | 'kushki' | 'openpay' | 'paypal' | 'getnet' | 'fiserv' | 'transbank' | 'toku_gateways' | 'payment_orchestration' | 'cards_batch_mx' | 'cards_batch_mx_recurring_pst' | 'amex_batch_mx_recurring_pst' | 'atoa_batch_mx_recurring_pst' | 'braintree' | 'cielo' | 'pagarme' | 'belvo' | 'iniciador' | 'qi_tech' | 'mit' | 'mit_amex' | 'rede' | 'br_banco_do_brasil' | 'br_banco_itau' | 'br_banco_santander' | 'br_banco_citibank' | 'br_banco_de_brasilia_via_accesstage' | 'br_santander_via_accesstage' | 'br_bradesco_via_accesstage' | 'br_banco_do_brasil_via_accesstage' | 'br_c6_via_accesstage' | 'br_sicoob_via_accesstage' | 'br_caixa_via_accesstage' | 'br_itau_via_accesstage' | 'br_sicoob' | 'worldpay' | 'br_caixa' | 'br_btg' | 'br_banco_itau_boleto' | 'br_banco_bradesco_boleto' | 'br_sicredi_boleto' | 'br_banco_de_brasilia' required

Integración a través de la cual se inscribió un medio de pago y por la que se cobrará después. Combina el adquirente o banco con la modalidad de inscripción — por ejemplo transbank_oneclick es una tarjeta inscrita en Oneclick de Transbank, y fintoc_pac un mandato de descuento automático inscrito vía Fintoc.

Es un conjunto distinto de PaymentIntentGateway, que identifica por dónde sale un cobro puntual: no todo gateway capaz de cobrar sirve para inscribir un medio de pago.

id_accountinteger required
id_bulk_insertionstring
id_checkoutinteger
id_customerinteger
id_customer_action_metadatainteger
id_organizationinteger required
id_payment_instrumentinteger
id_recurring_payment_configurationstring
id_subscriptionsinteger[]
idempotency_keystring
inscription_datestring date-time required
payment_instrument_type'CARD' | 'ACCOUNT' | 'CASH' | 'WALLET' | 'PIX' | 'BOLETO' | 'REFERENCED_PAYMENT' | 'EXTERNAL' | 'THIRD_PARTY_PROVIDER' required

Familia del instrumento con que se paga, que define qué datos se guardan de él: CARD es una tarjeta de crédito o débito, ACCOUNT una cuenta bancaria, WALLET una billetera digital, CASH un pago en efectivo, REFERENCED_PAYMENT un pago referenciado, PIX y BOLETO los dos medios brasileños, THIRD_PARTY_PROVIDER un cobro que ejecuta el proveedor de un tercero — es el instrumento con que se registra el pago hecho dentro de su aplicación — y EXTERNAL un pago que ocurrió fuera de Toku y que solo se registra.

payment_method_dataobject required
payment_scope'SUBSCRIPTION' | 'CUSTOMER'

Qué deudas puede pagar un medio de pago.

SUBSCRIPTION lo ata a las Subscriptions con las que se inscribió y solo paga deudas de esas Subscriptions. CUSTOMER lo ata al Customer y paga cualquier deuda suya, venga de la Subscription que venga.

provider_external_idstring
toku_product'pac_management' | 'pac_inscription' | 'direct_debit_cl' | 'direct_debit_mx' | 'transfer_cl' | 'transbank_oneclick' | 'transbank_webpay_plus' | 'klap_oneclick' | 'patpass' | 'cash' | 'cash_mx_one_time_psp' | 'cash_mx_one_time_pst' | 'cash_mx_psp' | 'cash_mx_pst' | 'toku_gateways' | 'payment_orchestration' | 'payment_orchestration_onetime' | 'multigateway_onetime' | 'toku_card_on_file' | 'toku_onetime' | 'domiciliation' | 'high_value_transfer' | 'codi' | 'wallet_mx' | 'cards_batch_mx_recurring_pst' | 'atoa_batch_mx_recurring_pst' | 'pix_onetime_pst_br' | 'boleto_br_onetime_pst' | 'boleto_br_recurring_pst' | 'pix_br_onetime_pst' | 'pix_br_onetime_psp' | 'pix_br_recurring_psp' | 'pix_bank_br_automatic_pst' | 'pix_bank_br_automatic_psp' | 'pix_bank_br_onetime_psp' | 'pix_openfinance_br_automatic_psp' | 'boleto_bank_br_onetime_psp' | 'cash_pst_cl' | 'transfer_mx_pst' | 'transfer_mx_psp' | 'transfer_cl_pst' | 'transfer_cl_psp' | 'direct_debit_onetime_cl_pst' | 'direct_debit_onetime_cl_psp' | 'bank_button_cl_pst' | 'bank_button_multiple_cl_pst' | 'bank_button_cl_psp' | 'bank_button_multiple_cl_psp' | 'digital_mandate_cl' | 'transfer_mx' | 'cards_br_recurring_pst' | 'cards_br_onetime_pst' | 'cards_br_recurring_psp' | 'cards_br_onetime_psp' | 'atoa_br_recurring_pst' | 'internal_balance' | 'cards_cl_onetime_pst' | 'cards_cl_recurring_pst' | 'cards_cl_pos_pst' | 'br_automatic_debit_pst' | 'external_collector_cl_pst' | 'referenced_payment_mx_psp' | 'in_app_payment_mx_psp' | 'external_payment' | 'collections_ai_agent' | 'bolepix_br_onetime_pst' | 'bolepix_bank_br_onetime_psp' | 'contacted_end_customers' | 'vcc' | 'atoa_batch_mx_recurring_psp' | 'international_transfer_mx_pst' | 'rat' | 'batch_reconciliations' | 'account_payouts' | 'account_payables' | 'transfer_cl_psp_wallet' | 'wallet_mx_psp' required

Producto de cobro de Toku: la combinación de método de pago, país y modalidad con que se ejecuta un cobro. El nombre codifica esas tres cosas — por ejemplo pix_br_recurring_psp es Pix recurrente en Brasil bajo el modelo PSP, y cards_cl_onetime_pst es tarjetas de un solo pago en Chile bajo el modelo PST.

Es el valor que decide con qué integración se ejecuta el cobro, así que buena parte de la lógica que depende del país se resuelve a partir de él. Qué productos tiene habilitados una organización es parte de su configuración: este listado es el universo posible, no lo que una organización determinada puede cobrar hoy.

cash, cash_mx_one_time_psp, cash_mx_one_time_pst y transfer_mx están deprecados y solo sobreviven por compatibilidad con registros históricos.

unique_internal_idstring

Clave de deduplicación para la inserción idempotente. Debe definirla quien realiza la llamada cuando corresponde deduplicar; dejar en None cuando no aplica (por ejemplo, si falta id_customer).

wait_for_result_payment_instrumentboolean

Response

Successful Response

successboolean required

Es true cuando la operación se ejecutó sin errores.

Changes

    • breaking

      added the new required request property

    • breaking

      added the new required request property

    • breaking

      added the new required request property

    • breaking

      added the new required request property

    • breaking

      added the new required request property

    • breaking

      added the new required request property

    • breaking

      request body became required

    • breaking

      request property was restricted to a list of enum values

    • breaking

      the request property became required

    • breaking

      removed the success response with the status

    • warning

      removed the request property

    • warning

      removed the request property

    • warning

      removed the request property

    • warning

      removed the request property

    • warning

      removed the request property

    • info

      api operation id create-card-payment-method removed and replaced with create_payment_method

    • info

      api tag Payment Methods added

    • info

      added the new optional request property

    • info

      added the new optional request property

    • info

      added the new optional request property

    • info

      added the new optional request property

    • info

      added the new optional request property

    • info

      added the new optional request property

    • info

      added the new optional request property

    • info

      added the new optional request property

    • info

      added the new optional request property

    • info

      added the new optional request property

    • info

      added the new optional request property

    • info

      added the new optional request property

    • info

      added the new optional request property

    • info

      added the new optional request property

    • info

      added the new optional request property

    • info

      added the new optional request property

    • info

      added the new account_payables enum value to the request property

    • info

      added the new account_payouts enum value to the request property

    • info

      added the new atoa_batch_mx_recurring_psp enum value to the request property

    • info

      added the new atoa_batch_mx_recurring_pst enum value to the request property

    • info

      added the new atoa_br_recurring_pst enum value to the request property

    • info

      added the new bank_button_cl_psp enum value to the request property

    • info

      added the new bank_button_cl_pst enum value to the request property

    • info

      added the new bank_button_multiple_cl_psp enum value to the request property

    • info

      added the new bank_button_multiple_cl_pst enum value to the request property

    • info

      added the new batch_reconciliations enum value to the request property

    • info

      added the new bolepix_bank_br_onetime_psp enum value to the request property

    • info

      added the new bolepix_br_onetime_pst enum value to the request property

    • info

      added the new boleto_bank_br_onetime_psp enum value to the request property

    • info

      added the new boleto_br_onetime_pst enum value to the request property

    • info

      added the new boleto_br_recurring_pst enum value to the request property

    • info

      added the new br_automatic_debit_pst enum value to the request property

    • info

      added the new cards_batch_mx_recurring_pst enum value to the request property

    • info

      added the new cards_br_onetime_psp enum value to the request property

    • info

      added the new cards_br_onetime_pst enum value to the request property

    • info

      added the new cards_br_recurring_psp enum value to the request property

    • info

      added the new cards_br_recurring_pst enum value to the request property

    • info

      added the new cards_cl_onetime_pst enum value to the request property

    • info

      added the new cards_cl_pos_pst enum value to the request property

    • info

      added the new cards_cl_recurring_pst enum value to the request property

    • info

      added the new cash enum value to the request property

    • info

      added the new cash_mx_one_time_psp enum value to the request property

    • info

      added the new cash_mx_one_time_pst enum value to the request property

    • info

      added the new cash_mx_psp enum value to the request property

    • info

      added the new cash_mx_pst enum value to the request property

    • info

      added the new cash_pst_cl enum value to the request property

    • info

      added the new codi enum value to the request property

    • info

      added the new collections_ai_agent enum value to the request property

    • info

      added the new contacted_end_customers enum value to the request property

    • info

      added the new digital_mandate_cl enum value to the request property

    • info

      added the new direct_debit_cl enum value to the request property

    • info

      added the new direct_debit_mx enum value to the request property

    • info

      added the new direct_debit_onetime_cl_psp enum value to the request property

    • info

      added the new direct_debit_onetime_cl_pst enum value to the request property

    • info

      added the new domiciliation enum value to the request property

    • info

      added the new external_collector_cl_pst enum value to the request property

    • info

      added the new external_payment enum value to the request property

    • info

      added the new high_value_transfer enum value to the request property

    • info

      added the new in_app_payment_mx_psp enum value to the request property

    • info

      added the new internal_balance enum value to the request property

    • info

      added the new international_transfer_mx_pst enum value to the request property

    • info

      added the new klap_oneclick enum value to the request property

    • info

      added the new multigateway_onetime enum value to the request property

    • info

      added the new pac_inscription enum value to the request property

    • info

      added the new pac_management enum value to the request property

    • info

      added the new patpass enum value to the request property

    • info

      added the new payment_orchestration enum value to the request property

    • info

      added the new payment_orchestration_onetime enum value to the request property

    • info

      added the new pix_bank_br_automatic_psp enum value to the request property

    • info

      added the new pix_bank_br_automatic_pst enum value to the request property

    • info

      added the new pix_bank_br_onetime_psp enum value to the request property

    • info

      added the new pix_br_onetime_psp enum value to the request property

    • info

      added the new pix_br_onetime_pst enum value to the request property

    • info

      added the new pix_br_recurring_psp enum value to the request property

    • info

      added the new pix_onetime_pst_br enum value to the request property

    • info

      added the new pix_openfinance_br_automatic_psp enum value to the request property

    • info

      added the new rat enum value to the request property

    • info

      added the new referenced_payment_mx_psp enum value to the request property

    • info

      added the new toku_card_on_file enum value to the request property

    • info

      added the new toku_gateways enum value to the request property

    • info

      added the new toku_onetime enum value to the request property

    • info

      added the new transbank_oneclick enum value to the request property

    • info

      added the new transbank_webpay_plus enum value to the request property

    • info

      added the new transfer_cl enum value to the request property

    • info

      added the new transfer_cl_psp enum value to the request property

    • info

      added the new transfer_cl_psp_wallet enum value to the request property

    • info

      added the new transfer_cl_pst enum value to the request property

    • info

      added the new transfer_mx enum value to the request property

    • info

      added the new transfer_mx_psp enum value to the request property

    • info

      added the new transfer_mx_pst enum value to the request property

    • info

      added the new vcc enum value to the request property

    • info

      added the new wallet_mx enum value to the request property

    • info

      added the new wallet_mx_psp enum value to the request property

    • info

      added the non-success response with the status

    • info

      added the non-success response with the status

    • info

      added the non-success response with the status

    • info

      added the non-success response with the status

    • info

      added the non-success response with the status

    • info

      removed the non-success response with the status

    • info

      added the success response with the status

    • info

      added the success response with the status