A Cs-Cart REST API (known as RESTful API) is an application programming interface (API, web API) that conforms to the constraints of REST architectural style, Allows for interaction with RESTful web services. The communication between the client and the server happens over HTTP. A REST API takes advantage of the HTTP methodologies to establish communication between the client and the server. It enables servers to cache the response that improves the application’s performance. REST stands for representational state transfer and was created by computer scientist Roy Fielding.
What’s an API?
An API is a set of definitions and protocols for building and integrating application software. It’s sometimes referred to as a contract between an information provider and an information user—establishing the content required from the consumer (the call) and the content required by the producer (the response). For example, the API design for a weather service could specify that the user supplies a zip code and that the producer reply with a 2-part answer, the first being the high temperature, and the second being the low.
4 In Cs-Cart REST API methods are available to view and modify objects:
GET
—get object dataPUT
—update object dataPOST
—create a new objectDELETE
—delete object
How to authenticate API In Cs-Cart REST API–
- In Postman-
In Postman you can just enter the email and generated API key in basic auth.
Email: Username
Password: API key
Find API key – https://prnt.sc/TfPdKhZ8MJ3I
- Curl-
You need to change the key in Base64 format.
Authorization: Basic base64(email: API key)
Supported Entities
- Auth
- Blocks
- Carts
- Call Requests
- Categories
- Discussions
- Languages
- Langvars
- Orders
- Pages
- Payment Methods
- Products
- Product Features
- Product Variations
- Product Variation Groups
- Product Options
- Product Option Combinations
- Product Option Exceptions
- Settings
- Shipments
- Shipping Methods
- Statuses
- Stores
- Taxes
- Users
- Usergroups
- Vendors
Example to use API
Get the user by id, /api/users/id
:
To get the users list, /api/users
:
Get a list of orders, send a GET request to /api/orders/
:
Get specific order/api/orders/<order_id>/
Php Example Code:
Same Post:
Be the first to comment.