Skip to content

QuickBooks: Get a refund by ID

QuickBooks paymentsCharges.getRefund: arguments, response, policy and SDK examples.

← Payments charges operations · Get started

Operation quickbooks.payments.charges.get_a_refund_by_id

Provider route: GET /quickbooks/v4/payments/charges/{id}/refunds/{refund_id}. Alter supplies the connection’s credentials and routing.

Install @alter-ai/sdk @alter-ai/quickbooks with npm, or alter-sdk-quickbooks with pip. Supply your connected customer’s grant ID and the arguments described below.

import { App } from "@alter-ai/sdk";
import { QuickBooksIntegration } from "@alter-ai/quickbooks";
async function execute(input: Parameters<QuickBooksIntegration["paymentsCharges"]["getRefund"]>[0]) {
const app = new App({ apiKey: process.env.ALTER_API_KEY! });
try {
const provider = new QuickBooksIntegration(app, { grantId: process.env.PROVIDER_GRANT_ID! });
const call = await provider.paymentsCharges.getRefund(input);
const result = await call.wait();
return result.bodyJson();
} finally {
await app.close();
}
}
import os
from alter_sdk import App
from alter_sdk_quickbooks import QuickBooksIntegration
async def execute(arguments):
async with App(api_key=os.environ["ALTER_API_KEY"]) as app:
provider = QuickBooksIntegration(app, {"grant_id": os.environ["PROVIDER_GRANT_ID"]})
call = await provider.payments_charges.get_refund(arguments)
result = await call.wait()
return result.body_json()
FieldTypePresenceDescription and constraints
$objectRootAdditional keys: not allowed
queryobjectOptionalAdditional keys: not allowed
pathobjectRequired within parentAdditional keys: not allowed
path.idstringRequired within parentMinimum length: 1
path.refund_idstringRequired within parentMinimum length: 1
headersobjectRequired within parentAdditional keys: not allowed
headers.request-IdstringRequired within parentThe request-Id that uniquely identifies the HTTP request sent by your app to the server. This lets apps correlate requests and responses in case it needs to resend a request due to a dropped connection.
Maximum length: 50

Response media type: application/json. The table describes the pinned successful response. Referenced models link to their complete fields.

FieldTypePresenceDescription and constraints
$ModelRootExpand Refund a charge — response body

Referenced models: Refund a charge — response body

Refund a charge — response body
FieldTypePresenceDescription and constraints
$objectRootAdditional keys: allowed
amountJSONOptionalAmount. If no number is specified, the full amount will be used.
Decimal string
amount (anyOf 1)JSONAlternative
amount (anyOf 1) (anyOf 1)numberAlternative
amount (anyOf 1) (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
amount (anyOf 2)stringAlternative
contextModelOptionalExpand Create a charge — response body — context
Additional data you wish to store for this transaction.
createdstringOptionalObject create time, in ISO 8601 date-time format, such as YYYY-MM-DDTHH:MM:SSZ
Read only: true
descriptionstringOptionalDescription.
idstringOptionalSystem generated alpha-numeric id.
Conditionally required
statusstringOptionalStatus of the refund. Valid status types include: ISSUED , DECLINED , SETTLED , VOIDED and SUCCEEDED .
Read only: true
typestringOptionalThe type of refund. Valid type include: REFUND or VOID .

Referenced models: Create a charge — response body — context

Create a charge — response body — context
FieldTypePresenceDescription and constraints
$objectRootAdditional keys: allowed
deviceInfoModelOptionalExpand Create an e Check — response body — context
Provides info about the device used to swipe or take payments.
isEcommerceJSONOptionalFlag that indicates if the charge is an eCommerce transaction made over the web.
isEcommerce (anyOf 1)booleanAlternative
isEcommerce (anyOf 2)stringAlternativeKnown values: true, false
lodgingModelOptionalExpand Create a charge — response body — context lodging
For lodging transactions, provides details about the lodging.
mobileJSONOptionalFlag that indicates if the charge was made from a mobile device. The card can be keyed, swiped, dipped or tapped on the merchant's POS device.
mobile (anyOf 1)booleanAlternative
mobile (anyOf 2)stringAlternativeKnown values: true, false
recurringJSONOptionalThis is set to true if the charge is recurring. Note : This value ignored for capture and refund requests.
recurring (anyOf 1)booleanAlternative
recurring (anyOf 2)stringAlternativeKnown values: true, false
restaurantModelOptionalExpand Create a charge — response body — context restaurant
For restaurant transactions, provides details about the restaurant.
taxJSONOptional
tax (anyOf 1)JSONAlternativeThe sales tax required for commercial card processing.
Decimal string
tax (anyOf 1) (anyOf 1)JSONAlternative
tax (anyOf 1) (anyOf 1) (anyOf 1)numberAlternative
tax (anyOf 1) (anyOf 1) (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
tax (anyOf 1) (anyOf 2)stringAlternative
tax (anyOf 2)nullAlternative

Referenced models: Create an e Check — response body — context, Create a charge — response body — context lodging, Create a charge — response body — context restaurant

Create an e Check — response body — context
FieldTypePresenceDescription and constraints
$objectRootAdditional keys: allowed
encryptedJSONOptionalThe device's encryption status.
encrypted (anyOf 1)booleanAlternative
encrypted (anyOf 2)stringAlternativeKnown values: true, false
idstringOptionalThe device's ID.
Conditionally required
ipAddressstringOptionalThe device's IP address.
latitudestringOptionalThe device's latitude coordinates.
longitudestringOptionalThe device's longitude coordinates.
macAddressstringOptionalThe device's media access control (MAC) address.
phoneNumberstringOptionalThe device's phone number (if available).
typestringOptionalThe type of device.
Create a charge — response body — context lodging
FieldTypePresenceDescription and constraints
$objectRootAdditional keys: allowed
chargeTypestringOptionalIndicates the specific lodging or non-lodging service charged to the customer. Valid values: ConventionFees GiftShop Golf HealthClub Hotel Restaurant Salon Tennis
checkInDatestringOptionalThe date of actual or anticipated check-in, depending on the transaction type. The check-in date can't be later than the check-out date. The date format is dates is CCCC-MM-DD where: CCCC : The four-digit year MM : The two digit month DD : The Two digit day For example: June 5, 2019 is represented as 2019-06-05 .
checkOutDatestringOptionalThe date of actual or anticipated check-out, depending on the transaction type. The check-out date must always be later than the check-in date. The date format is dates is CCCC-MM-DD where: CCCC : The four-digit year MM : The two digit month DD : The Two digit day For example: June 5, 2019 is represented as 2019-06-05 .
extraChargesarrayOptionalIndicates if the current charge contains one or more additional charges. This field is only relevant for lodging apps. It indicates the types of extra charges billed to the customer. They usually apply after a customer checks out. Valid values: GiftShop Laundry Minibar Restaurant Telephone Other
extraCharges[]stringEach item
folioIDstringOptionalThe unique ID that identifies the bill for a particular guest's stay. This value can be assigned by a hotel or automatically by lodging apps.
lengthOfStayJSONOptionalThe anticipated, actual, or icremental length of stay, depending on the transaction type.
Decimal string
lengthOfStay (anyOf 1)JSONAlternative
lengthOfStay (anyOf 1) (anyOf 1)numberAlternative
lengthOfStay (anyOf 1) (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
lengthOfStay (anyOf 2)stringAlternative
roomRateJSONOptionalThe nightly rate for the room. This field is only relevant for lodging apps. It should represent the nightly rate for the room as quoted at the time of reservation, including the taxes. If the reservation spans multiple days, provide the average rate for those days.
Decimal string
roomRate (anyOf 1)JSONAlternative
roomRate (anyOf 1) (anyOf 1)numberAlternative
roomRate (anyOf 1) (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
roomRate (anyOf 2)stringAlternative
specialProgramstringOptionalIndicates if the current charge is a normal room charge, an advance deposit, and so forth. This field is only relevant for lodging apps. It indicates the reason for the charge. Valid values: AdvanceDeposit AssuredReservation DelayedCharge ExpressService NormalCharge NoShowCharge
totalAuthAmountJSONOptionalThe total amount authorized by the card issuer for the current credit card and the current FolioID . It refers to the total amount authorized for the particular card and folio and includes tax and other applicable charges. Apps are responsible for keeping a running total of authorizations and submitting the correct amount in this field.
Decimal string
totalAuthAmount (anyOf 1)JSONAlternative
totalAuthAmount (anyOf 1) (anyOf 1)numberAlternative
totalAuthAmount (anyOf 1) (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
totalAuthAmount (anyOf 2)stringAlternative
Create a charge — response body — context restaurant
FieldTypePresenceDescription and constraints
$objectRootAdditional keys: allowed
beverageAmountJSONOptionalThe amount of the current charge attributed to beverages.
Decimal string
beverageAmount (anyOf 1)JSONAlternative
beverageAmount (anyOf 1) (anyOf 1)numberAlternative
beverageAmount (anyOf 1) (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
beverageAmount (anyOf 2)stringAlternative
foodAmountJSONOptionalThe amount of the current charge attributed to food.
Decimal string
foodAmount (anyOf 1)JSONAlternative
foodAmount (anyOf 1) (anyOf 1)numberAlternative
foodAmount (anyOf 1) (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
foodAmount (anyOf 2)stringAlternative
serverIDstringOptionalThe 2-digit string that identifies the individual server responsible for the transaction. Restaurant assign their own identifiers to their servers.
taxAmountJSONOptionalThe amount of the current charge attributed to tax.
Decimal string
taxAmount (anyOf 1)JSONAlternative
taxAmount (anyOf 1) (anyOf 1)numberAlternative
taxAmount (anyOf 1) (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
taxAmount (anyOf 2)stringAlternative
tipAmountJSONOptionalThe amount of the current charge attributed to tips.
Decimal string
tipAmount (anyOf 1)JSONAlternative
tipAmount (anyOf 1) (anyOf 1)numberAlternative
tipAmount (anyOf 1) (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
tipAmount (anyOf 2)stringAlternative

SDK function policy ID: quickbooks.payments.charges.get_a_refund_by_id. Catalog operation: payments/charges/get_a_refund_by_id. Rules can name either ID; function rules distinguish managed calls and conservatively cover raw calls sharing the route. Existing grant permissions and policy rules apply. wait() returns an immediate result or waits for a required approval; it never approves the request itself. Persist the approval ID to resume after a restart.

Provider errors retain their response; JSON decoding raises ProviderAPIError for provider failures. ManagedOperationError identifies contract/input/retention errors. See error handling and provider-specific behavior. Sensitive input may be refused before approval storage. A decoding error never resubmits a write.

Official provider source

Report an issue with this page

Necessary

Required for sign-in, security, authorization, and remembering your choices.

Always active

Analytics

Helps us understand how our website, product, and documentation are used.

Performance diagnostics

Uses performance tracing and privacy-masked session replay to diagnose problems.

Advertising

Shares visits and sign-ups with Meta, Reddit, and X so we can measure which of our ads work.

You can change these choices at any time from Cookie settings.