Review on Salla Merchants APIs
Table of contents
APIs aka Application Programming Interfaces are the main character in managing how all functions work seamlessly and effortlessly. Salla Merchants APIs are developed in-house to work perfectly in Salla environments.
We have previously elaborated on APIs best practices in a two-part article. Part one, where we explained about APIs world, the usage of RESTful URLs and actions, accept and respond using JSON. In part two, we dived into more ways you can have your APIs systemized, easy to use, easy to understand with APIs versioning, optimizing client-side data access, and using pretty print by default & ensuring gzip is supported.
Having that in mind we’ll delve into the Salla APIs and the way they help your App work seamlessly and the Merchants APIs documentation review.
Salla APIs are the key to your App success
Salla APIs are predefined by Salla and they help ensure all functionality of your App run smoothly in Salla environment. This includes the Shipping APIs which includes a host of new endpoints and webhooks critical for improving the Merchant experience and modernizing the administration of multiple shipments from different locations. Partners can also use Salla APIs for Invoice with InvoiceOcean, the process is explained in this article.
The Merchant APIs documentation is a suite for a collection of RESTful endpoints in-house written by our developers to assist Salla Partners’ Developers in equipping their Apps with up to date endpoints. In the following section we’ll explain the documentation and what each section is dedicated to.
Merchants APIs documentation
The Merchant APIs documentation is a simple, quick, and safe way to access merchant data, which comprises a collection of RESTful endpoints. Using Salla's standard APIs, developers can create Apps that reach over fifteen thousand online retailers, scale their Apps to meet demand, and submit their creations to the Salla App Store, the one, central location.
The documentation has three main sections which are Introduction, App and APIs.
Introduction
In this section, a list of articles are provided to help Partners better understand how the APIs in Salla works;
Get Started provides a brief description for documentation
Authorization article explains the authorization framework adopted in Salla environment is explained along with the benifits, types, flow and examples.
Webhooks, in this article go through the Salla Webhooks which allows you to easily set fully automated notifications to be notified when events occur on your App.
Conditional Webhooks, this article elaborates how Salla Rules allows developers to manipulate and customize webhooks by making use of the features that are provided. The developers may customize webhook experiences to meet their own needs and specifications.
Security Considerations, this article explains the security measures Salla follows to protect users and its platform.
Multi-Language Support, in this article the methods of having your App support multiple languages are thoroughly explained.
Responses, a list of responses and error handling are given with examples.
Pagination this article explains the Pagination used in Salla environments with the response code.
Rate Limiting, this article explains how Salla ensures its platform remains stable and fair for all users.
Versioning, this article provides a tracking log for the URI versioning
Change Log, this log consists all the information on hotfixes, frequent updates, bug fixes, performance improvements, and deprecated endpoints and requests for Salla APIs. In addition to both released and unreleased changes.
Support provides information about the dedicated support team for Merchants APIs
Apps
In this section you will find curated articles to assist you in creating your own Apps with Salla and the App events article gives you a directory for the Events and Payloads for each event.
APIs
This sections comprises two parts, Apps APIs and Merchants APIs.
App APIs
A list of endpoints for Salla Apps are documents in this section, categorized into two categories which are Settings with App Settings Details and Update App Settings Details endpoints. And Subscriptions with App Subscription Details and Updated App Subscription Balance endpoints.
Merchants APIs
This section is designated for Merchant's APIs with endpoints categorized into over forty categories. Each category contains a list of endpoints that has similar data. The categories of endpoints include Orders, Product, Shipments. Under each category there is a list of endpoints, for instance, Orders comprises four endpoints which are Create Order, List Orders, and Order Details.
Example
In this section we will present a number of examples on how to test the endpoints using the API documentation such as List endpoint, List endpoints with Query, Details endpoint, POST and PUT endpoints.
For a seamless process you will need to have the following:
Salla Demo Store
Access token
Salla App
Generate Access Token using Salla App and Demo Store
The access token can be obtained from a demo store using a Salla App where both are linked to your Partners Account .
1- On the Partners dashboard, go to Apps and choose any App you developed. It is preferred that the App is public.
2- Set up the App Scope and check the box next to Read and write for Product, Order and Webhooks then click Update Scope.
3- Set up the App Webhooks details using Webhook.site. Copy the Webhook link from the page.
Then add it as a Webhook URL for the App.
4- Scroll down to the Test App section and install the App on a demo store by clicking Install button next to the demo store.
This will redirect you to the store dashboard page where you can approve the App installment. Approve the installment request to proceed.
After that, go back to the Webhook.site and get the Access Token from the Request.
Congratulations, now you have an essential part of API testing, the access token.
For more information about access tokens check this article.
List Endpoints
The list endpoint will give you a list of information about a certain item, such as List Products. To test this endpoint follow these steps.
- Head to https://docs.salla.dev and go to Merchant API
- Choose any LIST endpoint. Example: List Products
- Click on Try It Out button
- Click on Auth
- Provide your valid access token
- Click on Send
- Check the response, which is expected to be 200
You have successfully tested the List Product endpoint and received the 200 Code Response with the list of products.
List Endpoints with Query Parameters
The List endpoints with query parameters allow you to list variables with a specific query parameter. In the below example we will walk you through the endpoint testing.
- Head to https://docs.salla.dev and go to Merchant API
- Choose any LIST endpoint. Example: List Products
- Click on Try It Out
- Click on Auth tab.
- Provide your valid access token
- In the params tab, choose any query parameter and add its value. Example: status = sale.
- Click on Send
- Check the response, which is expected to be 200
Details Endpoint
This endpoint allows you to get the details of a particular variable, we will explain how to test this type of endpoint step by step in the following part.
- Head to https://docs.salla.dev and go to Merchant API
- Choose any LIST endpoint. Example: List Products
- Click on Try It Out button
- Click on Auth
- Provide your valid access token
- Click on Send
- Check the response, which is expected to be 200
- From the response, choose the variable to be passed in the Path Parameter to fetch its details
- Choose any DETAILS endpoint to see an extended version. Example: Product Details, then click on Try it out
- Click on Auth
- Provide your valid access token
- In the Params tab, add the variable value in the Path Params
- Click on Send
- Check the response, which is expected to be 200
POST Endpoints
The POST endpoints enable you to create new variables, in the following section we will go through the steps of creating a new product using the Create Product and point.
- Head to https://docs.salla.dev and go to Merchant API
- Choose any POST operation endpoint. Example: Create Product
- Click on Try It Out
- Click on Auth
- Provide your valid access token
- Click on the Body tab and provide the body parameter’ variables (check the body request details for more information on what to provide)
📝Note: in this example we removed the following parameters: Category, Brand id and Tags. in addition to editing value for mpn, gtin and the date value in Overrides.
- Click on Send
- Check the response, which is expected to be 201
PUT Endpoints
This endpoint allows you to edit the parameters value using the parameter id. In the following part we will provide a step by step guide on how to use list endpoint to get the parameter id then use the put endpoint to edit the values.
- Head to https://docs.salla.dev and go to Merchant API
- Choose any LIST endpoint. Example: List Products
- Click on Try It Out button
- Click on Auth
- Provide your valid access token
- Click on Send
- Check the response, which is expected to be 200
- From the response, choose the variable to be passed in the Path Parameter to update its details
- Choose any PUT operation endpoint. Example: Update Product
- Click Try it out
- Click on Auth
- Provide your valid access token
- In the Params tab, add the variable value in the Path Params
- Click on the Body tab and provide the body parameter’ variables (check the body request details for more information on what to provide)
📝Note: in this example we removed the variables Category, Brand id and Tags. In addition we edited the value of Quantity and the Date value for Overrides.
- Click on Send
- Check the response, which is expected to be 201
Congratulations, you have successfully used the list endpoint to get the parameter id and used the put endpoint to edit the item.
DELETE Endpoints
This endpoint enables you to delete a specific variable using the parameter id. In the next section we will guide you how to use the list endpoint to get the parameter id then use the delete endpoint to delete the parameter.
- Head to https://docs.salla.dev and go to Merchant API
- Choose any LIST endpoint. Example: List Products
- Click on Try It Out button
- Click on Auth
- Provide your valid access token
- Click on Send
- Check the response, which is expected to be 200
- From the response, choose the variable to be passed in the Path Parameter to update its details
- Choose any DELETE operation endpoint. Example: Delete Product
- Click Try it out
- Click on Auth tab
- Provide your valid access token
- In the Params tab, add the variable value in the Path Params
- Click on Send
- Check the response, which is expected to be 202
Congratulations, you have successfully used the list endpoint to get the parameter id and used the delete endpoint to delete the item.
Conclusion
In this article we went through how Salla APIs allows Partners to enable their Apps work seamlessly in Salla environments, and provides a wholesome review for Salla Merchants APIs documentation which serves as a central hub for Partners to use as a reference for Salla APIs. in addition to real examples. Be part of the Global Developer Community on </Salla Developers> and visit the knowledge base for more practical articles and tutorials.
Subscribe to my newsletter
Read articles from Salla Partners directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by
Salla Partners
Salla Partners
Make passive income by creating customizable apps and themes for over 60,000 Salla E-commerce Platform Merchants in Saudi Arabia