Gift Card API

Gift Card API

1. Amasty\GiftCard\Api\ImageRepositoryInterface - class for managing gift card images: 
  1. POST /V1/amgcard/image, method="save" - save a gift card image;
  2. PUT /V1/amgcard/image/:id, method="save" - save a gift card image by ID;
  3. DELETE /V1/amgcard/image/:id, method="deleteById" - delete a gift card image by ID;
  4. GET /V1/amgcard/image/:id, method="getById" - get a gift card image by ID;
  5. 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:
  1. POST /V1/amgcard/code-pool, method="save" - create a code pool;
  2. PUT /V1/amgcard/code-pool/:id, method="save" - edit a specific code pool by ID; 
  3. DELETE /V1/amgcard/code-pool/:id, method="deleteById" - delete a code pool by ID;
  4. GET /V1/amgcard/code-pool/:id, method="getById" - get a code pool data by ID; 
  5. 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: 
  1. PUT /V1/amgcard/code-generator/code-pool/:codePoolId/qty/:qty, method="generateCodesForCodePool" - generate gift card codes;
  2. PUT /V1/amgcard/code-generator/code-pool/:codePoolId, method="generateCodesByTemplate" - generate gift card codes by template.

4. Amasty\GiftCardAccount\Api\GiftCardAccountRepositoryInterface - class for gift account processing:
  1. POST /V1/amgcard/account,  method="save" - save a gift card account;
  2. PUT /V1/amgcard/account/, method="save" - save a gift card account by ID;
  3. DELETE /V1/amgcard/account/:id, method="deleteById" - delete a gift card account by ID;
  4. GET /V1/amgcard/account/:id, method="getById"/> - get a gift card account by ID;
  5. GET /V1/amgcard/account/code/:code, method="getByCode - get a gift card account by code;
  6. GET /V1/amgcard/account/order/:orderId, method="getByOrderId" - get a gift card account by order ID;
  7. GET /V1/amgcard/account/all, method="getList" - get all gift card accounts;
  8. POST /V1/amgcard/account/send, method="send" - send a gift card account email;
  9. DELETE /V1/guest-carts/:cartId/gift-card/:giftCardCode, method="removeGiftCardFromCart"/> - delete gift card from guest cart;
  10. PUT /V1/guest-carts/:cartId/gift-card/:giftCardCode, method="applyGiftCardToCart"/> - apply a gift card to guest cart;
  11. DELETE /V1/carts/mine/gift-card/:giftCardCode, method="removeGiftCardFromCart - delete a gift card from customer cart;
  12. PUT /V1/carts/mine/gift-card/:giftCardCode, method="applyGiftCardToCart - apply a gift card to customer cart;
  13. PUT V1/carts/mine/gift-card-account/:giftCardCode, method="applyGiftCardAccountToCart"/> - apply a gift card account to customer cart.


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. 
      • Related Articles

      • Gift Wrap API

        1. Amasty\GiftWrap\Api\WrapRepositoryInterface - class for managing gift wraps: POST /V1/amasty_giftWrap/wrap, method="save" - create a wrap; PUT /V1/amasty_giftWrap/wrap/:entityId, method="save" - edit a wrap; DELETE ...
      • Gift Card | GraphQL methods

        Queries amGiftCardAccount(input: AmGiftCardAccountInput!) description: get gift card account information by code amGiftCardSetting description: get gift card module settings amGiftCardPreview(input: AmGiftCardPreviewInput) description: get rendered ...
      • What Amasty extensions support API?

        Each Amasty extension that has API support, includes the etc/webapi.xml file. The webapi.xml file contains API configurations with the list of available API requests. For example, a request from the Custom Form module interface: 1 - endpoint URL; 2 - ...
      • How to activate the gift card account?

        The gift card account is created automatically when the order is invoiced and paid. If the order has the Complete status, but the code of the gift card is not activated and can't be applied, please contact our team.
      • Advanced Conditions API (+Reward Points, Extra Fee, Free Gift, Shipping Rules, Shipping Restrictions)

        Advanced Conditions can be purchased both separately and within other Amasty modules: Reward Points, Extra Fee, Free Gift, Shipping Rules, Shipping Restrictions. The Advanced Conditions extension adds its functionality to the main modules, which ...