Refund created BUT response does not include the amount refunded

Hi, I create a refund request, it’s successful, however there’s no response in the amount that was refunded.

Request:

{
  "method": "POST",
  "endpoint": "": {
    "query": "mutation RefundCreate($input: RefundInput!) { refundCreate(input: $input) { refund { id totalRefundedSet { presentmentMoney { amount currencyCode } shopMoney { amount currencyCode } } } userErrors { field message } } }",
    "variables": {
      "input": {
        "note": "Product – Damaged Item",
        "notify": true,
        "orderId": "gid://shopify/Order/",
        "currency": "USD",
        "shipping": {
          "amount": "0"
        },
        "transactions": [
          {
            "kind": "REFUND",
            "amount": "61.6",
            "gateway": "shopify_payments",
            "orderId": "gid://shopify/Order/",
            "parentId": "gid://shopify/OrderTransaction/"
          }
        ],
        "refundLineItems": [
          {
            "quantity": 1,
            "lineItemId": "gid://shopify/LineItem/",
            "restockType": "NO_RESTOCK"
          }
        ]
      }
    }
  }
}

Response

{
  "status": 200,
  "body": {
    "data": {
      "refundCreate": {
        "refund": {
          "id": "gid://shopify/Refund/",
          "totalRefundedSet": {
            "shopMoney": {
              "amount": "0.0",
              "currencyCode": "USD"
            },
            "presentmentMoney": {
              "amount": "0.0",
              "currencyCode": "USD"
            }
          }
        },
        "userErrors": []
      }
    },
    "extensions": {
      "cost": {
        "throttleStatus": {
          "restoreRate": 1000,
          "maximumAvailable": 20000,
          "currentlyAvailable": 19980
        },
        "actualQueryCost": 20,
        "requestedQueryCost": 20
      }
    }
  }
}

According to the response and the screenshot, this was successful, but the totalRefundedSet returns the amount as 0.0

Hey @Dev_Siena, did the solution provided by Ceri help?

Yes it did. Will be implementing the solution provided.

1 Like

Perfect! Thanks for the update letting us know.