Customer amount selection, generally for payments.
When the amount to be paid or paid out is variable, such as donations, loan payments or topping up an account, this action gives the users the ability to choose an appropriate amount. The unioned action will then react appropriately to the amount being shared.
No products are required to use this action.
This action pairs well with the following actions.
State
The chosen amount will be defined in the state.
Union (required)
The unioned action should be the expected recipient for the amount being chosen.
Macro level details for how union attribute behaves can be found within the Union documentation.
Features (required)
Name | Type | Description | Rules |
---|---|---|---|
description | string | Deprecated, use markdown or instructions instead. Examples: "Deprecated, don't use.". | MaxLength: 65536 MinLength: 10 Pattern: ^(?!\s*$).+ |
suggestions | array | Suggestions for payment amounts. Examples: [{ "amount":100, "label":"current balance" },{ "amount":200, "label":"statement balance" }] . | See suggestions |
customAmount | boolean | Flag indicating whether a custom amount option should be displayed. Examples: true. | |
noAmount | boolean | When set to true, the user will be allowed to select a 'no amount' option. Resulting an amount in 0 being broadcast. Examples: false. | |
placeholder | string | When custom amount enabled, placeholder should visible in custom amount input field. Examples: "Custom amounts should be greater than your minimum balance.". | MaxLength: 65536 MinLength: 10 Pattern: ^(?!\s*$).+ |
helpText | string | When custom amount enabled, Show a help text for custom amount input field. Examples: "Enter the amount you wish to donate in USD. Minimum donation is $10.". | MaxLength: 65536 MinLength: 10 Pattern: ^(?!\s*$).+ |
resolvedText | string | A confirmation or success message that confirms the completion of the process. Examples: "Thank you for your donation of $50! Your support makes a difference.". | MaxLength: 65536 MinLength: 10 Pattern: ^(?!\s*$).+ |
recommendedLabel | string | Title under the recommended amount. Examples: "Suggested Gift". | MaxLength: 65536 MinLength: 10 Pattern: ^(?!\s*$).+ |
recommended | object | Causes the amount to be selected within the web experience, when the link is clicked. And, when paired with other actions such as payment or payout, this amount is available to be paid over messaging with an authorization code. Examples: { "amount":100 } . | See recommended |
minimum | object | The minimum amount in cents required to resolve the business process. Examples: { "amount":100 } . | See minimum |
maximum | object | The maximum amount in cents allowed to make a payment. Examples: { "amount":100 } . | See maximum |
suggestions
Name | Type | Description | Rules |
---|---|---|---|
amount | number | (required) Amount must be in cents. Examples: 100, 200. | |
label | string | Title under the suggestion amount. Examples: "current balance", "statement balance". | MinLength: 3 |
recommended
Name | Type | Description | Rules |
---|---|---|---|
amount | number | (required) Amount must be in cents. Examples: 100, 200. |
minimum
Name | Type | Description | Rules |
---|---|---|---|
amount | number | (required) Amount must be in cents. Examples: 100, 200. |
maximum
Name | Type | Description | Rules |
---|---|---|---|
amount | number | (required) Amount must be in cents. Examples: 100, 200. |
Context (required)
Name | Type | Description | Rules |
---|---|---|---|
mode | string | Deprecated. Mode will be removed around 2 weeks from 8-12-2024. | Possible values: amount . |
recommended | object | Deprecated, recommended should be used within features. Examples: { "amount":100 } . | See recommended |
calculationMode | string | Is set as RUNNING_TOTALS, will cause the payment-amount-selection to pay attention to the transaction events from the unioned payment. Charge will decrease, and reversal will increase all suggestions options amount. Examples: "RUNNING_TOTALS". | Possible values: NONE , RUNNING_TOTALS . |
recommended
Name | Type | Description | Rules |
---|---|---|---|
amount | number | (required) Amount must be in cents. Examples: 100, 200. |
Example
Below is an example payload for adding an action to a business process or blueprint.
{
"type": "payment-amount-selection",
"union": 1,
"context": {
"recommended": {
"amount": 100
},
"calculationMode": "RUNNING_TOTALS"
},
"features": {
"description": "Deprecated, don't use.",
"suggestions": [
{
"amount": 100,
"label": "current balance"
},
{
"amount": 200,
"label": "statement balance"
}
],
"customAmount": true,
"noAmount": false,
"placeholder": "Custom amounts should be greater than your minimum balance.",
"helpText": "Enter the amount you wish to donate in USD. Minimum donation is $10.",
"resolvedText": "Thank you for your donation of $50! Your support makes a difference.",
"recommendedLabel": "Suggested Gift",
"recommended": {
"amount": 100
},
"minimum": {
"amount": 100
},
"maximum": {
"amount": 100
}
}
}