Skip to content

Bug: Subscription type and APIMatic schema are missing the status property #69

Description

@wawyed

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:

  1. 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                                                                                                                                                                                                                                                                                          
  1. Look at node_modules/@paypal/paypal-server-sdk/src/models/subscription.ts -> The Subscription interface has no status field.
  2. 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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions