The REST Admin API is a legacy API as of October 1, 2024. All apps and integrations should be built with the GraphQL Admin API. For details and migration steps, visit our migration guide.

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?

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:


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

Was this section helpful?
Request body
applicationcharge
Application_charge resource
Was this section helpful?
post
/admin/api/2024-10/application_charges.json
Copy
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/2024-10/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": 1017262350,
    "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": "2024-09-19T10:13:00-04:00",
    "updated_at": "2024-09-19T10:13:00-04:00",
    "currency": "USD",
    "charge_type": null,
    "decorated_return_url": "http://super-duper.shopifyapps.com/?charge_id=1017262350",
    "confirmation_url": "https://jsmith.myshopify.com/admin/charges/755357713/1017262350/ApplicationCharge/confirm_application_charge?signature=BAh7BzoHaWRpBA4xojw6EmF1dG9fYWN0aXZhdGVU--2464d6c107837471fc7e579542e7dfa197a95f6d"
  }
}

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?
Was this section helpful?
get
/admin/api/2024-10/application_charges.json
Copy
curl -X GET "https://your-development-store.myshopify.com/admin/api/2024-10/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": "2024-09-19T10:10:57-04:00",
      "updated_at": "2024-09-19T10:10:57-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": "2024-09-19T10:10:57-04:00",
      "updated_at": "2024-09-19T10:10:57-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": "2024-09-19T10:10:57-04:00",
      "updated_at": "2024-09-19T10:10:57-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?
Path parameters
applicationchargeid=675931192
string
required
Was this section helpful?
get
/admin/api/2024-10/application_charges/675931192.json
Copy
curl -X GET "https://your-development-store.myshopify.com/admin/api/2024-10/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": "2024-09-19T10:10:57-04:00",
    "updated_at": "2024-09-19T10:10:57-04:00",
    "currency": "USD",
    "charge_type": null,
    "decorated_return_url": "http://google.com?charge_id=675931192"
  }
}