Skip to main content

Reporting Return Fees in Shopify Metafields

How to Report Return Fees in Shopify Metafields for ERP Integration?

Vineeta Pendse avatar
Written by Vineeta Pendse
Updated over a week ago

This feature allows merchants to report return fees in Shopify using metafields. The refund fees deducted for refunds in yayloh will be stored in the order metafields, helping retailers' ERP systems read and process refund fee details for accurate bookkeeping. This integration ensures that all financial records remain accurate and up to date.

Note:

  1. Please reach out to support@yayloh.com to set this up.

  2. ERP Integration: The ERP system should be configured to read the return_fee metafield from orders.


yayloh Metafield Structure

The return fee details will be stored in an order metafield with the following structure:

{
"id": "gid://shopify/Metafield/37791328633111",
"namespace": "yayloh",
"key": "return_fee",
"value": {
"amount": "10.00",
"currency_code": "SEK"
},
"type": "money"
}

How to fetch Return Fees via GraphQL? (For your ERP)

ERP systems can retrieve the return fee data from Shopify using the following GraphQL query:

query {
order(id: "gid://shopify/Order/6344849424663") {
id
name
metafields(first: 10) {
edges {
node {
id
namespace
key
value
type
}
}
}
}
}

Example Response

{
"data": {
"order": {
"id": "gid://shopify/Order/6344849424663",
"name": "DEV51286",
"metafields": {
"edges": [
{
"node": {
"id": "gid://shopify/Metafield/37791328633111",
"namespace": "yayloh",
"key": "return_fee",
"value": "{\"amount\":\"10.00\",\"currency_code\":\"SEK\"}",
"type": "money"
}
}
]
}
}
},
"extensions": {
"cost": {
"requestedQueryCost": 7,
"actualQueryCost

Did this answer your question?