post https://app.ecwid.com/api/v3//orders//extraFields
Create a new extra field and save it to order in an Ecwid store. This can be useful for storefronts with a custom checkout process or manually creating extra fields for orders made earlier.
You can create only one extra field per API request. To create several extra fields, send several separate requests for the order.
Access scopes required: read_orders and update_orders
Headers
Name | Type | Description |
---|---|---|
Authorization | string | oAuth token with mandatory Bearer before it. Example: Bearer e***s0 , where e***s0 should be replaced with your oAuth token. |
Request
A JSON object of type 'orderExtraFields' with the following fields:
orderExtraFields
Field | Type | Description |
---|---|---|
id | string | Extra field's key |
value | string | Extra field's value |
customerInputType | string | Supported values: TEXT , TEXTAREA , SELECT , CHECKBOX , TOGGLE_BUTTON_GROUP , RADIO_BUTTONS , DATETIME , LABEL . If not specified, default vale is TEXT . More on this in Types of fields section |
title | string | Title of an extra field that prompts the user to enter the value |
orderDetailsDisplaySection | string | Defines the order section the extra field values is shown to customer and merchant. Supported values: shipping_info , billing_info , customer_info , order_comments . More on this in Show extra fields in an order section. Empty if not specified. |
orderBy | string | Extra field position at an order section in Ecwid Control Panel. Use it to sort fields within the same orderDetailsDisplaySection . The smaller the number, the higher the position is. |
showInNotifications | boolean | If not specified the default value is false . Set true to show extra field in order emails. orderDetailsDisplaySection sets the part where the extra field will appear. |
showInInvoice | boolean | true /false if the extra field should be displayed in order invoice or not. Default value: false |
Response
A JSON object of type 'CreateStatus' with the following fields:
CreateStatus
Field | Type | Description |
---|---|---|
createCount | number | The number of created extra fields (1 or 0 depending on whether the creation was successful) |
Errors
Error response example:
HTTP/1.1 404 Order Not Found
Content-Type application/json; charset=utf-8
In case of error, Ecwid responds with an error HTTP status code and, optionally, JSON-formatted body containing error description
HTTP codes
HTTP Status | Description |
---|---|
400 | Request parameters are malformed |
403 | Access token doesn't have update_orders scope |
404 | Order is not found |
405 | Method not allowed. Can occur when using POST instead of PUT HTTP request method |
415 | Unsupported content-type: expected application/json or text/json |
500 | Cannot retrieve extra fields info because of an error on the server |
Error response body (optional)
Field | Type | Description |
---|---|---|
errorMessage | string | Error message |