Topics covering webhook creation & management, event handling, Pub/Sub, and Eventbridge, in Shopify apps.
Hello, we are working on an app to integrate becool couriers to shopify.
First time making a shopify app, but i cannot find information/examples on the following
- Handling App settings like becool apikeys and if production or sandbox
- Adding a Shipping Provider that can be picked on orders
- Add a button to the order's list 'more actions' to lodge the order
- Update Order Tracking Number and tracking information
- handle webhooks from becool so we can update the order as delivered
Can somone please provide information on these aspects as i am unable to find information on these points
We have decided to use PHP
Thank you for any assistance that you can provide
There is a course on Udemy that currently costs €14.99. It might not use php, but all the important stuff would be covered there.
Cheers,
Gary
@nucleo Hi ,
based on your stack you can find the sample repo https://github.com/Shopify/shopify-app-template-php php boilerplate from the official shopify github.
1 - you need to get input from user or you can mange the using via login and get the API key from the becool you can show the list of key or create new one and show the mode like production or sandbox from the API source becool. based on becool you can manage those things.
- here you need to consume api for mange your shipping provide. https://shopify.dev/docs/api/admin-rest/2023-01/resources/carrierservice
- you can manage the button into the shopify admin UI and get connected with your app using the app extensions https://shopify.dev/docs/apps/app-extensions/list
- add or Update Order Tracking use the order custom lineitems https://shopify.dev/docs/apps/fulfillment/order-management-apps/order-editing#add-a-custom-line-item
- for store front side you need to show the tracking info in order page you need use the Theme app extension https://shopify.dev/docs/apps/online-store/theme-app-extensions
- handle webhooks from becool so we can update the order as delivered first you need to setup secure webhook listener in app. based on you can add your business logics. here more guide reference link . https://shopify.dev/docs/apps/webhooks/configuration/https and order https://shopify.dev/docs/api/admin-rest/2023-01/resources/webhook#event-topics
I hope this answer you help full.
hello trying to use the extension that is an admin link, getting it to call the following code
```
Route::get('/api/becool/lodge', function (Request $request) {
/** @var AuthSession */
$session = $request->get('shopifySession'); // Provided by the shopify.auth middleware, guaranteed to be active
$client = new Rest($session->getShop(), $session->getAccessToken());
$order = \Shopify\Rest\Admin2023_01\Order::find($session, $request->get('id'));
$becool = new \App\Lib\BecoolUtil();
$response = $becool->lodgeShipment($order);
return response(print_r($response));
})->middleware('shopify.auth');
```
But i get the following error
Sorry I am not familiar with the package you are using to make the authenticated requests to shopify.
Apparently, from the error message the headers are not being correctly set.
@nucleo you are missing the few of the steps. i was able to run the complete repo.
Thank you, for all your help i managed to work it out