Vendors

Set a vendor's custom field value

Writes one custom field's value for a vendor. Send only the property matching the field's type — a text field takes stringValue, a number field numberValue, and so on. Requires the vendors:write permission.

PUT
https://services.magicdoor.com/maintenance/company-portal/vendors/{vendorId}/custom-fields/{customFieldId}

Authorization

Authorizationstringrequired
Bearer token — Send your API token in the Authorization header as Bearer <token>. Requests without a valid token are rejected with 401 Unauthorized.

Path parameters

vendorIdstringrequired

The vendor to act on. A Snowflake id, sent as a decimal string.

example: 1826110384726355968
customFieldIdstringrequired

The custom field. It must be one defined for vendors.

example: 1825110384726355968

Body

application/json

For a field that holds files, do not send referenceValue yourself — send the upload session ids instead and MagicDoor turns them into file ids for you.

stringValuestring

For a field that holds one piece of text.

stringArraystring[]

For a field that holds several pieces of text.

numberValuenumber

For a field that holds a number.

dateTimeValuestring · date-time

For a field that holds a date or time. Send it without an offset; it is read as UTC.

booleanValueboolean

For a field that holds a yes or no.

referenceValuestring

For a field that points at one other record — the record's id.

referenceArraystring[]

For a field that points at several other records.

referenceFileUploadSessionIdstring

For a file field holding one file: an upload session from Start a file upload for a vendor custom field, whose bytes you have already sent. It replaces whatever file was there.

referenceFileUploadSessionIdsstring[]

For a file field holding several files: upload sessions whose bytes you have already sent. These are appended to referenceArray rather than replacing it, so the field's existing files are kept unless you send a shorter referenceArray.

Response

200 · The value that was written.

customFieldIdstringrequired

The custom field this value belongs to.

entityTypestringrequired

What the value hangs off. Always the literal Vendor here — note this one is written in title case, unlike other enumerations in this API.

entityIdstringrequired

The vendor the value belongs to.

stringValuestring

The value, when the field holds one piece of text.

stringArraystring[]

The value, when the field holds several pieces of text.

numberValuenumber

The value, when the field holds a number.

dateTimeValuestring · date-time

The value, when the field holds a date or time, in the company's timezone and without an offset.

booleanValueboolean

The value, when the field holds a yes or no.

referenceValuestring

The value, when the field points at one other record — for a file field, the file's id.

referenceArraystring[]

The value, when the field points at several other records.

createdstring · date-timerequired

When the value was first set, in the company's timezone and without an offset.

updatedstring · date-timerequired

When it was last changed, in the company's timezone and without an offset.

referenceFilesobject[]

The files behind referenceValue and referenceArray, resolved for you. Absent when the field does not point at files.

400 · The value does not suit the field — wrong type, outside its allowed range or length, missing when the field is required, or not one of the field's allowed values.

401 · The request carried no valid access token.

403 · The token is not a property manager token, or it lacks the `vendors:write` permission.

404 · No such vendor, it belongs to another company, or `customFieldId` names a field that does not exist or is not a vendor field.