Astrada TypeScript SDK
    Preparing search index...

    Class CardSubscriptionApi

    Hierarchy (View Summary)

    Index
    configuration: Configuration
    middleware: Middleware[]

    The middleware of this instance; protected so hand-written subclasses can pass it on.

    • Check if the given MIME is a JSON MIME. JSON MIME examples: application/json application/json; charset=UTF8 APPLICATION/JSON application/vnd.company+json

      Parameters

      • mime: string

        MIME (Multipurpose Internet Mail Extensions)

      Returns boolean

      True if the given MIME is JSON, false otherwise.

    • Returns all card subscriptions under the account, ordered by createdAt descending (most recently created first). The subaccountId, cardId, bankAccountId, state, networkBulkFeedId, companyId, legalEntityId and legalEntityName filters are independent and combine additively; supplying more than one narrows the result set to subscriptions matching all of them. companyId, legalEntityId and legalEntityName filter on the card's cardholder as it is now: corporate.id, corporate.legalEntity.id and corporate.legalEntity.name (see the Glossary). Each is an exact match; legalEntityName is case-sensitive, and each of legalEntityId and legalEntityName never matches a cardholder whose legal entity lacks that field, so copy it from the cardholder (expand=cardholder shows each cardholder's company and legal entity in the same response). For example, this returns the active subscriptions of one legal entity on one feed: GET /card-subscriptions?networkBulkFeedId=<feed>&legalEntityId=<id>&state=active These three filters read cardholder data, so they need the cardholder:read scope, like expand=cardholder. Without it the request returns 403. Filtering by state accepts any of the states a card subscription reports in its response payload: - pending: enrolled from a network roster while the card is still inactive at the network. The subscription is fully enrolled and billable, but has not yet transacted. - active: also returns subscriptions still completing activation, which already report their own state as active. - deactivated, expired, reqSCA, failed-to-create: matched exactly. This endpoint supports offset-based pagination. Pagination links preserve any filters applied to the original request. Use expand to embed each subscription's card and cardholder in the same response (?expand=card,cardholder) instead of calling GET /cards/{cardId} and GET /cards/{cardId}/cardholder per item. Each embedded resource appears under the item's _embedded with the exact body its own endpoint serves, and requires that endpoint's scope (cards:read for card, cardholder:read for cardholder). Pagination links preserve expand like any other parameter. List card subscriptions

      Parameters

      Returns Promise<CardSubscriptionList>

    • Returns all card subscriptions under the account, ordered by createdAt descending (most recently created first). The subaccountId, cardId, bankAccountId, state, networkBulkFeedId, companyId, legalEntityId and legalEntityName filters are independent and combine additively; supplying more than one narrows the result set to subscriptions matching all of them. companyId, legalEntityId and legalEntityName filter on the card's cardholder as it is now: corporate.id, corporate.legalEntity.id and corporate.legalEntity.name (see the Glossary). Each is an exact match; legalEntityName is case-sensitive, and each of legalEntityId and legalEntityName never matches a cardholder whose legal entity lacks that field, so copy it from the cardholder (expand=cardholder shows each cardholder's company and legal entity in the same response). For example, this returns the active subscriptions of one legal entity on one feed: GET /card-subscriptions?networkBulkFeedId=<feed>&legalEntityId=<id>&state=active These three filters read cardholder data, so they need the cardholder:read scope, like expand=cardholder. Without it the request returns 403. Filtering by state accepts any of the states a card subscription reports in its response payload: - pending: enrolled from a network roster while the card is still inactive at the network. The subscription is fully enrolled and billable, but has not yet transacted. - active: also returns subscriptions still completing activation, which already report their own state as active. - deactivated, expired, reqSCA, failed-to-create: matched exactly. This endpoint supports offset-based pagination. Pagination links preserve any filters applied to the original request. Use expand to embed each subscription's card and cardholder in the same response (?expand=card,cardholder) instead of calling GET /cards/{cardId} and GET /cards/{cardId}/cardholder per item. Each embedded resource appears under the item's _embedded with the exact body its own endpoint serves, and requires that endpoint's scope (cards:read for card, cardholder:read for cardholder). Pagination links preserve expand like any other parameter. List card subscriptions

      Parameters

      Returns Promise<ApiResponse<CardSubscriptionList>>

    • Sends the request. Network errors and timeouts (while waiting for the answer or reading its body), 408, 429 and 5xx are retried for idempotent methods (see ConfigurationParameters.maxRetries). A 401 is retried once with a new token. Any other status outside 200 to 299 throws a ResponseError subclass. The body is read here, whole.

      Parameters

      Returns Promise<Response>

    • Updates an existing card subscription, allowing changes to its data-sharing state. Subscriptions that were enrolled in bulk, and where enrollmentType = \'network-bulk\' cannot be updated. Note: setting a card subscription to a deactivated state is a final action that cannot be undone. If the card also has a linked bank account, deactivating it stops that bank account's feed for the card too; to stop only the card network data, ask your Astrada contact. When deactivating, you can send an optional deactivationReason to record why the card was deactivated. Update card subscription

      Parameters

      Returns Promise<CardSubscription>

    • Updates an existing card subscription, allowing changes to its data-sharing state. Subscriptions that were enrolled in bulk, and where enrollmentType = \'network-bulk\' cannot be updated. Note: setting a card subscription to a deactivated state is a final action that cannot be undone. If the card also has a linked bank account, deactivating it stops that bank account's feed for the card too; to stop only the card network data, ask your Astrada contact. When deactivating, you can send an optional deactivationReason to record why the card was deactivated. Update card subscription

      Parameters

      Returns Promise<ApiResponse<CardSubscription>>