Browse Documentation
POST Create pos sale

Create POS Sale

POST /pos/

Create a new POS Sale

Parameters

  Parameter
  Type
 Description
 client_id
  String
 The client you are creating the POS Sale for. This parameter is optional. In most cases the customer you're selling to is unknown
  email
  String
Email address of the customer. Can be used for loyalty programs and sending digital receipts.
  mobile
  String
Mobile phone number of the customer. Can be used for loyalty programs and sending digital receipts.
date _issued
  Date YYYY-MM-DD
 The date the invoice was issued. Is not supplied it will default to the current date.
 date_due
  Date YYYY-MM-DD
 The expiration date of the invoice. If not supplied the number of days due of the default invoice template will be applied.
 reference
  String
 Any name that you wish to use as a reference
 status
  String
 Status of the POS sale. This can either be "draft" or "approved". If no status is defined it defaults to draft. The moment a POS sale is set to approved the journal entries are generated and no changes can be made anymore to the POS sale object.
 Items | required
  Array[object]
 Items to be added to the invoice
  items[item_id]
  String
 Id of a stored item
 items[title] | required
  String
 Item title
 items[description] 
  String
 Description of the item
 items[quantity] | required
  Numeric
 Item Quantity
 items[price] | required
  Numeric
 Item Price
 items[tax_id]
  String
 Item Tax ID In case the tax_id is not provided the default tax rate will be applied to the item.
 items[gl_account_id]
  String
 GL Account In case no general ledger account was set the default sales account will be selected.

A POST request is expected to be sent to the above endpoint where the content body must be JSON string containing all parameters that are needed to create a new invoice. The below example demonstrates how to create a new POS sale.

Request

 {
    "possale": {
        "date_issued": "2018-01-21",
        "email": "[email protected]",
        "phone": "+234123456789",
        "items": [
            {
            "title": "T-Shirt",
            "description": "Size: L",
            "quantity": 1,
            "price": 100
            },
            {
            "title": "Trousers",
            "quantity": 3,
            "price": 30
            }
        ]
    }
}

Response

 {
    "id": "74f5276cc8fecfd46795a69ac4279dac7a6e8a06",
    "organization_id": "7331ecfc6eb6050a5f0c3c0e12b3b6e95cdf9ed5",
    "document_number": "_",
    "client_id": null,
    "total_amount": 190,
    "total_base_amount": 190,
    "total_tax_amount": 0,
    "amount_due": 0,
    "currency": "NGN",
    "date_issued": "2018-01-21",
    "date_due": "2018-03-04",
    "date_created": "2018-02-04",
    "date_updated": "2018-02-04",
    "status": "draft",
    "user": {
       "email" : "[email protected]",
       "name" : Test
     }
    "reference": null,
    "items": [
        {
        "id": "c7911ebac167e77ddcb84bcbd676db6606cc9c06",
        "title": "T-Shirt",
        "description": "Size: L",
        "quantity": 1,
        "item_base_amount": 100,
        "tax_id": "95b709aefb0e92d433c832f0b3bf4edc0b9ce8e9",
        "tax_name": "Exempt",
        "tax_percentage": 0,
        "line_base_amount": 100,
        "line_tax_amount": 0,
        "line_total_amount": 100,
        "tax_included": true,
        "price": 100,
        "gl_account": {
        "id": "65baa5799055121db323f4ee6bf0a709516a6d96",
        "code": "700000",
        "title": "Verkopen",
        "description": null
        }
        },
        {
        "id": "e6c482bb56b47897922b3cfa4c0ca835d71ba1d5",
        "title": "Trousers",
        "description": null,
        "quantity": 3,
        "item_base_amount": 30,
        "tax_id": "95b709aefb0e92d433c832f0b3bf4edc0b9ce8e9",
        "tax_name": "Exempt",
        "tax_percentage": 0,
        "line_base_amount": 90,
        "line_tax_amount": 0,
        "line_total_amount": 90,
        "tax_included": true,
        "price": 30,
        "gl_account": {
        "id": "65baa5799055121db323f4ee6bf0a709516a6d96",
        "code": "700000",
        "title": "Verkopen",
        "description": null
        }
        }
    ],
    "clearings": []
}