Android · Arazzo Workflow

Android Revoke and Refund a Subscription Purchase

Version 1.0.0

Immediately terminate a subscriber's access and issue a refund, with a pre-flight read and a post-revoke state confirmation.

1 workflow 1 source API 1 provider
View Spec View on GitHub Artificial IntelligenceAndroidAutomotiveGoogleMachine-LearningMobile DevelopmentSDKTVWearablesArazzoWorkflows

Provider

android

Workflows

revoke-subscription-purchase
Verify a subscription, revoke and refund it immediately, then confirm the terminal subscription state.
Reads the subscription purchase for the audit record, revokes it (which refunds the subscriber and terminates access at once), and reads the resulting state back through the Subscriptions v2 API.
3 steps inputs: packageName, purchaseToken, subscriptionId outputs: finalSubscriptionState, refundedAmountMicros, revokedOrderId
1
readSubscriptionBeforeRevoke
Capture the subscription state, order id, and price before revoking, so the irreversible action is recorded against known-good live data.
2
revokeSubscription
Refund and immediately revoke the subscription. Access is terminated at once and the refund is issued. This cannot be undone.
3
confirmRevocation
Read the subscription through the v2 API to confirm it now reports a terminal state and to capture the cancellation context for the audit log.

Source API Descriptions

Arazzo Workflow Specification

Raw ↑
arazzo: 1.0.1
info:
  title: Android Revoke and Refund a Subscription Purchase
  summary: Immediately terminate a subscriber's access and issue a refund, with a pre-flight read and a post-revoke state confirmation.
  description: >-
    Revoking is the destructive counterpart to cancelling: it refunds the
    subscriber and cuts their access off immediately rather than letting the
    paid period run out, and it cannot be undone. It is the right tool for
    fraud, chargeback prevention, and abuse enforcement — and the wrong tool for
    an ordinary "please cancel" request. Because it is irreversible, this
    workflow deliberately reads the subscription state before the revoke so the
    decision is made against live data, and confirms the terminal state through
    the v2 API afterwards for the audit trail. Every step spells out its request
    inline so the flow can be read and executed without opening the underlying
    OpenAPI description.
  version: 1.0.0
  x-realizes-capability-ids:
  - BC-4240.70
  x-capability-derivation:
    method: 'deterministic join: sourceDescriptions -> per-tag OpenAPI -> tag/capability edge. No classification at this step.'
    min_confidence: 0.7
    sources:
    - capability_id: BC-4240.70
      capability_name: Entitlement Enforcement
      spec: android-purchases-api-openapi.yml
      confidence: 0.7
    model: Turbo EA Capabilities by Vincent Verdet — Turbo EA, https://github.com/vincentmakes/turbo-ea-capabilities, CC BY 4.0
sourceDescriptions:
- name: purchasesApi
  url: ../openapi/android-purchases-api-openapi.yml
  type: openapi
workflows:
- workflowId: revoke-subscription-purchase
  summary: Verify a subscription, revoke and refund it immediately, then confirm the terminal subscription state.
  description: >-
    Reads the subscription purchase for the audit record, revokes it (which
    refunds the subscriber and terminates access at once), and reads the
    resulting state back through the Subscriptions v2 API.
  inputs:
    type: object
    required:
    - packageName
    - subscriptionId
    - purchaseToken
    properties:
      packageName:
        type: string
        description: The package name of the application (e.g. com.example.myapp).
      subscriptionId:
        type: string
        description: The subscription product id the purchase relates to.
      purchaseToken:
        type: string
        description: >-
          The subscription purchase token to revoke. Revocation is immediate and
          irreversible.
  steps:
  - stepId: readSubscriptionBeforeRevoke
    description: >-
      Capture the subscription state, order id, and price before revoking, so
      the irreversible action is recorded against known-good live data.
    operationId: getPurchaseSubscription
    parameters:
    - name: packageName
      in: path
      value: $inputs.packageName
    - name: subscriptionId
      in: path
      value: $inputs.subscriptionId
    - name: token
      in: path
      value: $inputs.purchaseToken
    successCriteria:
    - condition: $statusCode == 200
    outputs:
      orderId: $response.body#/orderId
      expiryTimeMillis: $response.body#/expiryTimeMillis
      autoRenewing: $response.body#/autoRenewing
      priceAmountMicros: $response.body#/priceAmountMicros
      priceCurrencyCode: $response.body#/priceCurrencyCode
      countryCode: $response.body#/countryCode
      obfuscatedExternalAccountId: $response.body#/obfuscatedExternalAccountId
  - stepId: revokeSubscription
    description: >-
      Refund and immediately revoke the subscription. Access is terminated at
      once and the refund is issued. This cannot be undone.
    operationId: revokePurchaseSubscription
    parameters:
    - name: packageName
      in: path
      value: $inputs.packageName
    - name: subscriptionId
      in: path
      value: $inputs.subscriptionId
    - name: token
      in: path
      value: $inputs.purchaseToken
    successCriteria:
    - condition: $statusCode == 204
  - stepId: confirmRevocation
    description: >-
      Read the subscription through the v2 API to confirm it now reports a
      terminal state and to capture the cancellation context for the audit log.
    operationId: getSubscriptionPurchaseV2
    parameters:
    - name: packageName
      in: path
      value: $inputs.packageName
    - name: token
      in: path
      value: $inputs.purchaseToken
    successCriteria:
    - condition: $statusCode == 200
    outputs:
      subscriptionState: $response.body#/subscriptionState
      canceledStateContext: $response.body#/canceledStateContext
      latestOrderId: $response.body#/latestOrderId
  outputs:
    revokedOrderId: $steps.readSubscriptionBeforeRevoke.outputs.orderId
    refundedAmountMicros: $steps.readSubscriptionBeforeRevoke.outputs.priceAmountMicros
    finalSubscriptionState: $steps.confirmRevocation.outputs.subscriptionState

Work with this as data

Every workflow here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for arazzo workflows

4 MCP tools reach this
  • find_arazzoBrowse and filter every workflow in the catalog.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This workflow
curl "https://apis.io/api/v1/arazzo/android-revoke-subscription-purchase-workflow"
All arazzo workflows
curl "https://apis.io/api/v1/arazzo?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.