Create Invoice
1min
The following is an example of Create Invoice.
Request
Response
|
Updated 30 Mar 2023
Did this page help you?
Yes
No
The following is an example of Create Invoice.
Map<String, Object> invoiceData = new Map<String, Object>(); invoiceData.put('processorCustomerId', 'processorCustomerId'); invoiceData.put('invoiceStatus', 'SEND_TO_CUSTOMER'); invoiceData.put('daysUntilDue', 2); List<object> items = new List<object>(); Map<String, Object> itemData = new Map<String, Object>(); itemData.put('processorPriceId', 'processorPriceId'); itemData.put('quantity', 2); items.add(itemData); invoiceData.put('items', items); // Initializing the RequestJSON Data to be passed. Map<String, Object> requestJSONMap = new Map<String, Object>(); requestJSONMap.put('invoices', new List<Object>{invoiceData}); String reqJSON = JSON.serialize(requestJSONMap); Map<String, Object> reqObj = new Map<String, Object>(); reqObj.put('version','1.0'); reqObj.put('action','CreateInvoice'); reqObj.put('processorId', 'processorId'); reqObj.put('requestJSON',reqJSON); // Placing a request to Breadwinner Global API Map<String,Object> resp = bw_payments.BreadwinnerPaymentsAPI.call(reqObj); System.debug(resp);