Skip to main content

Perform payment gateway reconciliations with Workflow


Perform payment gateway reconciliations with Workflow

If you want to perform payment gateway reconciliation on your own, instead of using the gateway reconciliation feature in Zuora, you can create a workflow to automate the process. In this topic, we'll show you how to create a workflow for payment gateway reconciliation.

Workflow overview


The workflow consists of 9 tasks.

  1. Download: Downloads a gateway reconciliation report from a server.
  2. Iterate: Iterates records in the report.
  3. Object query: For each record, retrieves the corresponding payment ID in Zuora. The transaction ID in the record is expected to match a reference ID in the payment object.
  4. If: For each record, determines whether the corresponding payment is retrieved.
  5. Case: If the payment is retrieved, defines three cases for the three payment statuses and adds one additional case for the else condition. If a reason code does not meet any of the three cases, then an email will be sent to people who should know about it.
  6. Gateway reconciliation: Three reconciliation tasks for three actions (Settle, Reject, and Reverse). For Reject and Reverse actions, refunds will be created and the refund objects will be returned in the responses.
  7. Email: If the result of task 4 is false, send an email to people who should know about the discrepancy.


  • In the download task, use the post-processing options (rename or delete) to avoid a file from being processed twice. See Download: SFTP for details.
  • The gateway reconciliation report should contain a data field that represents different gateway response codes. In the case task, the cases should be defined based on different values of this data field. For example, if the data field for response codes is RecordType, you can specify this data field in the case definition.


    The values for the three cases should exactly match the values of the data field.

  • In the email task, you can configure the template to include the merge field for the transaction ID or reference ID of the record, to help people determine the reason for the failure or mismatch.

  • Configure the workflow to run at the same frequency (for example, daily) as the gateway reconciliation reports.


  • The gateway reconciliation report can also be from a direct file input.
  • If the gateway responses are in groups and each group starts with the same character combination (for example, ST for the Settled group), you can use regular expressions to associate a group with a reconciliation action. For example, you can use "[ST].+" to refer to all response codes that start with ST.