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 "pending""pending"refund.StatusPendingRefundStatus.PENDING\Inttegro\Refund\Status::Pendinginttegro.refund.Status.PENDINGInttegro::Refund::Status::PENDINGInttegro.RefundStatuses.Pending and then become "processing""processing"refund.StatusProcessingRefundStatus.PROCESSING\Inttegro\Refund\Status::Processinginttegro.refund.Status.PROCESSINGInttegro::Refund::Status::PROCESSINGInttegro.RefundStatuses.Processing, "succeeded""succeeded"refund.StatusSucceededRefundStatus.SUCCEEDED\Inttegro\Refund\Status::Succeededinttegro.refund.Status.SUCCEEDEDInttegro::Refund::Status::SUCCEEDEDInttegro.RefundStatuses.Succeeded, or "failed""failed"refund.StatusFailedRefundStatus.FAILED\Inttegro\Refund\Status::Failedinttegro.refund.Status.FAILEDInttegro::Refund::Status::FAILEDInttegro.RefundStatuses.Failed. Offline refunds begin as "pending""pending"refund.StatusPendingRefundStatus.PENDING\Inttegro\Refund\Status::Pendinginttegro.refund.Status.PENDINGInttegro::Refund::Status::PENDINGInttegro.RefundStatuses.Pending and become "succeeded""succeeded"refund.StatusSucceededRefundStatus.SUCCEEDED\Inttegro\Refund\Status::Succeededinttegro.refund.Status.SUCCEEDEDInttegro::Refund::Status::SUCCEEDEDInttegro.RefundStatuses.Succeeded only after a trusted operator records the settlement. A refund canceled before processing begins has a "canceled""canceled"refund.StatusCanceledRefundStatus.CANCELED\Inttegro\Refund\Status::Canceledinttegro.refund.Status.CANCELEDInttegro::Refund::Status::CANCELEDInttegro.RefundStatuses.Canceled status.
Order responses may include the same objects in Order.Refundsorder.refundsOrder.Refundsorder.refundsorder.refundsorder.refundsorder.refundsorder.refunds, with the newest refund first. Optional properties and lifecycle timestamps appear when they have a value.
Each refund line includes an immutable LineItems[].OrderLineItemrefund.line_items[].order_line_itemLineItems[].OrderLineItemlineItems[].orderLineItemlineItems[].orderLineItemline_items[].order_line_itemline_items[].order_line_itemlineItems[].orderLineItem snapshot when the
originating order can be resolved. Treat it as a union selected by LineItems[].OrderLineItem.Typerefund.line_items[].order_line_item.typeLineItems[].OrderLineItem.TypelineItems[].orderLineItem.typelineItems[].orderLineItem.typeline_items[].order_line_item.typeline_items[].order_line_item.typelineItems[].orderLineItem.type: "product""product"order.LineItemTypeProduct"product"'product''product'Inttegro::Order::ProductLineItemType::PRODUCT"product", "fee""fee"order.LineItemTypeFee"fee"'fee''fee''fee'"fee", or "shipping""shipping"order.LineItemTypeShipping"shipping"'shipping''shipping''shipping'"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
Refundv13.1.0Go SDK responseRefundv14.0.0Java SDK responseRefundv11.1.0PHP SDK responseRefundv15.0.0Python SDK responseRefundv15.0.0Ruby SDK responseRefundv13.0.0TypeScript SDK responseRefundv15.0.0- #
CancelReasoncancel_reasonCancelReasoncancelReasoncancelReasoncancel_reasoncancel_reasoncancelReasonstring?stringstringString?stringstr | NoneT.nilable(String)stringExplanation supplied when the refund was canceled. Omitted when cancellation did not include a reason. This free-form text is separate from the
Reasonrefund.reasonReasonreasonreasonreasonreasonreasonrecorded when the refund was created and theFailure.Reasonrefund.failure.reasonFailure.Reasonfailure.reasonfailure.reasonfailure.reasonfailure.reasonfailure.reasonreturned after a terminal failure. - #
CanceledAtcanceled_atCanceledAtcanceledAtcanceledAtcanceled_atcanceled_atcanceledAtDateTimeOffset?timestamp*TimeOffsetDateTime?DateTimeImmutabledatetime | NoneT.nilable(Time)DateWhen the refund entered the
"canceled""canceled"refund.StatusCanceledRefundStatus.CANCELED\Inttegro\Refund\Status::Canceledinttegro.refund.Status.CANCELEDInttegro::Refund::Status::CANCELEDInttegro.RefundStatuses.Canceledstate. Omitted otherwise. - #
CreatedAtcreated_atCreatedAtcreatedAtcreatedAtcreated_atcreated_atcreatedAtDateTimeOffset?timestampTimeOffsetDateTimeDateTimeImmutabledatetimeTimeDateWhen the refund was created.
#
CustomDatacustom_dataCustomDatacustomDatacustomDatacustom_datacustom_datacustomDataCustomData?object*DataCustomData?CustomDataCustomData | NoneT.nilable(CustomData)CustomDataClick or tap to expandYour metadata, returned as string values. Omitted when empty.
#
FailurefailureFailurefailurefailurefailurefailurefailureRefundFailure?object*FailureRefundFailure?FailureRefundFailure | NoneT.nilable(Refund::FailureInline)RefundFailureSanitized terminal failure information. Present only when status is failed.Click or tap to expand- #
FailedAtfailed_atFailedAtfailedAtfailedAtfailed_atfailed_atfailedAtDateTimeOffset?timestamp*TimeOffsetDateTime?DateTimeImmutabledatetime | NoneT.nilable(Time)DateWhen the refund entered the
"failed""failed"refund.StatusFailedRefundStatus.FAILED\Inttegro\Refund\Status::Failedinttegro.refund.Status.FAILEDInttegro::Refund::Status::FAILEDInttegro.RefundStatuses.Failedstate. Omitted otherwise. #
LineItemsline_itemsLineItemslineItemslineItemsline_itemsline_itemslineItemsList<RefundLineItem>?object[]LineItemList<RefundLineItem>arraylist[RefundLineItem]T::Array[Refund::LineItem]RefundLineItem[]Immutable allocations describing how much is refunded for each order line item.Click or tap to expand- #
OrderLineItemorder_line_itemOrderLineItemorderLineItemorderLineItemorder_line_itemorder_line_itemorderLineItemRefundOrderLineItem?object*OrderLineItemRefundOrderLineItemarray<string, mixed>RefundOrderLineItem | NoneT.nilable(T.any(Refund::OrderProductLineItem, Refund::OrderFeeLineItem, Refund::OrderShippingLineItem))RefundOrderLineItemView 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 onRefund.LineItems[].OrderLineItem.Typerefund.line_items[].order_line_item.typeRefund.LineItems[].OrderLineItem.Typerefund.lineItems[].orderLineItem.typerefund.lineItems[].orderLineItem.typerefund.line_items[].order_line_item.typerefund.line_items[].order_line_item.typerefund.lineItems[].orderLineItem.typebefore reading the product, fee, or shipping branch. Omitted when the originating order cannot be resolved.- #
FeefeeFeefeefeefeefeefeeDictionary<string, object?>object*OrderLineItemAdjustmentMap<String, Object>array<string, mixed>dict[str, Any]Refund::OrderFeeLineItemFeeRefundOrderLineItemAdjustmentView fee attributesClick or tap to expand
Fee details captured on the order. Present only whenRefund.LineItems[].OrderLineItem.Typerefund.line_items[].order_line_item.typeRefund.LineItems[].OrderLineItem.Typerefund.lineItems[].orderLineItem.typerefund.lineItems[].orderLineItem.typerefund.line_items[].order_line_item.typerefund.line_items[].order_line_item.typerefund.lineItems[].orderLineItem.typeis"fee""fee""fee""fee"'fee''fee''fee'"fee".- #
DescriptiondescriptionDescriptiondescriptiondescriptiondescriptiondescriptiondescriptionstringstringstringStringstringstrT.nilable(String)stringFee description captured on the order.
- #
ProductproductProductproductproductproductproductproductDictionary<string, object?>object*OrderLineItemProductMap<String, Object>array<string, mixed>dict[str, Any]Refund::OrderProductLineItemProductRefundOrderLineItemProductView product attributesClick or tap to expand
Product details captured on the order. Present only whenRefund.LineItems[].OrderLineItem.Typerefund.line_items[].order_line_item.typeRefund.LineItems[].OrderLineItem.Typerefund.lineItems[].orderLineItem.typerefund.lineItems[].orderLineItem.typerefund.line_items[].order_line_item.typerefund.line_items[].order_line_item.typerefund.lineItems[].orderLineItem.typeis"product""product""product""product"'product''product''product'"product". - #
QuantityquantityQuantityquantityquantityquantityquantityquantitylongintegerintLongintintIntegernumberQuantity captured on the order. Present only whenRefund.LineItems[].OrderLineItem.Typerefund.line_items[].order_line_item.typeRefund.LineItems[].OrderLineItem.Typerefund.lineItems[].orderLineItem.typerefund.lineItems[].orderLineItem.typerefund.line_items[].order_line_item.typerefund.line_items[].order_line_item.typerefund.lineItems[].orderLineItem.typeis"product""product""product""product"'product''product''product'"product". - #
ShippingshippingShippingshippingshippingshippingshippingshippingDictionary<string, object?>object*OrderLineItemAdjustmentMap<String, Object>array<string, mixed>dict[str, Any]Refund::OrderShippingLineItemShippingRefundOrderLineItemAdjustmentView shipping attributesClick or tap to expand
Shipping details captured on the order. Present only whenRefund.LineItems[].OrderLineItem.Typerefund.line_items[].order_line_item.typeRefund.LineItems[].OrderLineItem.Typerefund.lineItems[].orderLineItem.typerefund.lineItems[].orderLineItem.typerefund.line_items[].order_line_item.typerefund.line_items[].order_line_item.typerefund.lineItems[].orderLineItem.typeis"shipping""shipping""shipping""shipping"'shipping''shipping''shipping'"shipping".- #
DescriptiondescriptionDescriptiondescriptiondescriptiondescriptiondescriptiondescriptionstringstringstringStringstringstrT.nilable(String)stringShipping description captured on the order.
- #
TypetypeTypetypetypetypetypetypeenumenumOrderLineItemTypeenumstring enumEnumRefund::OrderProductLineItemType'product' | 'fee' | 'shipping'"product""product""product""product"'product''product''product'"product","fee""fee""fee""fee"'fee''fee''fee'"fee", or"shipping""shipping""shipping""shipping"'shipping''shipping''shipping'"shipping".
- #
OriginalAmountPaidoriginal_amount_paidOriginalAmountPaidoriginalAmountPaidoriginalAmountPaidoriginal_amount_paidoriginal_amount_paidoriginalAmountPaidAmount?objectAmountAmountarray<string, mixed>AmountRefund::LineItemOriginalAmountPaidAmountView original_amount_paid attributesClick or tap to expand
Amount originally paid for this order line allocation. - #
ReasonDetailsreason_detailsReasonDetailsreasonDetailsreasonDetailsreason_detailsreason_detailsreasonDetailsstring?stringstringStringstringstr | NoneT.nilable(String)stringLine-specific explanation. Omitted when not provided. - #
RefundAmountrefund_amountRefundAmountrefundAmountrefundAmountrefund_amountrefund_amountrefundAmountAmount?objectAmountAmountarray<string, mixed>AmountRefund::LineItemRefundAmountAmountView refund_amount attributesClick or tap to expand
Amount returned for this line.
- #
ProcessingAtprocessing_atProcessingAtprocessingAtprocessingAtprocessing_atprocessing_atprocessingAtDateTimeOffset?timestamp*TimeOffsetDateTime?DateTimeImmutabledatetime | NoneT.nilable(Time)DateWhen refund processing began. Omitted until processing starts.
- #
ReasonreasonReasonreasonreasonreasonreasonreasonRefundReasonenumReasonRefundReasonGenericValueRefundReasonValueRefund::ReasonRefundReasonOverall refund reason:
"custom""custom"refund.ReasonCustomRefundReason.CUSTOM\Inttegro\Refund\Reason::Custominttegro.refund.Reason.CUSTOMInttegro::Refund::Reason::CUSTOMInttegro.RefundReasons.Custom,"duplicate""duplicate"refund.ReasonDuplicateRefundReason.DUPLICATE\Inttegro\Refund\Reason::Duplicateinttegro.refund.Reason.DUPLICATEInttegro::Refund::Reason::DUPLICATEInttegro.RefundReasons.Duplicate,"fraudulent""fraudulent"refund.ReasonFraudulentRefundReason.FRAUDULENT\Inttegro\Refund\Reason::Fraudulentinttegro.refund.Reason.FRAUDULENTInttegro::Refund::Reason::FRAUDULENTInttegro.RefundReasons.Fraudulent,"item_damaged""item_damaged"refund.ReasonItemDamagedRefundReason.ITEM_DAMAGED\Inttegro\Refund\Reason::ItemDamagedinttegro.refund.Reason.ITEM_DAMAGEDInttegro::Refund::Reason::ITEM_DAMAGEDInttegro.RefundReasons.ItemDamaged,"item_not_as_described""item_not_as_described"refund.ReasonItemNotAsDescribedRefundReason.ITEM_NOT_AS_DESCRIBED\Inttegro\Refund\Reason::ItemNotAsDescribedinttegro.refund.Reason.ITEM_NOT_AS_DESCRIBEDInttegro::Refund::Reason::ITEM_NOT_AS_DESCRIBEDInttegro.RefundReasons.ItemNotAsDescribed,"item_not_received""item_not_received"refund.ReasonItemNotReceivedRefundReason.ITEM_NOT_RECEIVED\Inttegro\Refund\Reason::ItemNotReceivedinttegro.refund.Reason.ITEM_NOT_RECEIVEDInttegro::Refund::Reason::ITEM_NOT_RECEIVEDInttegro.RefundReasons.ItemNotReceived,"item_returned""item_returned"refund.ReasonItemReturnedRefundReason.ITEM_RETURNED\Inttegro\Refund\Reason::ItemReturnedinttegro.refund.Reason.ITEM_RETURNEDInttegro::Refund::Reason::ITEM_RETURNEDInttegro.RefundReasons.ItemReturned,"order_canceled""order_canceled"refund.ReasonOrderCanceledRefundReason.ORDER_CANCELED\Inttegro\Refund\Reason::OrderCanceledinttegro.refund.Reason.ORDER_CANCELEDInttegro::Refund::Reason::ORDER_CANCELEDInttegro.RefundReasons.OrderCanceled, or"requested_by_customer""requested_by_customer"refund.ReasonRequestedByCustomerRefundReason.REQUESTED_BY_CUSTOMER\Inttegro\Refund\Reason::RequestedByCustomerinttegro.refund.Reason.REQUESTED_BY_CUSTOMERInttegro::Refund::Reason::REQUESTED_BY_CUSTOMERInttegro.RefundReasons.RequestedByCustomer. - #
ReasonDetailsreason_detailsReasonDetailsreasonDetailsreasonDetailsreason_detailsreason_detailsreasonDetailsstring?stringstringString?stringstr | NoneT.nilable(String)stringOverall explanation. Omitted when not provided.
#
SettlementsettlementSettlementsettlementsettlementsettlementsettlementsettlementRefundSettlementobjectSettlementRefundSettlementarray<string, mixed>RefundSettlementT.any(Refund::OfflineSettlement, Refund::PaymentMethodSettlement)RefundSettlementImmutable destination captured when the refund is created. The required type discriminator is offline or payment_method.Click or tap to expand- #
TypetypeTypetypetypetypetypetypeenumenumSettlementTypeenumstring enumEnumRefund::OfflineSettlementType'offline' | 'payment_method'offline means the order was paid outside Inttegro. payment_method means the refund returns to the original payment method used for the order. - #
PaymentMethodpayment_methodPaymentMethodpaymentMethodpaymentMethodpayment_methodpayment_methodpaymentMethodDictionary<string, object?>object*SettlementPaymentMethodMap<String, Object>array<string, mixed>dict[str, Any]T.any(Refund::SettlementMobileMoneyPaymentMethod, Refund::SettlementBankAccountPaymentMethod)RefundSettlementPaymentMethodView 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.- #
TypetypeTypetypetypetypetypetypeenumenumSettlementPaymentMethodTypeenumstring enumEnumRefund::SettlementMobileMoneyPaymentMethodType'mobile_money' | 'bank_account'mobile_money or bank_account. - #
MobileMoneymobile_moneyMobileMoneymobileMoneymobileMoneymobile_moneymobile_moneymobileMoneyDictionary<string, object?>object*SettlementMobileMoneyMap<String, Object>array<string, mixed>dict[str, Any]Refund::SettlementMobileMoneyPaymentMethodMobileMoneyRefundSettlementMobileMoneyView mobile_money detailsClick or tap to expand
Present only for mobile_money. Includes network, last4, and account_number masked as ****1234. - #
BankAccountbank_accountBankAccountbankAccountbankAccountbank_accountbank_accountbankAccountDictionary<string, object?>object*SettlementBankAccountMap<String, Object>array<string, mixed>dict[str, Any]Refund::SettlementBankAccountPaymentMethodBankAccount{ … }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.
- #
StatusstatusStatusstatusstatusstatusstatusstatusRefundStatusenumStatusRefundStatusstringLiteral['canceled', 'failed', 'pending', 'processing', 'succeeded']Refund::StatusRefundStatusCurrent state:
"canceled""canceled"refund.StatusCanceledRefundStatus.CANCELED\Inttegro\Refund\Status::Canceledinttegro.refund.Status.CANCELEDInttegro::Refund::Status::CANCELEDInttegro.RefundStatuses.Canceled,"failed""failed"refund.StatusFailedRefundStatus.FAILED\Inttegro\Refund\Status::Failedinttegro.refund.Status.FAILEDInttegro::Refund::Status::FAILEDInttegro.RefundStatuses.Failed,"pending""pending"refund.StatusPendingRefundStatus.PENDING\Inttegro\Refund\Status::Pendinginttegro.refund.Status.PENDINGInttegro::Refund::Status::PENDINGInttegro.RefundStatuses.Pending,"processing""processing"refund.StatusProcessingRefundStatus.PROCESSING\Inttegro\Refund\Status::Processinginttegro.refund.Status.PROCESSINGInttegro::Refund::Status::PROCESSINGInttegro.RefundStatuses.Processing, or"succeeded""succeeded"refund.StatusSucceededRefundStatus.SUCCEEDED\Inttegro\Refund\Status::Succeededinttegro.refund.Status.SUCCEEDEDInttegro::Refund::Status::SUCCEEDEDInttegro.RefundStatuses.Succeeded. - #
SucceededAtsucceeded_atSucceededAtsucceededAtsucceededAtsucceeded_atsucceeded_atsucceededAtDateTimeOffset?timestamp*TimeOffsetDateTime?DateTimeImmutabledatetime | NoneT.nilable(Time)DateWhen the refund entered the
"succeeded""succeeded"refund.StatusSucceededRefundStatus.SUCCEEDED\Inttegro\Refund\Status::Succeededinttegro.refund.Status.SUCCEEDEDInttegro::Refund::Status::SUCCEEDEDInttegro.RefundStatuses.Succeededstate. Omitted otherwise.
Failure reason values
"amount_not_supported""amount_not_supported""amount_not_supported"RefundFailureReason.AMOUNT_NOT_SUPPORTED'amount_not_supported'inttegro.refund.FailureReason.AMOUNT_NOT_SUPPORTEDInttegro::Refund::FailureReason::AMOUNT_NOT_SUPPORTEDInttegro.RefundFailureReasons.AmountNotSupported— The requested refund amount is not supported."insufficient_balance""insufficient_balance""insufficient_balance"RefundFailureReason.INSUFFICIENT_BALANCE'insufficient_balance'inttegro.refund.FailureReason.INSUFFICIENT_BALANCEInttegro::Refund::FailureReason::INSUFFICIENT_BALANCEInttegro.RefundFailureReasons.InsufficientBalance— The available balance cannot fund the refund."original_payment_method_unavailable""original_payment_method_unavailable""original_payment_method_unavailable"RefundFailureReason.ORIGINAL_PAYMENT_METHOD_UNAVAILABLE'original_payment_method_unavailable'inttegro.refund.FailureReason.ORIGINAL_PAYMENT_METHOD_UNAVAILABLEInttegro::Refund::FailureReason::ORIGINAL_PAYMENT_METHOD_UNAVAILABLEInttegro.RefundFailureReasons.OriginalPaymentMethodUnavailable— The original payment method cannot receive the refund."original_payment_not_refundable""original_payment_not_refundable""original_payment_not_refundable"RefundFailureReason.ORIGINAL_PAYMENT_NOT_REFUNDABLE'original_payment_not_refundable'inttegro.refund.FailureReason.ORIGINAL_PAYMENT_NOT_REFUNDABLEInttegro::Refund::FailureReason::ORIGINAL_PAYMENT_NOT_REFUNDABLEInttegro.RefundFailureReasons.OriginalPaymentNotRefundable— The original payment cannot be refunded."refund_declined""refund_declined""refund_declined"RefundFailureReason.REFUND_DECLINED'refund_declined'inttegro.refund.FailureReason.REFUND_DECLINEDInttegro::Refund::FailureReason::REFUND_DECLINEDInttegro.RefundFailureReasons.RefundDeclined— The refund was declined."refund_not_permitted""refund_not_permitted""refund_not_permitted"RefundFailureReason.REFUND_NOT_PERMITTED'refund_not_permitted'inttegro.refund.FailureReason.REFUND_NOT_PERMITTEDInttegro::Refund::FailureReason::REFUND_NOT_PERMITTEDInttegro.RefundFailureReasons.RefundNotPermitted— The refund is not permitted."refund_not_supported""refund_not_supported""refund_not_supported"RefundFailureReason.REFUND_NOT_SUPPORTED'refund_not_supported'inttegro.refund.FailureReason.REFUND_NOT_SUPPORTEDInttegro::Refund::FailureReason::REFUND_NOT_SUPPORTEDInttegro.RefundFailureReasons.RefundNotSupported— This refund is not supported."temporarily_unavailable""temporarily_unavailable""temporarily_unavailable"RefundFailureReason.TEMPORARILY_UNAVAILABLE'temporarily_unavailable'inttegro.refund.FailureReason.TEMPORARILY_UNAVAILABLEInttegro::Refund::FailureReason::TEMPORARILY_UNAVAILABLEInttegro.RefundFailureReasons.TemporarilyUnavailable— Refund processing is temporarily unavailable."unknown""unknown""unknown"RefundFailureReason.UNKNOWN'unknown'inttegro.refund.FailureReason.UNKNOWNInttegro::Refund::FailureReason::UNKNOWNInttegro.RefundFailureReasons.Unknown— Inttegro could not safely classify the failure. Do not retry unless support advises you to.
Create a refund POST /refunds/create
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 "pending""pending"refund.StatusPendingRefundStatus.PENDING\Inttegro\Refund\Status::Pendinginttegro.refund.Status.PENDINGInttegro::Refund::Status::PENDINGInttegro.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
CreateRefundRequestv13.1.0Go SDK requestCreateParamsv14.0.0Java SDK requestCreateRefundParamsv11.1.0PHP SDK requestv15.0.0Python SDK requestCreateRequestv15.0.0Ruby SDK requestRefund::CreateRequestv13.0.0TypeScript SDK requestCreateRefundRequestv15.0.0#
CustomDatacustom_dataCustomDatacustomData(…)customDatacustom_datacustom_datacustomDataCustomDataobject*DataCustomDataarray<string, mixed>CustomDataT.nilable(CustomData)CustomDataClick 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.
#
LineItemsline_itemsLineItemslineItem(…)lineItemsline_itemsline_itemslineItemsList<CreateRefundLineItem>object[]CreateLineItemCreateRefundLineItemarray<string, mixed>list[CreateLineItemInput]T::Array[Refund::CreateLineItem]CreateRefundLineItem[]requiredOne to 64 order line-item allocations to refund. Each order line item can appear only once.Click or tap to expand- #
OrderLineItemIdorder_line_item_idOrderLineItemIDorderLineItemId(…)orderLineItemIdorder_line_item_idorder_line_item_idorderLineItemIdstringstringstringStringstringstrStringstringrequiredOrder line-item ID with theoli_prefix. It must belong toOrderIdorder_idOrderIDorderIdorderIdorder_idorder_idorderId. - #
ReasonreasonReasonreason(…)reasonreasonreasonreasonRefundReasonenum*ReasonRefundReasonstring enumRefundReasonInputT.nilable(Refund::Reason)RefundReasonOptional reason specific to this line. It is independent of the overall refund reason. Allowed values:"custom""custom"refund.ReasonCustomRefundReason.CUSTOM\Inttegro\Refund\Reason::Custominttegro.refund.Reason.CUSTOMInttegro::Refund::Reason::CUSTOMInttegro.RefundReasons.Custom,"duplicate""duplicate"refund.ReasonDuplicateRefundReason.DUPLICATE\Inttegro\Refund\Reason::Duplicateinttegro.refund.Reason.DUPLICATEInttegro::Refund::Reason::DUPLICATEInttegro.RefundReasons.Duplicate,"fraudulent""fraudulent"refund.ReasonFraudulentRefundReason.FRAUDULENT\Inttegro\Refund\Reason::Fraudulentinttegro.refund.Reason.FRAUDULENTInttegro::Refund::Reason::FRAUDULENTInttegro.RefundReasons.Fraudulent,"item_damaged""item_damaged"refund.ReasonItemDamagedRefundReason.ITEM_DAMAGED\Inttegro\Refund\Reason::ItemDamagedinttegro.refund.Reason.ITEM_DAMAGEDInttegro::Refund::Reason::ITEM_DAMAGEDInttegro.RefundReasons.ItemDamaged,"item_not_as_described""item_not_as_described"refund.ReasonItemNotAsDescribedRefundReason.ITEM_NOT_AS_DESCRIBED\Inttegro\Refund\Reason::ItemNotAsDescribedinttegro.refund.Reason.ITEM_NOT_AS_DESCRIBEDInttegro::Refund::Reason::ITEM_NOT_AS_DESCRIBEDInttegro.RefundReasons.ItemNotAsDescribed,"item_not_received""item_not_received"refund.ReasonItemNotReceivedRefundReason.ITEM_NOT_RECEIVED\Inttegro\Refund\Reason::ItemNotReceivedinttegro.refund.Reason.ITEM_NOT_RECEIVEDInttegro::Refund::Reason::ITEM_NOT_RECEIVEDInttegro.RefundReasons.ItemNotReceived,"item_returned""item_returned"refund.ReasonItemReturnedRefundReason.ITEM_RETURNED\Inttegro\Refund\Reason::ItemReturnedinttegro.refund.Reason.ITEM_RETURNEDInttegro::Refund::Reason::ITEM_RETURNEDInttegro.RefundReasons.ItemReturned,"order_canceled""order_canceled"refund.ReasonOrderCanceledRefundReason.ORDER_CANCELED\Inttegro\Refund\Reason::OrderCanceledinttegro.refund.Reason.ORDER_CANCELEDInttegro::Refund::Reason::ORDER_CANCELEDInttegro.RefundReasons.OrderCanceled, or"requested_by_customer""requested_by_customer"refund.ReasonRequestedByCustomerRefundReason.REQUESTED_BY_CUSTOMER\Inttegro\Refund\Reason::RequestedByCustomerinttegro.refund.Reason.REQUESTED_BY_CUSTOMERInttegro::Refund::Reason::REQUESTED_BY_CUSTOMERInttegro.RefundReasons.RequestedByCustomer. - #
ReasonDetailsreason_detailsReasonDetailsreasonDetails(…)reasonDetailsreason_detailsreason_detailsreasonDetailsstringstringstringStringstringstrT.nilable(String)stringOptional line-specific explanation, up to 2,048 characters. Requires a line-level reason and is required when that reason is"custom""custom"refund.ReasonCustomRefundReason.CUSTOM\Inttegro\Refund\Reason::Custominttegro.refund.Reason.CUSTOMInttegro::Refund::Reason::CUSTOMInttegro.RefundReasons.Custom. - #
RefundAmountrefund_amountRefundAmountrefundAmount(…)refundAmountrefund_amountrefund_amountrefundAmountAmountParamsobjectAmountParamsMoneyarray<string, mixed>AmountParamsMoney::AmountParamsAmountParamsrequiredView refund_amount attributesClick or tap to expand
Positive amount to refund for this line. It cannot exceed the remaining refundable amount.
- #
ReasonreasonReasonreason(…)reasonreasonreasonreasonRefundReasonenumReasonRefundReasonstring enumRefundReasonInputRefund::ReasonRefundReasonrequiredOverall refund reason. Allowed values:
"custom""custom"refund.ReasonCustomRefundReason.CUSTOM\Inttegro\Refund\Reason::Custominttegro.refund.Reason.CUSTOMInttegro::Refund::Reason::CUSTOMInttegro.RefundReasons.Custom,"duplicate""duplicate"refund.ReasonDuplicateRefundReason.DUPLICATE\Inttegro\Refund\Reason::Duplicateinttegro.refund.Reason.DUPLICATEInttegro::Refund::Reason::DUPLICATEInttegro.RefundReasons.Duplicate,"fraudulent""fraudulent"refund.ReasonFraudulentRefundReason.FRAUDULENT\Inttegro\Refund\Reason::Fraudulentinttegro.refund.Reason.FRAUDULENTInttegro::Refund::Reason::FRAUDULENTInttegro.RefundReasons.Fraudulent,"item_damaged""item_damaged"refund.ReasonItemDamagedRefundReason.ITEM_DAMAGED\Inttegro\Refund\Reason::ItemDamagedinttegro.refund.Reason.ITEM_DAMAGEDInttegro::Refund::Reason::ITEM_DAMAGEDInttegro.RefundReasons.ItemDamaged,"item_not_as_described""item_not_as_described"refund.ReasonItemNotAsDescribedRefundReason.ITEM_NOT_AS_DESCRIBED\Inttegro\Refund\Reason::ItemNotAsDescribedinttegro.refund.Reason.ITEM_NOT_AS_DESCRIBEDInttegro::Refund::Reason::ITEM_NOT_AS_DESCRIBEDInttegro.RefundReasons.ItemNotAsDescribed,"item_not_received""item_not_received"refund.ReasonItemNotReceivedRefundReason.ITEM_NOT_RECEIVED\Inttegro\Refund\Reason::ItemNotReceivedinttegro.refund.Reason.ITEM_NOT_RECEIVEDInttegro::Refund::Reason::ITEM_NOT_RECEIVEDInttegro.RefundReasons.ItemNotReceived,"item_returned""item_returned"refund.ReasonItemReturnedRefundReason.ITEM_RETURNED\Inttegro\Refund\Reason::ItemReturnedinttegro.refund.Reason.ITEM_RETURNEDInttegro::Refund::Reason::ITEM_RETURNEDInttegro.RefundReasons.ItemReturned,"order_canceled""order_canceled"refund.ReasonOrderCanceledRefundReason.ORDER_CANCELED\Inttegro\Refund\Reason::OrderCanceledinttegro.refund.Reason.ORDER_CANCELEDInttegro::Refund::Reason::ORDER_CANCELEDInttegro.RefundReasons.OrderCanceled, or"requested_by_customer""requested_by_customer"refund.ReasonRequestedByCustomerRefundReason.REQUESTED_BY_CUSTOMER\Inttegro\Refund\Reason::RequestedByCustomerinttegro.refund.Reason.REQUESTED_BY_CUSTOMERInttegro::Refund::Reason::REQUESTED_BY_CUSTOMERInttegro.RefundReasons.RequestedByCustomer. - #
ReasonDetailsreason_detailsReasonDetailsreasonDetails(…)reasonDetailsreason_detailsreason_detailsreasonDetailsstringstringstringStringstringstrT.nilable(String)stringOptional overall explanation, up to 2,048 characters. Required when
ReasonreasonReasonreasonreasonreasonreasonreasonis"custom""custom"refund.ReasonCustomRefundReason.CUSTOM\Inttegro\Refund\Reason::Custominttegro.refund.Reason.CUSTOMInttegro::Refund::Reason::CUSTOMInttegro.RefundReasons.Custom.
Response
Returns the new refund in"pending""pending"refund.StatusPendingRefundStatus.PENDING\Inttegro\Refund\Status::Pendinginttegro.refund.Status.PENDINGInttegro::Refund::Status::PENDINGInttegro.RefundStatuses.Pending status. Save its Idrefund.idIDididididid and use Lookup a refund when you need its latest status.Request
curl --fail-with-body https://api.inttegro.com/refunds/create \
-H "Authorization: Bearer $INTTEGRO_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: refund-return-1042" \
-d '{
"custom_data": {
"warehouse": "accra"
},
"line_items": [
{
"order_line_item_id": "oli_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMN",
"reason": "item_damaged",
"reason_details": "Packaging was crushed.",
"refund_amount": {
"currency": "ghs",
"value": 2500
}
},
{
"order_line_item_id": "oli_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmn",
"refund_amount": {
"currency": "ghs",
"value": 1000
}
}
],
"order_id": "or_0123456789abcdefghijklmnopqrstuvwxyzABCD",
"reason": "requested_by_customer",
"reason_details": "Customer returned part of the order.",
"reference": "return_1042"
}'import { InttegroClient, RefundReasons } from '@inttegro/inttegro-sdk'
const inttegro = new InttegroClient({
apiKey: process.env.INTTEGRO_API_KEY!,
})
const result = await inttegro.refunds.create({
customData: {
warehouse: "accra",
},
lineItems: [
{
orderLineItemId: "oli_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMN",
reason: RefundReasons.ItemDamaged,
reasonDetails: "Packaging was crushed.",
refundAmount: {
currency: "ghs",
value: 2500,
},
},
{
orderLineItemId: "oli_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmn",
refundAmount: {
currency: "ghs",
value: 1000,
},
},
],
orderId: "or_0123456789abcdefghijklmnopqrstuvwxyzABCD",
reason: RefundReasons.RequestedByCustomer,
reasonDetails: "Customer returned part of the order.",
reference: "return_1042",
}, {
idempotencyKey: "refund-return-1042",
})package main
import (
"context"
"log"
"os"
inttegro "github.com/inttegro/inttegro-sdk-go/v14"
"github.com/inttegro/inttegro-sdk-go/v14/customdata"
"github.com/inttegro/inttegro-sdk-go/v14/money"
"github.com/inttegro/inttegro-sdk-go/v14/refund"
)
func main() {
ctx := context.Background()
client := inttegro.NewClient(os.Getenv("INTTEGRO_API_KEY"))
params := refund.CreateParams{
CustomData: func() *customdata.Data { value, err := customdata.New(map[string]string{
"warehouse": "accra",
}); if err != nil { panic(err) }; return value }(),
LineItems: []refund.CreateLineItem{
{
OrderLineItemID: "oli_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMN",
Reason: func() *refund.Reason { value := refund.ReasonItemDamaged; return &value }(),
ReasonDetails: "Packaging was crushed.",
RefundAmount: money.AmountParams{
Currency: money.GHS,
Value: 2500,
},
},
{
OrderLineItemID: "oli_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmn",
RefundAmount: money.AmountParams{
Currency: money.GHS,
Value: 1000,
},
},
},
OrderID: "or_0123456789abcdefghijklmnopqrstuvwxyzABCD",
Reason: refund.ReasonRequestedByCustomer,
ReasonDetails: "Customer returned part of the order.",
Reference: "return_1042",
}
result, err := client.Refunds.Create(ctx, params)
if err != nil {
log.Fatal(err)
}
_ = result
}import os
import inttegro
from inttegro import InttegroClient
client = InttegroClient(api_key=os.environ["INTTEGRO_API_KEY"])
result = client.refunds.create(inttegro.refund.CreateRequest(
custom_data=inttegro.CustomData({
"warehouse": "accra",
}),
line_items=[
inttegro.refund.CreateLineItemInput(
order_line_item_id="oli_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMN",
reason=inttegro.refund.Reason.ITEM_DAMAGED,
reason_details="Packaging was crushed.",
refund_amount=inttegro.money.AmountParams(
currency=inttegro.money.Currency.GHS,
value=2500,
),
),
inttegro.refund.CreateLineItemInput(
order_line_item_id="oli_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmn",
refund_amount=inttegro.money.AmountParams(
currency=inttegro.money.Currency.GHS,
value=1000,
),
),
],
order_id="or_0123456789abcdefghijklmnopqrstuvwxyzABCD",
reason=inttegro.refund.Reason.REQUESTED_BY_CUSTOMER,
reason_details="Customer returned part of the order.",
reference="return_1042",
),
idempotency_key="refund-return-1042")<?php
use Inttegro\Client;
$client = new Client($_ENV['INTTEGRO_API_KEY']);
$result = $client->refunds->create([
'custom_data' => [
'warehouse' => 'accra',
],
'line_items' => [
[
'order_line_item_id' => 'oli_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMN',
'reason' => \Inttegro\RefundReason::ItemDamaged,
'reason_details' => 'Packaging was crushed.',
'refund_amount' => [
'currency' => 'ghs',
'value' => 2500,
],
],
[
'order_line_item_id' => 'oli_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmn',
'refund_amount' => [
'currency' => 'ghs',
'value' => 1000,
],
],
],
'order_id' => 'or_0123456789abcdefghijklmnopqrstuvwxyzABCD',
'reason' => \Inttegro\RefundReason::RequestedByCustomer,
'reason_details' => 'Customer returned part of the order.',
'reference' => 'return_1042',
], "refund-return-1042");require "inttegro"
client = Inttegro::Client.new(api_key: ENV.fetch("INTTEGRO_API_KEY"))
result = client.refunds.create(
custom_data: {
warehouse: "accra",
},
line_items: [
{
order_line_item_id: "oli_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMN",
reason: Inttegro::RefundReason::ITEM_DAMAGED,
reason_details: "Packaging was crushed.",
refund_amount: {
currency: "ghs",
value: 2500,
},
},
{
order_line_item_id: "oli_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmn",
refund_amount: {
currency: "ghs",
value: 1000,
},
},
],
order_id: "or_0123456789abcdefghijklmnopqrstuvwxyzABCD",
reason: Inttegro::RefundReason::REQUESTED_BY_CUSTOMER,
reason_details: "Customer returned part of the order.",
reference: "return_1042",
idempotency_key: "refund-return-1042"
)import com.inttegro.Client;
import com.inttegro.refunds.CreateRefundParams;
import com.inttegro.CustomData;
import com.inttegro.refunds.CreateRefundLineItem;
import com.inttegro.refunds.RefundReason;
import com.inttegro.money.AmountParams;
import com.inttegro.money.Currency;
import com.inttegro.RequestOptions;
public class Example {
public static void main(String[] args) throws Exception {
var client = new Client(System.getenv("INTTEGRO_API_KEY"));
var params = CreateRefundParams.builder()
.customData(new CustomData()
.set("warehouse", "accra"))
.lineItem(CreateRefundLineItem.builder()
.orderLineItemId("oli_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMN")
.reason(RefundReason.ITEM_DAMAGED)
.reasonDetails("Packaging was crushed.")
.refundAmount(AmountParams.of(Currency.GHS, 2500))
.build())
.lineItem(CreateRefundLineItem.builder()
.orderLineItemId("oli_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmn")
.refundAmount(AmountParams.of(Currency.GHS, 1000))
.build())
.orderId("or_0123456789abcdefghijklmnopqrstuvwxyzABCD")
.reason(RefundReason.REQUESTED_BY_CUSTOMER)
.reasonDetails("Customer returned part of the order.")
.reference("return_1042")
.build();
var result = client.refunds().create(params, RequestOptions.withIdempotencyKey("refund-return-1042"));
}
}using Inttegro;
using var inttegro = new InttegroClient(
Environment.GetEnvironmentVariable("INTTEGRO_API_KEY")!
);
var result = await inttegro.Refunds.CreateAsync(new Inttegro.CreateRefundRequest {
CustomData = new Inttegro.CustomData()
.Set("warehouse", "accra"),
LineItems = new List<Inttegro.CreateRefundLineItem> {
new Inttegro.CreateRefundLineItem {
OrderLineItemId = "oli_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMN",
Reason = Inttegro.RefundReason.ItemDamaged,
ReasonDetails = "Packaging was crushed.",
RefundAmount = new Inttegro.Money.AmountParams {
Currency = Inttegro.Money.Currency.GHS,
Value = 2500,
},
},
new Inttegro.CreateRefundLineItem {
OrderLineItemId = "oli_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmn",
RefundAmount = new Inttegro.Money.AmountParams {
Currency = Inttegro.Money.Currency.GHS,
Value = 1000,
},
},
},
OrderId = "or_0123456789abcdefghijklmnopqrstuvwxyzABCD",
Reason = Inttegro.RefundReason.RequestedByCustomer,
ReasonDetails = "Customer returned part of the order.",
Reference = "return_1042",
}, "refund-return-1042");{
"refund": {
"created_at": "2026-08-30T12:00:00Z",
"custom_data": {
"warehouse": "accra"
},
"id": "rf_1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZabcd",
"line_items": [
{
"id": "rli_zyxwvutsrqponmlkjihgfedcbaABCDEFGHIJKLMN",
"order_line_item": {
"id": "oli_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMN",
"product": {
"id": "prod_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMN",
"name": "Canvas backpack"
},
"quantity": 1,
"type": "product"
},
"original_amount_paid": {
"currency": "ghs",
"value": 10000
},
"reason": "item_damaged",
"reason_details": "Packaging was crushed.",
"refund_amount": {
"currency": "ghs",
"value": 2500
}
},
{
"id": "rli_ZYXWVUTSRQPONMLKJIHGFEDCBAabcdefghijklmn",
"order_line_item": {
"fee": {
"description": "Gift wrapping service.",
"label": "Gift wrapping"
},
"id": "oli_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmn",
"type": "fee"
},
"original_amount_paid": {
"currency": "ghs",
"value": 5000
},
"refund_amount": {
"currency": "ghs",
"value": 1000
}
}
],
"order_id": "or_0123456789abcdefghijklmnopqrstuvwxyzABCD",
"reason": "requested_by_customer",
"reason_details": "Customer returned part of the order.",
"reference": "return_1042",
"settlement": {
"payment_method": {
"id": "pm_xyz789",
"mobile_money": {
"account_number": "****7831",
"last4": "7831",
"network": "mtn"
},
"type": "mobile_money"
},
"type": "payment_method"
},
"total": {
"currency": "ghs",
"value": 3500
},
"status": "pending"
}
}Cancel a refund POST /refunds/cancel
"pending""pending"refund.StatusPendingRefundStatus.PENDING\Inttegro\Refund\Status::Pendinginttegro.refund.Status.PENDINGInttegro::Refund::Status::PENDINGInttegro.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 "processing""processing"refund.StatusProcessingRefundStatus.PROCESSING\Inttegro\Refund\Status::Processinginttegro.refund.Status.PROCESSINGInttegro::Refund::Status::PROCESSINGInttegro.RefundStatuses.Processing, "succeeded""succeeded"refund.StatusSucceededRefundStatus.SUCCEEDED\Inttegro\Refund\Status::Succeededinttegro.refund.Status.SUCCEEDEDInttegro::Refund::Status::SUCCEEDEDInttegro.RefundStatuses.Succeeded, or "failed""failed"refund.StatusFailedRefundStatus.FAILED\Inttegro\Refund\Status::Failedinttegro.refund.Status.FAILEDInttegro::Refund::Status::FAILEDInttegro.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
CancelRefundRequestv13.1.0Go SDK requestCancelParamsv14.0.0Java SDK requestCancelRefundParamsv11.1.0PHP SDK requestv15.0.0Python SDK requestv15.0.0Ruby SDK requestRefund::CancelRequestv13.0.0TypeScript SDK requestCancelRefundRequestv15.0.0- #
ReasonreasonReasonreason(…)reasonreasonreasonreasonstring?stringstringStringstringstrT.nilable(String)stringOptional 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
CancelReasonrefund.cancel_reasonCancelReasoncancelReasoncancelReasoncancel_reasoncancel_reasoncancelReason. An idempotent repeat preserves the explanation recorded by the first successful cancellation. #
RequestMetarequest_metaRequestMetarequestMeta(…)requestMetarequest_metarequest_metarequestMetaRequestMeta?object*MetaRequestMetaarray<string, mixed>dict[str, Any]T.nilable(Refund::RequestMeta)MetaOptional retry key inside request_meta. It must match the Idempotency-Key header when both are provided.Click or tap to expand- #
IdempotencyKeyidempotency_keyIdempotencyKeyidempotencyKey(…)idempotencyKeyidempotency_keyidempotency_keyidempotencyKeystringstringstringStringstringstrT.nilable(String)stringStable retry key from 1 through 255 characters. It must match the Idempotency-Key header when both are present.
Response
Returns the refund in"canceled""canceled"refund.StatusCanceledRefundStatus.CANCELED\Inttegro\Refund\Status::Canceledinttegro.refund.Status.CANCELEDInttegro::Refund::Status::CANCELEDInttegro.RefundStatuses.Canceled status. When a reason was supplied, the response includes CancelReasonrefund.cancel_reasonCancelReasoncancelReasoncancelReasoncancel_reasoncancel_reasoncancelReason; the selected SDK view shows its native property name.Request
curl --fail-with-body https://api.inttegro.com/refunds/cancel \
-H "Authorization: Bearer $INTTEGRO_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: cancel-refund-return-1042" \
-d '{"reason":"Customer asked us to stop the return.","refund_id":"rf_1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZabcd"}'import { InttegroClient } from '@inttegro/inttegro-sdk'
const inttegro = new 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",
})package main
import (
"context"
"log"
"os"
inttegro "github.com/inttegro/inttegro-sdk-go/v14"
"github.com/inttegro/inttegro-sdk-go/v14/refund"
)
func main() {
ctx := context.Background()
client := inttegro.NewClient(os.Getenv("INTTEGRO_API_KEY"))
params := refund.CancelParams{
Reason: "Customer asked us to stop the return.",
RefundID: "rf_1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZabcd",
}
result, err := client.Refunds.Cancel(ctx, params)
if err != nil {
log.Fatal(err)
}
_ = result
}import os
from inttegro import InttegroClient
client = InttegroClient(api_key=os.environ["INTTEGRO_API_KEY"])
result = client.refunds.cancel(
"rf_1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZabcd",
idempotency_key="cancel-refund-return-1042",
reason="Customer asked us to stop the return."
)<?php
use Inttegro\Client;
$client = new Client($_ENV['INTTEGRO_API_KEY']);
$result = $client->refunds->cancel(
"rf_1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZabcd",
"cancel-refund-return-1042",
"Customer asked us to stop the return."
);require "inttegro"
client = Inttegro::Client.new(api_key: ENV.fetch("INTTEGRO_API_KEY"))
result = client.refunds.cancel(
reason: "Customer asked us to stop the return.",
refund_id: "rf_1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZabcd"
)import com.inttegro.Client;
import com.inttegro.refunds.CancelRefundParams;
import com.inttegro.RequestOptions;
public class Example {
public static void main(String[] args) throws Exception {
var client = new Client(System.getenv("INTTEGRO_API_KEY"));
var params = CancelRefundParams.builder()
.reason("Customer asked us to stop the return.")
.refundId("rf_1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZabcd")
.build();
var result = client.refunds().cancel(params, RequestOptions.withIdempotencyKey("cancel-refund-return-1042"));
}
}using Inttegro;
using var inttegro = new InttegroClient(
Environment.GetEnvironmentVariable("INTTEGRO_API_KEY")!
);
var result = await inttegro.Refunds.CancelAsync(new Inttegro.CancelRefundRequest {
Reason = "Customer asked us to stop the return.",
RefundId = "rf_1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZabcd",
}, "cancel-refund-return-1042");Lookup a refund POST /refunds/lookup
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
LookupRefundRequestv13.1.0Go SDK requestLookupParamsv14.0.0Java SDK requestv11.1.0PHP SDK requestv15.0.0Python SDK requestv15.0.0Ruby SDK requestRefund::LookupRequestv13.0.0TypeScript SDK requestLookupRefundRequestv15.0.0Response
Returns the requested refund.
Request
: "${INTTEGRO_API_KEY:?INTTEGRO_API_KEY is required}"
: "${INTTEGRO_REFUND_ID:?INTTEGRO_REFUND_ID is required}"
curl --fail-with-body https://api.inttegro.com/refunds/lookup \
-H "Authorization: Bearer $INTTEGRO_API_KEY" \
-H "Content-Type: application/json" \
-d "{\"refund_id\":\"$INTTEGRO_REFUND_ID\"}"import { InttegroClient } from '@inttegro/inttegro-sdk'
const inttegro = new InttegroClient({
apiKey: process.env.INTTEGRO_API_KEY!,
})
const result = await inttegro.refunds.lookup({
refundId: "$INTTEGRO_REFUND_ID",
})package main
import (
"context"
"log"
"os"
inttegro "github.com/inttegro/inttegro-sdk-go/v14"
"github.com/inttegro/inttegro-sdk-go/v14/refund"
)
func main() {
ctx := context.Background()
client := inttegro.NewClient(os.Getenv("INTTEGRO_API_KEY"))
params := refund.LookupParams{
RefundID: "$INTTEGRO_REFUND_ID",
}
result, err := client.Refunds.Lookup(ctx, params)
if err != nil {
log.Fatal(err)
}
_ = result
}import os
from inttegro import InttegroClient
client = InttegroClient(api_key=os.environ["INTTEGRO_API_KEY"])
result = client.refunds.lookup("$INTTEGRO_REFUND_ID")<?php
use Inttegro\Client;
$client = new Client($_ENV['INTTEGRO_API_KEY']);
$result = $client->refunds->lookup("$INTTEGRO_REFUND_ID");require "inttegro"
client = Inttegro::Client.new(api_key: ENV.fetch("INTTEGRO_API_KEY"))
result = client.refunds.lookup(refund_id: "$INTTEGRO_REFUND_ID")import com.inttegro.Client;
public class Example {
public static void main(String[] args) throws Exception {
var client = new Client(System.getenv("INTTEGRO_API_KEY"));
var result = client.refunds().lookup("$INTTEGRO_REFUND_ID");
}
}using Inttegro;
using var inttegro = new InttegroClient(
Environment.GetEnvironmentVariable("INTTEGRO_API_KEY")!
);
var result = await inttegro.Refunds.LookupAsync("$INTTEGRO_REFUND_ID");List refunds POST /refunds/page
Browse refunds from newest to oldest. Use this endpoint to build refund history, customer-service, and reconciliation views.
Pages are one-based. PageSizepage_sizePageSizepageSizepageSizepage_sizepage_sizepageSize defaults to 256256256256256256256256, and the response’s Page.Sizepage.sizePage.Sizepage.sizepage.sizepage.sizepage.sizepage.size is the number of refunds actually returned. An empty page is successful and contains Page.Sizepage.sizePage.Sizepage.sizepage.sizepage.sizepage.sizepage.size set to 00000000 and an empty Page.Refundspage.refundsPage.Refundspage.refundspage.refundspage.refundspage.refundspage.refunds collection.
Request attributes
PageRefundsRequestv13.1.0Go SDK requestPageParamsv14.0.0Java SDK requestRefundPageParamsv11.1.0PHP SDK requestv15.0.0Python SDK requestPageRequestv15.0.0Ruby SDK requestRefund::PageRequestv13.0.0TypeScript SDK requestPageRefundsRequestv15.0.0- #
PageNumberpage_numberPageNumberpageNumber(…)pageNumberpage_numberpage_numberpageNumberintintegerintIntegerintintIntegernumberrequiredPage to retrieve, from
11111111through1010101010101010.
Response
Returns the page number, number of results, and aRefundspage.refundsRefundsrefundsrefundsrefundsrefundsrefunds array. An empty page returns an empty Refundspage.refundsRefundsrefundsrefundsrefundsrefundsrefunds collection and Sizepage.sizeSizesizesizesizesizesize set to 00000000.Request
: "${INTTEGRO_API_KEY:?INTTEGRO_API_KEY is required}"
curl --fail-with-body https://api.inttegro.com/refunds/page \
-H "Authorization: Bearer $INTTEGRO_API_KEY" \
-H "Content-Type: application/json" \
-d '{"page_number":1,"page_size":20}'import { InttegroClient } from '@inttegro/inttegro-sdk'
const inttegro = new InttegroClient({
apiKey: process.env.INTTEGRO_API_KEY!,
})
const result = await inttegro.refunds.page({
pageNumber: 1,
pageSize: 20,
})package main
import (
"context"
"log"
"os"
inttegro "github.com/inttegro/inttegro-sdk-go/v14"
"github.com/inttegro/inttegro-sdk-go/v14/refund"
)
func main() {
ctx := context.Background()
client := inttegro.NewClient(os.Getenv("INTTEGRO_API_KEY"))
params := refund.PageParams{
PageNumber: 1,
PageSize: 20,
}
result, err := client.Refunds.Page(ctx, params)
if err != nil {
log.Fatal(err)
}
_ = result
}import os
import inttegro
from inttegro import InttegroClient
client = InttegroClient(api_key=os.environ["INTTEGRO_API_KEY"])
result = client.refunds.page(inttegro.refund.PageRequest(
page_number=1,
page_size=20,
))<?php
use Inttegro\Client;
$client = new Client($_ENV['INTTEGRO_API_KEY']);
$result = $client->refunds->page([
'page_number' => 1,
'page_size' => 20,
]);require "inttegro"
client = Inttegro::Client.new(api_key: ENV.fetch("INTTEGRO_API_KEY"))
result = client.refunds.page(
page_number: 1,
page_size: 20
)import com.inttegro.Client;
import com.inttegro.refunds.RefundPageParams;
public class Example {
public static void main(String[] args) throws Exception {
var client = new Client(System.getenv("INTTEGRO_API_KEY"));
var params = RefundPageParams.builder()
.pageNumber(1)
.pageSize(20)
.build();
var result = client.refunds().page(params);
}
}using Inttegro;
using var inttegro = new InttegroClient(
Environment.GetEnvironmentVariable("INTTEGRO_API_KEY")!
);
var result = await inttegro.Refunds.PageAsync(new Inttegro.PageRefundsRequest {
PageNumber = 1,
PageSize = 20,
});{
"page": {
"number": 1,
"refunds": [
{
"created_at": "2026-08-30T12:00:00Z",
"id": "rf_1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZabcd",
"line_items": [
{
"id": "rli_zyxwvutsrqponmlkjihgfedcbaABCDEFGHIJKLMN",
"order_line_item": {
"id": "oli_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMN",
"product": {
"name": "Custom tailoring"
},
"quantity": 1,
"type": "product"
},
"original_amount_paid": {
"currency": "ghs",
"value": 10000
},
"refund_amount": {
"currency": "ghs",
"value": 2500
}
}
],
"order_id": "or_0123456789abcdefghijklmnopqrstuvwxyzABCD",
"reason": "item_returned",
"settlement": {
"type": "offline"
},
"total": {
"currency": "ghs",
"value": 2500
},
"status": "pending"
}
],
"size": 1
}
}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 "failed""failed"refund.StatusFailedRefundStatus.FAILED\Inttegro\Refund\Status::Failedinttegro.refund.Status.FAILEDInttegro::Refund::Status::FAILEDInttegro.RefundStatuses.Failed includes Failurerefund.failureFailurefailurefailurefailurefailurefailure.
Use the reason to choose the next step:
"amount_not_supported""amount_not_supported""amount_not_supported"RefundFailureReason.AMOUNT_NOT_SUPPORTED'amount_not_supported'inttegro.refund.FailureReason.AMOUNT_NOT_SUPPORTEDInttegro::Refund::FailureReason::AMOUNT_NOT_SUPPORTEDInttegro.RefundFailureReasons.AmountNotSupported— Retrieve the current order and correct the amount before creating a new refund."insufficient_balance""insufficient_balance""insufficient_balance"RefundFailureReason.INSUFFICIENT_BALANCE'insufficient_balance'inttegro.refund.FailureReason.INSUFFICIENT_BALANCEInttegro::Refund::FailureReason::INSUFFICIENT_BALANCEInttegro.RefundFailureReasons.InsufficientBalance— Restore sufficient available balance before creating a new refund."original_payment_method_unavailable""original_payment_method_unavailable""original_payment_method_unavailable"RefundFailureReason.ORIGINAL_PAYMENT_METHOD_UNAVAILABLE'original_payment_method_unavailable'inttegro.refund.FailureReason.ORIGINAL_PAYMENT_METHOD_UNAVAILABLEInttegro::Refund::FailureReason::ORIGINAL_PAYMENT_METHOD_UNAVAILABLEInttegro.RefundFailureReasons.OriginalPaymentMethodUnavailable— Do not submit the same refund again. Contact support if another return route is needed."original_payment_not_refundable""original_payment_not_refundable""original_payment_not_refundable"RefundFailureReason.ORIGINAL_PAYMENT_NOT_REFUNDABLE'original_payment_not_refundable'inttegro.refund.FailureReason.ORIGINAL_PAYMENT_NOT_REFUNDABLEInttegro::Refund::FailureReason::ORIGINAL_PAYMENT_NOT_REFUNDABLEInttegro.RefundFailureReasons.OriginalPaymentNotRefundable— Do not submit the same refund again. Contact support if the customer still needs another return route."refund_declined""refund_declined""refund_declined"RefundFailureReason.REFUND_DECLINED'refund_declined'inttegro.refund.FailureReason.REFUND_DECLINEDInttegro::Refund::FailureReason::REFUND_DECLINEDInttegro.RefundFailureReasons.RefundDeclined— ReadFailure.Detailrefund.failure.detailFailure.Detailfailure.detailfailure.detailfailure.detailfailure.detailfailure.detailbefore deciding whether the condition can be corrected."refund_not_permitted""refund_not_permitted""refund_not_permitted"RefundFailureReason.REFUND_NOT_PERMITTED'refund_not_permitted'inttegro.refund.FailureReason.REFUND_NOT_PERMITTEDInttegro::Refund::FailureReason::REFUND_NOT_PERMITTEDInttegro.RefundFailureReasons.RefundNotPermitted— Retrieve the current order and refund state, then correct the eligibility issue before creating a new refund."refund_not_supported""refund_not_supported""refund_not_supported"RefundFailureReason.REFUND_NOT_SUPPORTED'refund_not_supported'inttegro.refund.FailureReason.REFUND_NOT_SUPPORTEDInttegro::Refund::FailureReason::REFUND_NOT_SUPPORTEDInttegro.RefundFailureReasons.RefundNotSupported— Do not submit the same refund again. Contact support if another return route is needed."temporarily_unavailable""temporarily_unavailable""temporarily_unavailable"RefundFailureReason.TEMPORARILY_UNAVAILABLE'temporarily_unavailable'inttegro.refund.FailureReason.TEMPORARILY_UNAVAILABLEInttegro::Refund::FailureReason::TEMPORARILY_UNAVAILABLEInttegro.RefundFailureReasons.TemporarilyUnavailable— Wait before creating a new refund, and first confirm that the existing refund is terminal."unknown""unknown""unknown"RefundFailureReason.UNKNOWN'unknown'inttegro.refund.FailureReason.UNKNOWNInttegro::Refund::FailureReason::UNKNOWNInttegro.RefundFailureReasons.Unknown— Treat the failure as non-retryable unless support advises otherwise.- When
Failure.Retryablerefund.failure.retryableFailure.Retryablefailure.retryablefailure.retryablefailure.retryablefailure.retryablefailure.retryableistrue, resolve the reported condition before creating a new, intentional refund. It is not permission to repeat a refund whose status is still"processing""processing"refund.StatusProcessingRefundStatus.PROCESSING\Inttegro\Refund\Status::Processinginttegro.refund.Status.PROCESSINGInttegro::Refund::Status::PROCESSINGInttegro.RefundStatuses.Processing. - A timeout or uncertain provider outcome remains
"processing""processing"refund.StatusProcessingRefundStatus.PROCESSING\Inttegro\Refund\Status::Processinginttegro.refund.Status.PROCESSINGInttegro::Refund::Status::PROCESSINGInttegro.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.