Modify order with optimistic concurrency (V4)
PUT
/v4/orders/{id}
const url = 'https://api-crm-staging.divinea.com/api/v4/orders/1';const options = { method: 'PUT', headers: {APIKey: '<APIKey>', 'Content-Type': 'application/json'}, body: '{"expectedUpdatedAt":"2026-04-15T12:00:00Z","extraMetadata":{},"marketingManual":true,"notes":"example","paymentMethod":"example","sourceExternalId":"example","sourceExternalType":"example","sourceSyncedAt":"2026-04-15T12:00:00Z","status":"example","userMetadata":{}}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request PUT \ --url https://api-crm-staging.divinea.com/api/v4/orders/1 \ --header 'APIKey: <APIKey>' \ --header 'Content-Type: application/json' \ --data '{ "expectedUpdatedAt": "2026-04-15T12:00:00Z", "extraMetadata": {}, "marketingManual": true, "notes": "example", "paymentMethod": "example", "sourceExternalId": "example", "sourceExternalType": "example", "sourceSyncedAt": "2026-04-15T12:00:00Z", "status": "example", "userMetadata": {} }'Set expectedUpdatedAt to enforce optimistic lock; returns STALE_UPDATE on concurrent modifications. When userMetadata is non-null it replaces the entire orders.user_metadata JSON (COALESCE semantics — not a deep merge); to update secondaryContacts only, GET order-details first, merge fields into userMetadata, then PUT. WS-2594: optional userMetadata.secondaryContacts — array of { contactId, amountCents }; validated when present. When extraMetadata is non-null it likewise replaces orders.extra_metadata entirely.
Authorizations
Sezione intitolata “Authorizations”Parameters
Sezione intitolata “Parameters”Path Parameters
Sezione intitolata “Path Parameters”id
required
integer format: int64
Id
Header Parameters
Sezione intitolata “Header Parameters”APIKey
string
APIKey
Request Body
Sezione intitolata “Request Body”RequestParam
Media typeapplication/json
UpdateParam
object
expectedUpdatedAt
string format: date-time
extraMetadata
object
marketingManual
boolean
notes
string
paymentMethod
string
sourceExternalId
string
sourceExternalType
string
sourceSyncedAt
string format: date-time
status
string
userMetadata
object
Examplegenerated
{ "expectedUpdatedAt": "2026-04-15T12:00:00Z", "extraMetadata": {}, "marketingManual": true, "notes": "example", "paymentMethod": "example", "sourceExternalId": "example", "sourceExternalType": "example", "sourceSyncedAt": "2026-04-15T12:00:00Z", "status": "example", "userMetadata": {}}Responses
Sezione intitolata “Responses”OK
Media type*/*