One-time Application Charges
One-time application charges
Section titled “One-time application charges”Just like with recurring charges, the Shopify billing API lets you create a one-time application charge on the shop owner’s account. One-time charges cannot be deleted.
Create a one-time charge
Section titled “Create a one-time charge”var service = new ChargeService(myShopifyUrl, shopAccessToken);var charge = new Charge(){ Name = "Lorem Ipsum Charge", Price = 12.34, Test = true, //Marks this charge as a test, meaning it won't charge the shop owner.}
charge = await service.CreateAsync(charge);Retrieve a one-time charge
Section titled “Retrieve a one-time charge”var service = new ChargeService(myShopifyUrl, shopAccessToken);
var charge = await service.GetAsync(chargeId);Listing one-time charges
Section titled “Listing one-time charges”var service = new ChargeService(myShopifyUrl, shopAccessToken);
IEnumerable<Charge> charges = await service.ListAsync();Activating a charge
Section titled “Activating a charge”Just like recurring charges, creating a one-time charge does not actually charge the shop owner. You need to
send them to the charge’s ConfirmationUrl, have them accept the charge, then activate it.
var service = new ChargeService(myShopifyUrl, shopAccessToken);
await service.ActivateAsync(chargeId);