Forum

Ask, reply and learn. Join the community of Akaunting.

New Discussion

How to use REST API

Luca Pierabella   ( User )

Commented 2 years ago

if there is no possibility to add an attachment to either a Transaction,a Bill or an Invoice through a PUT or a POST that is a bug no ? should I raise an issue on GITHUB

Also I'm a developer, but I do mostly C++, I'm not really confident with Laravel.. can you at least point me to the right direction /file where to handle this?

Stojan   ( User )

Commented 2 years ago

I am a Laravel dev and better understand this code. Maybe it will be easy to continue talking here
https://chat.akaunting.com/public/messages/@stojan

Timo Brüntjen   ( User )

Commented 2 years ago

At this time I get app.akaunting.com | 502: Bad gateway for the https://app.akaunting.com/api/

Is this a known limitation or a general problem in the cloud version? This worked in September, this problem seems to be new

Stojan   ( User )

Commented 2 years ago

maybe some hiccups but generally it works well.

Pedro Arroz Serra   ( User )

Commented 2 years ago

Hi,
I am trying to create an invoice with the API. I tried to follow the information in the postman file but without success. I then tried to add some fields that I inferred from the import excel menu, still without success. I am doing the following:

query = {
"company_id":company["id"],
"type":"invoice",
"category_id":"224",
"document_number":"INV-6846846",
"status":"draft",
"issued_at":"2021-10-21",
"due_at":"2021-10-29",
"account_id":"1",
"currency_code":"EUR",
"currency_rate": "1",
"notes":" ",
"contact_id": "",
"contact_tax_number":"999999990",
"contact_name":"Peter",
"contact_email": "",
"contact_address": "",
"contact_phone": "985468759",
"contact_country": "Portugal",
"contact_state": "Leiria",
"contact_zip_code": "2500-000",
"contact_city" :"caldas da rainha",
"footer": "",
"order_number":"",
"invoiced_at":"2021-10-21",
"items[0][item_id]": "1",
"items[0][name]":"Service",
"items[0][quantity]": "2",
"items[0][price]": "12",
"items[0][total]": "24",
"items[0][discount]": "0",
"items[0][description]": "This is custom item",
"items[0][tax]": "5.52",
"items[0][tax_rate]": "23",
"amount" : "29.52"
}

url = f'https://app.akaunting.com/api/documents'
response = requests.post(url=url, data=query, auth=userpass)
print(response.text)

The answer is always:
User does not have any of the necessary access rights.
status_code 403

I was able to successfully create costumers, list costumers and invoices. THe problem seems to be just related with the invoice create.

I would appreciate any help. Thank you

Pedro Arroz Serra   ( User )

Commented 2 years ago

I have also tried to use @Stojan ‘s postman collection for create invoices and it fails with the same error message. It seems there are some mandatory fields that are missing.

Stojan   ( User )

Commented 2 years ago

I just updated the Postman collection so you can try:
https://drive.google.com/file/d/1ykZ-GNYpQPh7CcI8B3dAZCEXwadWzdT2/view?usp=sharing

Hassan Moulana   ( User )

Commented 2 years ago

One Quick Question

I cannot get the results of an API and I have explained here

@Stojan, Can you help me ?

https://docs.google.com/document/d/15E5W4NbZOxzB4Qh87L0R6b2-REEao0HPOgn3ywX786s/edit?usp=sharing


Anthony Marwyn Abadicio   ( User )

Commented 2 years ago

Hi, Do you know how I can get Roles and Users? I keep getting 403.

Muhammed Afeef   ( User )

Commented 2 years ago

How can i get the api for double entry

Please login or register to leave a response.

Showing 41 to 50 of 61 discussions