Update an offer
PATCH
/api/offers/{offerId}
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":["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": [ "example" ], "notes": [ "example" ], "discountPercent": 1, "discountAmount": 1 }'Authorizations
Section titled “Authorizations ”Parameters
Section titled “ Parameters ”Path Parameters
Section titled “Path Parameters ” offerId
required
string
Request Body required
Section titled “Request Body required ”Review edits to apply to the offer.
Media type application/json
Review edits that can be applied to a generated offer draft.
object
name
string
customerId
string | null format: uuid
customerName
string | null
status
string
currency
string
items
Array<object>
Editable fields for an offer item. Unit price and currency are read-only from the product catalog.
object
id
string
productId
string | null
name
string
description
string
quantity
number
requestItem
string
rationale
string
matchSource
string | null
matchScore
number | null
unmatched
Array<string>
notes
Array<string>
discountPercent
number
discountAmount
number
Responses
Section titled “ Responses ”The updated offer.
Media type application/json
object
offer
required
A draft or accepted offer for a customer request.
object
id
required
string
customerId
required
string | null
requestId
required
string | null
userId
required
string | null
name
required
string
status
required
string
currency
required
string
discountPercent
required
number
discountAmount
required
number
notes
required
Array<string>
unmatched
required
Array<string>
items
required
Array<object>
A product line item included in an offer.
object
id
string
offerId
string
productId
required
string | null
name
required
string
description
required
string
quantity
required
number
unitPriceNet
required
number
vatRate
required
number
unitGrossPrice
required
number
totalNet
required
number
totalGross
required
number
requestItem
required
string
rationale
required
string
matchSource
required
string | null
matchScore
required
number | null
position
required
integer
product
Product snapshot used to render an offer line without frontend fixture lookup.
object
id
required
string
sku
string
name
required
string
description
string
createdAt
required
string format: date-time
updatedAt
required
string format: date-time
customerName
string | null
clientRequest
string | null
userName
string | null
Example
{ "offer": { "id": "offer-demo-001", "status": "draft", "items": [ { "matchSource": "exact" } ] }}The request body did not match the offer update contract.
Media type application/json
Standard API error payload.
object
error
required
object
code
required
string
message
required
string
issues
Array<string>
Example generated
{ "error": { "code": "example", "message": "example", "issues": [ "example" ] }}No valid Better Auth session was present.
Media type application/json
Returned when no valid Better Auth session is present.
object
error
required
string
Example generated
{ "error": "example"}The offer was not found.
Media type application/json
Standard API error payload.
object
error
required
object
code
required
string
message
required
string
issues
Array<string>
Example generated
{ "error": { "code": "example", "message": "example", "issues": [ "example" ] }}