---
updatedAt: 2026-06-30T16:05:21.000Z
agentTools:
  projectIndex: https://docs.pelcro.com/llms.txt
---

# Update order

Update an existing order.

## Overview

Update an existing order's status. This is typically used to mark orders as fulfilled or returned.

**Example:** Mark an order as fulfilled after shipping the products to the customer.

***

## Conditional Requirements

| Condition | Required Fields                      |
| --------- | ------------------------------------ |
| Always    | `status` (`fulfilled` or `returned`) |

# OpenAPI definition

```json
{
  "openapi": "3.1.0",
  "info": {
    "title": "core-api",
    "version": "1.88"
  },
  "servers": [
    {
      "url": "https://www.pelcro.com/api/v1/core"
    }
  ],
  "components": {
    "securitySchemes": {
      "sec0": {
        "type": "apiKey",
        "in": "header",
        "name": "Authorization",
        "x-bearer-format": "bearer"
      },
      "sec1": {
        "type": "apiKey",
        "in": "query",
        "name": "site_id"
      }
    }
  },
  "security": [
    {
      "sec0": [],
      "sec1": []
    }
  ],
  "paths": {
    "/orders/{id}": {
      "put": {
        "summary": "Update order",
        "description": "Update an existing order.",
        "operationId": "api-core-update-ecommerce-order",
        "parameters": [
          {
            "name": "site_id",
            "in": "query",
            "description": "The unique identifier of the site associated with your account.",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "Authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "default": "Bearer eyJ***"
            }
          },
          {
            "name": "id",
            "in": "path",
            "description": "Object unique identifier.",
            "schema": {
              "type": "integer",
              "format": "int32"
            },
            "required": true
          },
          {
            "name": "status",
            "in": "query",
            "description": "The status or the order, one of `fulfilled` or `returned`.",
            "schema": {
              "type": "string",
              "enum": [
                "fulfilled",
                "returned"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "examples": {
                  "Result": {
                    "value": "{\n\t\"data\": {\n\t\t\"id\": 100,\n\t\t\"user_id\": 3297,\n\t\t\"address_id\": 122,\n\t\t\"user\": {\n\t\t\t\"id\": 3297,\n\t\t\t\"addresses\": [],\n\t\t\t\"default_source\": 289,\n\t\t\t\"organization\": null,\n\t\t\t\"subscriptions\": [],\n\t\t\t\"display_name\": null,\n\t\t\t\"username\": null,\n\t\t\t\"email\": null,\n\t\t\t\"email_confirm\": false,\n\t\t\t\"email_hardbounce\": false,\n\t\t\t\"first_name\": \"test\",\n\t\t\t\"last_name\": \"ecommerce\",\n\t\t\t\"mail_marketing\": false,\n\t\t\t\"metadata\": null,\n\t\t\t\"name\": \"test ecommerce\",\n\t\t\t\"old_provider_id\": null,\n\t\t\t\"is_imported\": null,\n\t\t\t\"phone\": null,\n\t\t\t\"phone_confirm\": false,\n\t\t\t\"salutation\": null,\n\t\t\t\"language\": null,\n\t\t\t\"title\": null,\n\t\t\t\"tin\": null,\n\t\t\t\"profile_photo\": null,\n\t\t\t\"default_source_id\": 289,\n\t\t\t\"tele_marketing\": false,\n\t\t\t\"timezone\": null,\n\t\t\t\"has_password\": false,\n\t\t\t\"password_last_updated_at\": null,\n\t\t\t\"last_login_at\": null,\n\t\t\t\"last_login_method\": null,\n\t\t\t\"created_at\": 1717621992,\n\t\t\t\"updated_at\": 1717624972\n\t\t},\n\t\t\"address\": {\n\t\t\t\"id\": 122,\n\t\t\t\"type\": \"shipping\",\n\t\t\t\"user_id\": 3297,\n\t\t\t\"is_default\": null,\n\t\t\t\"first_name\": \"Ahmed\",\n\t\t\t\"last_name\": \"Khairy\",\n\t\t\t\"line1\": \"arabelraml,quesna,menofya\",\n\t\t\t\"line2\": null,\n\t\t\t\"city\": \"Al Monufia\",\n\t\t\t\"country\": \"EG\",\n\t\t\t\"company\": null,\n\t\t\t\"salutation\": null,\n\t\t\t\"title\": null,\n\t\t\t\"department\": null,\n\t\t\t\"state\": \"SHR\",\n\t\t\t\"postal_code\": \"32637\",\n\t\t\t\"phone\": null,\n\t\t\t\"old_provider_id\": null,\n\t\t\t\"created_at\": 1717801673,\n\t\t\t\"updated_at\": 1717801673\n\t\t},\n\t\t\"items\": [\n\t\t\t{\n\t\t\t\t\"id\": 100,\n\t\t\t\t\"product_sku_id\": 3,\n\t\t\t\t\"product_sku_name\": \"test sku\",\n\t\t\t\t\"product_sku_entitlements\": null,\n\t\t\t\t\"product\": {\n\t\t\t\t\t\"name\": \"test ecommerce\",\n\t\t\t\t\t\"caption\": \"test ecommerce\",\n\t\t\t\t\t\"description\": \"test ecommerce\"\n\t\t\t\t},\n\t\t\t\t\"amount\": 1234500,\n\t\t\t\t\"quantity\": 1,\n\t\t\t\t\"created_at\": 1718216156\n\t\t\t}\n\t\t],\n\t\t\"amount\": 123449,\n\t\t\"currency\": \"usd\",\n\t\t\"status\": \"fulfilled\",\n\t\t\"metadata\": null,\n\t\t\"created_at\": 1718216156\n\t},\n\t\"status\": \"success\"\n}"
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "integer",
                          "example": 100,
                          "default": 0
                        },
                        "user_id": {
                          "type": "integer",
                          "example": 3297,
                          "default": 0
                        },
                        "address_id": {
                          "type": "integer",
                          "example": 122,
                          "default": 0
                        },
                        "user": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "integer",
                              "example": 3297,
                              "default": 0
                            },
                            "addresses": {
                              "type": "array"
                            },
                            "default_source": {
                              "type": "integer",
                              "example": 289,
                              "default": 0
                            },
                            "organization": {},
                            "subscriptions": {
                              "type": "array"
                            },
                            "display_name": {},
                            "username": {},
                            "email": {},
                            "email_confirm": {
                              "type": "boolean",
                              "example": false,
                              "default": true
                            },
                            "email_hardbounce": {
                              "type": "boolean",
                              "example": false,
                              "default": true
                            },
                            "first_name": {
                              "type": "string",
                              "example": "test"
                            },
                            "last_name": {
                              "type": "string",
                              "example": "ecommerce"
                            },
                            "mail_marketing": {
                              "type": "boolean",
                              "example": false,
                              "default": true
                            },
                            "metadata": {},
                            "name": {
                              "type": "string",
                              "example": "test ecommerce"
                            },
                            "old_provider_id": {},
                            "is_imported": {},
                            "phone": {},
                            "phone_confirm": {
                              "type": "boolean",
                              "example": false,
                              "default": true
                            },
                            "salutation": {},
                            "language": {},
                            "title": {},
                            "tin": {},
                            "profile_photo": {},
                            "default_source_id": {
                              "type": "integer",
                              "example": 289,
                              "default": 0
                            },
                            "tele_marketing": {
                              "type": "boolean",
                              "example": false,
                              "default": true
                            },
                            "timezone": {},
                            "has_password": {
                              "type": "boolean",
                              "example": false,
                              "default": true
                            },
                            "password_last_updated_at": {},
                            "last_login_at": {},
                            "last_login_method": {},
                            "created_at": {
                              "type": "integer",
                              "example": 1717621992,
                              "default": 0
                            },
                            "updated_at": {
                              "type": "integer",
                              "example": 1717624972,
                              "default": 0
                            }
                          }
                        },
                        "address": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "integer",
                              "example": 122,
                              "default": 0
                            },
                            "type": {
                              "type": "string",
                              "example": "shipping"
                            },
                            "user_id": {
                              "type": "integer",
                              "example": 3297,
                              "default": 0
                            },
                            "is_default": {},
                            "first_name": {
                              "type": "string",
                              "example": "Ahmed"
                            },
                            "last_name": {
                              "type": "string",
                              "example": "Khairy"
                            },
                            "line1": {
                              "type": "string",
                              "example": "arabelraml,quesna,menofya"
                            },
                            "line2": {},
                            "city": {
                              "type": "string",
                              "example": "Al Monufia"
                            },
                            "country": {
                              "type": "string",
                              "example": "EG"
                            },
                            "company": {},
                            "salutation": {},
                            "title": {},
                            "department": {},
                            "state": {
                              "type": "string",
                              "example": "SHR"
                            },
                            "postal_code": {
                              "type": "string",
                              "example": "32637"
                            },
                            "phone": {},
                            "old_provider_id": {},
                            "created_at": {
                              "type": "integer",
                              "example": 1717801673,
                              "default": 0
                            },
                            "updated_at": {
                              "type": "integer",
                              "example": 1717801673,
                              "default": 0
                            }
                          }
                        },
                        "items": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "integer",
                                "example": 100,
                                "default": 0
                              },
                              "product_sku_id": {
                                "type": "integer",
                                "example": 3,
                                "default": 0
                              },
                              "product_sku_name": {
                                "type": "string",
                                "example": "test sku"
                              },
                              "product_sku_entitlements": {},
                              "product": {
                                "type": "object",
                                "properties": {
                                  "name": {
                                    "type": "string",
                                    "example": "test ecommerce"
                                  },
                                  "caption": {
                                    "type": "string",
                                    "example": "test ecommerce"
                                  },
                                  "description": {
                                    "type": "string",
                                    "example": "test ecommerce"
                                  }
                                }
                              },
                              "amount": {
                                "type": "integer",
                                "example": 1234500,
                                "default": 0
                              },
                              "quantity": {
                                "type": "integer",
                                "example": 1,
                                "default": 0
                              },
                              "created_at": {
                                "type": "integer",
                                "example": 1718216156,
                                "default": 0
                              }
                            }
                          }
                        },
                        "amount": {
                          "type": "integer",
                          "example": 123449,
                          "default": 0
                        },
                        "currency": {
                          "type": "string",
                          "example": "usd"
                        },
                        "status": {
                          "type": "string",
                          "example": "fulfilled"
                        },
                        "metadata": {},
                        "created_at": {
                          "type": "integer",
                          "example": 1718216156,
                          "default": 0
                        }
                      }
                    },
                    "status": {
                      "type": "string",
                      "example": "success"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request.",
            "content": {
              "application/json": {
                "examples": {
                  "Result": {
                    "value": "{\n\t\"error\": {\n\t\t\"message\": \"The order status cannot be changed to the requested status.\",\n\t\t\"code\": 400\n\t}\n} "
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "message": {
                          "type": "string",
                          "example": "The order status cannot be changed to the requested status."
                        },
                        "code": {
                          "type": "integer",
                          "example": 400,
                          "default": 0
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthenticated.",
            "content": {
              "application/json": {
                "examples": {
                  "Result": {
                    "value": {
                      "error": "Unauthenticated."
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Not found.",
            "content": {
              "application/json": {
                "examples": {
                  "Result": {
                    "value": {
                      "error": {
                        "status": 404,
                        "message": "Not found."
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "deprecated": false,
        "x-readme": {
          "code-samples": [
            {
              "language": "php",
              "code": "use GuzzleHttp\\Client;\n\n$site_id = 0; // (int) your site id here\n$page = 1; // (int) the plan id here\n  \n$api_key = '' // (string) your api key here\n$uri = \"orders\";\n\n$config = [\n  'base_uri' => 'https://www.pelcro.com/api/v1/core/'\n];\n\n$client = new Client($config);\n\n$options = [\n\t'json' => [\n\t\t'site_id' => $site_id,\n\t\t'page' => $page,\n\t],\n\t'headers' => [\n\t\t'Accept' => 'application/json',\n\t\t'Authorization' => 'Bearer ' . $api_key\n\t]\n];\n\n$response = $client->request('GET', $uri, $options);"
            }
          ],
          "samples-languages": [
            "php"
          ]
        }
      }
    }
  },
  "x-readme": {
    "headers": [],
    "explorer-enabled": true,
    "proxy-enabled": true
  },
  "x-readme-fauxas": true
}
```

# Sibling pages

* [List orders](https://docs.pelcro.com/reference/api-core-list-ecommerce-orders.md)
* [Get order](https://docs.pelcro.com/reference/api-core-get-ecommerce-order.md)
* [Create order](https://docs.pelcro.com/reference/api-core-create-ecommerce-order.md)