Global API
...
Request
Customer

Update Customer

1min
the following is an example of updating the customer where we change some fields (see customer docid\ dm98bi1 brwesrpxuduve for all available fields) the processor customer id ( processorcustomerid ) is required to update the customer note you can only update one record at a time the response returns the complete customer information, which you can see in our example // create a map to store all the data of a customer map\<string, object> customermap = new map\<string, object>(); customermap put('processorcustomerid', 'processorcustomerid'); customermap put('customername', 'johnny doe'); customermap put('email', 'test\@bwp com'); customermap put('customerphone', '616 928 5099'); // create stripe address data customermap put('line1', '124 main street'); customermap put('line2', 'apt 3'); customermap put('city', 'anytown'); customermap put('state', 'ny'); customermap put('postal code', '12346'); // initializing the requestjson data to be passed map\<string, object> requestjsonmap = new map\<string, object>(); requestjsonmap put('customers', new list\<object>{customermap}); string reqjson = json serialize(requestjsonmap); map\<string, object> reqobj = new map\<string, object>(); reqobj put('version', '1 0'); reqobj put('action', 'updatecustomer'); reqobj put('processorid', 'processorid'); reqobj put('requestjson', reqjson); // placing a request to breadwinner global api map\<string, object> resp = bw payments breadwinnerpaymentsapi call(reqobj); system debug(resp);{ &#x9;action=updatecustomer, &#x9;timestamp=1599492195202, &#x9;validrequest=true, &#x9;version=1 0, statuscode=200, &#x9;responsejson={ "customers" \[ { "taxtype" "vat", "taxid" "", "taxexempt" "none", "shippingstreetaddress2" null, "shippingstreetaddress1" null, "shippingstate" null, "shippingpostalcode" null, "shippingphone" null, "shippingcountry" null, "shippingcity" null, "shippingaddressee" null, "salesforcename" "johnny depp", "salesforceid" "salesforceid", "salesforcecontact" null, "salesforceaccount" null, "referenceid" null, "processortype" "processortype", "processororgname" "processororgname", "processororgid" "processorid", "processorcustomerid" "processorcustomerid", "noassociatedsfcontact" false, "noassociatedsfaccount" false, "livemode" false, "lastname" null, "language" null, "invoiceprefix" "1f55e486", "hassuccessfulpayments" false, "firstname" null, "errormessage" null, "email" "test\@bwp com", "description" null, "delinquent" false, "defaultsource" "", "customerphone" "616 928 5099", "customername" "johnny doe", "customerid" "processorcustomerid processortype processorid", "customeraccountbalance" 0 00, "custcurrency" null, "createdvia" "breadwinner api", "createddateinprocessor" "2022 06 02t07 52 21 000z", "company" null, "billingstreetaddress2" "apt 3", "billingstreetaddress1" "124 main street", "billingstate" "ny", "billingpostalcode" "12346", "billingcountry" "us", "billingcity" "anytown" } ] } }