Create a draft workflow
curl --request POST \
--url https://api.shoppex.io/dev/v1/workflows \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"definition": {
"trigger": {
"type": "<string>",
"config": {}
},
"conditions": {
"conditions": [
{
"id": "<string>",
"field": "<string>",
"operator": "<string>",
"value": "<string>"
}
]
},
"steps": [
{
"id": "<string>",
"kind": "action",
"action": "<string>",
"params": {},
"continue_on_error": true
}
],
"settings": {
"max_runs_per_hour": 123
}
},
"note": "<string>",
"status": "<string>",
"template_key": "<string>"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
definition: {
trigger: {type: '<string>', config: {}},
conditions: {
conditions: [{id: '<string>', field: '<string>', operator: '<string>', value: '<string>'}]
},
steps: [
{
id: '<string>',
kind: 'action',
action: '<string>',
params: {},
continue_on_error: true
}
],
settings: {max_runs_per_hour: 123}
},
note: '<string>',
status: '<string>',
template_key: '<string>'
})
};
fetch('https://api.shoppex.io/dev/v1/workflows', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.shoppex.io/dev/v1/workflows"
payload = {
"name": "<string>",
"definition": {
"trigger": {
"type": "<string>",
"config": {}
},
"conditions": { "conditions": [
{
"id": "<string>",
"field": "<string>",
"operator": "<string>",
"value": "<string>"
}
] },
"steps": [
{
"id": "<string>",
"kind": "action",
"action": "<string>",
"params": {},
"continue_on_error": True
}
],
"settings": { "max_runs_per_hour": 123 }
},
"note": "<string>",
"status": "<string>",
"template_key": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.shoppex.io/dev/v1/workflows",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'definition' => [
'trigger' => [
'type' => '<string>',
'config' => [
]
],
'conditions' => [
'conditions' => [
[
'id' => '<string>',
'field' => '<string>',
'operator' => '<string>',
'value' => '<string>'
]
]
],
'steps' => [
[
'id' => '<string>',
'kind' => 'action',
'action' => '<string>',
'params' => [
],
'continue_on_error' => true
]
],
'settings' => [
'max_runs_per_hour' => 123
]
],
'note' => '<string>',
'status' => '<string>',
'template_key' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.shoppex.io/dev/v1/workflows"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"definition\": {\n \"trigger\": {\n \"type\": \"<string>\",\n \"config\": {}\n },\n \"conditions\": {\n \"conditions\": [\n {\n \"id\": \"<string>\",\n \"field\": \"<string>\",\n \"operator\": \"<string>\",\n \"value\": \"<string>\"\n }\n ]\n },\n \"steps\": [\n {\n \"id\": \"<string>\",\n \"kind\": \"action\",\n \"action\": \"<string>\",\n \"params\": {},\n \"continue_on_error\": true\n }\n ],\n \"settings\": {\n \"max_runs_per_hour\": 123\n }\n },\n \"note\": \"<string>\",\n \"status\": \"<string>\",\n \"template_key\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"data": {
"id": "<string>",
"name": "<string>",
"note": "<string>",
"status": "DRAFT",
"trigger_type": "<string>",
"created_at": "<string>",
"updated_at": "<string>",
"definition": {},
"issues": [
{
"path": "<string>",
"message": "<string>",
"code": "EMAIL_ORDER_REQUIRED"
}
]
}
}{
"status": 123,
"data": null,
"error": "<string>",
"message": "<string>",
"log": null,
"env": "<string>"
}{
"error": {
"code": "<string>",
"message": "<string>",
"doc_url": "<string>",
"details": [
{
"field": "<string>",
"message": "<string>"
}
],
"subcode": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"doc_url": "<string>",
"details": [
{
"field": "<string>",
"message": "<string>"
}
],
"subcode": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"doc_url": "<string>",
"details": [
{
"field": "<string>",
"message": "<string>"
}
],
"subcode": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"doc_url": "<string>",
"details": [
{
"field": "<string>",
"message": "<string>"
}
],
"subcode": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"doc_url": "<string>",
"details": [
{
"field": "<string>",
"message": "<string>"
}
],
"subcode": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"doc_url": "<string>",
"details": [
{
"field": "<string>",
"message": "<string>"
}
],
"subcode": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"doc_url": "<string>",
"details": [
{
"field": "<string>",
"message": "<string>"
}
],
"subcode": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"doc_url": "<string>",
"details": [
{
"field": "<string>",
"message": "<string>"
}
],
"subcode": "<string>"
}
}Workflows
Create a draft workflow
Always creates a DRAFT. Activation requires a separate explicit status request. Supports Idempotency-Key.
POST
/
dev
/
v1
/
workflows
Create a draft workflow
curl --request POST \
--url https://api.shoppex.io/dev/v1/workflows \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"definition": {
"trigger": {
"type": "<string>",
"config": {}
},
"conditions": {
"conditions": [
{
"id": "<string>",
"field": "<string>",
"operator": "<string>",
"value": "<string>"
}
]
},
"steps": [
{
"id": "<string>",
"kind": "action",
"action": "<string>",
"params": {},
"continue_on_error": true
}
],
"settings": {
"max_runs_per_hour": 123
}
},
"note": "<string>",
"status": "<string>",
"template_key": "<string>"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
definition: {
trigger: {type: '<string>', config: {}},
conditions: {
conditions: [{id: '<string>', field: '<string>', operator: '<string>', value: '<string>'}]
},
steps: [
{
id: '<string>',
kind: 'action',
action: '<string>',
params: {},
continue_on_error: true
}
],
settings: {max_runs_per_hour: 123}
},
note: '<string>',
status: '<string>',
template_key: '<string>'
})
};
fetch('https://api.shoppex.io/dev/v1/workflows', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.shoppex.io/dev/v1/workflows"
payload = {
"name": "<string>",
"definition": {
"trigger": {
"type": "<string>",
"config": {}
},
"conditions": { "conditions": [
{
"id": "<string>",
"field": "<string>",
"operator": "<string>",
"value": "<string>"
}
] },
"steps": [
{
"id": "<string>",
"kind": "action",
"action": "<string>",
"params": {},
"continue_on_error": True
}
],
"settings": { "max_runs_per_hour": 123 }
},
"note": "<string>",
"status": "<string>",
"template_key": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.shoppex.io/dev/v1/workflows",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'definition' => [
'trigger' => [
'type' => '<string>',
'config' => [
]
],
'conditions' => [
'conditions' => [
[
'id' => '<string>',
'field' => '<string>',
'operator' => '<string>',
'value' => '<string>'
]
]
],
'steps' => [
[
'id' => '<string>',
'kind' => 'action',
'action' => '<string>',
'params' => [
],
'continue_on_error' => true
]
],
'settings' => [
'max_runs_per_hour' => 123
]
],
'note' => '<string>',
'status' => '<string>',
'template_key' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.shoppex.io/dev/v1/workflows"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"definition\": {\n \"trigger\": {\n \"type\": \"<string>\",\n \"config\": {}\n },\n \"conditions\": {\n \"conditions\": [\n {\n \"id\": \"<string>\",\n \"field\": \"<string>\",\n \"operator\": \"<string>\",\n \"value\": \"<string>\"\n }\n ]\n },\n \"steps\": [\n {\n \"id\": \"<string>\",\n \"kind\": \"action\",\n \"action\": \"<string>\",\n \"params\": {},\n \"continue_on_error\": true\n }\n ],\n \"settings\": {\n \"max_runs_per_hour\": 123\n }\n },\n \"note\": \"<string>\",\n \"status\": \"<string>\",\n \"template_key\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"data": {
"id": "<string>",
"name": "<string>",
"note": "<string>",
"status": "DRAFT",
"trigger_type": "<string>",
"created_at": "<string>",
"updated_at": "<string>",
"definition": {},
"issues": [
{
"path": "<string>",
"message": "<string>",
"code": "EMAIL_ORDER_REQUIRED"
}
]
}
}{
"status": 123,
"data": null,
"error": "<string>",
"message": "<string>",
"log": null,
"env": "<string>"
}{
"error": {
"code": "<string>",
"message": "<string>",
"doc_url": "<string>",
"details": [
{
"field": "<string>",
"message": "<string>"
}
],
"subcode": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"doc_url": "<string>",
"details": [
{
"field": "<string>",
"message": "<string>"
}
],
"subcode": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"doc_url": "<string>",
"details": [
{
"field": "<string>",
"message": "<string>"
}
],
"subcode": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"doc_url": "<string>",
"details": [
{
"field": "<string>",
"message": "<string>"
}
],
"subcode": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"doc_url": "<string>",
"details": [
{
"field": "<string>",
"message": "<string>"
}
],
"subcode": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"doc_url": "<string>",
"details": [
{
"field": "<string>",
"message": "<string>"
}
],
"subcode": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"doc_url": "<string>",
"details": [
{
"field": "<string>",
"message": "<string>"
}
],
"subcode": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"doc_url": "<string>",
"details": [
{
"field": "<string>",
"message": "<string>"
}
],
"subcode": "<string>"
}
}Authorizations
Use your Shoppex API key in the Authorization header.
Body
application/jsonapplication/x-www-form-urlencodedmultipart/form-data
Response
Response for status 201
Show child attributes
Show child attributes