1. Amasty\GiftCard\Api\ImageRepositoryInterface - class for managing gift card images:
- POST /V1/amgcard/image, method="save" - save a gift card image;
- PUT /V1/amgcard/image/:id, method="save" - save a gift card image by ID;
- DELETE /V1/amgcard/image/:id, method="deleteById" -delete a gift card image by ID;
- GET /V1/amgcard/image/:id, method="getById" -get a gift card image by ID;
- GET /V1/amgcard/image/all, method="getList" - get a list of all gift card images.
2. Amasty\GiftCard\Api\CodePoolRepositoryInterface -class for managing gift card code pools:
- POST /V1/amgcard/code-pool, method="save" - create a code pool;
- PUT /V1/amgcard/code-pool/:id, method="save" - edit a specific code pool by ID;
- DELETE /V1/amgcard/code-pool/:id, method="deleteById" - delete a code pool by ID;
- GET /V1/amgcard/code-pool/:id, method="getById" - get a code pool data by ID;
- GET /V1/amgcard/code-pool/all, method="getList" - get the list of all code pools.
3. Amasty\GiftCard\Api\CodeGeneratorManagementInterface - class for gift card code generation:
- PUT /V1/amgcard/code-generator/code-pool/:codePoolId/qty/:qty, method="generateCodesForCodePool" - generate gift card codes;
- PUT /V1/amgcard/code-generator/code-pool/:codePoolId, method="generateCodesByTemplate" - generate gift card codes by template.
FAQ
Q: Can I get an example of Gift Card account creation via API?
A: A new gift card account can be created with the following API request: /rest/V1/amgcard/account. It requires specific parameters to be passed in the request body. Please find the example of the request body below:
{
"account": {
"code_id": 1,
"image_id": 1,
"website_id": 1,
"status": 1,
"initial_value": 10,
"current_value": 6
}
}
Fill in the values in the request body with the required data. Kindly note that to create a new entity (i.e. for a request with POST type), you don't need to specify the account ID, since it is auto-incremented.
Click the Send button and check the created gift card account in Magento admin.