cURL
curl --request POST \
--url https://api.tirdad.ai/v1/refunds/{id}/retry \
--header 'x-api-key: <api-key>'from tirdad_sdk import Tirdad
with Tirdad(
api_key_auth="<YOUR_API_KEY_HERE>",
) as f_client:
res = f_client.refunds.retry_refund(id="<id>")
# Handle response
print(res)import { Tirdad } from "@tirdad/sdk";
const tirdad = new Tirdad({
apiKeyAuth: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await tirdad.refunds.retryRefund("<id>");
console.log(result);
}
run();package main
import(
"context"
tirdad "github.com/tirdad-billing/go-sdk/v2"
"log"
)
func main() {
ctx := context.Background()
s := tirdad.New(
tirdad.WithSecurity("<YOUR_API_KEY_HERE>"),
)
res, err := s.Refunds.RetryRefund(ctx, "<id>")
if err != nil {
log.Fatal(err)
}
if res.RefundResponse != nil {
// handle response
}
}{
"amount": "<string>",
"attempt": 123,
"cancelled_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"created_by": "<string>",
"credit_note_id": "<string>",
"currency": "<string>",
"environment_id": "<string>",
"failed_at": "2023-11-07T05:31:56Z",
"failure_reason": "<string>",
"gateway_idempotency_token": "<string>",
"gateway_metadata": {},
"gateway_refund_id": "<string>",
"gateway_tracking_id": "<string>",
"id": "<string>",
"idempotency_key": "<string>",
"initiated_at": "2023-11-07T05:31:56Z",
"invoice_id": "<string>",
"metadata": {},
"payment_gateway": "<string>",
"payment_id": "<string>",
"refund_destination": "GATEWAY",
"refund_destination_id": "<string>",
"refund_reason": "DUPLICATE",
"refund_status": "PENDING",
"settled_amount": "<string>",
"status": "published",
"succeeded_at": "2023-11-07T05:31:56Z",
"tenant_id": "<string>",
"updated_at": "2023-11-07T05:31:56Z",
"updated_by": "<string>"
}{
"code": "http_client_error",
"http_status_code": 123,
"message": "<string>"
}{
"code": "http_client_error",
"http_status_code": 123,
"message": "<string>"
}{
"code": "http_client_error",
"http_status_code": 123,
"message": "<string>"
}{
"code": "http_client_error",
"http_status_code": 123,
"message": "<string>"
}Refunds
Retry refund
Use when a refund failed or is stuck pending. A failed gateway refund is retried into the customer’s wallet; an already-settled refund is rejected.
POST
/
refunds
/
{id}
/
retry
cURL
curl --request POST \
--url https://api.tirdad.ai/v1/refunds/{id}/retry \
--header 'x-api-key: <api-key>'from tirdad_sdk import Tirdad
with Tirdad(
api_key_auth="<YOUR_API_KEY_HERE>",
) as f_client:
res = f_client.refunds.retry_refund(id="<id>")
# Handle response
print(res)import { Tirdad } from "@tirdad/sdk";
const tirdad = new Tirdad({
apiKeyAuth: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await tirdad.refunds.retryRefund("<id>");
console.log(result);
}
run();package main
import(
"context"
tirdad "github.com/tirdad-billing/go-sdk/v2"
"log"
)
func main() {
ctx := context.Background()
s := tirdad.New(
tirdad.WithSecurity("<YOUR_API_KEY_HERE>"),
)
res, err := s.Refunds.RetryRefund(ctx, "<id>")
if err != nil {
log.Fatal(err)
}
if res.RefundResponse != nil {
// handle response
}
}{
"amount": "<string>",
"attempt": 123,
"cancelled_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"created_by": "<string>",
"credit_note_id": "<string>",
"currency": "<string>",
"environment_id": "<string>",
"failed_at": "2023-11-07T05:31:56Z",
"failure_reason": "<string>",
"gateway_idempotency_token": "<string>",
"gateway_metadata": {},
"gateway_refund_id": "<string>",
"gateway_tracking_id": "<string>",
"id": "<string>",
"idempotency_key": "<string>",
"initiated_at": "2023-11-07T05:31:56Z",
"invoice_id": "<string>",
"metadata": {},
"payment_gateway": "<string>",
"payment_id": "<string>",
"refund_destination": "GATEWAY",
"refund_destination_id": "<string>",
"refund_reason": "DUPLICATE",
"refund_status": "PENDING",
"settled_amount": "<string>",
"status": "published",
"succeeded_at": "2023-11-07T05:31:56Z",
"tenant_id": "<string>",
"updated_at": "2023-11-07T05:31:56Z",
"updated_by": "<string>"
}{
"code": "http_client_error",
"http_status_code": 123,
"message": "<string>"
}{
"code": "http_client_error",
"http_status_code": 123,
"message": "<string>"
}{
"code": "http_client_error",
"http_status_code": 123,
"message": "<string>"
}{
"code": "http_client_error",
"http_status_code": 123,
"message": "<string>"
}Response
OK