UpdateInvoice

Function to update a invoice

PUT https://rest.crmango.com/api/UpdateInvoice

Authorization

1 Sent in the request headers
Bearer varchar

Auth token

Body data

23 Sent in the request body
invoice_id integer

Invoice id

name varchar

Invoice name

rad_code integer

Invoice line
Reference: GetAllLists

supplier_id integer

Supplier id
Reference: GetAllContacts

purchaser_fa_id integer

Customer id
Reference: GetAllContacts

created_at timestamp

Created date

currency_id integer

Currency id
Reference: GetAllStates

status_id integer

Invoice status
0 - Created
1 - Fully paid
2 - Completely credited
3 - Partially paid
4 - Paid
5 - Cancelled

user_id integer

User id
Reference: GetAllUsers

active_service_id integer

Active services id
Reference: GetAllLists

var_symbol varchar

Variable symbol

due_date timestamp

Due date

taxable_date timestamp

Taxable date

note varchar

Note

file_url varchar

Invoice pdf url

paid integer|float

Already paid

products[][product_id] integer

Product id

products[][name] varchar

Product name

products[][quantity] integer

Quantity

products[][price] integer|float

Quantity

products[][cost_price] integer|float

Cost price

products[][vat] integer

VAT

products[][discount] integer

Discount

Response

2 HTTP 200

Function to update a invoice

code integer

Return code

message varchar

Info message

Example request

curl --request PUT \
  --url 'https://rest.crmango.com/api/UpdateInvoice' \
  --header 'Authorization: Bearer auth_token' \
  --header 'Content-Type: application/json' \
  --data '{
    "data": {
      "invoice_id": 21,
      "name": "Faktura 1-2",
      "rad_code": "PP",
      "supplier_id": 123,
      "purchaser_fa_id": 123,
      "created_at": 1673267509,
      "currency_id": 202,
      "status_id": 1,
      "user_id": 7,
      "active_service_id": 0,
      "var_symbol": "1223",
      "due_date": 1673267509,
      "taxable_date": 1673267509,
      "note": "Test",
      "file_url": "",
      "paid": 5,
      "products": [
        {
          "product_id": 19,
          "name": "Grafická karta 1080",
          "quantity": 2,
          "price": 2,
          "cost_price": 100,
          "vat": 20,
          "discount": 50
        },
        {
          "product_id": 20,
          "name": "Grafická karta",
          "quantity": 2,
          "price": 2,
          "cost_price": 100,
          "vat": 20,
          "discount": 0
        }
      ]
    }
  }'
{
    "code": 200,
    "message": "Invoice has been updated"
}