Polar::Api::CustomFields
API client for custom_fields operations
Constants
Constructors
Creates a new CustomFields instance
@param client [Client] The Polar API client instance
Instance methods
Create Custom Field
Create a custom field.
Scopes: custom_fields:write
Endpoint: POST /v1/custom-fields/
Parameters:
body(required): Request body as Polar::Models::CustomFieldCreate
Returns: Polar::Models::CustomField
Raises:
ResourceNotFoundErroron 404NotPermittedErroron 403HTTPValidationErroron 422PolarErroron other errors
Delete Custom Field
Delete a custom field.
Scopes: custom_fields:write
Endpoint: DELETE /v1/custom-fields/{id}
Parameters:
id(required): The custom field ID.
Returns: JSON response string
Raises:
ResourceNotFoundErroron 404NotPermittedErroron 403HTTPValidationErroron 422PolarErroron other errors
Get Custom Field
Get a custom field by ID.
Scopes: custom_fields:read custom_fields:write
Endpoint: GET /v1/custom-fields/{id}
Parameters:
id(required): The custom field ID.
Returns: Polar::Models::CustomField
Raises:
ResourceNotFoundErroron 404NotPermittedErroron 403HTTPValidationErroron 422PolarErroron other errors
List Custom Fields
List custom fields.
Scopes: custom_fields:read custom_fields:write
Endpoint: GET /v1/custom-fields/
Parameters:
organization_id(optional): Filter by organization ID.query(optional): Filter by custom field name or slug.type(optional): Filter by custom field type.page(optional): Page number, defaults to 1.limit(optional): Size of a page, defaults to 10. Maximum is 100.sorting(optional): Sorting criterion. Several criteria can be used simultaneously and will be applied in order. Add a minus sign - before the criteria name to sort by descending order.
Returns: Polar::Models::ListResource(Polar::Models::CustomField)
Raises:
ResourceNotFoundErroron 404NotPermittedErroron 403HTTPValidationErroron 422PolarErroron other errors
Update Custom Field
Update a custom field.
Scopes: custom_fields:write
Endpoint: PATCH /v1/custom-fields/{id}
Parameters:
id(required): The custom field ID.body(required): Request body as Polar::Models::CustomFieldUpdate
Returns: Polar::Models::CustomField
Raises:
ResourceNotFoundErroron 404NotPermittedErroron 403HTTPValidationErroron 422PolarErroron other errors