AdministrationClientOpenCardBatch Method |
Initialise the Batch for Generating a Batch of new Cards. The service returns the Batch Details, containing a key for calling the Service: QueryCardBatch.
Cards can be generated with a specified value loaded.
public ResultOfBatch OpenCardBatch( ManagementGroupRequestOfCardBatchOpen request )
using (var svc = new AdministrationService.AdministrationClient()) { var request = new AdministrationService.ManagementGroupRequestOfCardBatchOpen(); request.Token = "Token";//Required - Token returned from AccountService.ManagementGroupLogin request.ManagementGroup = "Management group";//Required - ManagementGroup supplied when calling AccountService.ManagementGroupLogin var cardBatchOpen = new AdministrationService.CardBatchOpen(); cardBatchOpen.BatchOwnerRSN = new Guid("4469eb02-5832-4d87-b44e-a33622fb8494");; //Required - security account RSN of the logged in user cardBatchOpen.ProgramRSN = new Guid("ac501843-5384-4754-870c-0a7ed14cfb61");; //Required cardBatchOpen.CardType = "VIRTUAL"; //Required - valid values are : 'STANDARD', 'INSTORE' or 'VIRTUAL' cardBatchOpen.NumCardsToCreate = 10; //Required cardBatchOpen.HomeBranchPartnerRSN = new Guid("89257d14-a681-468c-a650-630e7419f082");; //Required cardBatchOpen.BatchOwnerDisplayValue = "New card batch creation"; //Optional cardBatchOpen.PreLoadBalance = 25M; //Optional if (cardBatchOpen.PreLoadBalance > 0) { //set billing fields if PreLoadBalance is greater than 0 cardBatchOpen.BillingPartnerRSN = new Guid("b8c7bf8e-28f9-4f75-84db-eb3d745f03b1");; //Required cardBatchOpen.PurchaseOrderNumber = string.Empty;//Optional cardBatchOpen.InternalReference1 = string.Empty;//Optional cardBatchOpen.InternalReference2 = string.Empty;//Optional } request.Value = cardBatchOpen;//Required AdministrationService.ResultOfBatch result = svc.OpenCardBatch(request); if (result.FaultCode == 0) { //Request succeeded } else { //Request failed throw new Exception(result.FaultDescription); } }