When retrieving a subscription via subscriptionsController.getSubscription() , the returned result object is missing the status property (e.g. ACTIVE , APPROVED , CANCELLED ).
Because the SDK is generated using APIMatic and the subscriptionSchema omits status , the deserializer aggressively strips the field out of the response. This means it is not only missing from the TypeScript interface, but it evaluates to undefined at runtime on the result object, making it
impossible to check a subscription's state through the official type.
Steps to Reproduce:
- Fetch any existing subscription using the SDK:
const { subscriptionsController } = client;
const { result } = await subscriptionsController.getSubscription({ id: 'I-XXXXXXXXXXXX' });
console.log(result.status);
// Expected: "ACTIVE" (or similar)
// Actual: undefined
- Look at node_modules/@paypal/paypal-server-sdk/src/models/subscription.ts -> The Subscription interface has no status field.
- Look at subscriptionSchema -> The status mapping is omitted, causing APIMatic's lazy object parser to drop it from the API response payload.
Expected Behavior:
The Subscription interface should include status?: string (or a status enum), and the subscriptionSchema should map the status field so that it is preserved on the returned result object, matching the official PayPal Subscriptions REST API documentation
https://developer.paypal.com/docs/api/subscriptions/v1/#subscriptions_get.
Environment:
• SDK Version: (insert your version, e.g., @paypal/paypal-server-sdk@0.5.1 )
• Node Version: (insert your version)
When retrieving a subscription via subscriptionsController.getSubscription() , the returned result object is missing the status property (e.g. ACTIVE , APPROVED , CANCELLED ).
Because the SDK is generated using APIMatic and the subscriptionSchema omits status , the deserializer aggressively strips the field out of the response. This means it is not only missing from the TypeScript interface, but it evaluates to undefined at runtime on the result object, making it
impossible to check a subscription's state through the official type.
Steps to Reproduce:
Expected Behavior:
The Subscription interface should include status?: string (or a status enum), and the subscriptionSchema should map the status field so that it is preserved on the returned result object, matching the official PayPal Subscriptions REST API documentation
https://developer.paypal.com/docs/api/subscriptions/v1/#subscriptions_get.
Environment:
• SDK Version: (insert your version, e.g., @paypal/paypal-server-sdk@0.5.1 )
• Node Version: (insert your version)