get/premium/store

Get in-app purchase context

Returns the account token and the App Store and Google Play products the mobile apps may sell, plus the reason a new subscription is blocked, if any.

get_store_billing_context

Responses

200

Success

json
{
  "type": "object",
  "properties": {
    "app_account_token": {
      "type": "string",
      "description": "Lowercase UUID for this account. Pass it as appAccountToken on App Store purchases and as obfuscatedAccountId on Google Play purchases"
    },
    "app_store": {
      "type": "object",
      "properties": {
        "enabled": {
          "type": "boolean",
          "description": "Whether App Store purchases are accepted"
        },
        "bundle_ids": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "App bundle identifiers whose purchases are accepted"
        },
        "products": {
          "type": "array",
          "items": {
            "$ref": "#/components/schemas/StoreBillingAppStoreProductResponse"
          },
          "description": "App Store products on sale"
        }
      },
      "required": [
        "enabled",
        "bundle_ids",
        "products"
      ],
      "additionalProperties": false,
      "description": "App Store purchase settings"
    },
    "google_play": {
      "type": "object",
      "properties": {
        "enabled": {
          "type": "boolean",
          "description": "Whether Google Play purchases are accepted"
        },
        "package_names": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "App package names whose purchases are accepted"
        },
        "products": {
          "type": "array",
          "items": {
            "$ref": "#/components/schemas/StoreBillingGooglePlayProductResponse"
          },
          "description": "Google Play products on sale"
        }
      },
      "required": [
        "enabled",
        "package_names",
        "products"
      ],
      "additionalProperties": false,
      "description": "Google Play purchase settings"
    },
    "purchase_blocked_reason": {
      "anyOf": [
        {
          "$ref": "#/components/schemas/StorePurchaseBlockedReason"
        },
        {
          "type": "null"
        }
      ],
      "description": "Why this account cannot buy a subscription right now, null when it can"
    },
    "blocking_provider": {
      "anyOf": [
        {
          "$ref": "#/components/schemas/StoreBlockingProvider"
        },
        {
          "type": "null"
        }
      ],
      "description": "Provider of the active subscription that blocks a new one, null when nothing blocks"
    }
  },
  "required": [
    "app_account_token",
    "app_store",
    "google_play",
    "purchase_blocked_reason",
    "blocking_provider"
  ],
  "additionalProperties": false
}
400

Bad Request - The request was malformed or contained invalid data

json
{
  "type": "object",
  "properties": {
    "code": {
      "type": "string",
      "description": "Machine-readable error code"
    },
    "message": {
      "type": "string",
      "description": "Human-readable error message"
    },
    "errors": {
      "description": "Field-specific validation errors",
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "path": {
            "type": "string",
            "description": "Field path that failed validation"
          },
          "code": {
            "description": "Machine-readable validation error code",
            "type": "string"
          },
          "message": {
            "type": "string",
            "description": "Human-readable validation error message"
          }
        },
        "required": [
          "path",
          "message"
        ],
        "additionalProperties": false
      }
    }
  },
  "required": [
    "code",
    "message"
  ],
  "additionalProperties": {}
}
401

Unauthorized - Authentication is required or the token is invalid

json
{
  "type": "object",
  "properties": {
    "code": {
      "type": "string",
      "description": "Machine-readable error code"
    },
    "message": {
      "type": "string",
      "description": "Human-readable error message"
    },
    "errors": {
      "description": "Field-specific validation errors",
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "path": {
            "type": "string",
            "description": "Field path that failed validation"
          },
          "code": {
            "description": "Machine-readable validation error code",
            "type": "string"
          },
          "message": {
            "type": "string",
            "description": "Human-readable validation error message"
          }
        },
        "required": [
          "path",
          "message"
        ],
        "additionalProperties": false
      }
    }
  },
  "required": [
    "code",
    "message"
  ],
  "additionalProperties": {}
}
403

Forbidden - You do not have permission to perform this action

json
{
  "type": "object",
  "properties": {
    "code": {
      "type": "string",
      "description": "Machine-readable error code"
    },
    "message": {
      "type": "string",
      "description": "Human-readable error message"
    },
    "errors": {
      "description": "Field-specific validation errors",
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "path": {
            "type": "string",
            "description": "Field path that failed validation"
          },
          "code": {
            "description": "Machine-readable validation error code",
            "type": "string"
          },
          "message": {
            "type": "string",
            "description": "Human-readable validation error message"
          }
        },
        "required": [
          "path",
          "message"
        ],
        "additionalProperties": false
      }
    }
  },
  "required": [
    "code",
    "message"
  ],
  "additionalProperties": {}
}
429

Too Many Requests - You are being rate limited

json
{
  "type": "object",
  "properties": {
    "code": {
      "type": "string",
      "description": "Machine-readable error code"
    },
    "message": {
      "type": "string",
      "description": "Human-readable error message"
    },
    "errors": {
      "description": "Field-specific validation errors",
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "path": {
            "type": "string",
            "description": "Field path that failed validation"
          },
          "code": {
            "description": "Machine-readable validation error code",
            "type": "string"
          },
          "message": {
            "type": "string",
            "description": "Human-readable validation error message"
          }
        },
        "required": [
          "path",
          "message"
        ],
        "additionalProperties": false
      }
    },
    "retry_after": {
      "type": "number",
      "description": "Seconds to wait before retrying"
    },
    "global": {
      "type": "boolean",
      "description": "Whether this is a global rate limit"
    }
  },
  "required": [
    "code",
    "message"
  ],
  "additionalProperties": {}
}
500

Internal Server Error - An unexpected error occurred

json
{
  "type": "object",
  "properties": {
    "code": {
      "type": "string",
      "description": "Machine-readable error code"
    },
    "message": {
      "type": "string",
      "description": "Human-readable error message"
    },
    "errors": {
      "description": "Field-specific validation errors",
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "path": {
            "type": "string",
            "description": "Field path that failed validation"
          },
          "code": {
            "description": "Machine-readable validation error code",
            "type": "string"
          },
          "message": {
            "type": "string",
            "description": "Human-readable validation error message"
          }
        },
        "required": [
          "path",
          "message"
        ],
        "additionalProperties": false
      }
    }
  },
  "required": [
    "code",
    "message"
  ],
  "additionalProperties": {}
}