Skip to main content
PATCH
/
v1
/
orders
/
{orderId}
/
notes
Update order notes
curl --request PATCH \
  --url https://api-eu.flexportal.io/v1/orders/{orderId}/notes \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --header 'Tenant-ID: <tenant-id>' \
  --data '
{
  "notes": "<string>"
}
'
{
  "success": true,
  "message": "<string>",
  "orderId": "<string>"
}

Overview

Update the notes field on an order. Use this to add internal comments, special instructions, or any relevant information about the order.

Request Fields

FieldRequiredDescription
notesYesNote text (max 5000 characters)

Example Request

{
  "notes": "Customer requested delivery after 2pm. Contact before arrival."
}

Response Fields

FieldDescription
successAlways true on success
messageConfirmation message
orderIdThe updated order ID

Common Use Cases

Delivery Instructions

Add special delivery requirements or time preferences

Customer Communication

Log phone calls or email exchanges about the order

Internal Tracking

Add reference numbers or internal tracking info

Special Handling

Note VIP customers or priority handling requirements

Example: Append to Existing Notes

Notes are replaced, not appended. To preserve existing notes:
async function appendOrderNote(orderId, newNote) {
  const order = await getOrder(orderId);
  const timestamp = new Date().toISOString().split('T')[0];

  const updatedNotes = order.notes
    ? `${order.notes}\n\n[${timestamp}] ${newNote}`
    : `[${timestamp}] ${newNote}`;

  return await updateOrderNotes(orderId, { notes: updatedNotes });
}

Example: Log Customer Interaction

async function logCustomerCall(orderId, summary, agentName) {
  const order = await getOrder(orderId);
  const timestamp = new Date().toISOString();
  const entry = `[${timestamp}] Call with customer (${agentName}): ${summary}`;

  const notes = order.notes
    ? `${order.notes}\n${entry}`
    : entry;

  await updateOrderNotes(orderId, { notes });
}

Error Handling

Error CodeCauseSolution
NOT_FOUNDOrder doesn’t existVerify order ID
VALIDATION_ERRORNotes exceed 5000 charactersShorten the note text

Authorizations

Authorization
string
header
required

API key obtained from FlexPortal dashboard

Headers

Tenant-ID
string
required

Your tenant identifier

Path Parameters

orderId
string
required

The order ID

Body

application/json
notes
string
required
Maximum string length: 5000

Response

Notes updated

success
enum<boolean>
required
Available options:
true,
false
message
string
required
orderId
string
required