Skip to content

PAYMENT_COLLECT_SETUP

Initializes a payment collection session for a policy and returns the session details in the trigger metadata.

When and what fires this action?

If this event is defined on a product, and it has actions that are enabled:

  • API: can fire this event externally on demand.

Request payload

POST: https://api.{ENV}.dais.com/ioi/v3/event/fire

curl --location --request POST 'https://api.{ENV}.dais.com/ioi/v3/event/fire' --header 'Authorization: Basic <yourAuthHere>' --header 'Content-Type: application/json' --data-raw '{
  "lineId": "<UUID of the product>",
  "type": "PAYMENT_COLLECT_SETUP",
  "payload": {
    "policyId": "<UUID of the policy>",
    "clientId": "<UUID of the client>",
    "totalAmount": 12345
  }
}'
{
  "lineId": "262e67be-c08c-43c0-bb51-06fe4408b4e9",
  "type": "PAYMENT_COLLECT_SETUP",
  "payload": {
    "policyId": "b31e1d1e-31e0-4d9a-9a86-7f9d0a1a2b33",
    "clientId": "220c4020-7f20-4a16-ba51-d0945804dd83",
    "totalAmount": 12345
  }
}

Request fields

PropertyRequiredDescription
lineIdtrueUUID for the product.
typetrueMust be PAYMENT_COLLECT_SETUP.
payloadtrueSee below.

Payload fields

PropertyRequiredDescription
policyIdtrueTarget policy to collect a payment for.
clientIdtrueClient being charged; used by Payments session.
totalAmounttrueAmount to charge (minor units).

Response json

On success, the trigger response will include metadata with the payment session details:

{
  "triggerRequestId": "<UUID>",
  "executedActionCount": 1,
  "expectedResponseCount": 1,
  "metadata": {
    "PAYMENT_COLLECT_SETUP": {
      "policyId": "b31e1d1e-31e0-4d9a-9a86-7f9d0a1a2b33",
      "clientId": "220c4020-7f20-4a16-ba51-d0945804dd83",
      "totalAmount": 12345,
      "paymentSessionId": "psess_1234567890",
      "clientSecret": "secret_xxx",
      "publishKey": "pk_live_xxx",
      "metadata": {
        "requestId": "f3f1a2d0-...",
        "triggerRequestId": "fc55a520-..."
      }
    }
  }
}

Response fields

PropertyRequiredDescription
triggerRequestIdtrueUUID that identifies the execution of the trigger.
executedActionCounttrueNumber of workflow actions executed for this trigger.
expectedResponseCounttrueNumber of responses expected from executed actions.
metadatatrueContains dynamically generated data from payment setup actions.