RecurringApplicationCharge

Version 2019-10

The RecurringApplicationCharge resource facilitates a fixed-value, 30-day recurring charge. You can create an application charge by sending a request with the name the charge should appear under, the price your app is charging, and a return URL where Shopify redirects the merchant after the charge is accepted. After you've created the charge, redirect the merchant to the confirmation URL returned by Shopify. If the charge is declined, then Shopify redirects the merchant and provides a notification message that the app charge was declined. For step-by-step guidance that walks through this flow using examples, see our implementation guide.

Note

For testing purposes you can include "test": true when creating the charge. This prevents the credit card from being charged. Test shops and demo shops cannot be charged.

Updating an application charge

Each shop can have only one recurring charge per app. When a new recurring application charge is activated for a shop that already has one, the existing recurring charge is canceled and replaced by the new charge. The new recurring charge is then activated.

For example, if you want to offer discounted pricing to a specific merchant, then you can create a new application charge for the shop. This will prompt the shop to accept the new charge in order to continue using the app. The new charge replaces the old billing going forward.

What you can do with RecurringApplicationCharge

The Shopify API lets you do the following with the RecurringApplicationCharge resource. More detailed versions of these general actions may be available:

RecurringApplicationCharge properties

activated_on
"activated_on": null

The date and time (ISO 8601 format) when the customer activated the recurring application charge.
Note: The recurring application charge must be activated or the returned value is null.

billing_on
"billing_on": null

The date and time (ISO 8601 format) when the customer is billed.
Note: The recurring application charge must be accepted or the returned value is null.

cancelled_on
"cancelled_on": null

The date and time (ISO 8601 format) when the merchant canceled their recurring application charge.
Note: Returns null when the recurring application charge is not canceled.

capped_amount
"capped_amount": "100"

The limit a customer can be charged for usage based billing. If this property is provided, then you must also provide the terms property. See usage charges for more information.

confirmation_url
"confirmation_url": "https://apple.myshopify.com/admin/charges/confirm_recurring_application_charge?id=654381177&signature=BAhpBHkQASc%3D--374c02da2ea0371b23f40781b8a6d5f4a520e77b"

The URL where the merchant accepts or declines the recurring application charge.

created_at
"created_at": "2013-06-27T08:48:27-04:00"

The date and time (ISO 8601 format) when the recurring application charge was created.

id
"id": 675931192

The ID of the recurring application charge.

name
"name": "Super Duper Expensive action"

The name of the recurring application charge.

price
"price": "100.00"

The price of the recurring application charge. The maximum price is 10,000.

return_url
"return_url": "http://super-duper.shopifyapps.com"

The URL where the merchant is redirected after accepting the charge.

status
"status": "accepted"

The status of the recurring charge. Valid values:

  • pending: The recurring charge is pending.
  • accepted: Removed in version 2021-01. The recurring charge has been accepted. As of API version 2021-01, when a merchant accepts a charge, the charge immediately transitions from pending to active.
  • active: The recurring charge is activated. This is the only status that actually causes a merchant to be charged. As of API version 2021-01, when a merchant accepts a charge, the charge immediately transitions from pending to active.
  • declined: The recurring charge has been declined.
  • expired: The recurring charge was not accepted within 2 days of being created.
  • frozen: The recurring charge is on hold due to a shop subscription non-payment. The charge will re-activate once subscription payments resume.
  • cancelled: The developer cancelled the charge.

terms
"terms": "$1 for 1000 emails"

The terms and conditions of usage based billing charges. Must be present in order to create usage charges, for example when the capped_amount property is provided. Presented to the merchant when they approve an app's usage charges.

test
"test": null

Whether the application charge is a test transaction. Valid values: t