Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

With the Zuora Query Functionfunction, you can send query operations to Zuora Billing and retrieve the response . The Function for further enrichment. This enrichment can provide more context and details to the subscription billing data, enabling deeper insights, improve decision-making, and for more efficient operations. Enriched data from the Zuora Query function can be passed down for further processing by the next function in the stream.

The function sends requests using the POST method and then receives the responses, which are routed to the next Function function in the stream. This Function  This function supports two APIs Data Query and ZOQL. 

Image Removed

Sample stream with Zuora Query

 Image Removed

Zuora Query Configuration

Configuration

You can configure the Function function by entering the following details:

Settings

...

Setting

Description

Environment

Tenant

...

Select the

...

Zuora environment

...

TenantBase URL for REST Endpoints

US DC1 Production

. The following endpoints are available for selection:

You can also
  • : Use this option to access your own custom tenant environment. Specify the URL for your endpoint.

Credentials

Select

...

from secrets wallet

To select a predefined Zuora secret from your Secrets Wallet,

...

turn on the Secrets

...

Image Removed

Secrets Wallet Selection

Image Removed

Authentication using OAuth 2.0 or API Key

The following table describes the different settings you will see depending on your chosen authentication method.

Authentication TypeFieldDescription

OAuth 2.0

Client IDThe client ID

wallet toggle.

Authentication by

Note!

This option only appears Secrets wallet toggleis disabled.

Select how you want to perform authentication. You can select either authentication method:

  • OAuth 2.0

  • API key

Client ID

Note!

This option only appears Secrets wallet toggleis disabled, and the OAuth 2.0 authentication method is selected for the Authentication by option.

Enter the client ID that is displayed when the OAuth client is created in Zuora. 

Client

SecretThe

secret

Note!

This option only appears Secrets wallet toggleis disabled, and the OAuth 2.0 authentication method is selected for the Authentication by option.

Enter the client secret ID that is displayed when the OAuth client is created in Zuora.

API Key

Access

Key IDThe

key ID

Note!

This option only appears Secrets wallet toggleis disabled, and the API key authentication method is selected for the Authentication by option.

Enter the identifier that is used to sign the requests sent to Zuora. It is displayed when the API User is created in Zuora.

Secret

Access KeyThe key

access key

Note!

This option only appears Secrets wallet toggleis disabled, and the API key authentication method is selected for the Authentication by option.

Enter the key that is used along with the Access

Key

key ID to cryptographically sign the Zuora requests.

Entity

Multi-entity

If you have Zuora Multi-entity enabled,

...

specify the name of the Multi-entity you want to access.

...

 With Zuora Mulity-entity, you can create and manage multiple entities within a single Zuora tenant, see https://knowledgecenter.zuora.com/Billing/Tenant_Management/Multi-entity  for more information.

...

Query

...

Image Removed

...

Use data query

Select if you want to write your queries as Data Query or ZOQL. By default, the queries use the Data Query language.

...

 To perform queries using ZOQL, turn off the Use Data Query toggle.

...

 You can access the Zuora API using the following endpoints:

APIZuora EndpointData Query 
  • Data Query - Zuora endpoint is POST to /query/jobs

  • ZOQL

  • - Zuora endpoint is POST to/v1/action/

query.

...

  • query.

Query body

Enter the body of the query.

Use Index Join

Note!

This option only appears when the Use data query toggle is enabled.

Check the Use Index Join check box to enable Index Join to speed up retrieving data from multiple tables. See Zuora’s Index JOIN for more information.

Result key

Enter a custom result key to be included in the query output. The default result key is 'ZuoraQueryResponse'.

Enable result headers

Select the

...

check box to add a header to the response in the Result headers key field. The default result headers key is 'ZuoraQueryResponseHeaders'.

Enable result headers.pngImage Added

Cache settings

Enable cache

To enable the caching of items, turn on

...

the Enable cache toggle. Here, an item refers to the response to a query.

...

 Specify the maximum number of items you wish to store in the cache and the time (in seconds) after which the items are removed.  An item is removed from the cache in case

...

either the maximum number of items is reached, or if an item is stored for more than the defined duration.

...

Cache settings.pngImage Added

Cache Settings

Operational settings

In this section, you can define the behavior of the Function during execution. 

Wait for job completion for maximum

...

Enter

...

the wait time duration for the query job’s final state. Once a query is submitted to the Zuora tenant,

...

the job will be

...

retried repeatedly every

...

second until a final response is received, or the defined

...

wait time duration is reached.

...

 If no final state is received within the specified time period of the query job, the stream execution will be aborted. The maximum value allowed is 3600 seconds.

...

Action on error

...

Select

...

the

...

action you want to take in case of an error, the options are:

  • Ignore

...

  • Stop the stream

Any response with the HTTP status code 4xx or 5xx is considered an error. All errors get logged in the system logs. See Logs for more information.

The default value is Ignore.

Note!

If you click Preview, only a maximum of five records will be displayed. However, during the actual execution of the stream, the entire result will be displayed.

Input/Output Data

InputData

None.

Output Data

The query response from Zuora.

...

Below is a sample output data.

Code Block
[
    {
        "value": 1,
        "ZuoraQueryResponse": [
            {
                "Product Charge": "Annual User Charge"
            },
            {
                "Product Charge": "CloudStream Power Supply"
            },
            {
                "Product Charge": "Monthly User Charge"
            },
            {
                "Product Charge": "t2.medium Usage Charge"
            },
            {
                "Product Charge": "Professional Services Fixed Bid"
            }
        ]
    }
]