/salesestimate/{salesEstimateId}/rollback v1.0.0
Scroll down for code samples, example requests and responses. Select a language for code samples from the tabs above or the mobile navigation menu.
Base URLs:
Sales Estimates
postSalesEstimateIdRollback
Code samples
const headers = {
Accept: "application/json",
Authorization: undefined,
};
fetch("https://goldleaf.app/api/v1/salesestimate/{salesEstimateId}/rollback", {
method: "POST",
headers: headers,
})
.then(function (res) {
return res.json();
})
.then(function (body) {
console.log(body);
});
POST /salesestimate/{salesEstimateId}/rollback
Rollback the latest version of a sales estimate
Deletes the latest version of the specified sales estimate and reverts to the previous version.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| salesEstimateId | path | string(mongoId) | true | The ID of the sales estimate to rollback |
| Authorization | header | undefined | true | Bearer token for authentication |
Example responses
200 Response
{
"rolledBackVersionId": "60f5a3d5c7e4e21b5c123abc"
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | Successfully rolled back to previous sales estimate version | Inline |
| 400 | Bad Request | Invalid salesEstimateId or no previous version to rollback to | None |
| 401 | Unauthorized | Unauthorized - user must be authenticated | None |
| 403 | Forbidden | Forbidden - customers are blocked from this endpoint | None |
| 404 | Not Found | Sales estimate not found | None |
| 500 | Internal Server Error | Internal server error | None |
Response Schema
Status Code 200
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| ยป rolledBackVersionId | string | false | none | The ID of the reverted sales estimate version |
