The REST Admin API is a legacy API as of October 1, 2024. Starting April 1, 2025, all new public apps must be built exclusively with the GraphQL Admin API. For details and migration steps, visit our migration guide.
Application Charge
The ApplicationCharge resource facilitates one-time charges. This type of charge is recommended for apps that aren’t billed on a recurring basis. 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 testing purposes you can include "test": true
when creating the charge. This prevents the credit card from being charged.
Test shops and demo shops can't be charged.
Endpoints
- post/admin/api/latest/application_
charges. json Creates an application charge - get/admin/api/latest/application_
charges. json Retrieves a list of application charges - get/admin/api/latest/application_
charges/{application_ charge_ id}. json Retrieves an application charge
The ApplicationCharge resource
Properties
The URL where the merchant accepts or declines the application charge.
The ID of the application charge.
The application charge name.
The price of the application charge. The minimum price is 0.50, and maximum price is 10,000.
The URL where the merchant is redirected after accepting a charge.
The status of the application charge. Valid values:
Show status properties
- pending: The application charge is pending approval by the merchant.
- accepted: Removed in version 2021-01. The application charge has been accepted by the merchant and is ready to be activated by the app. At this point it will appear on the merchant's invoice. As of API version 2021-01, when a merchant accepts a charge, the charge immediately transitions from
pending
toactive
. - active: The application charge has been activated by the app and will be paid out to the Partner.
- declined: The application charge was declined by the merchant.
- expired: The application charge was not accepted within 2 days of being created.
Whether the application charge is a test transaction. Valid values:true
,null
.
The date and time (ISO 8601 format) when the charge was last updated.
The currency of the price of the application charge.
The ApplicationCharge resource
Anchor to POST request, Creates an application chargepostCreates an application charge
Creates an application charge
Create a test charge that will not cause a credit card to be charged
Create a test charge that will not cause a credit card to be charged
Show application_charge properties
The application charge name.
The price of the application charge. The minimum price is 0.50, and maximum price is 10,000.
The URL where the merchant is redirected after accepting a charge.
Whether the application charge is a test transaction. Valid values:true
,null
.
Create an application charge
Create an application charge
Show application_charge properties
The application charge name.
The price of the application charge. The minimum price is 0.50, and maximum price is 10,000.
The URL where the merchant is redirected after accepting a charge.
Trying to create a charge with a price less than 0.50 will return an error
Trying to create a charge with a price less than 0.50 will return an error
Show application_charge properties
The application charge name.
The price of the application charge. The minimum price is 0.50, and maximum price is 10,000.
The URL where the merchant is redirected after accepting a charge.
Trying to create a charge without a price or name will return an error
Trying to create a charge without a price or name will return an error
Show application_charge properties
The application charge name.
/admin/api/2025-07/application_ charges. json
Response
examples
Create a test charge that will not cause a credit card to be charged
curl -d '{"application_charge":{"name":"Super Duper Expensive action","price":100.0,"return_url":"http://super-duper.shopifyapps.com","test":true}}' \ -X POST "https://your-development-store.myshopify.com/admin/api/2025-07/application_charges.json" \ -H "X-Shopify-Access-Token: {access_token}" \ -H "Content-Type: application/json"
const { admin, session } = await authenticate.admin(request); const application_charge = new admin.rest.resources.ApplicationCharge({session: session}); application_charge.name = "Super Duper Expensive action"; application_charge.price = 100.0; application_charge.return_url = "http://super-duper.shopifyapps.com"; application_charge.test = true; await application_charge.save({ update: true, });
# Session is activated via Authentication test_session = ShopifyAPI::Context.active_session application_charge = ShopifyAPI::ApplicationCharge.new(session: test_session) application_charge.name = "Super Duper Expensive action" application_charge.price = 100.0 application_charge.return_url = "http://super-duper.shopifyapps.com" application_charge.test = true application_charge.save!
// Session is built by the OAuth process const application_charge = new shopify.rest.ApplicationCharge({session: session}); application_charge.name = "Super Duper Expensive action"; application_charge.price = 100.0; application_charge.return_url = "http://super-duper.shopifyapps.com"; application_charge.test = true; await application_charge.save({ update: true, });
response
HTTP/1.1 201 Created{"application_charge":{"id":1017262360,"name":"Super Duper Expensive action","api_client_id":755357713,"price":"100.00","status":"pending","return_url":"http://super-duper.shopifyapps.com/","test":true,"created_at":"2025-07-01T14:41:44-04:00","updated_at":"2025-07-01T14:41:44-04:00","currency":"USD","charge_type":null,"decorated_return_url":"http://super-duper.shopifyapps.com/?charge_id=1017262360","confirmation_url":"https://jsmith.myshopify.com/admin/charges/755357713/1017262360/ApplicationCharge/confirm_application_charge?signature=BAh7BzoHaWRpBBgxojw6EmF1dG9fYWN0aXZhdGVU--9edac431c388d3e493399940a8bd427e4334f6c8"}}
Create an application charge
curl -d '{"application_charge":{"name":"Super Duper Expensive action","price":100.0,"return_url":"http://super-duper.shopifyapps.com"}}' \ -X POST "https://your-development-store.myshopify.com/admin/api/2025-07/application_charges.json" \ -H "X-Shopify-Access-Token: {access_token}" \ -H "Content-Type: application/json"
const { admin, session } = await authenticate.admin(request); const application_charge = new admin.rest.resources.ApplicationCharge({session: session}); application_charge.name = "Super Duper Expensive action"; application_charge.price = 100.0; application_charge.return_url = "http://super-duper.shopifyapps.com"; await application_charge.save({ update: true, });
# Session is activated via Authentication test_session = ShopifyAPI::Context.active_session application_charge = ShopifyAPI::ApplicationCharge.new(session: test_session) application_charge.name = "Super Duper Expensive action" application_charge.price = 100.0 application_charge.return_url = "http://super-duper.shopifyapps.com" application_charge.save!
// Session is built by the OAuth process const application_charge = new shopify.rest.ApplicationCharge({session: session}); application_charge.name = "Super Duper Expensive action"; application_charge.price = 100.0; application_charge.return_url = "http://super-duper.shopifyapps.com"; await application_charge.save({ update: true, });
response
HTTP/1.1 201 Created{"application_charge":{"id":1017262359,"name":"Super Duper Expensive action","api_client_id":755357713,"price":"100.00","status":"pending","return_url":"http://super-duper.shopifyapps.com/","test":null,"created_at":"2025-07-01T14:41:44-04:00","updated_at":"2025-07-01T14:41:44-04:00","currency":"USD","charge_type":null,"decorated_return_url":"http://super-duper.shopifyapps.com/?charge_id=1017262359","confirmation_url":"https://jsmith.myshopify.com/admin/charges/755357713/1017262359/ApplicationCharge/confirm_application_charge?signature=BAh7BzoHaWRpBBcxojw6EmF1dG9fYWN0aXZhdGVU--59eadd25d98cdb5c9fafa6c0bbc73ad48906031f"}}
Trying to create a charge with a price less than 0.50 will return an error
curl -d '{"application_charge":{"name":"Super Duper Expensive action","price":0.4,"return_url":"http://super-duper.shopifyapps.com"}}' \ -X POST "https://your-development-store.myshopify.com/admin/api/2025-07/application_charges.json" \ -H "X-Shopify-Access-Token: {access_token}" \ -H "Content-Type: application/json"
const { admin, session } = await authenticate.admin(request); const application_charge = new admin.rest.resources.ApplicationCharge({session: session}); application_charge.name = "Super Duper Expensive action"; application_charge.price = 0.4; application_charge.return_url = "http://super-duper.shopifyapps.com"; await application_charge.save({ update: true, });
# Session is activated via Authentication test_session = ShopifyAPI::Context.active_session application_charge = ShopifyAPI::ApplicationCharge.new(session: test_session) application_charge.name = "Super Duper Expensive action" application_charge.price = 0.4 application_charge.return_url = "http://super-duper.shopifyapps.com" application_charge.save!
// Session is built by the OAuth process const application_charge = new shopify.rest.ApplicationCharge({session: session}); application_charge.name = "Super Duper Expensive action"; application_charge.price = 0.4; application_charge.return_url = "http://super-duper.shopifyapps.com"; await application_charge.save({ update: true, });
response
HTTP/1.1 422 Unprocessable Entity{"errors":{"price":["must be greater than or equal to the equivalent of $0.50 USD"]}}
Trying to create a charge without a price or name will return an error
curl -d '{"application_charge":{"name":""}}' \ -X POST "https://your-development-store.myshopify.com/admin/api/2025-07/application_charges.json" \ -H "X-Shopify-Access-Token: {access_token}" \ -H "Content-Type: application/json"
const { admin, session } = await authenticate.admin(request); const application_charge = new admin.rest.resources.ApplicationCharge({session: session}); application_charge.name = ""; await application_charge.save({ update: true, });
# Session is activated via Authentication test_session = ShopifyAPI::Context.active_session application_charge = ShopifyAPI::ApplicationCharge.new(session: test_session) application_charge.name = "" application_charge.save!
// Session is built by the OAuth process const application_charge = new shopify.rest.ApplicationCharge({session: session}); application_charge.name = ""; await application_charge.save({ update: true, });
response
HTTP/1.1 422 Unprocessable Entity{"errors":{"name":["can't be blank"],"price":["must be greater than or equal to the equivalent of $0.50 USD"]}}
Anchor to GET request, Retrieves a list of application chargesgetRetrieves a list of application charges
Retrieves a list of application charges
A comma-separated list of fields to include in the response.
Restrict results to after the specified ID.
Retrieve all application charges
Retrieve all application charges
Retrieve all application charges since a specified ID
Retrieve all application charges since a specified ID
Restrict results to after the specified ID.
/admin/api/2025-07/application_ charges. json
Response
examples
Retrieve all application charges
curl -X GET "https://your-development-store.myshopify.com/admin/api/2025-07/application_charges.json" \ -H "X-Shopify-Access-Token: {access_token}"
await admin.rest.resources.ApplicationCharge.all({ session: session, });
# Session is activated via Authentication test_session = ShopifyAPI::Context.active_session ShopifyAPI::ApplicationCharge.all( session: test_session, )
// Session is built by the OAuth process await shopify.rest.ApplicationCharge.all({ session: session, });
response
HTTP/1.1 200 OK{"application_charges":[{"id":556467234,"name":"Green theme","api_client_id":755357713,"price":"120.00","status":"accepted","return_url":"http://google.com","test":null,"external_id":null,"created_at":"2025-07-01T14:37:24-04:00","updated_at":"2025-07-01T14:37:24-04:00","currency":"USD","charge_type":"theme","decorated_return_url":"http://google.com?charge_id=556467234"},{"id":675931192,"name":"iPod Cleaning","api_client_id":755357713,"price":"5.00","status":"accepted","return_url":"http://google.com","test":null,"created_at":"2025-07-01T14:37:24-04:00","updated_at":"2025-07-01T14:37:24-04:00","currency":"USD","charge_type":null,"decorated_return_url":"http://google.com?charge_id=675931192"},{"id":1017262346,"name":"Create me a logo","api_client_id":755357713,"price":"123.00","status":"accepted","return_url":"http://google.com","test":null,"created_at":"2025-07-01T14:37:24-04:00","updated_at":"2025-07-01T14:37:24-04:00","currency":"USD","charge_type":"brokered_service","decorated_return_url":"http://google.com?charge_id=1017262346"}]}
Retrieve all application charges since a specified ID
curl -X GET "https://your-development-store.myshopify.com/admin/api/2025-07/application_charges.json?since_id=556467234" \ -H "X-Shopify-Access-Token: {access_token}"
await admin.rest.resources.ApplicationCharge.all({ session: session, since_id: "556467234", });
# Session is activated via Authentication test_session = ShopifyAPI::Context.active_session ShopifyAPI::ApplicationCharge.all( session: test_session, since_id: "556467234", )
// Session is built by the OAuth process await shopify.rest.ApplicationCharge.all({ session: session, since_id: "556467234", });
response
HTTP/1.1 200 OK{"application_charges":[{"id":675931192,"name":"iPod Cleaning","api_client_id":755357713,"price":"5.00","status":"accepted","return_url":"http://google.com","test":null,"created_at":"2025-07-01T14:37:24-04:00","updated_at":"2025-07-01T14:37:24-04:00","currency":"USD","charge_type":null,"decorated_return_url":"http://google.com?charge_id=675931192"},{"id":1017262346,"name":"Create me a logo","api_client_id":755357713,"price":"123.00","status":"accepted","return_url":"http://google.com","test":null,"created_at":"2025-07-01T14:37:24-04:00","updated_at":"2025-07-01T14:37:24-04:00","currency":"USD","charge_type":"brokered_service","decorated_return_url":"http://google.com?charge_id=1017262346"}]}
Anchor to GET request, Retrieves an application chargegetRetrieves an application charge
Retrieves an application charge
A comma-separated list of fields to include in the response.
Retrieve an application charge
Retrieve an application charge
/admin/api/2025-07/application_ charges/675931192. json
Response
examples
Retrieve an application charge
curl -X GET "https://your-development-store.myshopify.com/admin/api/2025-07/application_charges/675931192.json" \ -H "X-Shopify-Access-Token: {access_token}"
await admin.rest.resources.ApplicationCharge.find({ session: session, id: 675931192, });
# Session is activated via Authentication test_session = ShopifyAPI::Context.active_session ShopifyAPI::ApplicationCharge.find( session: test_session, id: 675931192, )
// Session is built by the OAuth process await shopify.rest.ApplicationCharge.find({ session: session, id: 675931192, });
response
HTTP/1.1 200 OK{"application_charge":{"id":675931192,"name":"iPod Cleaning","api_client_id":755357713,"price":"5.00","status":"accepted","return_url":"http://google.com","test":null,"created_at":"2025-07-01T14:37:24-04:00","updated_at":"2025-07-01T14:37:24-04:00","currency":"USD","charge_type":null,"decorated_return_url":"http://google.com?charge_id=675931192"}}