---
title: Online Invoice
slug: xero/online-invoice
description: Learn how to retrieve the Online Invoice Url for an invoice by passing the Invoice Id in the request. This document includes code examples for creating a Map to store invoice data and making a request to the Breadwinner Global API. Find out how to handle 
docTags: 
createdAt: 2022-07-20T14:26:42.000Z
---

You can retrieve the Online Invoice Url by passing the Invoice Id in the request. You cannot retrieve an Online Invoice Url for DRAFT Invoices.&#x20;

You can find Invoice Id in the Additional Information section on the Breadwinner Invoice page.

:::CodeblockTabs
Request

```json
//  Create a Map to store all the data of a Invoice
Map<String, Object> invoiceFiltersMap = new Map<String, Object>();
invoiceFiltersMap.put('IDs', 'b97f3dbb-04f5-4cb5-843d-32305c381cf1');    

//  Initializing the Request Data to be passed.
    Map<String, Object> reqObj = new Map<String, Object>();
    reqObj.put('version', '1.0');
    reqObj.put('action', 'readOnlineInvoiceUrl');
    reqObj.put('queryParameters', invoiceFiltersMap);
    //Required, if Xero Multi-Org is enabled in Breadwinner. 
    reqObj.put('xeroOrgId', '!aa00TM');  

//  Placing a request to Breadwinner Global API
Map<String, Object> respMap = bread_winner.BreadwinnerXeroAPI.call(reqObj);
System.debug(respMap);
```

Response

```json
"OnlineInvoices": [
    {
      "OnlineInvoiceUrl": "https://in.xero.com/anVr9XanjKRDApfUs8NxAsxapaV3Gu4UPkmt23hj"
    }
  ]
```
:::

