def METHOD_NAME(self, data):
    """
      input is:
        {
          "due_date": "2023-05-31",
          "customer": "ksim",
          "items": [
            {
              "name": "T-shirt--",
              "description": "T-shirt",
              "quantity": 1
            }
          ]
        }
    """
    invoice = json.loads(data)
    date = dt.datetime.strptime(invoice['due_date'], '%Y-%m-%d')
    if date <= dt.datetime.today():
        return 'Error: due_date have to be in the future'
    for item in invoice['items']:
        # rename column
        item['qty'] = item['quantity']
        del item['quantity']
        # add required fields
        item['uom'] = "Nos"
        item['conversion_factor'] = 1
        income_account = self.connection_data.get('income_account', "Sales Income - C8")
        item['income_account'] = income_account
    try:
        self.connect()
        self.client.post_document('Sales Invoice', invoice)
    except Exception as e:
        return f"Error: {e}"
    return f"Success"