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
| Property | Required | Description |
|---|---|---|
lineId | true | UUID for the product. |
type | true | Must be PAYMENT_COLLECT_SETUP. |
payload | true | See below. |
Payload fields
| Property | Required | Description |
|---|---|---|
policyId | true | Target policy to collect a payment for. |
clientId | true | Client being charged; used by Payments session. |
totalAmount | true | Amount 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
| Property | Required | Description |
|---|---|---|
triggerRequestId | true | UUID that identifies the execution of the trigger. |
executedActionCount | true | Number of workflow actions executed for this trigger. |
expectedResponseCount | true | Number of responses expected from executed actions. |
metadata | true | Contains dynamically generated data from payment setup actions. |