Skip to main content
POST
/
api
/
sale-estimates
Create a new sale estimate.
curl --request POST \
  --url https://api.example.com/api/sale-estimates \
  --header 'Authorization: <authorization>' \
  --header 'Content-Type: application/json' \
  --header 'organization-id: <organization-id>' \
  --data '
{
  "customerId": 1,
  "estimateDate": "2021-01-01",
  "expirationDate": "2021-01-01",
  "reference": "123456",
  "exchangeRate": 1,
  "warehouseId": 1,
  "branchId": 1,
  "entries": [
    {
      "index": 1,
      "itemId": 1,
      "description": "This is a description",
      "quantity": 100,
      "cost": 100
    }
  ],
  "note": "This is a note",
  "termsConditions": "This is a terms and conditions",
  "sendToEmail": "[email protected]",
  "attachments": [
    {
      "key": "123456"
    }
  ],
  "pdfTemplateId": 1,
  "discount": 1,
  "discountType": "amount",
  "adjustment": 1
}
'

Headers

Authorization
string
required

Value must be 'Bearer ' where is an API key prefixed with 'bc_' or a JWT token.

Example:

"Bearer bc_1234567890abcdef"

organization-id
string
required

Required if Authorization is a JWT token. The organization ID to operate within.

Body

application/json
customerId
number
required

The id of the customer

Example:

1

estimateDate
string<date-time>
required

The date of the estimate

Example:

"2021-01-01"

expirationDate
string<date-time>
required

The expiration date of the estimate

Example:

"2021-01-01"

reference
string
required

The reference of the estimate

Example:

"123456"

exchangeRate
number
required

The exchange rate of the estimate

Example:

1

warehouseId
number
required

The id of the warehouse

Example:

1

branchId
number
required

The id of the branch

Example:

1

entries
string[]
required

The entries of the estimate

Example:
[
{
"index": 1,
"itemId": 1,
"description": "This is a description",
"quantity": 100,
"cost": 100
}
]
note
string
required

The note of the estimate

Example:

"This is a note"

termsConditions
string
required

The terms and conditions of the estimate

Example:

"This is a terms and conditions"

sendToEmail
string
required

The email to send the estimate to

attachments
string[]
required

The attachments of the estimate

Example:
[{ "key": "123456" }]
pdfTemplateId
number
required

The id of the pdf template

Example:

1

discount
number
required

The discount of the estimate

Example:

1

discountType
string
required

The type of the discount

Example:

"amount"

adjustment
number
required

The adjustment of the estimate

Example:

1

Response

200

Sale estimate created successfully