Skip to content

Commit 99ce7e2

Browse files
authored
Merge pull request #191 from JosephDev/master
Example of search invoice
2 parents 2d7b07c + 320c019 commit 99ce7e2

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

samples/invoice/search.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
from paypalrestsdk import Invoice
2+
import logging
3+
logging.basicConfig(level=logging.INFO)
4+
5+
# status should pass array with below enum values
6+
# Allowed values: DRAFT, SENT, PAID, MARKED_AS_PAID, CANCELLED, REFUNDED, PARTIALLY_REFUNDED, MARKED_AS_REFUNDED.
7+
8+
options = {
9+
"start_invoice_date": "2016-01-01 PST",
10+
"end_invoice_date": "2017-03-26 PST",
11+
"status": ["SENT", "DRAFT", "PAID", "CANCELLED"],
12+
}
13+
invoices = Invoice.search(options)
14+
15+
if invoices.success(): # return True or False
16+
print("Search Invoice[%s] successfully" % (invoices,))
17+
else:
18+
print(invoices.error)

0 commit comments

Comments
 (0)