cURL
curl --request GET \
--url https://api.tirdad.ai/v1/checkout/sessions/{id} \
--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.checkout.get_checkout_session(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.checkout.getCheckoutSession("<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.Checkout.GetCheckoutSession(ctx, "<id>")
if err != nil {
log.Fatal(err)
}
if res.CheckoutSessionResponse != nil {
// handle response
}
}{
"action": "create_subscription",
"cancel_url": "<string>",
"cancelled_at": "2023-11-07T05:31:56Z",
"checkout_invoice_id": "<string>",
"checkout_payment_id": "<string>",
"checkout_status": "initiated",
"completed_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"customer_id": "<string>",
"entity_creation_result": {
"entity_id": "<string>",
"status": "created"
},
"expires_at": "2023-11-07T05:31:56Z",
"failure_reason": "<string>",
"failure_url": "<string>",
"id": "<string>",
"idempotency_key": "<string>",
"metadata": {},
"next_poll_after_ms": 123,
"payment": {
"gateway": "<string>",
"id": "<string>",
"status": "INITIATED"
},
"payment_action": {
"type": "checkout_url",
"url": "<string>"
},
"payment_provider": "razorpay",
"stale": true,
"success_url": "<string>",
"terminal": true,
"updated_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>"
}Checkout
Get checkout session
GET
/
checkout
/
sessions
/
{id}
cURL
curl --request GET \
--url https://api.tirdad.ai/v1/checkout/sessions/{id} \
--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.checkout.get_checkout_session(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.checkout.getCheckoutSession("<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.Checkout.GetCheckoutSession(ctx, "<id>")
if err != nil {
log.Fatal(err)
}
if res.CheckoutSessionResponse != nil {
// handle response
}
}{
"action": "create_subscription",
"cancel_url": "<string>",
"cancelled_at": "2023-11-07T05:31:56Z",
"checkout_invoice_id": "<string>",
"checkout_payment_id": "<string>",
"checkout_status": "initiated",
"completed_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"customer_id": "<string>",
"entity_creation_result": {
"entity_id": "<string>",
"status": "created"
},
"expires_at": "2023-11-07T05:31:56Z",
"failure_reason": "<string>",
"failure_url": "<string>",
"id": "<string>",
"idempotency_key": "<string>",
"metadata": {},
"next_poll_after_ms": 123,
"payment": {
"gateway": "<string>",
"id": "<string>",
"status": "INITIATED"
},
"payment_action": {
"type": "checkout_url",
"url": "<string>"
},
"payment_provider": "razorpay",
"stale": true,
"success_url": "<string>",
"terminal": true,
"updated_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>"
}Response
OK