Skip to main content

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.

ApplicationCharge

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.

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 can't be charged.

Was this section helpful?

Anchor to

The ApplicationCharge resource

Anchor to

Properties


confirmation_url

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


created_at

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


id
->
id

The ID of the application charge.


name

The application charge name.


price

The price of the application charge. The minimum price is 0.50, and maximum price is 10,000.


return_url

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


status

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 to active.
  • 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.

test

Whether the application charge is a test transaction. Valid values:true,null.


updated_at

The date and time (ISO 8601 format) when the charge was last updated.


currency

The currency of the price of the application charge.


Was this section helpful?
{}

The ApplicationCharge resource

{
"confirmation_url": "https://jsmith.myshopify.com/admin/charges/confirm_application_charge?id=1012637313&signature=BAhpBIGeWzw%3D--17779c1efb4688e9cfa653a3245f923b4f1eb140",
"created_at": "2013-06-27T08:48:27-04:00",
"id": 675931192,
"name": "Super Duper Expensive action",
"price": "100.00",
"return_url": "http://super-duper.shopifyapps.com",
"status": "accepted",
"test": null,
"updated_at": "2013-06-27T08:48:27-04:00",
"currency": "USD"
}

Anchor to POST request, Creates an application charge
post
Creates an application charge

Creates an application charge

Anchor to Parameters of Creates an application chargeParameters


api_version
string
required

Was this section helpful?

Anchor to post-application-charges-examplesExamples

Create a test charge that will not cause a credit card to be charged

Request body
application_charge
Application_charge resource
Show application_charge properties
application_charge.name:"Super Duper Expensive action"

The application charge name.

application_charge.price:100

The price of the application charge. The minimum price is 0.50, and maximum price is 10,000.

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

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

application_charge.test:true

Whether the application charge is a test transaction. Valid values:true,null.

Create an application charge

Request body
application_charge
Application_charge resource
Show application_charge properties
application_charge.name:"Super Duper Expensive action"

The application charge name.

application_charge.price:100

The price of the application charge. The minimum price is 0.50, and maximum price is 10,000.

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

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

Request body
application_charge
Application_charge resource
Show application_charge properties
application_charge.name:"Super Duper Expensive action"

The application charge name.

application_charge.price:0.4

The price of the application charge. The minimum price is 0.50, and maximum price is 10,000.

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

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

Request body
application_charge
Application_charge resource
Show application_charge properties
application_charge.name:""

The application charge name.

Was this section helpful?
post

/admin/api/2025-07/application_charges.json

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"

{}

Response

JSON
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"
}
}

Anchor to GET request, Retrieves a list of application charges
get
Retrieves a list of application charges

Retrieves a list of application charges


api_version
string
required

fields

A comma-separated list of fields to include in the response.


since_id

Restrict results to after the specified ID.


Was this section helpful?

Retrieve all application charges

Retrieve all application charges since a specified ID

Query parameters
since_id=556467234

Restrict results to after the specified ID.

Was this section helpful?
get

/admin/api/2025-07/application_charges.json

curl -X GET "https://your-development-store.myshopify.com/admin/api/2025-07/application_charges.json" \
-H "X-Shopify-Access-Token: {access_token}"

{}

Response

JSON
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"
}
]
}

Retrieves an application charge


api_version
string
required

application_charge_id
string
required

fields

A comma-separated list of fields to include in the response.


Was this section helpful?

Retrieve an application charge

Path parameters
application_charge_id=675931192
string
required
Was this section helpful?
get

/admin/api/2025-07/application_charges/675931192.json

curl -X GET "https://your-development-store.myshopify.com/admin/api/2025-07/application_charges/675931192.json" \
-H "X-Shopify-Access-Token: {access_token}"

{}

Response

JSON
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"
}
}