Custom Object API (/custom_objects/id)
Introduction
Use the Custom Objects API to create, update, or query the data records for your Custom Objects. If you need to define a new Custom Object, use the UI.
The URL to access the Custom Objects API is:
https://<instance>/api/custom_objects/{object_id}
See Integration Best Practices for more info.
Actions
Verb | Path | Action | Description |
---|---|---|---|
POST |
/api/custom_objects/{object_id}/object_instances/
|
create | Create a new data record for the Custom Object |
PUT |
/api/custom_objects/{object_id}/object_instances/{instance_id}
|
update | Modify an existing data record |
GET |
/api/custom_objects/{object_id}/object_instances/
|
index | Lists all of the data records for the Custom Object |
GET |
/api/custom_objects/{object_id}/object_instances/{instance_id}
|
show | Lists an individual data record |
Elements (Object Instance)
Element | Description | Req'd | Unique | Allowable Value | In | Out | Data Type |
---|---|---|---|---|---|---|---|
created-at | Automatically created by Coupa in the format YYYY-MM-DDTHH:MM:SS+HH:MMZ | any | yes | datetime | |||
created-by | User who created | any | yes | User | |||
custom-object-code | Custom object code | any | yes | string | |||
custom-object-name | Custom object name | any | yes | string | |||
form-response-id | ID of form response that created the instance | any | yes | integer | |||
id | Coupa Internal ID | any | yes | integer | |||
updated-at | Automatically created by Coupa in the format YYYY-MM-DDTHH:MM:SS+HH:MMZ | any | yes | datetime | |||
updated-by | User who updated | any | yes | User |
Note:
Elements are only used for GET calls. POST or PUT calls will only include the custom fields used in your custom object definition. See the below sample for details.
Sample Payloads
Since a Custom Object is made entirely of custom fields, you need to contain your custom
fields in the custom-field
namespace. A basic POST or PUT should take this
form:
<object-instance>
<custom-fields>
<custom-field-1>custom-field-1-value</custom-field-1>
<custom-field-2>custom-field-2-value</custom-field-2>
...
<custom-field-10>custom-field-10-value</custom-field-10>
<custom-fields>
</object-instance>