Customer get address via REST API

I accomplished to create a customer with an address but I don’t know how to get the billing address for a customer via the REST API. Anybody an idea?

So far I tried:

r = requests.get(eUrl + '/api/resource/Address', headers={ "Authorization": "token " + eKey }, params={
    'limit_page_length': 1,
    'filters': '[["Address", "links","=","' + customerId + '"]]'

the address doctype has a field called address type. you can filter it to get only the “Billing” addresses


Thank you, thats a good idea. Do you know now how to also filter by customer?

[“Dynamic Link”, “links”, “link_name”, “=”, “CUSTOMER”] should do the trick

Thanks for the idea! Sadly I get:

"exc_type": "DataError",
"exception": "frappe.exceptions.DataError: Field not permitted in query: links",
"exc": "[\"Traceback (most recent call last):\\n  File \\\"/home/frappe/frappe-bench/apps/frappe/frappe/\\\", line 68, in application\\n    response = frappe.api.handle()\\n  File \\\"/home/frappe/frappe-bench/apps/frappe/frappe/\\\", line 129, in handle\\n    data =, doctype, **frappe.local.form_dict)\\n  File \\\"/home/frappe/frappe-bench/apps/frappe/frappe/\\\", line 1208, in call\\n    return fn(*args, **newargs)\\n  File \\\"/home/frappe/frappe-bench/apps/frappe/frappe/\\\", line 47, in get_list\\n    validate_args(args)\\n  File \\\"/home/frappe/frappe-bench/apps/frappe/frappe/desk/\\\", line 62, in validate_args\\n    validate_filters(data, data.filters)\\n  File \\\"/home/frappe/frappe-bench/apps/frappe/frappe/desk/\\\", line 114, in validate_filters\\n    raise_invalid_field(fieldname)\\n  File \\\"/home/frappe/frappe-bench/apps/frappe/frappe/desk/\\\", line 142, in raise_invalid_field\\n    frappe.throw(_('Field not permitted in query') + ': {0}'.format(fieldname), frappe.DataError)\\n  File \\\"/home/frappe/frappe-bench/apps/frappe/frappe/\\\", line 439, in throw\\n    msgprint(msg, raise_exception=exc, title=title, indicator='red', is_minimizable=is_minimizable, wide=wide, as_list=as_list)\\n  File \\\"/home/frappe/frappe-bench/apps/frappe/frappe/\\\", line 418, in msgprint\\n    _raise_exception()\\n  File \\\"/home/frappe/frappe-bench/apps/frappe/frappe/\\\", line 372, in _raise_exception\\n    raise raise_exception(msg)\\nfrappe.exceptions.DataError: Field not permitted in query: links\\n\"]",
"_server_messages": "[\"{\\\"message\\\": \\\"Field not permitted in query: links\\\", \\\"indicator\\\": \\\"red\\\", \\\"raise_exception\\\": 1}\"]"


I made a mistake, it should be like this: api/resource/Address?filters=[[“Dynamic%20Link”,“link_name”,“=”,“CUSTOMER_NAME”]]

without the “links” key


Ahh thank you very much!