Requires read_orders access scope or read_marketplace_orders access scope.

Returns a Refund resource by ID.


Anchor to id
id
required

The ID of the Refund to return.


Was this section helpful?

Anchor to Refund
Refund
Access requirements

The record of the line items and transactions that were refunded to a customer, along with restocking instructions for refunded line items.


Was this section helpful?

Examples

Hide code
DescriptionCopy
query refund($input: ID!) {
  refund(id: $input) {
    duties {
      originalDuty {
        countryCodeOfOrigin
      }
      amountSet {
        shopMoney {
          amount
        }
      }
    }
  }
}
curl -X POST \
https://your-development-store.myshopify.com/admin/api/2025-01/graphql.json \
-H 'Content-Type: application/json' \
-H 'X-Shopify-Access-Token: {access_token}' \
-d '{
"query": "query refund($input: ID!) { refund(id: $input) { duties { originalDuty { countryCodeOfOrigin } amountSet { shopMoney { amount } } } } }",
 "variables": {
    "input": "gid://shopify/Refund/850600470"
  }
}'
const { admin } = await authenticate.admin(request);

const response = await admin.graphql(
  `#graphql
  query refund($input: ID!) {
    refund(id: $input) {
      duties {
        originalDuty {
          countryCodeOfOrigin
        }
        amountSet {
          shopMoney {
            amount
          }
        }
      }
    }
  }`,
  {
    variables: {
      "input": "gid://shopify/Refund/850600470"
    },
  },
);

const data = await response.json();
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
  query refund($input: ID!) {
    refund(id: $input) {
      duties {
        originalDuty {
          countryCodeOfOrigin
        }
        amountSet {
          shopMoney {
            amount
          }
        }
      }
    }
  }
QUERY

variables = {
  "input": "gid://shopify/Refund/850600470"
}

response = client.query(query: query, variables: variables)
const client = new shopify.clients.Graphql({session});
const data = await client.query({
  data: {
    "query": `query refund($input: ID!) {
      refund(id: $input) {
        duties {
          originalDuty {
            countryCodeOfOrigin
          }
          amountSet {
            shopMoney {
              amount
            }
          }
        }
      }
    }`,
    "variables": {
      "input": "gid://shopify/Refund/850600470"
    },
  },
});
use Shopify\Clients\Graphql;

$client = new Graphql("your-development-store.myshopify.com", $accessToken);
$query = <<<QUERY
  query refund($input: ID!) {
    refund(id: $input) {
      duties {
        originalDuty {
          countryCodeOfOrigin
        }
        amountSet {
          shopMoney {
            amount
          }
        }
      }
    }
  }
QUERY;

$variables = [
  "input" => "gid://shopify/Refund/850600470",
];

$response = $client->query(["query" => $query, "variables" => $variables]);
Hide code
Input variables
Copy
{
  "input": "gid://shopify/Refund/850600470"
}
Hide code
Response
JSON
{
  "refund": {
    "duties": [
      {
        "originalDuty": {
          "countryCodeOfOrigin": "US"
        },
        "amountSet": {
          "shopMoney": {
            "amount": "6.0"
          }
        }
      }
    ]
  }
}