curl -X POST "https://mydiscount.eservicii.md/MyDiscount/erp/CheckApiKey" \ -H "Content-Type: application/json" \ -d '{ "mAPIKey": "00000000-0000-0000-0000-000000000000" }'
using System.Net.Http; using System.Net.Http.Json; var client = new HttpClient { BaseAddress = new Uri("https://mydiscount.eservicii.md/MyDiscount/erp/") }; var payload = new { mAPIKey = Guid.Parse("00000000-0000-0000-0000-000000000000") }; var response = await client.PostAsJsonAsync("CheckApiKey", payload); var result = await response.Content.ReadFromJsonAsync<ResponseCheckApiKey>();
{
"ErrorCode": 0,
"ErrorMessage": null
}
| Company | |
| Card | |
| Cash | |
| CashTransaction | |
| ValidatedCard | |
| DiscountProfile |
curl -X POST "https://mydiscount.eservicii.md/MyDiscount/erp/AddBonus" \ -H "Content-Type: application/json" \ -d '{ "APIKey": "11111111-2222-3333-4444-555555555555", "CardID": "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee", "Amount": 25.00, "CashBack": 5.0, "Details": "Invoice #INV-12345", "DateTimeOfSale": "2026-04-30T14:35:00", "PlaceOfSale": "Central Store, Cashier 3" }'
var request = new CashData { APIKey = Guid.Parse(apiKey), CardID = cardId, Amount = 25.00m, CashBack = 5.0m, Details = "Invoice #INV-12345", DateTimeOfSale = DateTime.Now, PlaceOfSale = "Central Store, Cashier 3" }; var response = await client.PostAsJsonAsync("AddBonus", request); var result = await response.Content.ReadFromJsonAsync<ResponseSetCashBack>();
CheckApiKey
POST/MyDiscount/erp/CheckApiKey
| mAPIKey | Guid |
| ErrorCode | EnErrorCode | |
| ErrorMessage | string? |
curl -X POST "https://mydiscount.eservicii.md/MyDiscount/erp/CheckApiKey" \ -H "Content-Type: application/json" \ -d '{ "mAPIKey": "YOUR-API-KEY-HERE" }'
var payload = new { mAPIKey = Guid.Parse(apiKey) }; var resp = await client.PostAsJsonAsync("CheckApiKey", payload);
GetInfoBonusAmount
POST/MyDiscount/erp/GetInfoBonusAmount
| CardID | Guid | ||
| mAPIKey | Guid |
| Amount | decimal | |
| ErrorCode | EnErrorCode | |
| ErrorMessage | string? |
curl -X POST "https://mydiscount.eservicii.md/MyDiscount/erp/GetInfoBonusAmount" \ -H "Content-Type: application/json" \ -d '{ "CardID": "...", "mAPIKey": "YOUR-API-KEY" }'
var payload = new { CardID = cardId, mAPIKey = apiKey }; var resp = await client.PostAsJsonAsync("GetInfoBonusAmount", payload);
AddBonus
POST/MyDiscount/erp/AddBonus
| APIKey | Guid | ||
| CardID | Guid | ||
| Amount | decimal | ||
| CashBack | decimal | ||
| Details | string | ||
| DateTimeOfSale | DateTime | ||
| PlaceOfSale | string |
| TransactionID | Guid | |
| ErrorCode | EnErrorCode | |
| ErrorMessage | string? |
GetBonus
POST/MyDiscount/erp/GetBonus
Transaction
POST/MyDiscount/erp/Transaction
| APIKey | Guid | ||
| CardID | Guid | ||
| Amount | decimal | ||
| BillID | string |
BulkImport
POST/MyDiscountApp/CompanyCards/bulk-import
| APIKey | Guid | ||
| UniqueIdentifier | UniqueField | ||
| PurgeExisting | bool | ||
| Items | CompanyCardImportItem[] |
| 0 | Barcode | |
| 1 | ExternalId | |
| 2 | Phone |
| Barcode | string | |
| ExternalId | string | |
| Phone | string | |
| AccumulatedAmount | decimal | |
| Category | CardCategory | |
| Status | CardStatus | |
| IssuedAt | DateTime | |
| ExpiresAt | DateTime? | |
| Note | string | |
| Description | string |
| Ok | bool | |
| InsertedCount | int | |
| UpdatedCount | int | |
| DeletedCount | int | |
| SkippedCount | int | |
| Errors | string[] |
curl -X POST "https://mydiscount.eservicii.md/MyDiscount/CompanyCards/bulk-import" \ -H "Content-Type: application/json" \ -d '{ "APIKey": "11111111-2222-3333-4444-555555555555", "UniqueIdentifier": 0, "PurgeExisting": false, "Items": [ { "Barcode": "5949000000017", "ExternalId": "ERP-1001", "Phone": "+37369123456", "AccumulatedAmount": 250.50, "Category": 1, "Status": 0, "IssuedAt": "2026-01-15T10:00:00Z", "ExpiresAt": "2028-01-15T00:00:00Z", "Note": "VIP customer" }, { "Barcode": "5949000000024", "ExternalId": "ERP-1002", "Phone": "+37369765432", "Category": 0, "Status": 0 } ] }'
var request = new BulkImportRequest { APIKey = Guid.Parse(apiKey), UniqueIdentifier = UniqueField.Barcode, PurgeExisting = false, Items = new List<CompanyCardImportItem> { new() { Barcode = "5949000000017", ExternalId = "ERP-1001", Phone = "+37369123456", AccumulatedAmount = 250.50m, Category = CardCategory.VIP, Status = CardStatus.Active, IssuedAt = DateTime.UtcNow, ExpiresAt = DateTime.UtcNow.AddYears(2), Note = "VIP customer" }, new() { Barcode = "5949000000024", ExternalId = "ERP-1002", Phone = "+37369765432", Category = CardCategory.Standard, Status = CardStatus.Active } } }; var resp = await client.PostAsJsonAsync("CompanyCards/bulk-import", request); var result = await resp.Content.ReadFromJsonAsync<BulkImportResult>(); Console.WriteLine($"Inserted: {result.InsertedCount}, Updated: {result.UpdatedCount}, Skipped: {result.SkippedCount}"); if (result.Errors?.Count > 0) Console.WriteLine($"Errors: {string.Join('\n', result.Errors)}");
{
"Ok": true,
"InsertedCount": 2,
"UpdatedCount": 0,
"DeletedCount": 0,
"SkippedCount": 0,
"Errors": []
}
CashData
JSON Schema
{
"APIKey": Guid,
"CardID": Guid,
"Amount": decimal,
"CashBack": decimal,
"Details": string,
"DateTimeOfSale": DateTime,
"PlaceOfSale": string // max 200 chars
}
BillData
JSON Schema
{
"APIKey": Guid,
"CardID": Guid,
"Amount": decimal,
"BillID": string
}
ResponseAuthorizeCard
JSON Schema
{
"ErrorCode": EnErrorCode,
"ErrorMessage": string,
"Key": Guid,
"Amount": decimal,
"UserName": string,
"PHID": string,
"PushToken": string,
"DiscountPercent": decimal
}
ResponseSetCashBack
JSON Schema
{
"ErrorCode": EnErrorCode,
"ErrorMessage": string,
"TransactionID": Guid
}
ResponseGetInfoBonusAmount
JSON Schema
{
"ErrorCode": EnErrorCode,
"ErrorMessage": string,
"Amount": decimal
}
BulkImportRequest
JSON Schema
{
"APIKey": Guid,
"UniqueIdentifier": UniqueField, // 0=Barcode, 1=ExternalId, 2=Phone
"PurgeExisting": bool,
"Items": CompanyCardImportItem[]
}
CompanyCardImportItem
JSON Schema
{
"Barcode": string,
"ExternalId": string,
"Phone": string,
"AccumulatedAmount": decimal,
"Category": CardCategory,
"Status": CardStatus,
"IssuedAt": DateTime,
"ExpiresAt": DateTime?,
"Note": string, // max 500
"Description": string // max 5000
}
BulkImportResult
JSON Schema
{
"Ok": bool,
"InsertedCount": int,
"UpdatedCount": int,
"DeletedCount": int,
"SkippedCount": int,
"Errors": string[]
}
| 0 | NoError | |
| — | Invalid_ID | |
| — | Card_not_exist | |
| — | Expired_token | |
| — | Time_card_ID_expired | |
| — | Insufficient_amount_on_card | |
| — | The_amount_is_incorrect | |
| — | APIKey_not_exist | |
| — | Internal_error |
// 1. var auth = await client.GetFromJsonAsync<ResponseAuthorizeCard>( $"AuthorizeCard?TID={tid}&APIKey={apiKey}&PlaceOfSale=Casa-1"); if (auth.ErrorCode != EnErrorCode.NoError) throw new Exception($"Invalid card: {auth.ErrorCode}"); // 2. var info = await client.PostAsJsonAsync("GetInfoBonusAmount", new { CardID = auth.Key, mAPIKey = apiKey }); var infoData = await info.Content.ReadFromJsonAsync<ResponseGetInfoBonusAmount>(); // 3. decimal deUsing = Math.Min(infoData.Amount, 80m); var use = await client.PostAsJsonAsync("GetBonus", new CashData { APIKey = apiKey, CardID = auth.Key, Amount = deUsing, Details = "Partial cashback", DateTimeOfSale = DateTime.Now, PlaceOfSale = "Casa-1" }); // 4. decimal dePlatit = 80m - deUsing;
decimal totalBon = 200m; decimal bonusDeAdaugat = totalBon * 0.05m; var add = await client.PostAsJsonAsync("AddBonus", new CashData { APIKey = apiKey, CardID = cardId, Amount = bonusDeAdaugat, CashBack = 5m, Details = $"Cashback 5% on bill {billId}", DateTimeOfSale = DateTime.Now, PlaceOfSale = "Casa-1" }); var result = await add.Content.ReadFromJsonAsync<ResponseSetCashBack>();
| INTELECTSOFT | |
| sales.edi.md | |
| +373 22 835 312 | |