Flows

A Flow describes a collection of Fields. It is named after the internal entity type you wish to associate it with. For example a Flow with a slug of products will be applied to all Product responses in your store.

The flow object

Attribute

Type

Description

id

string

The unique identifier for this flow.

type

string

Represents the type of object being returned

name

string

The name of the flow

slug

string

A unique slug identifier for the flow

description

string

Any description for this flow

enabled

bool

true if enabled, false if not

Get a Flow

GET https://api.moltin.com/v2/flows/:id

Path Parameters

NameTypeDescription

id

string

The ID for the flow you are requesting

Headers

NameTypeDescription

Authorization

string

The Bearer token to grant access to the API

{
    "data": {
        "id": "38ba1451-efa4-4361-9ca6-3fb646490f37",
        "type": "flow",
        "name": "extraFieldRenamed",
        "slug": "products",
        "description": "Extends the default product object",
        "enabled": true,
        "links": {
            "self": "https://api.moltin.com/v2/flows/38ba1451-efa4-4361-9ca6-3fb646490f37"
        },
        "relationships": {},
        "meta": {
            "timestamps": {
                "created_at": "2018-05-10T01:41:36.009Z",
                "updated_at": "2018-05-10T15:27:26.241Z"
            }
        }
    }
}
curl https://api.moltin.com/v2/flows/:id \
     -H "Authorization: Bearer XXXX"

Create a Flow

POST https://api.moltin.com/v2/flows

Headers

NameTypeDescription

Authorization

string

The Bearer token to grant access to the API.

Request Body

NameTypeDescription

enabled

boolean

true if enabled, false if not

description

string

Any description for this flow

slug

string

A unique slug identifier for the flow

name

string

The name of the flow

type

string

Represents the type of object being returned.

{
    "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://api.moltin.com/v2/flows/6d320b42-237d-4474-8452-d49f884d4ae1"
        },
        "relationships": {},
        "meta": {
            "timestamps": {
                "created_at": "2018-05-10T18:04:26.623Z",
                "updated_at": "2018-05-10T18:04:26.623Z"
            }
        }
    }
}
curl -X POST "https://api.moltin.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
        }
     }'

Update a Flow

PUT https://api.moltin.com/v2/flows/:id

Path Parameters

NameTypeDescription

id

string

The ID for the flow you are changing.

Headers

NameTypeDescription

Authorization

string

The Bearer token to grant access to the API.

Request Body

NameTypeDescription

id

string

The ID of the flow you're requesting

type

string

Represents the type of object being returned

name

string

The name of the flow

slug

string

A unique slug identifier for this flow

description

string

Any description for this flow

enabled

string

true if enabled false if not

{
    "data": {
        "id": "6d320b42-237d-4474-8452-d49f884d4ae1",
        "type": "flow",
        "name": "extraFieldRenamed",
        "slug": "products-1",
        "description": "Extends the default product object",
        "enabled": true,
        "links": {
            "self": "https://api.moltin.com/v2/flows/6d320b42-237d-4474-8452-d49f884d4ae1"
        },
        "relationships": {},
        "meta": {
            "timestamps": {
                "created_at": "2018-05-10T18:04:26.623Z",
                "updated_at": "2018-05-10T18:11:47.469Z"
            }
        }
    }
}
curl -X POST "https://api.moltin.com/v2/flows/:id" \
     -H "Authorization: XXXX" \
     -H "Content-Type: application/json" \
     -d $'{
        "data": {
            "id": "{FLOW_ID}",
            "type": "flow",
            "name": "Categories",
            "slug": "categories",
            "description": "Extends the default category object",
            "enabled": true
        }
     }'

Delete a Flow

DELETE https://api.moltin.com/v2/flows/:id

Path Parameters

NameTypeDescription

id

string

The ID for the field you are requesting to be deleted

Headers

NameTypeDescription

Authorization

string

The Bearer token to grant access to the API

curl -X DELETE https://api.moltin.com/v2/flows/:id \
    -H "Authorization: Bearer XXXX"

Last updated