Skip to main content

Update custom fields of a specific object

Zuora

Update custom fields of a specific object

You can update the custom fields of a specific object through Settings API. You must specify the object name in the endpoint.  See the following example on how to update the custom fields of the Account object.

Note that when updating custom fields with this API operation, you must add all custom fields of this specific object in the request body, instead of providing only the fields you need to update. After the update, existing custom fields that are not present in the request body will be removed.

HTTP request:

PUT https://rest.zuora.com/settings/custom-fields/zuora/Account

Request body:

{
  "type": "object",
  "properties": {
    "Territory__c": {
      "enum": [
        "Undefined",
        "Central",
        "North",
        "South",
        "East",
        "West"
      ],
      "label": "Territory",
      "type": "string",
      "description": "The territory in which the account belongs in. This is used to enhance reporting.",
      "default": "Undefined"
    },
    "SEUseCase__c": {
      "maxLength": 255,
      "label": "SE Use Case",
      "type": "string"
    },
    "InvoiceNumber__c": {
      "enum": [
        "dddd"
      ],
      "label": "Invoice Number",
      "type": "string",
      "description": "",
      "default": "dddd"
    },
    "AccountStructure__c": {
      "enum": [
        "Public",
        "Private",
        "Wholly Owned Subsidiary",
        "VC Backed",
        "State and Local Govt",
        "Federal"
      ],
      "label": "Account Structure",
      "type": "string",
      "description": "Field used to support custom reporting and analysis."
    },
    "AccountProfile__c": {
      "enum": [
        "Small",
        "Medium",
        "Enterprise",
        "Strategic",
        "Growth"
      ],
      "label": "Account Profile",
      "type": "string",
      "description": "Custom field to support reporting by account type.",
      "default": "Small"
    },
    "Entity__c": {
      "enum": [
        "EMEA",
        "APAC"
      ],
      "label": "Entity",
      "type": "string",
      "description": "",
      "default": "EMEA"
    },
    "NewField__c": {
      "enum": [
        "List1",
        "List2"
      ],
      "label": "NewField",
      "type": "string",
      "description": "",
      "default": "List1"
    }
  },
  "indexed": [
    "AccountProfile__c",
    "AccountStructure__c",
    "Entity__c",
    "InvoiceNumber__c",
    "SEUseCase__c",
    "Territory__c"
  ]
}

Response body:

"/fields/zuora/definitions/Account"