Added Search for Discount Cards by Number

Tags:

In PluginContext.Operations, a method SearchDiscountCardByNumber has been added, allowing you to retrieve a discount card by its number. Additionally, information about the binding to the price category (PriceCategory) is now available for discount cards.

Previously, a discount card could only be created (CreateOrUpdateDiscountCard), but it could not be found by number. There was a search by id (GetDiscountCardById), but this is useless, as a card is usually identified by its number, including the binding to the client, which is implemented by the card number (CardNumber). Starting from V6/V6Preview5, a discount card can be found by number using SearchDiscountCardByNumber. This method is intended only for personal discount cards. A discount card is considered personal if one issued card corresponds to one object IDiscountCard in the database, where the real card number and the card number in the database match. There are also group discount cards, where clients are issued cards with similar numbers (for example, 777-001, 777-002, …), and a common card is created in the database for all of them, where the number is set by a mask (777-???); searching for such cards is currently unavailable.

There are two ways to reduce the order cost for a loyal customer — provide a discount or apply a special price category. Accordingly, a discount card can be linked to either a discount or a price category. However, previously the API only provided information about the linked discount. Starting from V6/V6Preview5, in addition to DiscountType, a new property PriceCategory has been added to the discount card. Only one of these properties is filled at any time; the other is always null.