cURL
curl --request PUT \
--url https://api.tirdad.ai/v1/payments/{id} \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"error_message": "<string>",
"failed_at": "2023-11-07T05:31:56Z",
"gateway_payment_id": "<string>",
"gateway_tracking_id": "<string>",
"metadata": {},
"payment_gateway": "<string>",
"payment_method_id": "<string>",
"payment_status": "<string>",
"refunded_at": "2023-11-07T05:31:56Z",
"succeeded_at": "2023-11-07T05:31:56Z",
"voided_at": "2023-11-07T05:31:56Z"
}
'from tirdad_sdk import Tirdad
with Tirdad(
api_key_auth="<YOUR_API_KEY_HERE>",
) as f_client:
res = f_client.payments.update_payment(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.payments.updatePayment("<id>", {});
console.log(result);
}
run();package main
import(
"context"
tirdad "github.com/tirdad-billing/go-sdk/v2"
"github.com/tirdad-billing/go-sdk/v2/models/types"
"log"
)
func main() {
ctx := context.Background()
s := tirdad.New(
tirdad.WithSecurity("<YOUR_API_KEY_HERE>"),
)
res, err := s.Payments.UpdatePayment(ctx, "<id>", types.UpdatePaymentRequest{})
if err != nil {
log.Fatal(err)
}
if res.PaymentResponse != nil {
// handle response
}
}{
"amount": "<string>",
"attempts": [
{
"attempt_number": 123,
"created_at": "2023-11-07T05:31:56Z",
"created_by": "<string>",
"error_message": "<string>",
"id": "<string>",
"metadata": {},
"payment_id": "<string>",
"tenant_id": "<string>",
"updated_at": "2023-11-07T05:31:56Z",
"updated_by": "<string>"
}
],
"created_at": "2023-11-07T05:31:56Z",
"created_by": "<string>",
"currency": "<string>",
"destination_id": "<string>",
"destination_type": "INVOICE",
"environment_id": "<string>",
"error_message": "<string>",
"failed_at": "2023-11-07T05:31:56Z",
"gateway_metadata": {},
"gateway_payment_id": "<string>",
"gateway_tracking_id": "<string>",
"id": "<string>",
"idempotency_key": "<string>",
"invoice_number": "<string>",
"metadata": {},
"payment_gateway": "<string>",
"payment_method_id": "<string>",
"payment_method_type": "CARD",
"payment_status": "INITIATED",
"payment_url": "<string>",
"refunded_at": "2023-11-07T05:31:56Z",
"save_card_and_make_default": true,
"succeeded_at": "2023-11-07T05:31:56Z",
"tenant_id": "<string>",
"track_attempts": true,
"updated_at": "2023-11-07T05:31:56Z",
"updated_by": "<string>",
"voided_at": "2023-11-07T05:31:56Z"
}{
"code": "http_client_error",
"http_status_code": 123,
"message": "<string>"
}{
"code": "http_client_error",
"http_status_code": 123,
"message": "<string>"
}Payments
Update payment
Use when updating payment status or metadata (e.g. after reconciliation or adding a reference).
PUT
/
payments
/
{id}
cURL
curl --request PUT \
--url https://api.tirdad.ai/v1/payments/{id} \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"error_message": "<string>",
"failed_at": "2023-11-07T05:31:56Z",
"gateway_payment_id": "<string>",
"gateway_tracking_id": "<string>",
"metadata": {},
"payment_gateway": "<string>",
"payment_method_id": "<string>",
"payment_status": "<string>",
"refunded_at": "2023-11-07T05:31:56Z",
"succeeded_at": "2023-11-07T05:31:56Z",
"voided_at": "2023-11-07T05:31:56Z"
}
'from tirdad_sdk import Tirdad
with Tirdad(
api_key_auth="<YOUR_API_KEY_HERE>",
) as f_client:
res = f_client.payments.update_payment(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.payments.updatePayment("<id>", {});
console.log(result);
}
run();package main
import(
"context"
tirdad "github.com/tirdad-billing/go-sdk/v2"
"github.com/tirdad-billing/go-sdk/v2/models/types"
"log"
)
func main() {
ctx := context.Background()
s := tirdad.New(
tirdad.WithSecurity("<YOUR_API_KEY_HERE>"),
)
res, err := s.Payments.UpdatePayment(ctx, "<id>", types.UpdatePaymentRequest{})
if err != nil {
log.Fatal(err)
}
if res.PaymentResponse != nil {
// handle response
}
}{
"amount": "<string>",
"attempts": [
{
"attempt_number": 123,
"created_at": "2023-11-07T05:31:56Z",
"created_by": "<string>",
"error_message": "<string>",
"id": "<string>",
"metadata": {},
"payment_id": "<string>",
"tenant_id": "<string>",
"updated_at": "2023-11-07T05:31:56Z",
"updated_by": "<string>"
}
],
"created_at": "2023-11-07T05:31:56Z",
"created_by": "<string>",
"currency": "<string>",
"destination_id": "<string>",
"destination_type": "INVOICE",
"environment_id": "<string>",
"error_message": "<string>",
"failed_at": "2023-11-07T05:31:56Z",
"gateway_metadata": {},
"gateway_payment_id": "<string>",
"gateway_tracking_id": "<string>",
"id": "<string>",
"idempotency_key": "<string>",
"invoice_number": "<string>",
"metadata": {},
"payment_gateway": "<string>",
"payment_method_id": "<string>",
"payment_method_type": "CARD",
"payment_status": "INITIATED",
"payment_url": "<string>",
"refunded_at": "2023-11-07T05:31:56Z",
"save_card_and_make_default": true,
"succeeded_at": "2023-11-07T05:31:56Z",
"tenant_id": "<string>",
"track_attempts": true,
"updated_at": "2023-11-07T05:31:56Z",
"updated_by": "<string>",
"voided_at": "2023-11-07T05:31:56Z"
}{
"code": "http_client_error",
"http_status_code": 123,
"message": "<string>"
}{
"code": "http_client_error",
"http_status_code": 123,
"message": "<string>"
}Body
application/json
Payment configuration
Response
Updated payment