Close quote via api
Hi,
7.2.1.0
SR 16
I am trying to close quotes via the API, but I am finding conflicting information on how to do this.
So far I have the following, but I am getting conflicting information on what the payload should be:
7.2.1.0
SR 16
I am trying to close quotes via the API, but I am finding conflicting information on how to do this.
So far I have the following, but I am getting conflicting information on what the payload should be:
- Code: Select all
$url = $this->NGROK_ENDPOINT_URL."SalesQuotes/".$QUOTE_ID."";
curl_setopt($this->CURL_OBJ, CURLOPT_URL, $url);
curl_setopt($this->CURL_OBJ, CURLOPT_COOKIEFILE, './cookies.txt'); // set cookie file to given file
curl_setopt($this->CURL_OBJ, CURLOPT_COOKIEJAR, './cookies.txt'); // set same file as cookie jar
curl_setopt($this->CURL_OBJ, CURLOPT_HTTPAUTH, CURLAUTH_DIGEST); //poll the server to see what methods it supports and pick the best one
curl_setopt($this->CURL_OBJ, CURLOPT_RETURNTRANSFER, $this->CURL_RETURNTRANSFER); // return the transfer as a string of the return value of curl_exec() instead of outputting it out directly.
curl_setopt($this->CURL_OBJ, CURLOPT_CUSTOMREQUEST, "PATCH");
$payload = '{
"QuoteID": "'.$QUOTE_ID.'",
"Status": "CANCELLED"
}';
curl_setopt($this->CURL_OBJ, CURLOPT_POSTFIELDS, $payload);
curl_setopt($this->CURL_OBJ, CURLOPT_HTTPHEADER, [
'Content-Type: application/json',
'Content-Length: ' . strlen($payload)
]);