> To build or manage a Wix site with an AI agent, follow https://www.wix.com/headless/skill.md
> It builds a new Wix site or puts your own site online, from a prompt, and keeps changing it afterwards. The pages are code in any web technology, and Wix runs the backend.
> It works through the Wix plugin (the Wix MCP and the Wix skills), the Wix CLI or no Wix login, and puts the site live on Wix hosting or on another host.
> Business features include a store, bookings, events and tickets, a restaurant, a blog, forms, members and many more.
> Read the Wix skills online at https://www.wix.com/skills
> 
> Portal Navigation:
> 
> - Append `.md` to any URL under `https://dev.wix.com/docs/` to get its markdown version.
> - Pages are either content pages (article or reference text) or menu pages (a list of links to child pages).
> - To get a menu page, truncate any URL to a parent path and append `.md` (e.g. `https://dev.wix.com/docs/sdk.md`, `https://dev.wix.com/docs/sdk/core-modules.md`).
> - If a reference page seems to be missing its schema (parameters, return types, or type definitions), append `?schema=true` to its `.md` URL (e.g. `https://dev.wix.com/docs/contexts/contexts/stores/category-info/use-category-info-context.md?schema=true`).
> - Top-level index of all portals: https://dev.wix.com/docs/llms.txt
> - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt

# Method name: onInvoiceOverdue(event: Invoice)

# Method package: wixBillingBackend

# Method menu location: wixBillingBackend --> Events --> onInvoiceOverdue

# Method Link: https://dev.wix.com/docs/velo/apis/wix-billing-backend/events/on-invoice-overdue.md

# Method Description:

An event that fires when an invoice is overdue.

The `onInvoiceOverdue()` event handler runs when an invoice is overdue. The received `Invoice`
 object contains information about the invoice that is overdue.

> **Note:** Backend events don't work when previewing your site.



# Method Code Examples:

*** Note: do not assume any prop names or enum values other than the ones in the example.

## An event when an invoice is overdue

```javascript
// Place this code in the events.js file
// of your site's Backend section.

export function wixBilling_onInvoiceOverdue(event) {
  let invoiceId = event.id.id;
  let email = event.customer.email;
}
    
/*  Full event object:
 *
 * {  
 *   "id":{  
 *     "id": "411a5551-b0f6-4826-8a41-ebae2879f857",
 *     "version": 25
 *   },
 *   "status": "Overdue",
 *   "number": "0000001",
 *   "title": "My Invoice",
 *   "currency": "USD",
 *   "customer": {  
 *     "contactId": "4f7c6637-0657-4696-a00b-9bc2ae4e035d",
 *     "email": "john.doe@somedomain.com",
 *     "address": {
 *       "country": "USA",
 *       "subdivision": "NY",
 *       "city": "New York",
 *       "postalCode": "10011",
 *       "streetAddress": {
 *         "value": "235 W 23rd St",
 *         "type": "Name"
 *       },
 *       "addressLine": "someStreet",
 *       "formatted": "235 W 23rd St, New York, NY 10011, USA"
 *     },
 *     "billingAddress": {
 *       "country": "USA",
 *       "streetAddress": {
 *         "value": "235 W 23rd St",
 *         "type": "Name"
 *       },
 *       "addressLine": "235 W 23rd St, New York, NY 10011, USA",
 *       "postalCode": "10011",
 *       "subdivision": "NY",
 *       "city": "New York",
 *       "formatted": "235 W 23rd St, New York, NY 10011, USA"
 *     },
 *     "shippingAddress": {
 *       "country": "USA",
 *       "streetAddress": {
 *         "value": "235 W 23rd St",
 *         "type": "Name"
 *       },
 *       "addressLine": "235 W 23rd St, New York, NY 10011, USA",
 *       "postalCode": "10011",
 *       "subdivision": "NY",
 *       "city": "New York",
 *       "formatted": "235 W 23rd St, New York, NY 10011, USA"
 *     },
 *     "phone": "5555555555",
 *     "company": "Some Company",
 *     "companyId": "Some Company Id",
 *     "fullName": "John Doe",
 *     "firstName": "John",
 *     "lastName": "Doe"
 *   },
 *   "dates": {  
 *     "issueDate": 2019-03-13T00:00:00.000Z,
 *     "dueDate": 2019-06-12T00:00:00.000Z,
 *     "lastSeenDate": 2019-03-14T00:00:00.000Z
 *   },
 *   "discount": {
 *     "value": 2.5,
 *     "type": "Fixed"
 *   },
 *   "lineItems":[  
 *     {  
 *       "id": "00001",
 *       "name": "Item 1",
 *       "description": "First Item",
 *       "price": 10.5,
 *       "quantity": 3,
 *       "taxes": [
 *         {
 *           "name": "tax name",
 *           "rate": 8.5,
 *           "code": "tax code"
 *         }
 *       ]
 *     },
 *     {
 *       "id": "00002",
 *       "name": "Item 2",
 *       "description": "Second Item",
 *       "price": 50,
 *       "quantity": 1,
 *       "taxes": [
 *         {
 *           "name": "tax name",
 *           "rate": 8.5,
 *           "code": "tax code"
 *         }
 *       ]
 *     }
 *   ],
 *   "locale": {  
 *     "language": "en"
 *   },
 *   "payments": [{
 *     "id": "4j9q4o00-4205-8q83-003d-3ofd9d8wmf0w",
 *     "type": "offline",
 *     "amount": "25.50",
 *     "date": 2019-03-23T00:00:00.000Z"
 *   }],
 *   "totals": {  
 *     "discountAmount": null,
 *     "taxedAmount": 6.93,
 *     "fees": [],
 *     "subtotal": 81.5,
 *     "total": 88.43
 *   },
 *   "dynamicTotals": {
 *     "paidAmount": 25.50,
 *     "balance": 62.39
 *   },
 *   "taxes": [  
 *     {  
 *       "name": "tax name",
 *       "rate": 8.5,
 *       "taxable": 81.5,
 *       "taxed": 6.93,
 *       "code": "tax code"
 *     }
 *   ],
 *   "metadata": {  
 *     "notes": "Some note.",
 *     "legalTerms": "Some legal terms",
 *     "sourceUrl": "http://legalurl.com",
 *     "source": "Some source",
 *     "sourceRefId": "Some source ref id"
 *   }
 * }
 */
```

---