Composable Frontend 2.0 Learn more 

  • Commerce Cloud/
    Custom Data/
    Custom Data (Flows) API/
    Flows/
    Create a Flow

    Create a Flow

    POST Create a Flow

    https://useast.api.elasticpath.com/v2/flows
    

    Custom names and values prefixed with $ are not supported.

    Parameters

    Headers

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

    Body

    NameRequiredTypeDescription
    enabledRequiredbooleantrue if enabled, false if not.
    descriptionRequiredstringAny description for this flow.
    slugRequiredstringA unique slug identifier for the flow.
    nameRequiredstringThe name of the flow.
    typeRequiredstringRepresents the type of object being returned.

    Request Examples

    Curl

    curl -X POST "https://useast.api.elasticpath.com/v2/flows" \
         -H "Authorization: XXXX" \
         -H "Content-Type: application/json" \
         -d $ {
            "data": {
                "type": "flow",
                "name": "Products",
                "slug": "products",
                "description": "Extends the default product object",
                "enabled": true
            }
         }
    

    JavaScript SDK

    const data = {
        name: "Products flow",
        slug: "products",
        description: "Extends the default product object",
        enabled: true,
    };
    
    
    // Where `EPCC` is an authenticated client
    await Moltin.Flows.Create(data);
    

    Response Example

    201 Created

    {
        "data": {
            "id": "6d320b42-237d-4474-8452-d49f884d4ae1",
            "type": "flow",
            "name": "Products-1",
            "slug": "products-1",
            "description": "Extends the default product object",
            "enabled": true,
            "links": {
                "self": "https://useast.api.elasticpath.com/v2/flows/6d320b42-237d-4474-8452-d49f884d4ae1"
            },
            "relationships": {},
            "meta": {
                "owner": "organization",
                "timestamps": {
                    "created_at": "2018-05-10T18:04:26.623Z",
                    "updated_at": "2018-05-10T18:04:26.623Z"
                }
            }
        }
    }
    
    Previous
    Get a Flow