I am using basic authentication. I will try to add CallSettings to my CURLOPT_HTTPHEADER => array(). I will also add my full test code which is working with Company A. The failure happens when I try to change the Postfields to include the companyB.
My full working PHP Code (I’m sure there is some sloppyness in here I apologize):
Function ConnectPilot($order_number) {
ini_set(‘max_execution_time’, 300);
ini_set(‘memory_limit’, ‘1024M’); // or you could use 1G
$auth = base64_encode(“MYUSERNAME:MYPASSWORD”);
// create a new cURL resource
$ch = curl_init();// set URL and other appropriate options
curl_setopt_array($ch, array(
CURLOPT_URL => ‘https://cent…/api/v1/Erp.BO.SalesOrderSvc/SalesOrders’,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_SSL_VERIFYPEER => false,
CURLOPT_SSL_VERIFYHOST => false,
CURLOPT_ENCODING => “”,
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 300,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_POST => 1,
CURLOPT_POSTFIELDS => ‘{
“CustNum”: 101,
“PONum”: "’ . $order_number . ‘",
“CurrencyCode”: “BASE”,
“Character01”: "Shopify_’ . $order_number . ‘",
“TermsCode”: “30RW”}’,CURLOPT_HTTPHEADER => array( "Authorization: Basic " . $auth,“Accept: application/atom+xml”,
“Cache-Control: no-cache”,
“Content-Type: application/json”,
“Top: 20000”,
),
));$response = curl_exec($ch);
$err = curl_error($ch);
$info = curl_getinfo($ch);curl_close($ch);
}