Error while trying to Generate e-invoice

I am facing error while creating e-invoice:

API Request Failed

5002 : The field Tranport Document Number must match the regular expression ‘[1]{1}[a-zA-Z0-9-/]*$’.

Full error Log:
Traceback (most recent call last):
File “apps/frappe/frappe/app.py”, line 114, in application
response = frappe.api.handle(request)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File “apps/frappe/frappe/api/init.py”, line 49, in handle
data = endpoint(**arguments)
^^^^^^^^^^^^^^^^^^^^^
File “apps/frappe/frappe/api/v1.py”, line 36, in handle_rpc_call
return frappe.handler.handle()
^^^^^^^^^^^^^^^^^^^^^^^
File “apps/frappe/frappe/handler.py”, line 49, in handle
data = execute_cmd(cmd)
^^^^^^^^^^^^^^^^
File “apps/frappe/frappe/handler.py”, line 85, in execute_cmd
return frappe.call(method, **frappe.form_dict)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “apps/frappe/frappe/init.py”, line 1775, in call
return fn(*args, **newargs)
^^^^^^^^^^^^^^^^^^^^
File “apps/frappe/frappe/utils/typing_validations.py”, line 31, in wrapper
return func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File “apps/india_compliance/india_compliance/gst_india/utils/e_invoice.py”, line 167, in generate_e_invoice
raise e
File “apps/india_compliance/india_compliance/gst_india/utils/e_invoice.py”, line 135, in generate_e_invoice
result = api.generate_irn(data)
^^^^^^^^^^^^^^^^^^^^^^
File “apps/india_compliance/india_compliance/gst_india/api_classes/e_invoice.py”, line 77, in generate_irn
result = self.post(endpoint=“invoice”, json=data)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “apps/india_compliance/india_compliance/gst_india/api_classes/base.py”, line 86, in post
return self._make_request(“POST”, args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “apps/india_compliance/india_compliance/gst_india/api_classes/base.py”, line 170, in _make_request
raise e
File “apps/india_compliance/india_compliance/gst_india/api_classes/base.py”, line 161, in _make_request
response_json = self.process_response(response_json)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “apps/india_compliance/india_compliance/gst_india/api_classes/base.py”, line 191, in process_response
self.handle_error_response(response)
File “apps/india_compliance/india_compliance/gst_india/api_classes/base.py”, line 205, in handle_error_response
frappe.throw(
File “apps/frappe/frappe/init.py”, line 652, in throw
msgprint(
File “apps/frappe/frappe/init.py”, line 617, in msgprint
_raise_exception()
File “apps/frappe/frappe/init.py”, line 568, in _raise_exception
raise exc
frappe.exceptions.ValidationError: 5002 : The field Tranport Document Number must match the regular expression '[2]{1}[a-zA-Z0-9-/]
$'.

Versions:
ERPNext: v15.34.0 (HEAD)

Frappe Framework: v15.40.0 (HEAD)

Frappe HR: v15.28.2 (HEAD)

India Compliance: v15.13.2 (HEAD)



  1. a-zA-Z0-9 ↩︎

  2. a-zA-Z0-9 ↩︎

Check Transport Document Number field in Sales Invoice, may be that is having space or any special character into it.
For resolve issue remove space or special character from field.

suggestions:
you can check in JS console or Python terminal.