Genstore REST API
Genstore offers a robust set of REST APIs. These enable developers to programmatically extend the platform’s functionality and synchronize data with other systems.
REST API requirements
- HTTP REST standards: All API calls comply with HTTP REST standards.
- Response status codes: Conform to standard HTTP status codes to indicate the success or failure of each request.
- Rate limiting: To prevent API abuse, all requests are subject to rate limitations.
- Authentication and authorization: Access to the API requires valid authentication and authorization credentials.
- Version management: The Genstore API is regularly updated to introduce new features and improvements.
Paths and requests
Interact with the REST API using standard HTTP methods. Below are the basic URI structure and method examples:
Base URI
https://{shop}.genmystore.ai/api/202410/{resource}.json
Request methods
- POST: Create a resource (non-idempotent).
- PUT: Update an existing resource (idempotent).
- DELETE: Remove a resource.
- GET: Retrieve information about a resource.
Response status codes
When Genstore receives a REST API request, it issues various HTTP status codes based on the outcome, such as 200 OK
for a successful request. For more detailed information on Genstore response status codes, refer to Response status codes.
API rate limit
Genstore manages API request rates using the token bucket algorithm, detailed as follows:
- Initial bucket size: Each app at each shop starts with 40 tokens.
- Token consumption: Each request consumes one token.
- Token replenishment: When the token count falls below 40, the system replenishes at a rate of 2 tokens per second until the bucket is full again.
- Handling over-limit requests: If the bucket runs out of tokens, any new requests will receive a
429 Too Many Requests
status code, indicating that the rate limit has been reached.
WARNING
Strictly adhere to API rate limits to ensure reliable service. Avoid using these APIs in customer-facing apps to prevent service interruptions caused by exceeding rate limits.
For more details on rate limit, see API rate limiting.
Access scope and permissions
Apps must declare their required access scope and obtain merchant authorization during installation to access specific APIs. Additionally, access to certain sensitive or high-functionality APIs (such as accessing all order data or protected fields) may require extra approval from Genstore.
- General access: Apps declare the access scope during merchant installation and can access the APIs upon merchant authorization.
- Special access: For sensitive or highly functional APIs, developers need to submit detailed apps to Genstore for approval.
For more details on access scope, see Access scope.
Version management
The Genstore REST API regularly releases new versions to address evolving business needs. You can specify the desired version in your requests, with the current default version being 202412.
For more details on access scope, see Version management.