Extract invoice in JSON format
This commit is contained in:
parent
5c8fadfcca
commit
9e8ee08d41
3
.gitignore
vendored
3
.gitignore
vendored
|
@ -1,4 +1,7 @@
|
|||
# Sensitive files
|
||||
config.py
|
||||
*.JSON
|
||||
*.json
|
||||
|
||||
# ---> Python
|
||||
# Byte-compiled / optimized / DLL files
|
||||
|
|
|
@ -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
14
extract-invoice.py
Normal 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)
|
||||
|
Loading…
Reference in a new issue