Customer Portal

Crear Customer Portal Session

Changed on

Crea una sesión de un Customer en el Customer Portal y devuelve la url con la que entra.

Se usa para llevar a un Customer al portal desde un canal propio: la url que viene en la respuesta es el enlace que se le entrega.

billing_data.id_customer es obligatorio. Si no se envía billing_data.id_account, la sesión queda asociada al Account principal de la organización.

expiration_datetime es obligatorio, debe quedar al menos 30 minutos en el futuro y se interpreta en UTC. Al llegar esa fecha la sesión pasa sola al estado expired, sin necesidad de llamar a la operación de expiración.

external_id es una referencia propia opcional y no puede repetirse entre las Customer Portal Sessions ni las Checkout Sessions de la organización: un valor ya usado devuelve 409. flow_name elige el flujo con el que abre el portal y por defecto es "0". Lo que venga en additional_metadata se guarda tal cual y se devuelve en las lecturas de la sesión.

Al crear la sesión se despacha un mensaje al Customer con el enlace: con la plantilla indicada en template si se envía, y en caso contrario según la configuración de mensajería de la organización, sobre el canal indicado en communication_channel. Ese despacho es asincrónico y no condiciona la creación: si falla, la sesión igual queda creada.

post/v2/customer-portal-sessions

Request

  • Base URL
    https://api.trytoku.com
  • URL
    https://api.trytoku.com/v2/customer-portal-sessions
  • Auth
    API key in header x-api-key

Headers

x-account-keystring

Llave de API de una Account, para operar sobre esa Account en lugar de la principal.

Request body

additional_metadataobject
communication_channelstring
expiration_datetimestring date-time required
external_idstring
flow_namestring
templatestring

Response

Successful Response

additional_metadataobject
additional_query_parametersobject
billing_dataobject required
communication_channelstring
expiration_datetimestring date-time required
external_idstring
flow_namestring required
idstring required
id_organizationinteger required
journey_idstring
payment_options_configurationobject
redirection_configurationobject
state'open' | 'expired' required

Estado de una sesión del portal de pago. Nace open, que es el único estado en que la sesión sirve para entrar al portal, y pasa a expired cuando se cumple su fecha de expiración o cuando se la expira a propósito. Es un cambio de una sola vía: una sesión expirada no vuelve a abrirse.

templatestring
urlstring required

Changes

    • breaking

      request body became required

    • breaking

      removed the enum value mail of the request property

    • breaking

      removed the enum value sms of the request property

    • breaking

      removed the enum value wsp of the request property

    • breaking

      the request property type changed from string to object

    • breaking

      the request property format changed from no format to date-time

    • breaking

      removed the media type application/json for the response with the status

    • breaking

      removed the media type application/json for the response with the status

    • warning

      deleted the header request parameter x-api-key

    • info

      api operation id post_v2-customer-portal-sessions removed and replaced with create_handler

    • info

      api tag Customer Portal added

    • info

      added the new optional header request parameter x-account-key

    • 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

      the request property default value 0 was added

    • info

      removed the non-success response with the status

    • info

      added the optional property to the response with the status