Skip to content

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.

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);
var service = new ChargeService(myShopifyUrl, shopAccessToken);
var charge = await service.GetAsync(chargeId);
var service = new ChargeService(myShopifyUrl, shopAccessToken);
IEnumerable<Charge> charges = await service.ListAsync();

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);