Composable Frontend 2.0 Learn more 

  • Commerce Cloud/
    Custom Data/
    Custom Data (Flows) API/
    Fields/
    Get a Field

    Get a Field

    GET Get a Field

    https://useast.api.elasticpath.com/v2/fields/:id
    

    Parameters

    Path parameters

    NameRequiredTypeDescription
    idRequiredstringThe ID for the field you are requesting.

    Headers

    NameRequiredTypeDescription
    AuthorizationRequiredstringThe Bearer token required to get access to the API.

    Request Examples

    Curl

    curl https://useast.api.elasticpath.com/v2/fields/:id \
         -H "Authorization: Bearer XXXX" \
         -H "Content-Type: application/json" \
    

    JavaScript SDK

    const fieldId = "25617d3e-14a6-434c-bfab-3fda87517aaf";
    
    
    // Where `EPCC` is an authenticated client
    await EPCC.Fields.Get(fieldID);
    

    Response Example

    200 OK

    {
        "data": {
            "id": "102b2087-d56a-45e7-bf1c-e9517716abb3",
            "type": "field",
            "field_type": "integer",
            "slug": "product-rating",
            "name": "Product Rating",
            "description": "Average rating as given by our users",
            "required": false,
            "default": null,
            "enabled": true,
            "validation_rules": [
                {
                    "type": "between",
                    "options": {
                        "from": 1,
                        "to": 5
                    }
                }
            ],
            "order": 1,
            "omit_null": false,
            "links": {
                "self": "https://useast.api.elasticpath.com/v2/flows/6d320b42-237d-4474-8452-d49f884d4ae1/fields/102b2087-d56a-45e7-bf1c-e9517716abb3"
            },
            "relationships": {
                "flow": {
                    "data": {
                        "id": "6d320b42-237d-4474-8452-d49f884d4ae1",
                        "type": "flow"
                    }
                }
            },
            "meta": {
                "owner": "organization",
                "timestamps": {
                    "created_at": "2018-05-10T18:19:11.559Z",
                    "updated_at": "2018-05-10T18:19:11.559Z"
                }
            }
        }
    }
    
    Previous
    Get all Fields