{
  "openapi": "3.1.0",
  "info": {
    "title": "Moddify Studio REST API",
    "version": "2026-10",
    "description": "Customized orders, designs and customizers of one Shopify store, and their production status. Docs: https://moddifystudio.com/docs/rest-api"
  },
  "servers": [
    {
      "url": "https://app.moddifystudio.com/api/v1"
    }
  ],
  "security": [
    {
      "bearer": []
    }
  ],
  "paths": {
    "/orders": {
      "get": {
        "summary": "List orders with custom items, newest first",
        "operationId": "listOrders",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 25
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "pagination.nextCursor from the previous page"
          },
          {
            "name": "orderedAfter",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "late",
            "in": "query",
            "description": "true: only open orders past their due date",
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Orders",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Order"
                      }
                    },
                    "pagination": {
                      "type": "object",
                      "properties": {
                        "total": {
                          "type": "integer"
                        },
                        "limit": {
                          "type": "integer"
                        },
                        "nextCursor": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "Pass as cursor for the next page; null on the last page."
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/orders/{orderId}": {
      "get": {
        "summary": "One order",
        "operationId": "getOrder",
        "parameters": [
          {
            "name": "orderId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[0-9]+$"
            },
            "description": "Shopify order id"
          }
        ],
        "responses": {
          "200": {
            "description": "Order",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Order"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      },
      "patch": {
        "summary": "Set the production status (token with write access)",
        "operationId": "updateOrder",
        "parameters": [
          {
            "name": "orderId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[0-9]+$"
            },
            "description": "Shopify order id"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "productionStatus"
                ],
                "properties": {
                  "productionStatus": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "enum": [
                      "todo",
                      "in_production",
                      "done",
                      null
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated order",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Order"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "description": "The order was cancelled",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Invalid body",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/designs": {
      "get": {
        "summary": "List designs, drafts included, newest first",
        "operationId": "listDesigns",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 25
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "pagination.nextCursor from the previous page"
          },
          {
            "name": "status",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "draft",
                "ordered",
                "cancelled"
              ]
            }
          },
          {
            "name": "createdAfter",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Designs",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Design"
                      }
                    },
                    "pagination": {
                      "type": "object",
                      "properties": {
                        "total": {
                          "type": "integer"
                        },
                        "limit": {
                          "type": "integer"
                        },
                        "nextCursor": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "Pass as cursor for the next page; null on the last page."
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/designs/{designId}": {
      "get": {
        "summary": "One design",
        "operationId": "getDesign",
        "parameters": [
          {
            "name": "designId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Design",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Design"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/customizers/{customizerId}": {
      "get": {
        "summary": "A customizer and its published definition",
        "operationId": "getCustomizer",
        "parameters": [
          {
            "name": "customizerId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Customizer",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Customizer"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearer": {
        "type": "http",
        "scheme": "bearer",
        "description": "API token from Settings → Developers → API tokens (starts with cmz_). Read-only tokens can call every GET; PATCH needs read and write access."
      }
    },
    "responses": {
      "Unauthorized": {
        "description": "Missing, unknown, revoked or expired token",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "Forbidden": {
        "description": "Read-only token on a write call, or the plan doesn't include the API",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "NotFound": {
        "description": "Not found in this store",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "TooManyRequests": {
        "description": "More than 120 requests a minute for this token",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      }
    },
    "schemas": {
      "Error": {
        "type": "object",
        "required": [
          "message"
        ],
        "properties": {
          "message": {
            "type": "string"
          },
          "errors": {
            "type": "object",
            "additionalProperties": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          }
        }
      },
      "Price": {
        "type": "object",
        "properties": {
          "base": {
            "type": "integer"
          },
          "lines": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "q": {
                  "type": "string"
                },
                "a": {
                  "type": "string"
                },
                "amount": {
                  "type": "integer"
                },
                "variantId": {
                  "type": [
                    "string",
                    "null"
                  ]
                }
              }
            }
          },
          "rounding": {
            "type": "integer"
          },
          "total": {
            "type": "integer"
          },
          "currency": {
            "type": "string"
          }
        },
        "description": "Cents in the shop currency"
      },
      "Design": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "draft",
              "ordered",
              "cancelled"
            ]
          },
          "customizer": {
            "type": "object",
            "properties": {
              "id": {
                "type": "integer"
              },
              "title": {
                "type": "string"
              },
              "version": {
                "type": [
                  "integer",
                  "null"
                ]
              }
            }
          },
          "order": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "id": {
                "type": "string"
              },
              "name": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "lineItemId": {
                "type": [
                  "string",
                  "null"
                ]
              }
            }
          },
          "quantity": {
            "type": "integer"
          },
          "cancelledQuantity": {
            "type": "integer"
          },
          "discount": {
            "type": "integer",
            "description": "Cents"
          },
          "selection": {
            "type": "object"
          },
          "summary": {
            "type": "array",
            "items": {
              "type": "object"
            }
          },
          "productionData": {
            "type": "array",
            "items": {
              "type": "object"
            }
          },
          "price": {
            "$ref": "#/components/schemas/Price"
          },
          "images": {
            "type": "object",
            "additionalProperties": {
              "type": "string",
              "format": "uri"
            },
            "description": "Stable image URL per view"
          },
          "thumbnail": {
            "type": "string",
            "format": "uri"
          },
          "createdAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "orderedAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "fulfilledAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "cancelledAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        }
      },
      "Order": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Shopify order id"
          },
          "name": {
            "type": [
              "string",
              "null"
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "ordered",
              "cancelled"
            ]
          },
          "financialStatus": {
            "type": [
              "string",
              "null"
            ],
            "description": "Shopify's payment status: paid, pending, refunded, partially_refunded..."
          },
          "fulfillmentStatus": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "fulfilled",
              "partial",
              null
            ]
          },
          "productionStatus": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "in_production",
              "done",
              null
            ],
            "description": "null means to do"
          },
          "currency": {
            "type": "string"
          },
          "total": {
            "type": "integer",
            "description": "Cents"
          },
          "orderedAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "dueDate": {
            "type": [
              "string",
              "null"
            ],
            "format": "date",
            "description": "Due date in the shop's timezone; null while due dates are off"
          },
          "late": {
            "type": "boolean",
            "description": "Open and past its due date"
          },
          "designs": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Design"
            }
          }
        }
      },
      "Customizer": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "title": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "shopifyProductId": {
            "type": [
              "string",
              "null"
            ]
          },
          "version": {
            "type": [
              "integer",
              "null"
            ]
          },
          "assetBase": {
            "type": "string"
          },
          "definition": {
            "type": [
              "object",
              "null"
            ]
          }
        }
      }
    }
  },
  "webhooks": {
    "design.ordered": {
      "post": {
        "summary": "A custom item was ordered",
        "description": "Signed with X-Moddify-Signature (HMAC-SHA256 of timestamp.body). See https://moddifystudio.com/docs/webhooks",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "event": {
                    "const": "design.ordered"
                  },
                  "apiVersion": {
                    "type": "string"
                  },
                  "createdAt": {
                    "type": "string",
                    "format": "date-time"
                  },
                  "shop": {
                    "type": "string"
                  },
                  "data": {
                    "type": "object",
                    "properties": {
                      "design": {
                        "$ref": "#/components/schemas/Design"
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Any 2xx within 5 seconds"
          }
        }
      }
    },
    "order.cancelled": {
      "post": {
        "summary": "An order with custom items was cancelled",
        "description": "Signed with X-Moddify-Signature (HMAC-SHA256 of timestamp.body). See https://moddifystudio.com/docs/webhooks",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "event": {
                    "const": "order.cancelled"
                  },
                  "apiVersion": {
                    "type": "string"
                  },
                  "createdAt": {
                    "type": "string",
                    "format": "date-time"
                  },
                  "shop": {
                    "type": "string"
                  },
                  "data": {
                    "type": "object",
                    "properties": {
                      "order": {
                        "$ref": "#/components/schemas/Order"
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Any 2xx within 5 seconds"
          }
        }
      }
    },
    "order.updated": {
      "post": {
        "summary": "Payment, fulfillment or production status changed",
        "description": "Signed with X-Moddify-Signature (HMAC-SHA256 of timestamp.body). See https://moddifystudio.com/docs/webhooks",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "event": {
                    "const": "order.updated"
                  },
                  "apiVersion": {
                    "type": "string"
                  },
                  "createdAt": {
                    "type": "string",
                    "format": "date-time"
                  },
                  "shop": {
                    "type": "string"
                  },
                  "data": {
                    "type": "object",
                    "properties": {
                      "order": {
                        "$ref": "#/components/schemas/Order"
                      },
                      "changes": {
                        "type": "array",
                        "items": {
                          "type": "string",
                          "enum": [
                            "financialStatus",
                            "fulfillmentStatus",
                            "productionStatus"
                          ]
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Any 2xx within 5 seconds"
          }
        }
      }
    },
    "order.fulfilled": {
      "post": {
        "summary": "Everything in the order has shipped",
        "description": "Signed with X-Moddify-Signature (HMAC-SHA256 of timestamp.body). See https://moddifystudio.com/docs/webhooks",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "event": {
                    "const": "order.fulfilled"
                  },
                  "apiVersion": {
                    "type": "string"
                  },
                  "createdAt": {
                    "type": "string",
                    "format": "date-time"
                  },
                  "shop": {
                    "type": "string"
                  },
                  "data": {
                    "type": "object",
                    "properties": {
                      "order": {
                        "$ref": "#/components/schemas/Order"
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Any 2xx within 5 seconds"
          }
        }
      }
    },
    "design.created": {
      "post": {
        "summary": "A shopper saved a design (opt-in)",
        "description": "Signed with X-Moddify-Signature (HMAC-SHA256 of timestamp.body). See https://moddifystudio.com/docs/webhooks",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "event": {
                    "const": "design.created"
                  },
                  "apiVersion": {
                    "type": "string"
                  },
                  "createdAt": {
                    "type": "string",
                    "format": "date-time"
                  },
                  "shop": {
                    "type": "string"
                  },
                  "data": {
                    "type": "object",
                    "properties": {
                      "design": {
                        "$ref": "#/components/schemas/Design"
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Any 2xx within 5 seconds"
          }
        }
      }
    }
  }
}
