Create a callout template

Creates a callout template.

This operation supports creating the callout template for all event types:

You must specify either eventCategory or eventTypeName, but not both at the same time.

Request
header Parameters
Idempotency-Key
string <= 255 characters

Specify a unique idempotency key if you want to perform an idempotent POST or PATCH request. Do not use this header in other request types.

With this header specified, the Zuora server can identify subsequent retries of the same request using this value, which prevents the same operation from being performed multiple times by accident.

Accept-Encoding
string

Include the Accept-Encoding: gzip header to compress responses as a gzipped file. It can significantly reduce the bandwidth required for a response.

If specified, Zuora automatically compresses responses that contain over 1000 bytes of data, and the response contains a Content-Encoding header with the compression algorithm so that your client can decompress it.

Content-Encoding
string

Include the Content-Encoding: gzip header to compress a request. With this header specified, you should upload a gzipped file for the request payload instead of sending the JSON payload.

Authorization
required
string

The value is in the Bearer {token} format where {token} is a valid OAuth token generated by calling Create an OAuth token.

Zuora-Track-Id
string <= 64 characters

A custom identifier for tracing the API call. If you set a value for this header, Zuora returns the same value in the response headers. This header enables you to associate your system process identifiers with Zuora API calls, to assist with troubleshooting in the event of an issue.

The value of this field must use the US-ASCII character set and must not include any of the following characters: colon (:), semicolon (;), double quote ("), and quote (').

Zuora-Entity-Ids
string

An entity ID. If you have Zuora Multi-entity enabled and the OAuth token is valid for more than one entity, you must use this header to specify which entity to perform the operation in. If the OAuth token is only valid for a single entity, or you do not have Zuora Multi-entity enabled, you should not set this header.

Zuora-Org-Ids
string

Comma separated IDs. If you have Zuora Multi-Org enabled, you can use this header to specify which orgs to perform the operation in. If you do not have Zuora Multi-Org enabled, you should not set this header.

The IDs must be a sub-set of the user's accessible orgs. If you specify an org that the user does not have access to, the operation fails.

If the header is not set, the operation is performed in scope of the user's accessible orgs.

Request Body schema: application/json
required

The request body to create a callout template.

One of:

Common information for callout templates.

active
boolean
Default: true

The status of the callout. The default is true.

calloutBaseurl
required
string <url> >= 10 characters

The callout URL. It must start with https://.

You can add merge fields in the callout URL. For example, https://mywebsite.com/zuora/{{DataSource.Account.Id}}. For more information, see Merge field syntax for email and callout templates.

object (calloutHeader)

Container for custom callout headers. Each custom callout header consists of a header name and a header value.

object (calloutParameter)

Container for callout parameters sent in the request body. Each callout parameter consists of a parameter name and a parameter value.

calloutRetry
boolean
Default: true

Specified whether to retry the callout when the callout fails. The default value is true.

customRequestBody
string

Customized request body. This field is available only for callouts whose Content-Type in the request body is application/json. The value must be in JSON format and double quotes in the value must be escaped.

You can add merge fields to the request body. For example, {\"AccountNumber\": \"{{DataSource.Account.AccountNumber}}\",\"AccountId\": \"{{DataSource.Account.Id}}\"}. For more information, see Merge field syntax for email and callout templates.

You must set useCustomRequestBody to true if you want to customize the callout request body with this field. Alternatively, you can use the calloutParams field.

description
string <= 255 characters

Description for the callout template.

eventCategory
number

The event category code for a standard event that the callout template relates to.

This field is required when creating callout templates for standard events.

For the list of supported standard event category codes, see Standard event category code for events and notifications.

eventTypeName
string non-empty

The name of a custom event that the callout template relates to.

This field is required when creating callout templates for Zuora custom events, custom events, or custom scheduled events.

If this field is provided, you can specify the event namespace in the eventTypeNamespace field.

eventTypeNamespace
string
Default: "user.notification"

The namespace of the eventTypeName field. It indicates who created the event and which namespace the event is assigned to.

Supported values are as follows:

  • com.zuora.notification: events that are created by Zuora. This value applies to Zuora custom events.
  • user.notification: events that are created by tenant users. This value applies to custom events and custom scheduled events. This is the default value.

For example, if you want to create a callout template that relates to the OrderActionProcessed event, which is a Zuora custom event, you must specify com.zuora.notification for this field.

Enum: "user.notification" "com.zuora.notification"
httpMethod
required
string

The HTTP method of the callout.

Enum: "POST" "GET" "PUT" "PATCH" "DELETE"
name
required
string <= 255 characters

The name of the callout template. It must be unique across all callout templates.

useCustomRequestBody
boolean

Indicates whether to enable the customized request body configured in the customRequestBody field.

Responses
200

OK

400

Bad Request

404

Not Found

405

Method Not Allowed

415

Unsupported Media Type

500

Internal Server Error

post/notifications/callout-templates
Request samples
application/json
{}
Response samples
application/json
{
  • "id": "dcc5a61ee76e496c984206131b5b83e7",
  • "createdBy": "8a90e08282f4ed040182f67bab2902ff",
  • "createdOn": "2024-06-17T04:07:13.000 UTC",
  • "updatedBy": "8a90e08282f4ed040182f67bab2902ff",
  • "updatedOn": "2024-06-17T04:07:13.000 UTC",
  • "eventTypeName": "AccountEdit",
  • "eventTypeNamespace": "user.notification",
  • "name": "Account Edit",
  • "description": "Callout when an account is edited",
  • "active": true,
  • "calloutParams": null,
  • "calloutHeaders": null,
  • "httpMethod": "POST",
  • "requiredAuth": false,
  • "calloutAuth": null,
  • "requiredOauth2": false,
  • "oauth2ProviderId": null,
  • "calloutRetry": true,
  • "contentType": "APPLICATION_JSON",
  • "useCustomRequestBody": false,
  • "customRequestBody": null
}