Allowing customers to edit a custom metafield from the account.liquid page

Shopify Partner
113 0 7

I've successfully created a customer metafield: customer.metafields.c_f.proxy_pickup

Goal is allow the customer (logged in) and on the account.liquid template, be able to edit the value of the metafield. I'm trying to use some jquery and the Metafield API to POST this change from the user:

 <form action="/admin/customers/{{ }}/metafields.json" method="POST" id="custmeta">
    <input type="hidden" name="customer[id]" value="{{ }}" />
    <input type="text" name="metafield[c_f.proxy_pickup]" value="{{ customer.metafields.c_f.proxy_pickup }}" placeholder="{{ customer.metafields.c_f.proxy_pickup }}" />
    <input type="submit" value="Edit"/>

    $('form#custmeta').submit(function(e) {
        type: "POST",
        dataType: "json",
        data: $(this).serialize(),
        url: $(this).attr('action'),
        success: function (data) {
          var formValid = (data.status === 'OK');
          if (formValid) {
            var msgs = '';
            for (var i=0;i<data.messages.length;i++) {
              msgs += '-- ' + data.messages[i] + '\n';
            if (msgs > '') {
              alert('SUCCESS WITH MESSAGES:\n\n' + msgs);
            else {
          else {
            alert('Status: ' + data.status + '\nMessage: ' + data.message);
        error: function (jqXHR, textStatus, errorThrown) {
          alert('AJAX or Server 500 error occurred');
      return false;

Currently keep getting the Alert of AJAX or Server 500 error occurred

Is this even possible?

Shopify Partner
28 0 1

Requires admin rights - suggest you use nodejs

The end point requires admin - gives "Authentication required" if you are not admin.

 to prove: 


 Replace "yourstore" with a valid store. 

 open it in your browser. 

{"errors":"Not Found"}  When logged in as admin. 
Authentication required  When logged in as customer.


Docs for Admin API->Customer

 "/admin/customers/{{ }}/metafields.json"
"/admin/customers/{{ }}.json"


The above endpoints are part of admin api see


nodejs, API & Heroku

 It will work via the api

 I used Heroku and the API to do this with nodejs. This  tutorial: takes maybe 2 hours, gives

 you a lot of power. A lot better than using liquid, metafields and js. The work load is about the same.