Creates an application charge
Description
Create a one-time charge for an app feature or service that doesn't need recurring billing, such as a completed bulk import of orders.
The mutation returns a `confirmationUrl` that the merchant must visit to approve the charge.
After the merchant approves the charge, they're redirected to the `returnUrl` that the app provides.
Learn more about [one-time app purchases](https://shopify.dev/docs/apps/launch/billing/manual-pricing/support-one-time-purchases).
Query
mutation AppPurchaseOneTimeCreate($name: String!, $price: MoneyInput!, $returnUrl: URL!) {
appPurchaseOneTimeCreate(name: $name, returnUrl: $returnUrl, price: $price) {
userErrors {
field
message
}
appPurchaseOneTime {
createdAt
id
}
confirmationUrl
}
}
Variables
{
"name": "1,000 imported orders",
"returnUrl": "https://order-importer.example.com/billing/complete",
"price": {
"amount": 10,
"currencyCode": "USD"
}
}
cURL
curl -X POST \
https://your-development-store.myshopify.com/admin/api/2026-10/graphql.json \
-H 'Content-Type: application/json' \
-H 'X-Shopify-Access-Token: {access_token}' \
-d '{
"query": "mutation AppPurchaseOneTimeCreate($name: String!, $price: MoneyInput!, $returnUrl: URL!) { appPurchaseOneTimeCreate(name: $name, returnUrl: $returnUrl, price: $price) { userErrors { field message } appPurchaseOneTime { createdAt id } confirmationUrl } }",
"variables": {
"name": "1,000 imported orders",
"returnUrl": "https://order-importer.example.com/billing/complete",
"price": {
"amount": 10,
"currencyCode": "USD"
}
}
}'
React Router
import { authenticate } from "../shopify.server";
export const loader = async ({request}) => {
const { admin } = await authenticate.admin(request);
const response = await admin.graphql(
`#graphql
mutation AppPurchaseOneTimeCreate($name: String!, $price: MoneyInput!, $returnUrl: URL!) {
appPurchaseOneTimeCreate(name: $name, returnUrl: $returnUrl, price: $price) {
userErrors {
field
message
}
appPurchaseOneTime {
createdAt
id
}
confirmationUrl
}
}`,
{
variables: {
"name": "1,000 imported orders",
"returnUrl": "https://order-importer.example.com/billing/complete",
"price": {
"amount": 10,
"currencyCode": "USD"
}
},
},
);
const json = await response.json();
return json.data;
}
Ruby
session = ShopifyAPI::Auth::Session.new(
shop: "your-development-store.myshopify.com",
access_token: access_token
)
client = ShopifyAPI::Clients::Graphql::Admin.new(
session: session
)
query = <<~QUERY
mutation AppPurchaseOneTimeCreate($name: String!, $price: MoneyInput!, $returnUrl: URL!) {
appPurchaseOneTimeCreate(name: $name, returnUrl: $returnUrl, price: $price) {
userErrors {
field
message
}
appPurchaseOneTime {
createdAt
id
}
confirmationUrl
}
}
QUERY
variables = {
"name": "1,000 imported orders",
"returnUrl": "https://order-importer.example.com/billing/complete",
"price": {
"amount": 10,
"currencyCode": "USD"
}
}
response = client.query(query: query, variables: variables)
Node.js
const client = new shopify.clients.Graphql({session});
const data = await client.query({
data: {
"query": `mutation AppPurchaseOneTimeCreate($name: String!, $price: MoneyInput!, $returnUrl: URL!) {
appPurchaseOneTimeCreate(name: $name, returnUrl: $returnUrl, price: $price) {
userErrors {
field
message
}
appPurchaseOneTime {
createdAt
id
}
confirmationUrl
}
}`,
"variables": {
"name": "1,000 imported orders",
"returnUrl": "https://order-importer.example.com/billing/complete",
"price": {
"amount": 10,
"currencyCode": "USD"
}
},
},
});
Shopify CLI
shopify app execute \
--query \
'mutation AppPurchaseOneTimeCreate($name: String!, $price: MoneyInput!, $returnUrl: URL!) {
appPurchaseOneTimeCreate(name: $name, returnUrl: $returnUrl, price: $price) {
userErrors {
field
message
}
appPurchaseOneTime {
createdAt
id
}
confirmationUrl
}
}' \
--variables \
'{
"name": "1,000 imported orders",
"returnUrl": "https://order-importer.example.com/billing/complete",
"price": {
"amount": 10,
"currencyCode": "USD"
}
}'
Direct API Access
const response = await fetch('shopify:admin/api/2026-10/graphql.json', {
method: 'POST',
body: JSON.stringify({
query: `
mutation AppPurchaseOneTimeCreate($name: String!, $price: MoneyInput!, $returnUrl: URL!) {
appPurchaseOneTimeCreate(name: $name, returnUrl: $returnUrl, price: $price) {
userErrors {
field
message
}
appPurchaseOneTime {
createdAt
id
}
confirmationUrl
}
}
`,
variables: {
"name": "1,000 imported orders",
"returnUrl": "https://order-importer.example.com/billing/complete",
"price": {
"amount": 10,
"currencyCode": "USD"
}
},
}),
});
const { data } = await response.json();
console.log(data);
Response
{
"appPurchaseOneTimeCreate": {
"userErrors": [],
"appPurchaseOneTime": {
"createdAt": "2026-09-08T14:32:17Z",
"id": "gid://shopify/AppPurchaseOneTime/1017262352"
},
"confirmationUrl": "https://billingshop.myshopify.com/admin/charges/193172482/1017262352/ApplicationCharge/confirm_application_charge?signature=BAh7BzoHaWRpBBAxojw6EmF1dG9fYWN0aXZhdGVU--a03eedf9ef12d714906af085ebc2aa3d97aa9466"
}
}