Skip to content

feat(sessions): align session endpoint with API specification#858

Open
Naoray wants to merge 5 commits intomasterfrom
feat/update-session-endpoint
Open

feat(sessions): align session endpoint with API specification#858
Naoray wants to merge 5 commits intomasterfrom
feat/update-session-endpoint

Conversation

@Naoray
Copy link
Collaborator

@Naoray Naoray commented Jan 14, 2026

Summary

Align the session endpoint implementation with the API specification by replacing the express checkout flow with a standard session API that supports order lines, addresses, metadata, and other fields.

Features

  • align CreateSessionRequest with API specification
  • update Session resource to match API specification

Refactors

  • update SessionStatus constants and remove CheckoutFlow

Tests

  • update tests for new session endpoint structure
  • update mock response to match API specification

- Replace method/checkoutFlow parameters with lines (required)
- Add optional fields: billingAddress, shippingAddress, customerId, sequenceType, metadata, payment.webhookUrl, profileId
- Make cancelUrl optional
- Implement SupportsTestmodeInPayload interface
- Update RequestFactory to support nested payload lookup (payment.webhookUrl)
- Add clientAccessToken property (required)
- Add customerId, sequenceType, metadata, payment, lines properties
- Remove deprecated properties: authenticationId, nextAction, method, methodDetails, failedAt
- Update status helper methods: isCreated() -> isOpen(), hasFailed() -> isExpired(), remove isReadyForProcessing()
…tFlow

- Replace STATUS_CREATED, STATUS_READY_FOR_PROCESSING, STATUS_FAILED with OPEN, EXPIRED
- Change STATUS_COMPLETED to COMPLETED
- Remove CheckoutFlow type (no longer used)
- Update CreateSessionRequestTest to use lines parameter
- Add CreateSessionRequestFactoryTest with full and minimal data tests
- Update SessionEndpointCollectionTest to use new payload structure
- Add clientAccessToken (required)
- Update status to 'open' (valid values: open, expired, completed)
- Add redirectUrl, cancelUrl, metadata, payment, lines
- Remove deprecated fields: method, methodDetails, nextAction, createdAt
@Naoray Naoray changed the base branch from main to master January 14, 2026 08:54
@Naoray Naoray requested a review from sandervanhooft January 14, 2026 08:55
@fjbender
Copy link
Contributor

Can we hold off merging this into master but still make sure things work as expected? I'd like to keep this in a feature branch until the API stabilizes.

@sandervanhooft sandervanhooft removed their request for review February 9, 2026 12:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments