> This page is for Developers.

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://zuora.ferndocs.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://zuora.ferndocs.com/_mcp/server.

# Retrieve metadata object schema

GET https://rest.test.zuora.com/object-metadata/{objectName}

Returns the complete JSON Schema for the specified object.

The response includes standard JSON Schema properties and Zuora-specific
metadata extensions, including field types, constraints, relationships,
custom field indicators, and context-specific capabilities.

For Data Query(DQ) and Object Query(OQ) contexts, object name matching is case-insensitive. The
response uses the canonical object name returned by the upstream source.

For Data Source Export(DSE) or Aggregate Query API(AQuA) contexts, the response `title` and `$id` use the canonical object name returned by Billing.


Reference: https://zuora.ferndocs.com/developers/api-reference/zuora-api/general-purpose-operations/metadata/retrieve-metadata-object-schema

## Authentication

- `Authorization` header (bearer token, required) — Use `Bearer {{token}}` in the `Authorization` header for authentication.

## Servers

- `https://rest.test.zuora.com` (US Developer & Central Sandbox (incl. Test Drive), default)
- `https://rest.sandbox.na.zuora.com` (US API Sandbox Cloud 1)
- `https://rest.apisandbox.zuora.com` (US API Sandbox Cloud 2)
- `https://rest.na.zuora.com` (US Production Cloud 1)
- `https://rest.zuora.com` (US Production Cloud 2)
- `https://rest.test.eu.zuora.com` (EU Developer & Central Sandbox)
- `https://rest.sandbox.eu.zuora.com` (EU API Sandbox)
- `https://rest.eu.zuora.com` (EU Production)
- `https://rest.test.ap.zuora.com` (APAC Developer & Central Sandbox)
- `https://rest.ap.zuora.com` (APAC Production)

## Request

### Path parameters

- `objectName` (string, required) — Name of the object to retrieve schema for. For Data Query(DQ) and Object Query(OQ), matching is case-insensitive. For Data Source Export(DSE) and Aggregate Query API(AQuA), use the object name casing expected by Billing Describe.

### Query parameters

- `context` (enum, required) — Data context for which to retrieve metadata. Supported values: - DQ: Data Query context - OQ: Object Query context - DSE: Data Source Export context - AQUA: Analytics Query context
  - Allowed values: `DQ`, `OQ`, `DSE`, `AQUA`

### Headers

- `Accept-Encoding` (string, optional) — 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, optional) — 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, optional) — 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, optional) — An entity ID. If you have [Zuora Multi-entity](https://knowledgecenter.zuora.com/BB_Introducing_Z_Business/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, optional) — 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. This header is important in Multi-Org (MO) setups because it defines the organization context under which the API should operate—mainly used for read access or data visibility filtering. If the header is not set, the operation is performed in scope of the user's accessible orgs.

## Response

### 200

JSON Schema for the specified object.

- `$schema` (string, required) — JSON Schema dialect
- `$id` (string, required) — Stable schema URI (canonical object name suffix; not the REST URL for this endpoint)
- `type` (enum, required) — Schema type (always 'object' for Zuora objects)
  - Allowed values: `object`
- `title` (string, optional) — Canonical object name from upstream (same segment as in `$id`)
- `description` (string, optional) — Object description
- `properties` (map from string to FieldSchema, optional) — Field definitions keyed by field name
- `required` (list of string, optional) — List of required field names
- `x-zuora-context` (enum, optional) — Data context
  - Allowed values: `DQ`, `OQ`, `DSE`, `AQUA`
- `x-zuora-category` (string, optional) — Object category (DQ/OQ only)
- `x-zuora-support-custom-field` (boolean, optional) — Whether object supports custom fields
- `x-zuora-relationships` (list of RelationshipSchema, optional) — Relationships to other objects

## Errors

### 500 Internal Server Error

Internal server error.

- `reasons` (list of ErrorReason, required)
- `requestId` (string, required) — Request correlation id (Zuora IT id from the gateway when available; otherwise a generated UUID).

### 400 Client Request Error

Object not found in the specified context.

- `reasons` (list of ErrorReason, required)
- `requestId` (string, required) — Request correlation id (Zuora IT id from the gateway when available; otherwise a generated UUID).

## Types

### FieldSchema

Field definition with JSON Schema core properties and Zuora extensions. Boolean `x-zuora-*` flags are emitted only when true; if a flag is absent, treat it as false. Extensions vary by context: - DQ/OQ: filterable, sortable, indexed, unique, object-key, inline relationships - DSE/AQUA: selectable, createable, updateable, relationship metadata

- `type` (enum, required, nullable) — JSON Schema type
  - Allowed values: `string`, `number`, `integer`, `boolean`, `array`, `object`
- `format` (enum, optional) — JSON Schema format hint
  - Allowed values: `date`, `date-time`, `uuid`
- `description` (string, optional) — Field description
- `readOnly` (boolean, optional) — Present only when true (read-only fields)
- `maxLength` (integer, optional) — Maximum string length
- `minimum` (double, optional) — Minimum numeric value
- `maximum` (double, optional) — Maximum numeric value
- `enum` (list of string, optional) — Allowed values for picklist fields
- `default` (any, optional) — Default value
- `x-zuora-type` (string, optional) — Original Zuora type name
- `x-zuora-filterable` (boolean, optional) — Whether field can be filtered (DQ/OQ/DSE)
- `x-zuora-sortable` (boolean, optional) — Whether field can be sorted (DQ/OQ)
- `x-zuora-indexed` (boolean, optional) — Whether field is indexed (DQ/OQ)
- `x-zuora-unique` (boolean, optional) — Whether field values must be unique (DQ/OQ)
- `x-zuora-object-key` (boolean, optional) — Whether field is the object's primary key (DQ/OQ)
- `x-zuora-custom-field` (boolean, optional) — Whether this is a custom field
- `x-zuora-selectable` (boolean, optional) — Whether field can be selected in queries (DSE/AQUA)
- `x-zuora-createable` (boolean, optional) — Whether field can be set on create (DSE/AQUA)
- `x-zuora-updateable` (boolean, optional) — Whether field can be updated (DSE/AQUA)
- `x-zuora-relationship` (InlineRelationshipSchema, optional) — Inline relationship metadata attached to foreign key fields (DQ/OQ only). Provides quick access to relationship information without parsing the top-level `x-zuora-relationships` array.

### RelationshipSchema

Relationship metadata describing how this object relates to another. Format varies by context: - DQ/OQ: Basic cardinality and field mappings - DSE/AQUA: Additional label, directRelationship, and path metadata

- `object` (string, required) — Related object name
- `cardinality` (enum, required) — Relationship cardinality
  - Allowed values: `manyToOne`, `oneToMany`, `manyToMany`
- `fields` (map from string to string, optional) — Foreign key field mappings (local field -> remote field)
- `label` (string, optional) — Human-readable relationship label (DSE/AQUA only)
- `directRelationship` (boolean, optional) — Whether this is a direct relationship (DSE/AQUA only)
- `path` (string, optional) — Relationship path (DSE/AQUA only)

### ErrorReason

A single Zuora reason entry (code + message).

- `code` (integer, required) — Zuora reason code (RRRRRRCC format)
- `message` (string, required) — Human-readable explanation for this reason

### InlineRelationshipSchema

Inline relationship metadata attached to foreign key fields (DQ/OQ only). Provides quick access to relationship information without parsing the top-level `x-zuora-relationships` array.

- `object` (string, required) — Related object name
- `cardinality` (enum, required) — Relationship cardinality
  - Allowed values: `manyToOne`, `oneToMany`
- `fields` (map from string to string, required) — Foreign key field mappings

## Examples

### Account schema for DQ context

**Response**

```json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema,",
  "$id": "https://api.zuora.com/schemas/account,",
  "type": "object",
  "title": "account",
  "description": "Account object schema",
  "properties": {
    "accountId": {
      "type": "string",
      "x-zuora-filterable": true,
      "x-zuora-sortable": false,
      "x-zuora-object-key": true
    },
    "accountNumber": {
      "type": "string",
      "maxLength": 50,
      "x-zuora-filterable": true,
      "x-zuora-sortable": false,
      "x-zuora-object-key": true
    },
    "balance": {
      "type": "number",
      "description": "Account balance",
      "x-zuora-type": "currency",
      "x-zuora-filterable": true
    },
    "billToContactId": {
      "type": "string",
      "format": "uuid",
      "description": "Bill-to contact reference",
      "x-zuora-type": "zuuid",
      "x-zuora-filterable": true,
      "x-zuora-relationship": {
        "object": "Contact",
        "cardinality": "manyToOne",
        "fields": {
          "BillToContactId": "Id"
        }
      }
    },
    "createdById": {
      "type": "string",
      "x-zuora-type": "zuuid",
      "x-zuora-filterable": true,
      "x-zuora-sortable": false,
      "x-zuora-object-key": false
    },
    "createdDate": {
      "type": "string",
      "x-zuora-filterable": true,
      "x-zuora-sortable": false,
      "x-zuora-object-key": false
    },
    "currency": {
      "type": "string",
      "enum": [
        "USD",
        "EUR",
        "GBP"
      ],
      "x-zuora-filterable": true,
      "x-zuora-sortable": true
    },
    "deleted": {
      "type": "boolean",
      "description": "Unique identifier",
      "x-zuora-filterable": true,
      "x-zuora-sortable": false,
      "x-zuora-object-key": false
    },
    "description": {
      "type": "string",
      "maxLength": 255,
      "x-zuora-filterable": true,
      "x-zuora-sortable": false,
      "x-zuora-object-key": false
    },
    "duration": {
      "type": "string",
      "maxLength": 255,
      "x-zuora-indexed": true,
      "x-zuora-object-key": false
    },
    "id": {
      "type": "string",
      "format": "uuid",
      "description": "Unique identifier",
      "readOnly": true,
      "x-zuora-type": "zuuid",
      "x-zuora-filterable": true,
      "x-zuora-sortable": false,
      "x-zuora-object-key": true
    },
    "name": {
      "type": "string",
      "description": "Account name",
      "maxLength": 255,
      "x-zuora-type": "string",
      "x-zuora-filterable": true,
      "x-zuora-sortable": true
    },
    "quantity": {
      "type": "number",
      "maxLength": 16,
      "x-zuora-filterable": true,
      "x-zuora-sortable": false,
      "x-zuora-object-key": false
    },
    "rbeStatus": {
      "type": "string",
      "maxLength": 9,
      "enum": [
        "Importing",
        "Pending",
        "Processed"
      ],
      "x-zuora-filterable": true,
      "x-zuora-sortable": false,
      "x-zuora-object-key": false
    },
    "startDateTime": {
      "type": "string",
      "x-zuora-filterable": true,
      "x-zuora-sortable": true,
      "x-zuora-object-key": false
    },
    "status": {
      "type": "string",
      "enum": [
        "Draft",
        "Active",
        "Canceled"
      ],
      "x-zuora-filterable": true,
      "x-zuora-sortable": true
    },
    "uom": {
      "type": "string",
      "maxLength": 50,
      "x-zuora-filterable": true,
      "x-zuora-sortable": false,
      "x-zuora-object-key": false
    }
  },
  "required": [
    "createdById",
    "id",
    "name",
    "startDateTime",
    "uom"
  ],
  "x-zuora-context": "OQ",
  "x-zuora-category": "core",
  "x-zuora-support-custom-field": true,
  "x-zuora-relationships": [
    {
      "object": "Contact",
      "cardinality": "manyToOne",
      "fields": {
        "BillToContactId": "Id"
      }
    }
  ]
}
```

**SDK Code**

```python Account schema for DQ context
import requests

url = "https://rest.test.zuora.com/object-metadata/Account"

querystring = {"context":"DQ"}

headers = {"Authorization": "Bearer <token>"}

response = requests.get(url, headers=headers, params=querystring)

print(response.json())
```

```javascript Account schema for DQ context
const url = 'https://rest.test.zuora.com/object-metadata/Account?context=DQ';
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Account schema for DQ context
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://rest.test.zuora.com/object-metadata/Account?context=DQ"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("Authorization", "Bearer <token>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Account schema for DQ context
require 'uri'
require 'net/http'

url = URI("https://rest.test.zuora.com/object-metadata/Account?context=DQ")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'

response = http.request(request)
puts response.read_body
```

```java Account schema for DQ context
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://rest.test.zuora.com/object-metadata/Account?context=DQ")
  .header("Authorization", "Bearer <token>")
  .asString();
```

```php Account schema for DQ context
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://rest.test.zuora.com/object-metadata/Account?context=DQ', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
  ],
]);

echo $response->getBody();
```

```csharp Account schema for DQ context
using RestSharp;

var client = new RestClient("https://rest.test.zuora.com/object-metadata/Account?context=DQ");
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "Bearer <token>");
IRestResponse response = client.Execute(request);
```

```swift Account schema for DQ context
import Foundation

let headers = ["Authorization": "Bearer <token>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://rest.test.zuora.com/object-metadata/Account?context=DQ")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

### Invoice schema for DSE context

**Response**

```json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://api.zuora.com/schemas/Invoice",
  "type": "object",
  "title": "Invoice",
  "description": "Invoice object schema",
  "properties": {
    "AccountId": {
      "type": "string",
      "description": "Account ID reference",
      "x-zuora-type": "string",
      "x-zuora-filterable": true,
      "x-zuora-selectable": true,
      "x-zuora-createable": true
    },
    "Amount": {
      "type": "number",
      "description": "Invoice amount",
      "x-zuora-type": "decimal",
      "x-zuora-filterable": true,
      "x-zuora-selectable": true
    },
    "Id": {
      "type": "string",
      "description": "Invoice ID",
      "readOnly": true,
      "x-zuora-type": "string",
      "x-zuora-selectable": true
    },
    "Status": {
      "type": "string",
      "description": "Invoice status",
      "enum": [
        "Draft",
        "Posted",
        "Canceled"
      ],
      "x-zuora-type": "picklist",
      "x-zuora-filterable": true,
      "x-zuora-selectable": true
    }
  },
  "required": [
    "Id",
    "AccountId"
  ],
  "x-zuora-context": "DSE",
  "x-zuora-support-custom-field": true,
  "x-zuora-relationships": [
    {
      "object": "Account",
      "cardinality": "manyToOne",
      "label": "Account",
      "directRelationship": true,
      "path": "Account"
    }
  ]
}
```

**SDK Code**

```python Invoice schema for DSE context
import requests

url = "https://rest.test.zuora.com/object-metadata/Account"

querystring = {"context":"DQ"}

headers = {"Authorization": "Bearer <token>"}

response = requests.get(url, headers=headers, params=querystring)

print(response.json())
```

```javascript Invoice schema for DSE context
const url = 'https://rest.test.zuora.com/object-metadata/Account?context=DQ';
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Invoice schema for DSE context
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://rest.test.zuora.com/object-metadata/Account?context=DQ"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("Authorization", "Bearer <token>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Invoice schema for DSE context
require 'uri'
require 'net/http'

url = URI("https://rest.test.zuora.com/object-metadata/Account?context=DQ")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'

response = http.request(request)
puts response.read_body
```

```java Invoice schema for DSE context
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://rest.test.zuora.com/object-metadata/Account?context=DQ")
  .header("Authorization", "Bearer <token>")
  .asString();
```

```php Invoice schema for DSE context
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://rest.test.zuora.com/object-metadata/Account?context=DQ', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
  ],
]);

echo $response->getBody();
```

```csharp Invoice schema for DSE context
using RestSharp;

var client = new RestClient("https://rest.test.zuora.com/object-metadata/Account?context=DQ");
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "Bearer <token>");
IRestResponse response = client.Execute(request);
```

```swift Invoice schema for DSE context
import Foundation

let headers = ["Authorization": "Bearer <token>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://rest.test.zuora.com/object-metadata/Account?context=DQ")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```