POST /objects/definitions/default

You can post custom object definitions with the request body schema described below.

This operation also allows you to use the List custom object definitions response schema as its request schema. If you want to copy all the existing custom objects from an old tenant to a new tenant, you can make a List custom object definitions call in your old tenant and then use its response directly as the request of this operation in the new tenant to import all the custom objects from the old tenant.

The label field is the UI label of the custom object. The object field contains the API Name of the custom object.

Limitations

This custom object definition has the following limitations:

Servers

Request headers

Name Type Required Description
Content-Type String Yes The media type of the request body.

Default value: "application/json"

Content-Encoding String No

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.

Zuora-Track-Id String No

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 (').

Authorization String Yes

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

Idempotency-Key String No

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.

Zuora-Version String No

API version that determines the response schema. The default version is used if this parameter is not included. Specify Zuora-Version in the request header if you expect a specific response schema.

Zuora-Entity-Ids String No

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 do not need to set this header.

Zuora-Org-Ids String No

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.

Accept-Encoding String No

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.

Request body fields

Name Type Required Description
definitions Object No

The custom object definitions. This object maps types to custom object definitions.

definitions.name Object No
definitions.name.unique[] Array No

The fields with unique constraints. You can remove the unique constraint on a field. However, you can only add a unique constraint to a filterable field if the custom object contains no record. One custom object can have a maximum of five fields with unique constraints.

definitions.name.filterable[] Array No

The set of fields that are allowed to be queried on. Queries on non-filterable fields will be rejected. You can not change a non-filterable field to filterable.

definitions.name.object String Yes

The API name of the custom object

definitions.name.properties Object No
definitions.name.properties.name Object No
definitions.name.properties.name.format String No

The data format of the custom field

definitions.name.properties.name.label String Yes

The UI label of the custom field

definitions.name.properties.name.displayName Boolean No

Indicates whether to use this field as the display name of the custom object when being linked to another custom object.

This field applies only to the Text custom field type:

  • The type field is string.
  • The enum field is not specified.
definitions.name.properties.name.type String Yes

The data type of the custom field

definitions.name.properties.name.maxLength Integer No

The maximum length of string that can be stored in the custom field.

This field applies only to the following custom field types:

  • Text:
    • The type field is string.
    • The format field is not specified or is url.
    • The enum field is not specified.
  • Picklist:
    • The type field is string.
    • The enum field is specified.
    • The multiselect field is not specified or is false.
  • Multiselect:
    • The type field is string.
    • The enum field is specified.
    • The multiselect field is true.

If the custom field is filterable, the value of maxLength must be 512 or less.

definitions.name.properties.name.multiselect Boolean No

Indicates whether this is a multiselect custom field.

This field applies only to the Picklist or Multiselect custom field types:

  • The type field is string.
  • The maxLength field is specified.
  • The enum field is specified.
definitions.name.required[] Array No

The required fields of the custom object. You can change required fields to optional. However, you can only change optional fields to required on the custom objects with no records.

definitions.name.label String Yes

A UI label for the custom object

definitions.name.auditable[] Array No

The set of fields which Audit Trail tracks and records changes of. You can change auditable fields to non-auditable, and vice versa. One custom object can have a maximum of five auditable fields.

definitions.name.enableCreateRecordAuditing Boolean No

Indicates whether to audit the creation of custom object records of this custom object definition.

Note that you must enable the Custom Object Definition audit trail setting in your Zuora tenant before auditing custom object record creation. For more information, see Manage audit trail settings.

Default value: false

definitions.name.relationships[] Array No

An array of relationships with Zuora objects or other custom objects. You can add at most 2 manyToOne relationships when creating a custom field definition.

definitions.name.relationships[].recordConstraints Object No

Specifies contraints to apply to custom object records.

definitions.name.relationships[].recordConstraints.create Object No
definitions.name.relationships[].recordConstraints.create.enforceValidMapping Boolean No

Specifies whether Zuora validates the values of mapped fields in custom object records.

By default, Zuora validates the values of mapped fields in custom object records. For example, if the custom object definition has a field called AccountId__c that is mapped to the Id field of the account object, Zuora verifies that the value of AccountId__c is a valid account ID when a custom object record is created. If the value of AccountId__c is not a valid account ID, the operation fails.

Default value: true

definitions.name.relationships[].cardinality String No

The cardinality of the relationship from this object to another object.

Only the manyToOne cardinality can be used when creating relationships. A relationship with oneToMany cardinality is created implicitly when a manyToOne relationship is created.

A custom object definition can have a maximum of 2 manyToOne relationships.

Possible values:

  • "manyToOne"
definitions.name.relationships[].namespace String Yes

The namespace where the related object is located

definitions.name.relationships[].object String Yes

The API name of the related object

definitions.name.relationships[].fields Object Yes

Field mappings in the form of <this-object-field-name>: <other-object-field-name>. Usually the <other-object-field-name> can only be the Id field of the related object. Two exceptions are Subscription Name and Rate Plan Charge Number as both of them are unique.

definitions.name.enableDeleteRecordAuditing Boolean No

Indicates whether to audit the deletion of custom object records of this custom object definition.

Note that you must enable the Custom Object Definition audit trail setting in your Zuora tenant before auditing custom object record deletion. For more information, see Manage audit trail settings.

Default value: false

How to start integrating

  1. Add HTTP Task to your workflow definition.
  2. Search for the API you want to integrate with and click on the name.
    • This loads the API reference documentation and prepares the Http request settings.
  3. Click Test request to test run your request to the API and see the API's response.