Global API
...
Request
Customer
Create Customer
1min
to create a customer in the payment processor, use the action "createcustomer" and pass the customer data in the requestjson under "customers " note you can only create one record at a time the following is an example of creating a customer where we are setting every possible field (see customer docid\ dm98bi1 brwesrpxuduve for the available fields) the response will return the response from the payment processor, which includes the customer id ( internalid ) plus the newly created salesforce customer id ( salesforceid ) // create a map to store all the data of a customer map\<string, object> customermap = new map\<string, object>(); customermap put('customername', 'john doe'); customermap put('email', 'test\@test com'); customermap put('customerphone', '616 928 5098'); // create stripe address data customermap put('billingstreetaddress1', '123 main street'); customermap put('billingstreetaddress2', 'apt 2'); customermap put('billingcity', 'anytown'); customermap put('billingstate', 'ny'); customermap put('billingcountry', 'us'); customermap put('billingpostalcode', '12345'); // 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', 'createcustomer'); 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); { action=createcustomer, timestamp=1599492195202, validrequest=true, version=1 0, statuscode=200, responsejson={ "customers" \[ { "taxtype" null, "taxid" "", "taxexempt" "none", "shippingstreetaddress2" null, "shippingstreetaddress1" null, "shippingstate" null, "shippingpostalcode" null, "shippingphone" null, "shippingcountry" null, "shippingcity" null, "shippingaddressee" null, "salesforcename" "john doe", "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\@gmail com", "description" null, "delinquent" false, "defaultsource" "", "customerphone" "616 928 5098", "customername" "john doe", "customerid" "processorcustomerid processortype processororgid", "customeraccountbalance" 0 00, "custcurrency" null, "createdvia" "breadwinner api", "createddateinprocessor" "2022 06 02t07 52 21 000z", "company" null, "billingstreetaddress2" "apt 2", "billingstreetaddress1" "123 main street", "billingstate" "ny", "billingpostalcode" "12345", "billingcountry" "us", "billingcity" "anytown" } ] } }