Create Sale

This API allows partners to post the sales object to the accounting software. This object can be used for posting individual sale or daily aggregation based on the configuration.

Post a sale to the accounting software

POST https://<PayEngine-host>/api/merchant/:merchantId/accounting/sale

Request

Request Body

Name
Type
Description

id*

string

Unique ID assigned to the sales object (for reconciliation and trouble shooting)

items[]*

array

The collection of the items object. The items could represent groupings or items depending on the configuration.

items.total_amount*

float

The total Amount of the products sold

items.description

string

Additional notes/description for the items/grouping

order_date*

timestamp

The date time representing the time of the transaction (in GMT).

items.name

string

The item/grouping name or the discount name (only if the discounts are being sent separately).

items.id

string

The unique identifier for the item/grouping.

items.quantity*

float

The quantity of the products sold

tax[]*

object

Tax object

tax.id*

string

Id of the tax applied at the sale

tax.tax_rate*

float

The rate applied at the item during the sale

tax.tax_amount*

float

Calculated tax amount at the item during the sale

is_service*

boolean

The flag representing if the product is to be treated as service always.

cogs_amount

float

The calculated amount for the recording of the COGS. Only to be sent if the syncCOGS is true.

payment_methods*

array

The collection of the payments object

payment_methods.id*

string

The unique identifier for the payment method

payment_methods.name*

string

The payment method name

payment_methods.description

string

Additional notes/description for the payment method

payment_methods.amount*

float

The total Amount of the payment received.

customer

array

The customer object representing the customer details

customer.id

string

The unique identifier for the customer

customer.name

array

Customer Name

customer.name.first_name

string

First name of the customer

customer.name.last_name

string

Last name of the customer

customer.name.business_name

string

Business name of the customer

customer.email_address

string

Email address of the customer

customer.address

array

Address object

customer.address.street_address

string

The street address

customer.address.city

string

City

customer.address.state

string

state

customer.address.zip_code

string

Zip/Postal code of the address

customer.address.country

string

Country of the customer address

customer.phone_number

string

Customer phone number

gratuity

float

Gratuity amount

service_charge

float

Service charges, if any

order_number

string

Order number of the sales

Field Name
Type
Description
Required?

transaction_reference

string

Transaction Reference number for reconciliation

Required

order_number

string

Order number of the sales

Required

status

string

Allowed values - processed | failed

Required

{
  "id": 3858152,
  "order_date": "2022-06-30T20:24:02",
  "payment_methods": [
    {
      "id": "23423432"
      "name": "Cash",
      "amount": "112.50"
    }
  ],
  "items": [
    {
      "id" : "item id"
      "name": "default",
      "description": "default",
      "total_amount": "100.00",
      "quantity": 1,
      "tax": {
        "id":"tax id",
        "name": "12.5VAT - 12.5%",
        "amount": "12.50"
      },
      "is_service": 0,
      "cogs_amount": 0.0
    }
  ],
  "customer":{
    "name":{
        "first_name":" first Name",
        "last_name": " last name"
    }
  },
  "gratuity": 0,
  "delivery_charge": 0
}

Last updated