Ventia
Sales

Upsert sale

Updates an existing sale matched by the `ticket_id` in the request body, or creates a new one if none exists.

PUT
/sales

Authorization

bearerAuth
headerAuthorizationBearer <token>

API key sent as Authorization: Bearer <API_KEY>.

Request Body

application/json
  1. body
status?string

Status of the sale.

ticket_id?string

ID of the ticket related to the sale.

ticket_sale_id?string

Optional ID for ticket sale.

date_sale?string

Optional sale date.

Formatdate
date?string

Optional date of the sale record.

Formatdate
type?string

Type of sale.

phone?string

Phone number associated with the sale.

name?string

Optional name associated with the sale.

product?string

Optional product related to the sale.

gov_id?string

Optional government ID associated with the sale.

user?string

ID of the user responsible for the sale.

importation?string

Optional importation method.

Response Body

Sale created or updated successfully

application/json
  1. response
_id?string

Unique ID of the sale.

status?string

Updated or created status of the sale.

date_sale?string

Date when the sale occurred.

Formatdate
phone?string

Phone number associated with the sale.

name?string

Name of the contact.

user?string

ID of the user associated with the sale.

product?string

Product related to the sale.

curl -X PUT 'https://api.getventia.com/api/v1.0/sales' \  -H 'Content-Type: application/json' \  -d '{  "status": "sold",  "ticket_id": "123456",  "date_sale": "2024-01-01",  "phone": "+1234567890",  "user": "60d0fe4f5311236168a109ca"}'
{  "_id": "string",  "status": "string",  "date_sale": "2019-08-24",  "phone": "string",  "name": "string",  "user": "string",  "product": "string"}