Refunds
Refunds return all or part of a paid order to the customer's original payment method. Use this API to create a refund, follow its progress, cancel it before processing begins, or browse previous refunds.
For an explanation of refund eligibility, lifecycle, and effects on balances and payouts, read the Refunds product guide. This page is the endpoint reference.
Create new refunds through POST /refunds/create.
The refund object
A refund records the amounts requested against an order's line items, why they were returned, where the money is settled, and the refund's current status. Payment-method refunds begin as Inttegro.RefundStatuses.Pending and then become Inttegro.RefundStatuses.Processing, Inttegro.RefundStatuses.Succeeded, or Inttegro.RefundStatuses.Failed. Offline refunds begin as Inttegro.RefundStatuses.Pending and become Inttegro.RefundStatuses.Succeeded only after a trusted operator records the settlement. A refund canceled before processing begins has a Inttegro.RefundStatuses.Canceled status.
Order responses may include the same objects in refunds, with the newest refund first. Optional properties and lifecycle timestamps appear when they have a value.
Each refund line includes an immutable
lineItems[].orderLineItem snapshot when the
originating order can be resolved. Treat it as a union selected by
lineItems[].orderLineItem.type:
"product",
"fee", or
"shipping".
Match the allocation to the order through order_line_item.id.
For product lines, order_line_item.product.id links to the
source catalog product; inline products omit that product ID.
Properties
- Name
cancelReason- Type
string- Description
Explanation supplied when the refund was canceled. Omitted when cancellation did not include a reason. This free-form text is separate from the
reasonrecorded when the refund was created and thefailure.reasonreturned after a terminal failure.
- Name
canceledAt- Type
Date- Description
When the refund entered the
Inttegro.RefundStatuses.Canceledstate. Omitted otherwise.
- Name
createdAt- Type
Date- Description
When the refund was created.
customDataCustomDataClick or tap to expandYour metadata, returned as string values. Omitted when empty.
failureRefundFailureSanitized terminal failure information. Present only when status is failed.Click or tap to expand- Name
detail- Type
string- Description
- Safe explanation of what prevented the refund from completing.
- Name
reason- Type
RefundFailureReason- Description
- Stable failure category. The possible values follow.
- Name
retryable- Type
boolean- Description
- Whether you may be able to resolve the condition before creating a new, intentional refund. It never means that an uncertain request should be repeated blindly.
- Name
failedAt- Type
Date- Description
When the refund entered the
Inttegro.RefundStatuses.Failedstate. Omitted otherwise.
- Name
id- Type
string- Description
Unique refund identifier with the
rf_prefix.
lineItemsRefundLineItem[]Immutable allocations describing how much is refunded for each order line item.Click or tap to expand- Name
id- Type
string- Description
- Server-generated refund line-item ID with the
rli_prefix.
- Name
orderLineItem- Type
RefundOrderLineItem
View order_line_item attributesClick or tap to expand
Immutable snapshot of the original order line. Useorder_line_item.idto match the refund allocation to the order. Discriminate onlineItems[].orderLineItem.typebefore reading the product, fee, or shipping branch. Omitted when the originating order cannot be resolved.- Name
fee- Type
RefundOrderLineItemAdjustment
View fee attributesClick or tap to expand
Fee details captured on the order. Present only whenlineItems[].orderLineItem.typeis"fee".- Name
description- Type
string- Description
- Fee description captured on the order.
- Name
label- Type
string- Description
- Fee label captured on the order.
- Name
id- Type
string- Description
- Original order line-item ID with the
oli_prefix.
View product attributesClick or tap to expand
Product details captured on the order. Present only whenlineItems[].orderLineItem.typeis"product".- Name
quantity- Type
number- Description
- Quantity captured on the order. Present only when
lineItems[].orderLineItem.typeis"product".
View shipping attributesClick or tap to expand
Shipping details captured on the order. Present only whenlineItems[].orderLineItem.typeis"shipping".- Name
description- Type
string- Description
- Shipping description captured on the order.
- Name
label- Type
string- Description
- Shipping label captured on the order.
- Name
type- Type
'product' | 'fee' | 'shipping'- Description
"product","fee", or"shipping".
- Name
originalAmountPaid- Type
Amount
- Name
reason- Type
RefundReason- Description
- Independent reason for refunding this line. Omitted when not provided.
- Name
reasonDetails- Type
string- Description
- Line-specific explanation. Omitted when not provided.
- Name
refundAmount- Type
Amount
- Name
orderId- Type
string- Description
Paid order covered by this refund, with the
or_prefix.
- Name
processingAt- Type
Date- Description
When refund processing began. Omitted until processing starts.
- Name
reason- Type
RefundReason- Description
Overall refund reason:
Inttegro.RefundReasons.Custom,Inttegro.RefundReasons.Duplicate,Inttegro.RefundReasons.Fraudulent,Inttegro.RefundReasons.ItemDamaged,Inttegro.RefundReasons.ItemNotAsDescribed,
Inttegro.RefundReasons.ItemNotReceived,
Inttegro.RefundReasons.ItemReturned,Inttegro.RefundReasons.OrderCanceled, or
Inttegro.RefundReasons.RequestedByCustomer.
- Name
reasonDetails- Type
string- Description
Overall explanation. Omitted when not provided.
- Name
reference- Type
string- Description
Your reconciliation reference. Omitted when not provided.
settlementRefundSettlementImmutable destination captured when the refund is created. The required type discriminator is offline or payment_method.Click or tap to expand- Name
type- Type
'offline' | 'payment_method'- Description
- offline means the order was paid outside Inttegro. payment_method means the refund returns to the original payment method used for the order.
View payment_method attributesClick or tap to expand
Present only when type is payment_method. This is a caller-safe immutable snapshot, not the mutable payment-method management object.- Name
id- Type
string- Description
- Public original payment-method ID with the pm_ prefix.
- Name
type- Type
'mobile_money' | 'bank_account'- Description
- mobile_money or bank_account.
View mobile_money detailsClick or tap to expand
Present only for mobile_money. Includes network, last4, and account_number masked as ****1234.- Name
bankAccount- Type
{ … }
View bank_account detailsClick or tap to expand
Present only for bank_account. Its ghana_bank_account contains last4 and account_number masked as ****1234.
- Name
status- Type
RefundStatus- Description
Current state:
Inttegro.RefundStatuses.Canceled,Inttegro.RefundStatuses.Failed,Inttegro.RefundStatuses.Pending,Inttegro.RefundStatuses.Processing, orInttegro.RefundStatuses.Succeeded.
- Name
succeededAt- Type
Date- Description
When the refund entered the
Inttegro.RefundStatuses.Succeededstate. Omitted otherwise.
The settlement snapshot never contains a full phone or bank-account number, provider identifiers, fingerprints, credentials, verification request IDs, or custom data. Store it with the refund as historical display evidence; use Payment Methods endpoints for current management state.
Failure reason values
Inttegro.RefundFailureReasons.AmountNotSupported— The requested refund amount is not supported.Inttegro.RefundFailureReasons.InsufficientBalance— The available balance cannot fund the refund.-
Inttegro.RefundFailureReasons.OriginalPaymentMethodUnavailable— The original payment method cannot receive the refund. -
Inttegro.RefundFailureReasons.OriginalPaymentNotRefundable— The original payment cannot be refunded. Inttegro.RefundFailureReasons.RefundDeclined— The refund was declined.Inttegro.RefundFailureReasons.RefundNotPermitted— The refund is not permitted.Inttegro.RefundFailureReasons.RefundNotSupported— This refund is not supported.Inttegro.RefundFailureReasons.TemporarilyUnavailable— Refund processing is temporarily unavailable.Inttegro.RefundFailureReasons.Unknown— Inttegro could not safely classify the failure. Do not retry unless support advises you to.
Create a refund
Return all or part of one or more paid order line items. Inttegro sends each amount back through the payment method used for the order. Processing happens asynchronously, so every new refund begins in Inttegro.RefundStatuses.Pending status.
Before creating the refund:
- Read the order to obtain its line-item IDs and current refundable amounts.
- Include each line item once, using the same currency and no more than its remaining refundable amount.
- Reuse the same idempotency key and request body if the result of a request is uncertain.
Request attributes
customDataCustomDataClick or tap to expandOptional metadata for reconciliation. The object can contain at most 25 KB of JSON, and each key can contain at most 256 characters. Stored values are returned as strings.
lineItemsCreateRefundLineItem[]requiredOne to 64 order line-item allocations to refund. Each order line item can appear only once.Click or tap to expand- Name
orderLineItemId- Type
string- Required
- required
- Description
- Order line-item ID with the
oli_prefix. It must belong toorderId.
- Name
reason- Type
RefundReason- Description
- Optional reason specific to this line. It is independent of the overall refund reason. Allowed values:
Inttegro.RefundReasons.Custom,Inttegro.RefundReasons.Duplicate,Inttegro.RefundReasons.Fraudulent,Inttegro.RefundReasons.ItemDamaged,Inttegro.RefundReasons.ItemNotAsDescribed,Inttegro.RefundReasons.ItemNotReceived,Inttegro.RefundReasons.ItemReturned,Inttegro.RefundReasons.OrderCanceled, orInttegro.RefundReasons.RequestedByCustomer.
- Name
reasonDetails- Type
string- Description
- Optional line-specific explanation, up to 2,048 characters. Requires a line-level reason and is required when that reason is
Inttegro.RefundReasons.Custom.
- Name
refundAmount- Type
AmountParams- Required
- required
View refund_amount attributesClick or tap to expand
Positive amount to refund for this line. It cannot exceed the remaining refundable amount.
- Name
orderId- Type
string- Required
- required
- Description
Paid order to refund, using the
or_ID returned by Inttegro.
- Name
reason- Type
RefundReason- Required
- required
- Description
Overall refund reason. Allowed values:
Inttegro.RefundReasons.Custom,Inttegro.RefundReasons.Duplicate,Inttegro.RefundReasons.Fraudulent,Inttegro.RefundReasons.ItemDamaged,Inttegro.RefundReasons.ItemNotAsDescribed,Inttegro.RefundReasons.ItemNotReceived,Inttegro.RefundReasons.ItemReturned,Inttegro.RefundReasons.OrderCanceled, orInttegro.RefundReasons.RequestedByCustomer.
- Name
reasonDetails- Type
string- Description
Optional overall explanation, up to 2,048 characters. Required when
reasonisInttegro.RefundReasons.Custom.
- Name
reference- Type
string- Description
Optional non-empty reconciliation reference, up to 256 characters.
Response
Returns the new refund in Inttegro.RefundStatuses.Pending status. Save its id and use Lookup a refund when you need its latest status.
Request
import * as Inttegro from '@inttegro/inttegro-sdk'
const inttegro = new Inttegro.InttegroClient({
apiKey: process.env.INTTEGRO_API_KEY!,
})
const result = await inttegro.refunds.create({
customData: {
warehouse: "accra",
},
lineItems: [
{
orderLineItemId: "oli_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMN",
reason: Inttegro.RefundReasons.ItemDamaged,
reasonDetails: "Packaging was crushed.",
refundAmount: {
currency: "ghs",
value: 2500,
},
},
{
orderLineItemId: "oli_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmn",
refundAmount: {
currency: "ghs",
value: 1000,
},
},
],
orderId: "or_0123456789abcdefghijklmnopqrstuvwxyzABCD",
reason: Inttegro.RefundReasons.RequestedByCustomer,
reasonDetails: "Customer returned part of the order.",
reference: "return_1042",
}, {
idempotencyKey: "refund-return-1042",
})
Response excerpt
- Object
- JSON
RefundResponse {
refund: { … },
}
{
"refund": {
"created_at": "2026-08-30T12:00:00Z",
"custom_data": { … },
"id": "rf_1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZabcd",
"line_items": [ … ],
"order_id": "or_0123456789abcdefghijklmnopqrstuvwxyzABCD",
"reason": "requested_by_customer",
"reason_details": "Customer returned part of the order.",
"reference": "return_1042",
"settlement": { … },
"total": { … },
"status": "pending"
}
}
Cancel a refund
Cancel a refund while its status is Inttegro.RefundStatuses.Pending, before Inttegro begins processing it. Cancellation releases the balance reserved for the refund and restores the affected order lines' refundable amounts.
A refund cannot be canceled once it is Inttegro.RefundStatuses.Processing, Inttegro.RefundStatuses.Succeeded, or Inttegro.RefundStatuses.Failed. Repeating this operation for an already canceled refund returns the same refund, making retries safe when you reuse the same idempotency key and request body.
Request attributes
- Name
reason- Type
string- Description
Optional explanation for canceling the refund. Inttegro removes leading and trailing whitespace; when supplied, the remaining text must contain 1–2,048 characters. It is returned as
cancelReason. An idempotent repeat preserves the explanation recorded by the first successful cancellation.
- Name
refundId- Type
string- Required
- required
- Description
Refund to cancel, with the
rf_prefix.
requestMetaRequestMetaOptional body-level idempotency key. Prefer the Idempotency-Key header for new integrations.Click or tap to expand- Name
idempotencyKey- Type
string- Description
- Stable retry key from 1 through 255 characters. It must match the Idempotency-Key header when both are present.
Response
Returns the refund in Inttegro.RefundStatuses.Canceled status. When a reason was supplied, the response includes cancelReason; the selected SDK view shows its native property name.
Request
import * as Inttegro from '@inttegro/inttegro-sdk'
const inttegro = new Inttegro.InttegroClient({
apiKey: process.env.INTTEGRO_API_KEY!,
})
const result = await inttegro.refunds.cancel({
reason: "Customer asked us to stop the return.",
refundId: "rf_1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZabcd",
}, {
idempotencyKey: "cancel-refund-return-1042",
})
Lookup a refund
Retrieve a refund's current status and line-item amounts. Use this after creating or canceling a refund, or when helping a customer with a return.
Request attributes
- Name
refundId- Type
string- Required
- required
- Description
Refund to retrieve, with the
rf_prefix.
Response
Returns the requested refund.
Request
import * as Inttegro from '@inttegro/inttegro-sdk'
const inttegro = new Inttegro.InttegroClient({
apiKey: process.env.INTTEGRO_API_KEY!,
})
const result = await inttegro.refunds.lookup({
refundId: "$INTTEGRO_REFUND_ID",
})
List refunds
Browse refunds from newest to oldest. Use this endpoint to build refund history, customer-service, and reconciliation views.
Pages are one-based. pageSize defaults to 256, and the response's size is the number of refunds actually returned. An empty page is successful and contains size set to 0 and an empty refunds collection.
Request attributes
- Name
pageNumber- Type
number- Required
- required
- Description
Page to retrieve, from
1through10.
- Name
pageSize- Type
number- Description
Maximum refunds to request, from
1through256. Defaults to256.
Response
Returns the page number, number of results, and a refunds array. An empty page returns an empty refunds collection and size set to 0.
Request
import * as Inttegro from '@inttegro/inttegro-sdk'
const inttegro = new Inttegro.InttegroClient({
apiKey: process.env.INTTEGRO_API_KEY!,
})
const result = await inttegro.refunds.page({
pageNumber: 1,
pageSize: 20,
})
Handling refund failures
Request errors and terminal refund failures are different. A request rejected
before a refund is created uses the standard error envelope.
An accepted refund that later reaches
Inttegro.RefundStatuses.Failed includes
failure.
Use the reason to choose the next step:
Inttegro.RefundFailureReasons.AmountNotSupported— Retrieve the current order and correct the amount before creating a new refund.Inttegro.RefundFailureReasons.InsufficientBalance— Restore sufficient available balance before creating a new refund.-
Inttegro.RefundFailureReasons.OriginalPaymentMethodUnavailable— Do not submit the same refund again. Contact support if another return route is needed. -
Inttegro.RefundFailureReasons.OriginalPaymentNotRefundable— Do not submit the same refund again. Contact support if the customer still needs another return route. -
Inttegro.RefundFailureReasons.RefundDeclined— Readfailure.detailbefore deciding whether the condition can be corrected. Inttegro.RefundFailureReasons.RefundNotPermitted— Retrieve the current order and refund state, then correct the eligibility issue before creating a new refund.Inttegro.RefundFailureReasons.RefundNotSupported— Do not submit the same refund again. Contact support if another return route is needed.Inttegro.RefundFailureReasons.TemporarilyUnavailable— Wait before creating a new refund, and first confirm that the existing refund is terminal.Inttegro.RefundFailureReasons.Unknown— Treat the failure as non-retryable unless support advises otherwise.- When
failure.retryableistrue, resolve the reported condition before creating a new, intentional refund. It is not permission to repeat a refund whose status is stillInttegro.RefundStatuses.Processing. - A timeout or uncertain provider outcome remains
Inttegro.RefundStatuses.Processing; it is never represented as a terminal failure reason.
Related resources
- Refunds product guide — Understand eligibility, lifecycle, balances, and payouts.
- Lookup an order — Read the paid order and its line-item IDs before creating a refund.
- Errors — Handle Inttegro API errors consistently.