Extract invoice in JSON format

This commit is contained in:
Enrique Barcelli 2023-06-21 20:19:08 +08:00
parent 5c8fadfcca
commit 9e8ee08d41
Signed by: kikobar
GPG key ID: 006C13A68E25D3B7
3 changed files with 23 additions and 0 deletions

3
.gitignore vendored
View file

@ -1,4 +1,7 @@
# Sensitive files
config.py
*.JSON
*.json
# ---> Python
# Byte-compiled / optimized / DLL files

View file

@ -0,0 +1,6 @@
# Openbravo API parameters
ob_api_url = "http://[your-openbravo-domain]/openbravo/org.openbravo.service.json.jsonrest/"
#client_id = "7B75C13C21B945AB9DA2B32DD993FE70"
#client_identifier = "Grupo Acme Companies"
userpass_b64 = "cm9ib3RhcGk6S2kxMzAxa28j"

14
extract-invoice.py Normal file
View file

@ -0,0 +1,14 @@
import requests
from config import *
url = ob_api_url+"Invoice?_where=documentNo='1001649'&_noActiveFilter=false"
payload = {}
headers = {
'Authorization': 'Basic '+userpass_b64
}
response = requests.request("GET", url, headers=headers, data=payload)
print(response.text)