Skip to main content
POST
/
api
/
sale-receipts
Create a new sale receipt.
curl --request POST \
  --url https://api.example.com/api/sale-receipts \
  --header 'Authorization: <authorization>' \
  --header 'Content-Type: application/json' \
  --header 'organization-id: <organization-id>' \
  --data '
{
  "customerId": 1,
  "exchangeRate": 1,
  "depositAccountId": 1,
  "receiptDate": "2021-01-01",
  "receiptNumber": "123456",
  "referenceNo": "123456",
  "closed": false,
  "warehouseId": 1,
  "branchId": 1,
  "entries": [
    {
      "key": "123456"
    }
  ],
  "receiptMessage": "123456",
  "statement": "123456",
  "attachments": [
    {
      "key": "123456"
    }
  ],
  "pdfTemplateId": 1,
  "discount": 1,
  "discountType": "percentage",
  "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

exchangeRate
number
required

The exchange rate of the sale receipt

Example:

1

depositAccountId
number
required

The id of the deposit account

Example:

1

receiptDate
string<date-time>
required

The date of the sale receipt

Example:

"2021-01-01"

receiptNumber
string
required

The receipt number of the sale receipt

Example:

"123456"

referenceNo
string
required

The reference number of the sale receipt

Example:

"123456"

closed
boolean
required

Whether the sale receipt is closed

Example:

false

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 sale receipt

Example:
[{ "key": "123456" }]
receiptMessage
string
required

The receipt message of the sale receipt

Example:

"123456"

statement
string
required

The statement of the sale receipt

Example:

"123456"

attachments
string[]
required

The attachments of the sale receipt

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

The id of the pdf template

Example:

1

discount
number
required

The discount of the sale receipt

Example:

1

discountType
string
required

The discount type of the sale receipt

Example:

"percentage"

adjustment
number
required

The adjustment of the sale receipt

Example:

1

Response

201 - undefined