7. Invoices and orders
These methods read, create, revise and change the status of slips (invoices, orders, waybills). All of them are POST, with the address prefix {base_url}/api/v1/integ/invoices.
| Method | Address | Function | Required role |
|---|---|---|---|
getall | /getall | Returns not-yet-retrieved slips with their line items | Integration.Invoices.Get |
bill | /bill | Creates a new slip | Integration.Invoices.bill |
| Revise | `` (prefix, no suffix) | Revises existing slips (list) | Integration.Invoices.Update |
cancel | /cancel | Cancels a slip by number and distributor | Integration.Invoices.Cancel |
cancelbyid | /cancelbyid | Cancels a slip by ID | Integration.Invoices.CancelByIDInv |
confirmbyid | /confirmbyid | Approves a slip | Integration.Invoices.ConfirmByIDInv |
unconfirmbyid | /unconfirmbyid | Sets a slip to unapproved | Integration.Invoices.UnconfirmByIDInv |
getInvStatus | /getInvStatus | Returns the status and dates of slips | Integration.Invoices.GetInvStatus |
The Integration.Invoices role grants access to all of these methods.
Slip types (invShapes and targetSlipType; written in upper case, exactly as shown)
| Name | Meaning | Customer and seller code |
|---|---|---|
BUYORDER | Purchase order placed with headquarters | Not required |
BUYORDEROUTLETDETAILED | Purchase order with customer details | Required |
ORDER | Customer sales order | Required |
VOLUMETRICORDER | Volumetric order | Required |
NCORDER | Central-type order | Required |
AVAILABILITY | Availability record | Required |
SALESINVOICE | Sales invoice | Required |
HOTSALESINVOICE | Hot sale (van sales) invoice | Required |
BUYINVOICEFROMHEADQUARTER | Purchase invoice from headquarters | Not required |
BUYINVOICE | Purchase invoice | Required |
SERVICEINVOICE | Service invoice | Required |
RETURNINVOICETOHEADQ | Return invoice to headquarters (intact goods) | Not required |
CORRUPTRETURNINVOICETOHEADQ | Return invoice to headquarters (damaged goods) | Not required |
NCRETURNINVOICETOHEADQ | Central-type return invoice to headquarters | Required |
RETURNINVOICEFROMOUTLET | Return invoice from customer (intact goods) | Required |
CORRUPTRETURNINVOICEFROMOUTLET | Return invoice from customer (damaged goods) | Required |
SALESWAYBILL | Sales waybill | Required |
HOTSALESWAYBILL | Hot sale (van sales) waybill | Required |
NCWAYBILL | Central-type waybill | Required |
BUYWAYBILL | Purchase waybill | Not required |
RETURNWAYBILLFROMOUTLET | Return waybill from customer (intact goods) | Required |
CORRUPTRETURNWAYBILLFROMOUTLET | Return waybill from customer (damaged goods) | Required |
Slip statuses (docStatus): Canceled = canceled, Printed = numbered/approved, Unconfirmed = unapproved, Waiting = approved, pending.
Methods in this chapter
- 7.1 getall — Pulls new slips and orders and marks them as taken.
- 7.2 bill (creating a slip) — Creates a new slip (invoice, order, return) with items and discounts.
- 7.3 Revise (updating an existing slip) — Closes an existing slip and creates the updated slip in its place.
- 7.4 Cancellation and approval — Cancels or approves a slip.
- 7.5 getInvStatus — Returns the current status of slips without marking them.