Discover a product’s fields
Read a product (GET /v1/products/{id}, or any item from GET /v1/catalog). When it needs inputs,
it carries an inputFields array. When it needs none, the field is absent.
A top-up product, copied from a real call:
Reading a field spec
string
The field’s machine name. This is the key to use in
inputFields on the order line.string
How to render and validate the value:
text, number or select.boolean
When
true, the order line must carry this field with a non-empty value.string
For a
text or number field, a regular expression the value must match. Absent when there is no
pattern constraint.object[]
For a
select field, the allowed values in display order. Each option has a value (what you
submit), a label (for display), and an optional parentValue. A parentValue gates a cascade:
the option applies only when the parent field’s option of that value is chosen — for example a
server that belongs to a chosen region.Submit the fields
Passinput_fields on the order line, keyed by each field’s key. For a select, submit the
option’s value. Copied from a real call:
Validation
The server validatesinput_fields before accepting the order:
- every required field must be present and non-empty;
- a value must match its field’s regex when one is set;
- an unknown key is rejected.
order_rejected (see Errors). Validate
against the field specs on your side first, so a rejection is the exception, not the flow.
A product that needs nothing
Most gift cards need no input. Their product has noinputFields, and the order line carries only
the product and quantity: