0

I am using the following code to create an order using rest API.

$apiURL="https://domain.com/index.php/rest/V1/carts/mine/payment-information";
$data_string =json_encode(array("paymentMethod"=>array("method"=>"banktransfer"),"billing_address"=>array("customer_id"=>100,"region"=>"Test Region","region_id"=>25,"country_id"=>"US","telephone"=>"1234567890","postcode"=>06401,"street"=>array("0"=>"testing"),"city"=>"testing","firstname"=>"John","lastname"=>"Doe","region_code"=>"NV")));
$ch = curl_init($apiURL);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_POSTFIELDS, $data_string);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, array("Authorization: Bearer ".$token,"Content-Type: application/json"));

Order is created but no email is sent. In the admin section "The order confirmation email is not sent" is displayed.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.