Contact Us 1-800-596-4880

Zuora Connector 6.0 Examples - Mule 4

Example: Retrieve Details for an Account

This example retrieves the account details for the specified account ID and returns them in JSON format.

Studio Flows

  • Listener (HTTP) - Accepts data from HTTP requests.

  • Zuora API Connector - Connects with Zuora and executes a query to retrieve the account details for the specified account ID.

  • Transform message - Outputs the results of the Get account operation in JSON format.

    Studio flow with Listener, Get account, and Transform Message

XML Flows

Paste this XML code into Anypoint Studio to experiment with the flow described in the previous section.

<?xml version="1.0" encoding="UTF-8"?>

<mule xmlns:ee="http://www.mulesoft.org/schema/mule/ee/core" xmlns:http="http://www.mulesoft.org/schema/mule/http"
xmlns:mule-zuora-connector="http://www.mulesoft.org/schema/mule/mule-zuora-connector"
xmlns="http://www.mulesoft.org/schema/mule/core" xmlns:doc="http://www.mulesoft.org/schema/mule/documentation" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd
http://www.mulesoft.org/schema/mule/mule-zuora-connector http://www.mulesoft.org/schema/mule/mule-zuora-connector/current/mule-mule-zuora-connector.xsd
http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd
http://www.mulesoft.org/schema/mule/ee/core http://www.mulesoft.org/schema/mule/ee/core/current/mule-ee.xsd">
<mule-zuora-connector:config name="Zuora_Connector___Mule_4_Config" doc:name="Zuora Connector - Mule 4 Config" doc:id="ab77ca79-6f70-4c6f-98f6-be22cfc8eecc" >
<mule-zuora-connector:basic-auth-connection
        username="${zuora.username}"
        password="${zuora.password}"
        baseUri="${zuora.baseUri}" />
</mule-zuora-connector:config>
<http:listener-config name="HTTP_Listener_config" doc:name="HTTP Listener config" doc:id="dc0c431a-8608-446d-9a43-cb8515a36a90" >
<http:listener-connection host="localhost" port="8081" />
</http:listener-config>
<flow name="zuora-demo-testFlow" doc:id="83fb740f-9c7b-4c98-8b32-ae8c84c3c1e4" >
<http:listener doc:name="Listener" doc:id="e623ac5d-cab7-4bf2-a6e0-27a78462ab1a" config-ref="HTTP_Listener_config" path="/getAccount"/>
<mule-zuora-connector:get-v1-accounts-by-account-key doc:name="Get account" doc:id="eedfd82c-b8d3-4b83-88b3-50e284aa217b" config-ref="Zuora_Connector___Mule_4_Config" accountKey="#[payload]"/>
<ee:transform doc:name="Transform Message" doc:id="d4607f1d-7d2e-4d84-a079-c436050767f0" >
<ee:message >
<ee:set-payload ><![CDATA[%dw 2.0
output application/json
---
payload
]]></ee:set-payload>
</ee:message>
</ee:transform>
</flow>
</mule>
View on GitHub