Creating actions for Payment interactions

A Payment interaction requires actions to get the initial payment data, to handle an update to the payment method and to pass on the final payment details. The actions that handle the shipping contact details and shipping method are optional.

See also JSON format for payment data (Apple Pay) and the Apple Developer documentation.

Required actions

The key points when creating the required action is summarized below.

Interaction REST action
Get initial payment data Gets initial payment data from the client system:
  • The endpoint returns the initial payment data as JSON. For details of the format required by Converse, see JSON format for payment data (Apple Pay).
  • Next is set to the Payment interaction. This means that the action runs before the Payment interaction populating the Payment Data variable.
  • Variable Name must be set to the Payment Data variable in the Payment interaction. Used when sending payment requests to Apple Pay.

Optional actions

The key points when creating the optional actions are summarized below.

Interaction REST action
Payment method Gets updated payment data from the client system after the user changes the payment method.
  • The action will pass the paymentMethod portion of the response from Apple Pay:
    "paymentMethod": {
                "type": ""
            }
  • The endpoint must return updated payment data in the format required by Converse.
  • Variable Name must be set to the Payment Data variable in the Payment interaction. The variable will hold the updated payment data.
Note: The response from Apple Pay is stored unchanged in the paymentMethodUpdate_<x> variable set in the Payment interaction.
shippingContact Gets updated payment data from the client system when the user changes the shipping contact details:
  • The action will pass the shippingContact portion of the response from Apple Pay:
    "shippingContact": {
                "postalAddress": [""],
                "name": "",
                "phoneticName": "",
                "phone": "",
                "email": ""
            }
  • The endpoint must return updated payment data in the format required by Converse.
  • Variable Name must be set to the Payment Data variable in the Payment interaction. The variable will hold the updated payment data.
Note: The response from Apple Pay is stored unchanged in the shippingContactUpdate_<x> variable set in the Payment interaction.
shippingUpdate Gets updated payment data from the client system after the user changes the shipping method:
  • The action will pass the shippingMethod portion of the response from Apple Pay. For example:
    "shippingMethod": {
              "amount": "29.99",
              "detail": "1-3 Business Days",
              "identifier": "flat_rate_shipping_id_1",
              "label": "FedEx Priority Mail",
            }
  • The endpoint must return updated payment data in the Converse format.
  • Variable Name is set to the Payment Data variable in the Payment interaction.
Note: The response from Apple Pay is stored unchanged in the shippingMethodUpdate_<x> variable set in the Payment interaction.
Track order Passes the final payment details from Apple Pay to the client system:
  • The action will pass the billingContact, errors, shippingContact, shippingMethod and summaryItems portions of the response from Apple Pay.
  • If the bot requires access to the final payment data then Variable Name could be set to a new variable. Do not set this to the Payment Data variable in the Payment interaction.
Note: The response from Apple Pay is stored unchanged in the orderTrackingUrl_<x> variable set in the Payment interaction.