HomeGuidesAPI ReferenceChangelogDiscussions
GuidesiMIS ProfessionaliMIS EnterpriseClient SupportLog In
Guides

Example: Tokenizing a credit card that is saved as an AutoPay account

🚧

For iMIS 2017 Only

Due to DataVault updates this is not applicable to cloud versions of iMIS.

Once you have the PaymentMethodId of the payment card and the gateway with which the card is processed, you can tokenize a credit card that is saved as an AutoPay account:

{   
    "$type":"Asi.Soa.Commerce.DataContracts.AutoPayAccountData, Asi.Contracts", 
    "AccountData":{   
       "$type":"Asi.Services.DataVault.Contracts.CardAccountData, Asi.Contracts", 
       "CardNumber":"4111111111111111", 
       "ContactName":"Mr. James B. Soup, Jr.", 
       "ExpirationDate":"2022-01-01T00:00:00.000Z", 
       "Address":{   
          "$type":"Asi.Soa.Membership.DataContracts.AddressData, Asi.Contracts", 
          "AddressId":"af4dff9a-304b-496e-873b-6099e7b6acc9", 
          "AddressLines":{   
             "$type":"Asi.Soa.Membership.DataContracts.AddressLineDataCollection, Asi.Contracts", 
             "$values":[   
                "P.O. Box 8765" 
             ] 
          }, 
          "Barcode":"", 
          "CityName":"Dallas", 
          "CountryCode":"US", 
          "CountryName":"United States", 
          "CountrySubEntityCode":"TX", 
          "CountrySubEntityName":"Texas", 
          "CountyName":"Texas", 
          "DeliveryPointCode":"0", 
          "FullAddress":"P.O. Box 8765\r\nDallas, TX 75206-8765\r\n\r\nUnited States", 
          "PostalCode":"75206-8765", 
          "VerificationStatus":0, 
          "VerifiedOn":"0001-01-01T00:00:00" 
       }, 
       "ContactId":"5a1d9250-d2f1-43dd-b587-5257f413031a" 
    }, 
    "Payer":{   
       "$type":"Asi.Soa.Commerce.DataContracts.AccountPayerInformationData, Asi.Contracts", 
       "PayerId":"5a1d9250-d2f1-43dd-b587-5257f413031a", 
       "PayerName":"Mr. James B. Soup, Jr.", 
       "PayerAddress":{   
          "$type":"Asi.Soa.Membership.DataContracts.AddressData, Asi.Contracts", 
          "AddressId":"af4dff9a-304b-496e-873b-6099e7b6acc9", 
          "AddressLines":{   
             "$type":"Asi.Soa.Membership.DataContracts.AddressLineDataCollection, Asi.Contracts", 
             "$values":[   
                "P.O. Box 8765" 
             ] 
          }, 
          "Barcode":"", 
          "CityName":"Dallas", 
          "CountryCode":"US", 
          "CountryName":"United States", 
          "CountrySubEntityCode":"TX", 
          "CountrySubEntityName":"Texas", 
          "CountyName":"Texas", 
          "DeliveryPointCode":"0", 
          "FullAddress":"P.O. Box 8765\r\nDallas, TX 75206-8765\r\n\r\nUnited States", 
          "PostalCode":"75206-8765", 
          "VerificationStatus":0, 
          "VerifiedOn":"0001-01-01T00:00:00" 
       } 
    }, 
    "PaymentMethodId":"994567cd-3666-498a-89ff-94b45b9b76c8", 
    "ApplicationRestrictions":{   
       "$type":"Asi.Soa.Commerce.DataContracts.ApplicationRestrictionDataCollection, Asi.Contracts", 
       "$values":[   
          {   
             "$type":"Asi.Soa.Commerce.DataContracts.ApplicationRestrictionData, Asi.Contracts", 
             "RestrictionType":8, 
             "UniformId":"b6bf6c97-8341-45a6-a42d-524498c71c3e" 
          } 
       ] 
    } 
}

📘

Note:

The ApplicationRestrictions section allows for automatically cleaning up or destroying these cards when they are no longer useful.

The UniformId must be the overall batch ID.

Example: AutoPayAccountID result

You can see how the PaymentMethodId of the payment card and the gateway can be used to return the AutoPayAccountId:

{  
   "$type":"Asi.Soa.Commerce.DataContracts.AutoPayAccountData, Asi.Contracts",
   "AutoPayAccountId":"9a17d20a-7f53-4217-a4fd-ccfa80b6bc98",
   "Status":"Active",
   "PaymentTokenId":"2718e64d-bb86-e911-ba3f-d89ef3323877",
   "PaymentTokenExpirationDate":"2021-01-31T00:00:00",
   "PaymentMethodSummary":"Visa ************1111 01/2021",
   "Payer":{  
      "$type":"Asi.Soa.Commerce.DataContracts.AccountPayerInformationData, Asi.Contracts",
      "PayerName":"Mr. James B. Soup, Jr.",
      "PayerId":"5a1d9250-d2f1-43dd-b587-5257f413031a",
      "PayerAddress":{  
         "$type":"Asi.Soa.Membership.DataContracts.AddressData, Asi.Contracts",
         "AddressId":"af4dff9a-304b-496e-873b-6099e7b6acc9",
         "AddressLines":{  
            "$type":"Asi.Soa.Membership.DataContracts.AddressLineDataCollection, Asi.Contracts",
            "$values":[  
               "P.O. Box 8765"
            ]
         },
         "Barcode":"",
         "CityName":"Dallas",
         "CountryCode":"US",
         "CountryName":"United States",
         "CountrySubEntityCode":"TX",
         "CountrySubEntityName":"Texas",
         "CountyName":"Texas",
         "DeliveryPointCode":"0",
         "FullAddress":"P.O. Box 8765\r\nDallas, TX 75206-8765\r\n\r\nUnited States",
         "PostalCode":"75206-8765",
         "VerificationStatus":0,
         "VerifiedOn":"0001-01-01T00:00:00"
      }
   },
   "PaymentMethodId":"44d95682-d218-4fde-9187-254fff7a721a",
   "AccountType":1,
   "IsAvailableToDisable":true,
   "DisableMessage":"",
   "ApplicationRestrictions":{  
      "$type":"Asi.Soa.Commerce.DataContracts.ApplicationRestrictionDataCollection, Asi.Contracts",
      "$values":[  
         {  
            "$type":"Asi.Soa.Commerce.DataContracts.ApplicationRestrictionData, Asi.Contracts",
            "ExtensionData":null,
            "RestrictionType":8,
            "UniformId":"a0c7cbc3-978f-48f2-baff-6f72c35d510f"
         }
      ]
   },
   "PaymentMethodIsReadOnly":false
}