Create or alter a custom field

Creates or alters a schema of the specified custom field for the specified resource type.

SecuritySecretApiKey or JWT
Request
path Parameters
resource
required
string

Resource type string.

Enum: "customers" "payment-instruments" "subscriptions" "transactions" "websites" "products" "plans" "bump-offers"
name
required
string <= 60 characters ^[\w-]+$

Custom field identifier string.

Request Body schema: application/json

Custom fields schema of the specified resource type.

type
required
string
Type value Description
array An array of strings with up to 255 characters. Maximum size is 1000 elements.
boolean true or false value.
date String in full-date format (YYYY-MM-DD).
datetime String in date-time format (YYYY-MM-DDTHH:MM:SSZ).
integer Cardinal value of between -2^31 and 2^31-1.
number Float value. This field also accepts cardinal values which are interpreted as float.
string Regular string of up to 255 characters.
monetary A map of 3-letter currency, code, and amount. Example: {"currency": "EUR", "amount": 25.30}

Note: The type value cannot be changed.

Enum: "array" "boolean" "datetime" "integer" "number" "string" "monetary"
description
string

Description of the custom field.

additionalSchema
any

Additional schema which adds additional values constrains.

Additional parameters which can be added according to type:

Parameter name Types Description
allowedValues string, array List of allowed values.
maxLength string Maximum allowed length of a string. A maximum length of 4000 characters can be configured. By default, this value is set to 255.
Responses
200

Custom field updated.

Response Schema: application/json
type
required
string
Type value Description
array An array of strings with up to 255 characters. Maximum size is 1000 elements.
boolean true or false value.
date String in full-date format (YYYY-MM-DD).
datetime String in date-time format (YYYY-MM-DDTHH:MM:SSZ).
integer Cardinal value of between -2^31 and 2^31-1.
number Float value. This field also accepts cardinal values which are interpreted as float.
string Regular string of up to 255 characters.
monetary A map of 3-letter currency, code, and amount. Example: {"currency": "EUR", "amount": 25.30}

Note: The type value cannot be changed.

Enum: "array" "boolean" "datetime" "integer" "number" "string" "monetary"
name
string

Name of the custom field.

description
string

Description of the custom field.

additionalSchema
any

Additional schema which adds additional values constrains.

Additional parameters which can be added according to type:

Parameter name Types Description
allowedValues string, array List of allowed values.
maxLength string Maximum allowed length of a string. A maximum length of 4000 characters can be configured. By default, this value is set to 255.
Array of objects (Self) non-empty

Related resource links.

Array (non-empty)
href
required
string

Link URL.

rel
required
string

Type of link.

Value: "self"
201

Custom field created.

Response Headers
Location
string <uri>

Location of the related resource.

Example: "https://api.rebilly.com/example"
Response Schema: application/json
type
required
string
Type value Description
array An array of strings with up to 255 characters. Maximum size is 1000 elements.
boolean true or false value.
date String in full-date format (YYYY-MM-DD).
datetime String in date-time format (YYYY-MM-DDTHH:MM:SSZ).
integer Cardinal value of between -2^31 and 2^31-1.
number Float value. This field also accepts cardinal values which are interpreted as float.
string Regular string of up to 255 characters.
monetary A map of 3-letter currency, code, and amount. Example: {"currency": "EUR", "amount": 25.30}

Note: The type value cannot be changed.

Enum: "array" "boolean" "datetime" "integer" "number" "string" "monetary"
name
string

Name of the custom field.

description
string

Description of the custom field.

additionalSchema
any

Additional schema which adds additional values constrains.

Additional parameters which can be added according to type:

Parameter name Types Description
allowedValues string, array List of allowed values.
maxLength string Maximum allowed length of a string. A maximum length of 4000 characters can be configured. By default, this value is set to 255.
Array of objects (Self) non-empty

Related resource links.

Array (non-empty)
href
required
string

Link URL.

rel
required
string

Type of link.

Value: "self"
401

Unauthorized access. Invalid credentials used.

409

Schema in use. To remove or alter the schema, remove all associated data.

422

Invalid data was sent.

put/custom-fields/{resource}/{name}
Request samples
application/json
{
  • "type": "array",
  • "description": "string",
  • "additionalSchema": null
}
Response samples
application/json
{
  • "name": "string",
  • "type": "array",
  • "description": "string",
  • "additionalSchema": null,
  • "_links": [
    ]
}