Global API
...
Requests
Customer Payment

Create

1min
to create a customer payment in netsuite, use action as "createcustomerpayment" and pass the customer payment data in the requestjson under "customerpayments" note you can only create one record at a time the following is an example of creating a customer payment where we are setting every possible field (see https //app archbee io/docs/ lihuunv 7xnqrtzhskkc/hnjmkn99qxwdeafyyifsq customer payment docid\ l s8ofal1497wkapqkulh the available fields) the response will return the response back from netsuite, which includes the netsuite customer payment id (internalid), plus the newly created salesforce customer payment id (salesforceid) request //create a map to store all the data of a payment map\<string, object> nscustomerpayment = new map\<string, object>(); nscustomerpayment put('classification', new map\<string, object>{'internalid'=>'5'}); nscustomerpayment put('currencyrecord', new map\<string, object>{'internalid'=>'1'}); nscustomerpayment put('department', new map\<string, object>{'internalid'=>'2'}); nscustomerpayment put('location', new map\<string, object>{'internalid'=>'1'}); nscustomerpayment put('customer', new map\<string, object>{'internalid'=>'63587'}); nscustomerpayment put('memo', 'payment 25'); nscustomerpayment put('trandate', datetime newinstance(2020, 09, 07) gettime()/1000); nscustomerpayment put('payment', '97006'); // initializing the payment custom fields list\<object> paymentcustomfieldlist = new list\<object>(); map\<string,object> paymentcustomfield = new map\<string,object>(); paymentcustomfield put('fieldtype', 'select'); paymentcustomfield put('scriptid', 'custbody customlist'); paymentcustomfield put('valuelookup', new map\<string,object>{'internalid'=>'2'}); paymentcustomfieldlist add(paymentcustomfield); // adding the payment custom fields nscustomerpayment put('customfieldlist', new map\<string,object>{'customfield'=>paymentcustomfieldlist}); // initializing the requestjson data to be passed map\<string, object> requestjsonmap = new map\<string, object>(); requestjsonmap put('customerpayments', new list\<object>{nscustomerpayment}); string reqjson = json serialize(requestjsonmap); map\<string, object> reqobj = new map\<string, object>(); reqobj put('version', '1 0'); reqobj put('action', 'createcustomerpayment'); reqobj put('requestjson', reqjson); // placing a request to breadwinner global api map\<string, object> resp = breadwinner ns breadwinnernetsuiteapi call(reqobj); system debug(resp); response { action=createcustomerpayment, timestamp=1639492143080, validrequest=true, version=1 0, responsejson={ "errors" \[], "status" "200", "customerpayments" \[ { "undepfunds" true, "unapplied" 96770 0, "tranid" "113", "trandate" 1599364800, "subsidiary" { "type" null, "name" "parent company", "internalid" "1", "externalid" null }, "status" "not deposited", "salesforceid" "a0l1m000003ee6peas", "payment" 97006 0, "memo" "payment 25", "location" { "type" null, "name" "test atlanta west", "internalid" "1", "externalid" null }, "lastmodifieddate" 1648039356, "internalid" "97006", "externalid" null, "exchangerate" 1 0, "department" { "type" null, "name" "sales", "internalid" "2", "externalid" null }, "customform" { "type" null, "name" "custom customer payment", "internalid" "105", "externalid" null }, "customfieldlist" null, "customer" { "type" null, "name" "cust1022at spider man", "internalid" "63587", "externalid" null }, "currencyname" "us dollars", "createddate" 1648032330, "classification" { "type" null, "name" "corporate sales", "internalid" "5", "externalid" null }, "applylist" null, "applied" 0 0 } ], } }