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.
Call through Alter
Section titled “Call through Alter”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 osfrom alter_sdk import Appfrom 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()| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Additional keys: not allowed |
query | object | Optional | Additional keys: not allowed |
path | object | Required within parent | Additional keys: not allowed |
path.id | string | Required within parent | Minimum length: 1 |
path.refund_id | string | Required within parent | Minimum length: 1 |
headers | object | Required within parent | Additional keys: not allowed |
headers.request-Id | string | Required within parent | The 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
Section titled “Response”Response media type: application/json. The table describes the pinned successful response. Referenced models link to their complete fields.
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | Model | Root | Expand Refund a charge — response body |
Referenced models: Refund a charge — response body
Schemas
Section titled “Schemas”Refund a charge — response body
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Additional keys: allowed |
amount | JSON | Optional | Amount. If no number is specified, the full amount will be used. Decimal string |
amount (anyOf 1) | JSON | Alternative | |
amount (anyOf 1) (anyOf 1) | number | Alternative | |
amount (anyOf 1) (anyOf 2) | string | Alternative | Pattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$ |
amount (anyOf 2) | string | Alternative | |
context | Model | Optional | Expand Create a charge — response body — context Additional data you wish to store for this transaction. |
created | string | Optional | Object create time, in ISO 8601 date-time format, such as YYYY-MM-DDTHH:MM:SSZ Read only: true |
description | string | Optional | Description. |
id | string | Optional | System generated alpha-numeric id. Conditionally required |
status | string | Optional | Status of the refund. Valid status types include: ISSUED , DECLINED , SETTLED , VOIDED and SUCCEEDED . Read only: true |
type | string | Optional | The type of refund. Valid type include: REFUND or VOID . |
Referenced models: Create a charge — response body — context
Create a charge — response body — context
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Additional keys: allowed |
deviceInfo | Model | Optional | Expand Create an e Check — response body — context Provides info about the device used to swipe or take payments. |
isEcommerce | JSON | Optional | Flag that indicates if the charge is an eCommerce transaction made over the web. |
isEcommerce (anyOf 1) | boolean | Alternative | |
isEcommerce (anyOf 2) | string | Alternative | Known values: true, false |
lodging | Model | Optional | Expand Create a charge — response body — context lodging For lodging transactions, provides details about the lodging. |
mobile | JSON | Optional | Flag 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) | boolean | Alternative | |
mobile (anyOf 2) | string | Alternative | Known values: true, false |
recurring | JSON | Optional | This is set to true if the charge is recurring. Note : This value ignored for capture and refund requests. |
recurring (anyOf 1) | boolean | Alternative | |
recurring (anyOf 2) | string | Alternative | Known values: true, false |
restaurant | Model | Optional | Expand Create a charge — response body — context restaurant For restaurant transactions, provides details about the restaurant. |
tax | JSON | Optional | |
tax (anyOf 1) | JSON | Alternative | The sales tax required for commercial card processing. Decimal string |
tax (anyOf 1) (anyOf 1) | JSON | Alternative | |
tax (anyOf 1) (anyOf 1) (anyOf 1) | number | Alternative | |
tax (anyOf 1) (anyOf 1) (anyOf 2) | string | Alternative | Pattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$ |
tax (anyOf 1) (anyOf 2) | string | Alternative | |
tax (anyOf 2) | null | Alternative |
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
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Additional keys: allowed |
encrypted | JSON | Optional | The device's encryption status. |
encrypted (anyOf 1) | boolean | Alternative | |
encrypted (anyOf 2) | string | Alternative | Known values: true, false |
id | string | Optional | The device's ID. Conditionally required |
ipAddress | string | Optional | The device's IP address. |
latitude | string | Optional | The device's latitude coordinates. |
longitude | string | Optional | The device's longitude coordinates. |
macAddress | string | Optional | The device's media access control (MAC) address. |
phoneNumber | string | Optional | The device's phone number (if available). |
type | string | Optional | The type of device. |
Create a charge — response body — context lodging
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Additional keys: allowed |
chargeType | string | Optional | Indicates the specific lodging or non-lodging service charged to the customer. Valid values: ConventionFees GiftShop Golf HealthClub Hotel Restaurant Salon Tennis |
checkInDate | string | Optional | The 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 . |
checkOutDate | string | Optional | The 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 . |
extraCharges | array | Optional | Indicates 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[] | string | Each item | |
folioID | string | Optional | The 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. |
lengthOfStay | JSON | Optional | The anticipated, actual, or icremental length of stay, depending on the transaction type. Decimal string |
lengthOfStay (anyOf 1) | JSON | Alternative | |
lengthOfStay (anyOf 1) (anyOf 1) | number | Alternative | |
lengthOfStay (anyOf 1) (anyOf 2) | string | Alternative | Pattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$ |
lengthOfStay (anyOf 2) | string | Alternative | |
roomRate | JSON | Optional | The 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) | JSON | Alternative | |
roomRate (anyOf 1) (anyOf 1) | number | Alternative | |
roomRate (anyOf 1) (anyOf 2) | string | Alternative | Pattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$ |
roomRate (anyOf 2) | string | Alternative | |
specialProgram | string | Optional | Indicates 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 |
totalAuthAmount | JSON | Optional | The 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) | JSON | Alternative | |
totalAuthAmount (anyOf 1) (anyOf 1) | number | Alternative | |
totalAuthAmount (anyOf 1) (anyOf 2) | string | Alternative | Pattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$ |
totalAuthAmount (anyOf 2) | string | Alternative |
Create a charge — response body — context restaurant
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Additional keys: allowed |
beverageAmount | JSON | Optional | The amount of the current charge attributed to beverages. Decimal string |
beverageAmount (anyOf 1) | JSON | Alternative | |
beverageAmount (anyOf 1) (anyOf 1) | number | Alternative | |
beverageAmount (anyOf 1) (anyOf 2) | string | Alternative | Pattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$ |
beverageAmount (anyOf 2) | string | Alternative | |
foodAmount | JSON | Optional | The amount of the current charge attributed to food. Decimal string |
foodAmount (anyOf 1) | JSON | Alternative | |
foodAmount (anyOf 1) (anyOf 1) | number | Alternative | |
foodAmount (anyOf 1) (anyOf 2) | string | Alternative | Pattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$ |
foodAmount (anyOf 2) | string | Alternative | |
serverID | string | Optional | The 2-digit string that identifies the individual server responsible for the transaction. Restaurant assign their own identifiers to their servers. |
taxAmount | JSON | Optional | The amount of the current charge attributed to tax. Decimal string |
taxAmount (anyOf 1) | JSON | Alternative | |
taxAmount (anyOf 1) (anyOf 1) | number | Alternative | |
taxAmount (anyOf 1) (anyOf 2) | string | Alternative | Pattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$ |
taxAmount (anyOf 2) | string | Alternative | |
tipAmount | JSON | Optional | The amount of the current charge attributed to tips. Decimal string |
tipAmount (anyOf 1) | JSON | Alternative | |
tipAmount (anyOf 1) (anyOf 1) | number | Alternative | |
tipAmount (anyOf 1) (anyOf 2) | string | Alternative | Pattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$ |
tipAmount (anyOf 2) | string | Alternative |
Policy, approvals and errors
Section titled “Policy, approvals and errors”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.