# Custom Object Records

With Custom Objects service, you can create, update, delete and find custom object records.

If you use Postman, you can import the custom objects endpoints as a collection into your Postman app and try out different requests to learn how the API works. 

You can sign up for a free account on the [Postman website](https://identity.getpostman.com/signup) and download the app in case you do not use Postman yet.

Note that the Custom Object Records API is versioned by `Zuora-Version` in the request header. The response may be different for the same request with a different API version. Specify `Zuora-Version` in the request header if you expect a specific response schema.



## Create custom object records

 - [POST /objects/records/default/{object}](https://developer.zuora.com/v1-api-reference/api/custom-object-records/post_customobjectrecords.md): Creates custom object records with the given type.

Upon creating records of a custom object type, the 200 response contains a list of records that have been successfully processed and stored.

### Limitations

This call has the following limitations:
  
* The maximum number of records that you can create by one call is 1,000.
* The storage of empty strings in records is not supported.
* Null values must be formatted as the following example:
  
  {
    "records": [
      {
        "fieldName__c": null
      }
    ]
  }
  
* When creating or updating custom object records with relationship-type fields, Zuora verifies the related objects against the transactional databases, which are updated in near real-time. The record creation or modification fails upon unsuccessful verifications. If the related objects are newly created in your tenant, it might need some time for the transactional database synchronization.

## List records for a custom object

 - [GET /objects/records/default/{object}](https://developer.zuora.com/v1-api-reference/api/custom-object-records/get_allrecordsforcustomobjecttype.md): Lists all object records of the given type. You can also use the q query parameter to filter the output records.


### Custom Objects read consistency

Custom Objects support eventually consistency. When you read custom object records, the response might not reflect the result of a recently completed operation and might include some stale data. The operations include creating, updating, and deleting custom object records.  If you repeat your read request after a short time, the response should return the latest data.

For example, if you create five records and perform a query that these five records satisfy the query conditions, there might be a delay before these records can be returned in the query result.

## Retrieve a custom object record

 - [GET /objects/records/default/{object}/{id}](https://developer.zuora.com/v1-api-reference/api/custom-object-records/get_customobjectrecordbyid.md): Retrieves a record of a given type by ID.

## Update a custom object record

 - [PUT /objects/records/default/{object}/{id}](https://developer.zuora.com/v1-api-reference/api/custom-object-records/put_customobjectrecord.md): Updates a record of the given type and ID.

### Limitations

* The storage of empty strings in records is not supported.
* Null values must be formatted as the following example:
  
  {
    "records": [
      {
        "fieldName__c": null
      }
    ]
  }
  
* When creating or updating custom object records with relationship-type fields, Zuora verifies the related objects against the transactional databases, which are updated in near real-time. The record creation or modification fails upon unsuccessful verifications. If the related objects are newly created in your tenant, it might need some time for the transactional database synchronization.

## Partially update a custom object record

 - [PATCH /objects/records/default/{object}/{id}](https://developer.zuora.com/v1-api-reference/api/custom-object-records/patch_partialupdatecustomobjectrecord.md): Updates one or many fields of a custom object record. Patch update uses JSON Merge Patch as specified in RFC 7386.

### Limitations

* The storage of empty strings in records is not supported.
* Null values must be formatted as the following example:
  
  {
    "records": [
      {
        "fieldName__c": null
      }
    ]
  }
  
* When creating or updating custom object records with relationship-type fields, Zuora verifies the related objects against the transactional databases, which are updated in near real-time. The record creation or modification fails upon unsuccessful verifications. If the related objects are newly created in your tenant, it might need some time for the transactional database synchronization.

## Delete a custom object record

 - [DELETE /objects/records/default/{object}/{id}](https://developer.zuora.com/v1-api-reference/api/custom-object-records/delete_customobjectrecordbyid.md): Deletes a custom object record of the given type and ID.

Note that 200 response will be returned under either of the following conditions:
* The record is identified and successfully deleted
* The record could not be found

Note that the record is deleted immediately and, therefore, will not be retained upon successful deletion.

## Update or delete custom object records

 - [POST /objects/batch/default/{object}](https://developer.zuora.com/v1-api-reference/api/custom-object-records/post_customobjectrecordsbatchupdateordelete.md): Makes a batch update or delete of custom object records.

### Limitations

This call has the following limitations:

* The maximum number of records that you can update by one call is 1,000.
* The maximum number of records that you can delete by one call is 1,000.
* The storage of empty strings in records is not supported.
* Null values must be formatted as the following example:
  
  {
    "action": {
      "type": "update",
      "records": {
        "64edb2a5-2796-4e95-9559-846f8636a01b": {
          "fieldName__c": null
        }
      }
    }
  }
  
* When creating or updating custom object records with relationship-type fields, Zuora verifies the related objects against the transactional databases, which are updated in near real-time. The record creation or modification fails upon unsuccessful verifications. If the related objects are newly created in your tenant, it might need some time for the transactional database synchronization.

