Rest API - Post and Get pos invoice

I am new, can u help me regarding Pos sale integration with our application through REST API.

When i am going to submitting the pos sale invoice i want to post , following detail to my other application hosted online. But i want to do this before invoice posted to my erpnext db.

1- item price
2- quantity
3- discount,
4- invoice or serial number
5- totalbillamount

I hope you will save my time becoz i am searching for this solution from last few weeks.

What exactly are you having problems with? The execution of the REST endpoints or the sequence of events in ERPNext, or the fields you’d like to refer/update?

Rather show a portion of your code so people can help.
If it’s the REST invocation, then have a look at [Tutorial] Using cURL for REST and RPC API calls

@EugeneP thanx for your kind response. Actually i dont how to fullfill my requirement in erpnext , for post of sale invoice to online other server through json and rest api.
I have read frappe and erpnext guide but i have not understand.

Plz if you and guide me step by step process like in which files i make changes , i will b very thankful to you.

I hope u got my point.

Thanx in advance