API Explorer

API Product Subscription

An API Product Subscription records that one Consumer (the subscriber) holds one API Product for a period, with a status. | |The API Product describes the plan: which endpoints (its API Collection), how many calls (six rate limits), the monthly price, and any attributes. The Subscription is the record of who holds it. Its status is what makes the product enforceable: | |- requested: created, nothing granted yet. |- active: OBP-API has given the Consumer a rate limit record with the product's six limits, and a Scope for each Role required by the endpoints in the product's Collection. |- past_due: payment is overdue. A grace period; nothing changes for the Consumer. |- suspended: the subscription's rate limit record is set to 0 in every period, which blocks the Consumer's calls. Scopes are kept so reinstatement is cheap. |- cancelled: the rate limit record and the derived Scopes are removed. Terminal; a new subscription is a new record. | |Only the rate limit record and the Scopes created by the subscription are touched. Limits and Scopes granted by hand are never removed. Overlapping rate limit records are summed, so a Consumer holding two products gets both allowances. | |Anyone who may act for a Consumer needs no Role to subscribe it, read its subscriptions or cancel them. That is the User who created it, or, once it belongs to an here, every member of that Organisation. Roles exist for bank staff (enrol a partner's Consumer, approve, suspend, reinstate) and for billing systems (move the status on payment events). Two attributes on the API Product decide the flow: SELF_SUBSCRIBE (may developers subscribe their own Consumers; default true) and BILLING_SYSTEM (none activates at once; manual waits for a bank admin; stripe or invoice_ninja waits for that billing system). | |OBP-API core carries no billing vocabulary: payments, invoices and refunds live in the billing system, which only ever changes the subscription status. For stripe, that billing system is here. | |## Endpoints | |- Create Api Product Subscription: POST /obp/v7.0.0/banks/BANK_ID/api-products/API_PRODUCT_CODE/subscriptions |- Get My Api Product Subscriptions: GET /obp/v7.0.0/my/api-product-subscriptions |- Cancel My Api Product Subscription: PUT /obp/v7.0.0/my/api-product-subscriptions/API_PRODUCT_SUBSCRIPTION_ID/status |- Get My Consumer Api Product Subscriptions: GET /obp/v7.0.0/my/consumers/CONSUMER_ID/api-product-subscriptions |- Get Api Product Subscriptions by Product: GET /obp/v7.0.0/banks/BANK_ID/api-products/API_PRODUCT_CODE/subscriptions |- Update Api Product Subscription Status: PUT /obp/v7.0.0/management/api-product-subscriptions/API_PRODUCT_SUBSCRIPTION_ID/status |- Delete Api Product Subscription: DELETE /obp/v7.0.0/management/api-product-subscriptions/API_PRODUCT_SUBSCRIPTION_ID |