Create an Invoice

Facades: pos, merchant

Overview

Create an invoice.

Example

📘

Note

In this example, we assume that a Client has already been initializedand assigned to the bitpay variable.

invoice = Invoice()
invoice.full_notifications = True
invoice.extended_notifications = True
invoice.notification_url = "https://test/lJnJg9WW7MtG9GZlPVdj"
invoice.redirect_url = "https://test/lJnJg9WW7MtG9GZlPVdj"
invoice.notification_email = "[email protected]"

buyer = Buyer()
buyer.name = "Test"
buyer.email = "[email protected]"
buyer.address1 = "168 General Grove"
buyer.country = "AD"
buyer.locality = "Port Horizon"
buyer.notify = True
buyer.phone = "+990123456789"
buyer.postal_code = "KY7 1TH"
buyer.region = "New Port"

invoice.buyer = buyer

result = bitpay.create_invoice(invoice, Facade.MERCHANT)
invoice = Invoice()
invoice.full_notifications = True
invoice.extended_notifications = True
invoice.notification_url = "https://test/lJnJg9WW7MtG9GZlPVdj"
invoice.redirect_url = "https://test/lJnJg9WW7MtG9GZlPVdj"
invoice.notification_email = "[email protected]"

buyer = Buyer()
buyer.name = "Test"
buyer.email = "[email protected]"
buyer.address1 = "168 General Grove"
buyer.country = "AD"
buyer.locality = "Port Horizon"
buyer.notify = True
buyer.phone = "+990123456789"
buyer.postal_code = "KY7 1TH"
buyer.region = "New Port"

invoice.buyer = buyer

result = bitpay.create_invoice(invoice, Facade.POS, False)