Skip to main content
POST
/
api
/
adm
/
transactions
/
{id}
/
refund
Process Refund
curl --request POST \
  --url https://localhost:44371/api/adm/transactions/{id}/refund \
  --header 'Authorization: Bearer <token>'
{
  "success": true,
  "code": 200,
  "errorMessage": null
}

Description

Initiates a refund for a captured (settled) transaction, crediting funds back to the customer. Refunds are used for customer returns, order cancellations after shipment, or dispute resolution. The refund is processed through the original payment processor and typically takes 3-10 business days to appear in the customer’s account.

Input

  • Path Parameter: id (guid, required) — Unique identifier of the captured transaction to refund.
  • Query Parameter: companyProjectId (guid, required) — Company project ID for security validation.

Output

Returns a TransactionRefundAdminCommandResponse indicating refund processing result.

Example Request

POST /api/admin/transactions/a1b2c3d4-e5f6-7890-abcd-ef1234567890/refund?companyProjectId=3fa85f64-5717-4562-b3fc-2c963f66afa6
Authorization: Bearer {admin-token}

Example Response

{
  "success": true,
  "code": 200,
  "errorMessage": null,
  "transactionId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  "refundId": "c3d4e5f6-a7b8-9012-cdef-123456789012",
  "amount": 99.99,
  "status": "Refunded",
  "message": "Refund processed successfully"
}

Errors

  • 400 Bad Request — Transaction not captured (use reversal instead), already refunded, or refund exceeds original amount.
  • 404 Not Found — No transaction exists with the specified ID.

Notes

  • Only works on captured (settled) transactions.
  • For authorized but uncaptured transactions, use reversal operation.
  • Refunds typically take 3-10 business days to process.
  • Some processors charge fees for refunds.
  • Partial refunds may be supported depending on implementation.

Authorizations

Authorization
string
header
required

The access token received from the authorization server in the OAuth 2.0 flow.

Path Parameters

id
string<guid>
required

The unique identifier of the captured transaction to refund.

Query Parameters

companyProjectId
string<guid>

The company project ID for security validation.

Response

Always returned. Check the success property in the response body to determine if the operation succeeded.

Standard response structure containing operation status and error information. Standard command response indicating the result of a data modification.

success
boolean

True if the operation completed successfully; false if an error occurred.

Example:

true

code
enum<string>

Result code indicating the outcome of the operation.

Available options:
Unknown,
Success,
BadRequest,
Unauthorized,
NotFound,
Error
Example:

200

errorMessage
string | null

Human-readable error message when an error occurs.

Example:

null