Child Sessions
Quick Reference
- API Endpoint:
POST v1/checkout-sessions/{sessionId}/child-sessions - Scope:
user - Applicable Session Modes:
PAYMENT_WITH_WALLET,PAYMENT,WALLET - Key Fields:
childSession,childSessionStatus,parentSession,mode,status - Usage: Used for flows like Text to Pay, where a parent session delegates a specialized function to a child session.
- See Also: Get Checkout Session Details
Handling Child Sessions
- Use this API to enable delegation scenarios by linking a child session to a parent session.
- Supported Child Session Modes:
TEXT_TO_PAY,EMAIL_TO_PAY,TEXT_TO_ADD,EMAIL_TO_ADD
Create Child Session
Sample Request
Sample Request – Create Child Session
{
"email": "string",
"phone": {
"countryCode": "string",
"number": "string"
},
"childSessionMode": "TEXT_TO_ADD"
}
Sample Response
- Child session inherit all the information from parent session
- Child session response does not include childSessionObject
- Refer to Sample Response – Get Checkout Session
Child Session Statuses
Child Session Statuses
| Status | Description |
|---|---|
| NOTIFICATION_CREATED | Initial state after notification sent to customer |
| NOTIFICATION_SENT | After notification delivered to customer |
| LINK_OPENED | Customer has opened the notification link |
| COMPLETED | Successfully completed its function |
| FAILED | Failed to complete its function |
| CANCELED | Explicitly canceled |
| EXPIRED | Exceeded its time limit |
Sample Use Case: Text to Pay Notification Flow
- Parent session creates child session with
NOTIFICATION_CREATEDmode - System sends notification to customer with link
- Status set to
NOTIFICATION_SENT - When customer opens link, status updates to
LINK_OPENED - When customer completes action, status updates to
COMPLETED
Error Handling
When a child session encounters an error:
- The error details are stored in the child session
- The parent session is notified of the error
- Appropriate error responses are generated for API consumers