Skip to content

Refunds API Reference ​

The Refunds API allows you to issue full or partial reimbursements for paid orders.

Methods ​

  • client.Refunds.List(ctx, opts) -> (*PageResponse[Refund], error)
  • client.Refunds.All(ctx, opts) -> iter.Seq2[Refund, error]
  • client.Refunds.Get(ctx, id) -> (*Refund, error)
  • client.Refunds.Create(ctx, req) -> (*Refund, error)

1. Issue a Full Refund ​

go
refund, err := client.Refunds.Create(ctx, &shopier.RefundCreateRequest{
	OrderID: "ord_123456",
	Note:    "Customer returned merchandise within 14 days",
})
if err != nil {
	log.Fatal(err)
}
fmt.Printf("Refund ID: %s | Status: %s\n", refund.ID, refund.Status)

2. Issue a Partial Refund ​

go
partialRefund, err := client.Refunds.Create(ctx, &shopier.RefundCreateRequest{
	OrderID: "ord_123456",
	Amount:  "50.00",
	Note:    "Partial refund for damaged outer box",
})
if err != nil {
	log.Fatal(err)
}
fmt.Println("Partial Refund ID:", partialRefund.ID)

Data Models & Types ​

Refund ​

Represents a monetary reimbursement issued on an order.

FieldTypeJSON TagDescription
IDstringidUnique refund identifier
OrderIDstringorderIdAssociated Shopier order ID
Typestringtype"full" or "partial"
Statusstringstatus"pending", "succeeded", or "failed"
Currencystringcurrency3-letter currency code ("TRY", "USD", etc.)
TotalstringtotalTotal refunded amount
NotestringnoteReason or explanatory note
DateCreatedstringdateCreatedISO-8601 creation timestamp
DateRefundedstringdateRefundedTimestamp when reimbursement settled

RefundCreateRequest ​

FieldTypeJSON TagRequiredDescription
OrderIDstringorderIdYesShopier order ID to refund
AmountstringamountNoAmount for partial refund (omit for 100% full refund)
NotestringnoteNoInternal or customer-visible refund reason

RefundListOptions ​

FieldTypeURL ParamDescription
OrderIDstringorderIdFilter refunds by specific order ID
PageintpagePagination page index (1-based)
LimitintlimitRecords per page (default: 20)