• Resolved retroriff

    (@retroriff)


    Hello,

    I have been passing the tracking number to the orders through the API, but it has stopped working, probably due to any update. WooCommerce orders are receiving the API tracking number correctly and it is shown in the admin page, but the tracking details are not included in the emails. When I add it manually from the WooCommerce admin,the tracking details are correctly added to the email.

    Do you have any idea about why is it failing?

    Thank you

Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Author Zorem

    (@zorem)

    I think that the order status is updated to Shipped (Completed) before the tracking info is added. Maybe you can think of any other change in your system? new plugin? new custom code?
    Can you share the API call you are doing to update the tracking?

    Thread Starter retroriff

    (@retroriff)

    Hello, this is the API call we are doing:

    public function handle()
        {
            try {
                $data = [
                    "tracking_provider" => $this->provider,
                    "tracking_number" => $this->tracking,
                ];
    
                if ($this->link) {
                    $data['tracking_link'] = urlencode($this->link);
                }
    
                $shipmentTracking = Woocommerce::post("orders/$this->number/shipment-trackings", $data);
    
                Log::debug("[WooCommerce.job.order.send-shipping-number] update tracking number $this->number order");
            } catch (\Exception $exception) {
                Log::error($exception->getMessage());
            }
        }
    Plugin Author Zorem

    (@zorem)

    Hi, check the API code we provide in the AST shipment tracking API docs, we do not use the tracking link since its coming form the shipping providers list:

    Thanks

    Thread Starter retroriff

    (@retroriff)

    We have commented this line:

    if ($this->link) {
      $data['tracking_link'] = urlencode($this->link);
    }
    

    But it doesn’t work either. Actually as I said WP is receiving the tracking number correctly, as shown on the WP Admin Orders page.

    Plugin Author Zorem

    (@zorem)

    Our API endpoint does not offer a tracking link, you add the provider and the tracking link is generated by the shipping providers list. Are you sure you are using the AST plugin?

    Thread Starter retroriff

    (@retroriff)

    Yes, we are using the plugin made by zorem.

    We can get the tracking link, so we send it I think because the Mail Boxes Etc provider wasn’t added yet. However we have removed this line and the emails still don’t include the tracking number.

    Plugin Author Zorem

    (@zorem)

    The orders includes the tracking? if yes, it means that somehow you are updating the order status to “Completed” before you add the tracking to the order.

    Thread Starter retroriff

    (@retroriff)

    Hello, we have changed it as suggested and now it works. Thank you

    Plugin Author Zorem

    (@zorem)

    Great! if you like AST, please share your review 🙂

Viewing 9 replies - 1 through 9 (of 9 total)

The topic ‘Emails don’t show API tracking anymore’ is closed to new replies.