# Create or alter a custom field

Creates or alters a specified custom field schema for a specified resource.

Endpoint: PUT /custom-fields/{resource}/{name}
Version: latest
Security: SecretApiKey, JWT

## Security:

  - `SecretApiKey` (unknown)
    apiKey in header REB-APIKEY

  - `JWT` (unknown)
    http bearer JWT

## Path parameters:

  - `resource` (string, required)
    Type of resource schema.

  - `name` (string, required)
    ID of the custom field.

## Request body:

  - `application/json` (unknown)
    Custom fields schema of the specified resource.

## Request fields (application/json):

  - `type` (string, required)
    Describes the data type.
The custom field type value cannot be changed.

Array of strings with up to 255 characters.
The maximum size is 1000 elements.
    Enum: "array"

  - `description` (string | null)
    Description of the custom field.

  - `isEnabled` (boolean)
    Specifies if the custom field is enabled.

  - `additionalSchema` (object | null)
    Additional schema which adds additional values constrains.

  - `additionalSchema.allowedValues` (array)
    List of allowed values.

  - `additionalSchema.required` (boolean)
    Specifies if this value is required.
This value can be combined with any parameter and is available for custom fields of any type.

  - `additionalSchema.default` (array)
    Default value.

  - `type` (string, required)
    Describes the data type.
The custom field type value cannot be changed.
Specifies a `true` or `false` value.
    Enum: "boolean"

  - `isEnabled` (boolean)
    Specifies if custom field is enabled.

  - `type` (string, required)
    Describes the data type.
The custom field type value cannot be changed.
String in [full-date](https://www.rfc-editor.org/rfc/rfc3339) format (YYYY-MM-DD).
    Enum: "date"

  - `type` (string, required)
    Describes the data type.
The custom field type value cannot be changed.
String in [date-time](https://www.rfc-editor.org/rfc/rfc3339) format (YYYY-MM-DDTHH:MM:SSZ).
    Enum: "datetime"

  - `type` (string, required)
    Describes the data type.
The custom field type value cannot be changed.
Cardinal value of between `-2^31` and `2^31-1`.
    Enum: "integer"

  - `type` (string, required)
    Describes the data type.
The custom field type value cannot be changed.

Float value. This field also accepts cardinal values which are interpreted as float.
    Enum: "number"

  - `type` (string, required)
    Describes the data type.
The custom field type cannot be changed.

Regular string of up to 255 characters.
    Enum: "string"

  - `type` (string, required)
    Describes the data type.
The custom field type cannot be changed.
A map of 3-letter currency, code, and amount.
Example: `{"currency": "EUR", "amount": 25.30}`.
    Enum: "monetary"

## Response 200:

  - `200` (unknown)
    Custom field updated.

## Response 200 fields (application/json):

  - `name` (string)
    Name of the custom field.

  - `type` (string, required)
    Describes the data type.
The custom field type value cannot be changed.

Array of strings with up to 255 characters.
The maximum size is 1000 elements.
    Enum: "array"

  - `description` (string | null)
    Description of the custom field.

  - `isEnabled` (boolean)
    Specifies if the custom field is enabled.

  - `additionalSchema` (object | null)
    Additional schema which adds additional values constrains.

  - `additionalSchema.allowedValues` (array)
    List of allowed values.

  - `additionalSchema.required` (boolean)
    Specifies if this value is required.
This value can be combined with any parameter and is available for custom fields of any type.

  - `additionalSchema.default` (array)
    Default value.

  - `_links` (array)
    Related links.

  - `_links.href` (string)
    Link URL.

  - `_links.rel` (string)
    Type of link.
    Enum: "self"

  - `type` (string, required)
    Describes the data type.
The custom field type value cannot be changed.
Specifies a `true` or `false` value.
    Enum: "boolean"

  - `isEnabled` (boolean)
    Specifies if custom field is enabled.

  - `type` (string, required)
    Describes the data type.
The custom field type value cannot be changed.
String in [full-date](https://www.rfc-editor.org/rfc/rfc3339) format (YYYY-MM-DD).
    Enum: "date"

  - `type` (string, required)
    Describes the data type.
The custom field type value cannot be changed.
String in [date-time](https://www.rfc-editor.org/rfc/rfc3339) format (YYYY-MM-DDTHH:MM:SSZ).
    Enum: "datetime"

  - `type` (string, required)
    Describes the data type.
The custom field type value cannot be changed.
Cardinal value of between `-2^31` and `2^31-1`.
    Enum: "integer"

  - `type` (string, required)
    Describes the data type.
The custom field type value cannot be changed.

Float value. This field also accepts cardinal values which are interpreted as float.
    Enum: "number"

  - `type` (string, required)
    Describes the data type.
The custom field type cannot be changed.

Regular string of up to 255 characters.
    Enum: "string"

  - `type` (string, required)
    Describes the data type.
The custom field type cannot be changed.
A map of 3-letter currency, code, and amount.
Example: `{"currency": "EUR", "amount": 25.30}`.
    Enum: "monetary"

## Response 200 headers (application/json):

  - `Rate-Limit-Limit` (integer)
    Maximum number of requests available at one time for this rate limit.
For more information, see [Rate limits](#section/Rate-limits).
    Example: 500

  - `Rate-Limit-Remaining` (integer)
    Number of requests still available for this rate limit.
For more information, see [Rate limits](#section/Rate-limits).
    Example: 499

## Response 201:

  - `201` (unknown)
    Custom field created.

## Response 201 fields (application/json):

  - `name` (string)
    Name of the custom field.

  - `type` (string, required)
    Describes the data type.
The custom field type value cannot be changed.

Array of strings with up to 255 characters.
The maximum size is 1000 elements.
    Enum: "array"

  - `description` (string | null)
    Description of the custom field.

  - `isEnabled` (boolean)
    Specifies if the custom field is enabled.

  - `additionalSchema` (object | null)
    Additional schema which adds additional values constrains.

  - `additionalSchema.allowedValues` (array)
    List of allowed values.

  - `additionalSchema.required` (boolean)
    Specifies if this value is required.
This value can be combined with any parameter and is available for custom fields of any type.

  - `additionalSchema.default` (array)
    Default value.

  - `_links` (array)
    Related links.

  - `_links.href` (string)
    Link URL.

  - `_links.rel` (string)
    Type of link.
    Enum: "self"

  - `type` (string, required)
    Describes the data type.
The custom field type value cannot be changed.
Specifies a `true` or `false` value.
    Enum: "boolean"

  - `isEnabled` (boolean)
    Specifies if custom field is enabled.

  - `type` (string, required)
    Describes the data type.
The custom field type value cannot be changed.
String in [full-date](https://www.rfc-editor.org/rfc/rfc3339) format (YYYY-MM-DD).
    Enum: "date"

  - `type` (string, required)
    Describes the data type.
The custom field type value cannot be changed.
String in [date-time](https://www.rfc-editor.org/rfc/rfc3339) format (YYYY-MM-DDTHH:MM:SSZ).
    Enum: "datetime"

  - `type` (string, required)
    Describes the data type.
The custom field type value cannot be changed.
Cardinal value of between `-2^31` and `2^31-1`.
    Enum: "integer"

  - `type` (string, required)
    Describes the data type.
The custom field type value cannot be changed.

Float value. This field also accepts cardinal values which are interpreted as float.
    Enum: "number"

  - `type` (string, required)
    Describes the data type.
The custom field type cannot be changed.

Regular string of up to 255 characters.
    Enum: "string"

  - `type` (string, required)
    Describes the data type.
The custom field type cannot be changed.
A map of 3-letter currency, code, and amount.
Example: `{"currency": "EUR", "amount": 25.30}`.
    Enum: "monetary"

## Response 201 headers (application/json):

  - `Location` (string)
    Location of the related resource.
    Example: https://api.rebilly.com/example

  - `Rate-Limit-Limit` (integer)
    Maximum number of requests available at one time for this rate limit.
For more information, see [Rate limits](#section/Rate-limits).
    Example: 500

  - `Rate-Limit-Remaining` (integer)
    Number of requests still available for this rate limit.
For more information, see [Rate limits](#section/Rate-limits).
    Example: 499

## Response 401:

  - `401` (unknown)
    Unauthorized access.
Invalid credentials used.

## Response 401 fields (application/json):

  - `status` (integer)
    HTTP status code.

  - `type` (string)
    Problem type in the form of a [URI](https://tools.ietf.org/html/rfc3986) reference.
It should provide human-readable documentation for the problem type.
When this member is not present, its value is assumed to be "about:blank".

  - `title` (string)
    Short, human-readable summary of the problem type.
Other than for the purposes of localization, this should not change from occurrence to occurrence of the problem.

  - `detail` (string)
    Human-readable explanation that is specific to this occurrence of the problem.

  - `instance` (string)
    URI reference that identifies the specific occurrence of the problem.
It may or may not yield further information if dereferenced.

## Response 409:

  - `409` (unknown)
    Schema in use. To remove or alter the schema, remove all
associated data.

## Response 409 fields (application/json):

  - `error` (string)

## Response 422:

  - `422` (unknown)
    Invalid data sent.

## Response 422 fields (application/json):

  - `status` (integer)
    HTTP status code.

  - `type` (string)
    Problem type in the form of a [URI](https://tools.ietf.org/html/rfc3986) reference.
It should provide human-readable documentation for the problem type.
When this member is not present, its value is assumed to be "about:blank".

  - `title` (string)
    Short, human-readable summary of the problem type.
Other than for the purposes of localization, this should not change from occurrence to occurrence of the problem.

  - `detail` (string)
    Human-readable explanation that is specific to this occurrence of the problem.

  - `instance` (string)
    URI reference that identifies the specific occurrence of the problem.
It may or may not yield further information if dereferenced.

  - `invalidFields` (array)
    Invalid field details.
    Example: [{"field":"field1","message":"field1 is invalid"},{"field":"subObject.field2","message":"field2 is invalid"},{"field":"subObject.field2","message":"another error in the field2"}]

  - `invalidFields.field` (string)
    Name of the field.
Dot notation is used for nested object field names.

  - `invalidFields.message` (string)
    Message field.

## Response 429:

  - `429` (unknown)
    Request rate limit exceeded.

## Response 429 fields (application/json):

  - `type` (string)
    Problem type in the form of a [URI](https://tools.ietf.org/html/rfc3986) reference.
It should provide human-readable documentation for the problem type.
When this member is not present, its value is assumed to be "about:blank".
    Example: about:blank

  - `title` (string)
    Short, human-readable summary of the problem type.
Other than for the purposes of localization, this should not change from occurrence to occurrence of the problem.
    Example: Rate Limit Exceeded

  - `status` (integer)
    HTTP status code.

  - `detail` (string)
    Human-readable explanation that is specific to this occurrence of the problem.
    Example: A request cannot be executed because the user has sent too many requests within a certain period of time

  - `instance` (string)
    URI reference that identifies the specific occurrence of the problem.
It may or may not yield further information if dereferenced.

## Response 429 headers (application/json):

  - `Rate-Limit-Limit` (integer)
    Maximum number of requests available at one time for this rate limit.
For more information, see [Rate limits](#section/Rate-limits).
    Example: 500

  - `Rate-Limit-Remaining` (integer)
    Number of requests still available for this rate limit.
For more information, see [Rate limits](#section/Rate-limits).
    Example: 0

  - `Rate-Limit-Retry-After` (integer)
    Number of seconds to wait before retrying the request.
    Example: 1

  - `Retry-After` (integer)
    Number of seconds to wait before retrying the request.
    Example: 1

