Sunrise - Magento 2.3 API Connector Interface,  Quick guide.


The Following Credentials are Required to pull and push data between Sunrise and Magento 2.3 API:


Sunrise API User

Username: , Password:   

 API integration:

Public key, Public secret

Token key,  Token secret

Web address where the API End points are available for example  https://mywebshop.com


Required Magento end points:

These are the end points used in the Integration with your Magento 2.3 system : 

 ·    $target_order = $target_url . '/rest/V1/orders';          

      Get the feed of orders From Magento into Sunrise  (PULL) 


·     $target_orderstatus = $target_url . '/rest/V1/order/';    (PUSH) 

      Update order status in Magento from Sunrise when the order is Shipped in Sunrise.


Note: It’s required to add the extension attribute 'sunrise_id' to the existing api. (order endpoint and orders endpoint) 

This additional extension is required to link the orders in both systems and also to retry the pulling of orders in case of a failure in the transmission.


 This is a query example that is executed to fetch the orders:

 

$result = magento_order($target_order, "GET", $token, array("searchCriteria[filter_groups][0][filters][0][field]" => "sunrise_id", "searchCriteria[filter_groups][0][filters][0][condition_type]" => "null", "searchCriteria[filter_groups][1][filters][0][field]" => "status", "searchCriteria[filter_groups][1][filters][0][value]" => "processing", "searchCriteria[filter_groups][1][filters][0][condition_type]" => "eq", )


 As you can see an additional field is required in Magento order end point  that we can use to search = "sunrise_id"

 

Order status:   


"processing" status after the invoice is booked in the system. (Used for pulling the orders)

One of these statuses can be set at the moment the order is shipped from the warehouse to the customer:

''Pakket_is_onderweg " status when shipment is booked in the system. 

"Bezorgd" status when shipment has arrived at the customer.



Additional end points available in the Sunrise – Magento integration, these will require additional setup and are not required for the base integration:

$target_product = $target_url . '/rest/all/V1/products/';

$target_one_product = $target_url . '/rest/V1/products/';

$target_orderstatus_emails = $target_url . '/rest/V1/shipment/';

$target_warehouse = $target_url . '/rest/V1/inventory/warehouses';

$target_warehouse_stocks = $target_url . '/rest/V1/inventory/warehouseStocks';