Loading

REST API request to update Amount on Opportunity record with Opportunity Products returns a 204 status code

Date de publication: Sep 22, 2026
Description

For Opportunities with Products, the Amount field is a derived field that sums the Total Price of the related Opportunity Products. As a result, the Amount field is not directly editable for such records via the REST API, even though the API call itself may report success.

Résolution

This article explains why a REST API PATCH request to update the Amount field on an Opportunity with related Opportunity Products returns a 204 success status code, even though the Amount value doesn't actually change.

Why This Happens

A REST API request to update the Amount on an Opportunity record returns a 204 status code in the API response if there's no error, regardless of whether the Opportunity has related Products.

  • For Opportunities with no related Products, the Amount is updated to the specified value.
  • For Opportunities with related Products, the Amount isn't updated — it continues to match the sum of the Total Price of the associated Opportunity Products (Opportunity Line Items).

Example

Updating the Amount field of an Opportunity record using REST API sObject Rows:

  • URI: /services/data/v62.0/sobjects/Opportunity/<Record ID>
  • HTTP Method: PATCH
  • Body (JSON): { "Amount": 5000}

Screenshot of a REST API PATCH request to update an Opportunity record

The status code returned is 204, as shown in the "Raw Response" in the image above - indicating the request succeeded, even though the Amount value on the Opportunity was not changed because it has related Products.

Numéro d’article de la base de connaissances

004052228

 
Chargement
Salesforce Help | Article