-
Notifications
You must be signed in to change notification settings - Fork 0
/
api.py
172 lines (152 loc) · 4.97 KB
/
api.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
# ??? dont know what is API version
from . import errors
method = {
'user.accounts' : {
'url' : 'https://www.app.invoicexpress.com/users/accounts.xml',
'method' : 'GET',
},
'user.change-account' : {
'url' : 'https://{account-name}.app.invoicexpress.com/users/change_account.xml',
'method' : 'POST',
},
# Clients
'clients.create' : {
'url' : 'https://{account-name}.app.invoicexpress.com/clients.xml',
'method' : 'POST',
'root_tag_name' : 'client',
},
'clients.get' : {
'url' : 'https://{account-name}.app.invoicexpress.com/clients/{client-id}.xml',
'method' : 'GET',
},
'clients.update' : {
'url' : 'https://{account-name}.app.invoicexpress.com/clients/{client-id}.xml',
'method' : 'PUT',
'root_tag_name' : 'client',
},
'clients.list' : {
'url' : 'https://{account-name}.app.invoicexpress.com/clients.xml',
'method' : 'GET',
'root_tag_name' : 'client',
},
'clients.invoices' : {
'url' : 'https://{account-name}.app.invoicexpress.com/clients/{client-id}/invoices.xml',
'method' : 'GET',
'root_tag_name' : 'filter',
},
'clients.find-by-name' : {
'url' : 'https://{account-name}.app.invoicexpress.com/clients/find-by-name.xml',
'method' : 'GET',
'url_params' : {'client_name'},
},
'clients.find-by-code' : {
'url' : 'https://{account-name}.app.invoicexpress.com/clients/find-by-code.xml',
'method' : 'GET',
'url_params' : {'client_code'},
},
'clients.create-invoice' : {
'url' : 'https://{account-name}.app.invoicexpress.com/clients/{client-id}/create/invoice.xml',
'method' : 'POST',
'root_tag_name' : 'invoice',
},
'clients.create-credit-note' : {
'url' : 'https://{account-name}.app.invoicexpress.com/clients/{client-id}/create/credit-note.xml',
'method' : 'POST',
'root_tag_name' : 'credit_note',
},
'clients.create-debit-note' : {
'url' : 'https://{account-name}.app.invoicexpress.com/clients/{client-id}/create/debit-note.xml',
'method' : 'POST',
'root_tag_name' : 'debit_note',
},
# invoice_receipt
'invoice-receipts.create' : {
'url' : 'https://{account-name}.app.invoicexpress.com/invoice_receipts.xml',
'method' : 'POST',
'root_tag_name' : 'invoice_receipt',
},
'invoice-receipts.get' : {
'url' : 'https://{account-name}.app.invoicexpress.com/invoice_receipts/{invoice-receipt-id}.xml',
'method' : 'GET',
},
'invoice-receipts.update' : {
'url' : 'https://{account-name}.app.invoicexpress.com/invoice_receipts/{invoice-receipt-id}.xml',
'method' : 'PUT',
'root_tag_name' : 'invoice_receipt',
},
'invoice-receipts.list' : {
'url' : 'https://{account-name}.app.invoicexpress.com/invoice_receipts.xml',
'method' : 'GET',
'root_tag_name' : 'invoice_receipt',
'url_params' : {'page', 'per_page'}
},
'invoice-receipts.change-state' : {
'url' : 'https://{account-name}.app.invoicexpress.com/invoice_receipts/{invoice-receipt-id}/change-state.xml',
'method' : 'PUT',
'root_tag_name' : 'invoice_receipt',
},
'invoice-receipts.email-document' : {
'url' : 'https://{account-name}.app.invoicexpress.com/invoice_receipts/{invoice-receipt-id}/email-document.xml',
'method' : 'PUT',
'root_tag_name' : 'message',
},
'invoice-receipts.related_documents' : {
'url' : 'https://{account-name}.app.invoicexpress.com/document/{invoice-receipt-id}/related_documents.xml',
'method' : 'GET',
},
'invoice-receipts.pdf' : {
'url' : 'https://{account-name}.app.invoicexpress.com/api/pdf/{invoice-receipt-id}.xml',
'method' : 'GET',
},
# invoices
'invoices.create' : {
'url' : 'https://{account-name}.app.invoicexpress.com/invoices.xml',
'method' : 'POST',
'root_tag_name' : 'invoice',
},
'invoices.get' : {
'url' : 'https://{account-name}.app.invoicexpress.com/invoices/{invoice-id}.xml',
'method' : 'GET',
},
'invoices.update' : {
'url' : 'https://{account-name}.app.invoicexpress.com/invoices/{invoice-id}.xml',
'method' : 'PUT',
'root_tag_name' : 'invoice',
},
'invoices.list' : {
'url' : 'https://{account-name}.app.invoicexpress.com/invoices.xml',
'method' : 'GET',
'root_tag_name' : 'invoice',
'url_params' : {'non_archived'}
},
'invoices.change-state' : {
'url' : 'https://{account-name}.app.invoicexpress.com/invoice/{invoice-id}/change-state.xml',
'method' : 'PUT',
'root_tag_name' : 'invoice',
},
# Taxes (currently add Get and Create)
'taxes.get' : {
'url' : 'https://{account-name}.app.invoicexpress.com/taxes/{tax-id}.xml',
'method' : 'GET',
'root_tag_name' : 'tax',
},
'taxes.create' : {
'url' : 'https://{account-name}.app.invoicexpress.com/taxes.xml',
'method' : 'POST',
'root_tag_name' : 'tax',
},
'taxes.update' : {
'url' : 'https://{account-name}.app.invoicexpress.com/taxes/{tax-id}.xml',
'method' : 'PUT',
'root_tag_name' : 'tax',
},
'taxes.delete' : {
'url' : 'https://{account-name}.app.invoicexpress.com/taxes/{tax-id}.xml',
'method' : 'DELETE',
},
'taxes.list' : {
'url' : 'https://{account-name}.app.invoicexpress.com/taxes.xml',
'method' : 'GET',
'root_tag_name' : 'taxes',
},
}