Update an offer
const url = 'https://example.com/api/offers/example';const options = { method: 'PATCH', headers: { cookie: 'better-auth.session_token=<better-auth.session_token>', 'Content-Type': 'application/json' }, body: '{"name":"example","customerId":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0","customerName":"example","status":"draft","currency":"example","items":[{"id":"example","productId":"example","name":"example","description":"example","quantity":1,"requestItem":"example","rationale":"example","matchSource":"exact","matchScore":1}],"unmatched":[{"item":"example","reason":"example"}],"notes":["example"],"discountPercent":1,"discountAmount":1}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request PATCH \ --url https://example.com/api/offers/example \ --header 'Content-Type: application/json' \ --cookie better-auth.session_token=<better-auth.session_token> \ --data '{ "name": "example", "customerId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "customerName": "example", "status": "draft", "currency": "example", "items": [ { "id": "example", "productId": "example", "name": "example", "description": "example", "quantity": 1, "requestItem": "example", "rationale": "example", "matchSource": "exact", "matchScore": 1 } ], "unmatched": [ { "item": "example", "reason": "example" } ], "notes": [ "example" ], "discountPercent": 1, "discountAmount": 1 }'Authorizations
Section titled “ Authorizations ”Parameters
Section titled “ Parameters ”Path Parameters
Section titled “ Path Parameters ”Request Bodyrequired
Section titled “ Request Bodyrequired ”Review edits to apply to the offer.
Review edits that can be applied to a generated offer draft.
object
Editable fields for an offer item. Unit price and currency are read-only from the product catalog.
object
Unmatched fragment before persistence (no row id).
object
Responses
Section titled “ Responses ”The updated offer.
object
A draft or accepted offer for a customer request.
object
Knowledge base article referenced during offer generation.
object
Persisted unmatched request fragment. reason may be empty for legacy rows.
object
A product line item included in an offer.
object
Product snapshot used to render an offer line without frontend fixture lookup.
object
Example
{ "offer": { "id": "offer-demo-001", "status": "draft", "kbArticles": [], "items": [ { "matchSource": "exact" } ] }}The request body did not match the offer update contract.
Standard API error payload.
object
object
Examplegenerated
{ "error": { "code": "example", "message": "example", "issues": [ "example" ] }}No valid Better Auth session was present.
Returned when no valid Better Auth session is present.
object
Examplegenerated
{ "error": "example"}The offer was not found.
Standard API error payload.
object
object
Examplegenerated
{ "error": { "code": "example", "message": "example", "issues": [ "example" ] }}
