Ventia
Sales

Modify sale by ID

Updates fields of an existing sale by its unique ID.

PATCH
/sales/{id}

Authorization

bearerAuth
headerAuthorizationBearer <token>

API key sent as Authorization: Bearer <API_KEY>.

Path Parameters

id*string

The unique ID of the sale to be updated.

Request Body

application/json
  1. body
status?string

Status of the sale.

date_sale?string

Date when the sale occurred.

Formatdate
user?string

ID of the user associated with the sale.

Response Body

Sale updated successfully

application/json
  1. response
_id?string

Unique ID of the sale.

user?string

ID of the user associated with the sale.

user_string?string

Name and lastname of the user.

status?string

Status of the sale.

date_sale?string

Sale date.

Formatdate
sold?boolean

Indicates if the sale status is sold.

curl -X PATCH 'https://api.getventia.com/api/v1.0/sales/string' \  -H 'Content-Type: application/json' \  -d '{  "status": "sold",  "date_sale": "2024-01-01",  "user": "60d0fe4f5311236168a109ca"}'
{  "_id": "string",  "user": "string",  "user_string": "string",  "status": "string",  "date_sale": "2019-08-24",  "sold": true}