# Edit Order

This documentation provides all the details you need to successfully edit order within the Fincart platform.&#x20;

## Edit  Order

<mark style="color:blue;">`PUT`</mark> `/v4/orders/{order_id}/edit`

This end point is to edit pending order details by order id.

<details>

<summary>Base URL</summary>

[https://api.fincart.io](https://api.fincart.io/)

</details>

**Headers**

| Name          | Value                                                                             |
| ------------- | --------------------------------------------------------------------------------- |
| Content-Type  | `application/json`                                                                |
| Authorization | [<mark style="color:blue;">`<token>`</mark>](/fincart-api/access/access-token.md) |

**Body**

```json
{
  "instaShip": true,
  "source": "s2s",
  "orderType": "delivery",
  "customerDetails": {
    "name": "Clinet Name",
    "phone": "0100000XXXX",
    "address": {
      "addressLine": "Client Address",
      "city": "Cairo",
      "area": "Abdeen - Bab ElLouq",
      "landmark": "Client Landmark" //(Optional, can be empty String) 
    },
    "shippingNotes": "Shipping notes", //(Optional, can be empty String)
    "backupPhone": "0120000XXXX" //(Optional)
  },
  "orderDetails": {
    "paymentType": "with_cash_collection",
    "pickupLocationId": "66f277d401591daadfaeXXX",
    "packageType": "parcel",
    "amount": 4000,
    "noOfItems": 3, //(must be 1 at least)
    "description": "1 X Shoe, 3 X Bags",
    "openPackageAllowed": true,
    "referenceNumber": "#1800022D2", //(Order referance number at your system)
    "serviceType":"standard" //(standard or same-day) 
  }
}
```

**Response**

{% tabs %}
{% tab title="200" %}

```json
{
    "statusCode": 200,
    "message": "Order Updated Successfully",
    "data": {
        "orderCode": "DMA-EX-0000XXX",
        "orderId": "6877bb43a665f49134f0cXXX",
        "externalId": "JEG00033641XXXX",
        "courier": "J&T",
        "orderStatus": "pending",
        "orderSubStatus": "new",
        "trackURL": "https://fincart.io/t/XXXX",
        "shortId": "XXXX",
        "courierLogo": "images/jt.png"
    }
}
```

{% endtab %}

{% tab title="400" %}

```json
{
    "statusCode": 400,
    "timestamp": "2025-07-16T14:47:49.365Z",
    "path": "/v4/orders/67bb43a665f49134f0cXXX/edit",
    "message": "Invalid ObjectId format for parameter orderId",
    "errors": [
        "Invalid ObjectId format for parameter orderId"
    ]
}
```

{% endtab %}

{% tab title="400(No Changes)" %}

```json
{
    "statusCode": 400,
    "timestamp": "2025-07-16T14:49:20.425Z",
    "path": "/v4/orders/6877bb43a665f49134f0XXX/edit",
    "message": "No changes were made.",
    "errors": [
        "No changes were made."
    ]
}
```

{% endtab %}

{% tab title="403" %}

```json
{
    "statusCode": 403,
    "timestamp": "2025-07-16T14:48:40.560Z",
    "path": "/v4/orders/67e54736dcd96baa0141bXXX/edit",
    "message": "User is not authorized",
    "errors": [
        "User is not authorized"
    ]
}
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://fincart.gitbook.io/fincart-api/apis/edit-order.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
