https://graph.oculus.com
OC|$APPID|$APPSECRET
.ovr_User_GetAccessToken()
method.FRL
or OC
and a long alpha numeric string similar to the following: FRL12342GhFccWvUBxPMR4KXzM5s2ZCMp0mlWGq0ZBrOMXyjh4EmuAPvaXiMCAMV9okNm9DXdUA2EWNplrQ
.sku
, owner{id}
, and is_active
.GET https://graph.oculus.com/application/subscriptions
Parameter | Required or Optional | Description | Type | Example |
---|---|---|---|---|
access_token | Required | Bearer token that contains OC|$APP_ID |$APP_SECRET or the User Access Token | string | “OC|1234|456789” |
fields | Optional | A comma-separated list of field names. Can contain: owner, sku, period_start_time, period_end_time, cancellation_time, next_renewal_time, is_trial, trial_type, is_active, current_price_term, next_price_term. For more information, see Response Fields. | comma-separated string | “sku, is_trial, is_active, period_end_time, next_renewal_time, trial_type” |
owner_id | Optional | Restricts the result to a single owner ID. Can only be used with an app-secret access token. Use with a user access token will result in an error. | string | |
is_active | Optional | Set to true when a subscription is active. | bool | true |
is_trial | Optional | Set to true when the most recent subscription period is a free trial (7d, 14d, 30d). Does not indicate that the subscription itself is active. | bool | true |
skus | Optional | SKUs of subscriptions | comma-separated string | “SKU1,SKU2” |
fields
parameter. If specific response fields aren’t specified, the query returns only sku
, owner{id}
, and is_active
.Field | Definition | Type |
---|---|---|
id | Unique subscription identifier | string |
owner{id} | Unique user identifier | string |
sku | SKU of subscription | string |
period_start_time | The date when the most recent subscription period started | timestamp |
period_end_time | The date when the most recent subscription will end | timestamp |
cancellation_time | The date when the user last canceled the subscription. Does not affect period_end_time. | timestamp |
is_trial | Set to true when the most recent subscription period is a free trial (7d, 14d, 30d). Does not indicate that the subscription itself is active. | bool |
trial_type | Set to FREE_TRIAL or INTRO_OFFER to indicate the type of trial associated to the current subscription period. This field is only populated if is_trial is set to true . | string |
is_active | Set to true when a subscription is active. | bool |
next_renewal_time | The date when the subscription will next be billed. This date includes any extended time granted to the subscription | timestamp |
current_price_term | The price and term of the current subscription | Price Term |
next_price_term | The price and term the subscription will be renewed at next | Price Term |
Field | Definition | Type |
---|---|---|
term | The term of the subscription (e.g.: MONTHLY, ANNUAL, WEEKLY, etc.). May be empty for trial subscriptions. | string? |
currency | Unique user identifier | Currency of the price. For Example: USD, EUR |
price | Price of the subscription without the currency symbol. | string |
curl -d "access_token=OC|$APP_ID|$APP_SECRET" -d "fields=id,sku,owner{id},is_active,is_trial,trial_type,cancellation_time,period_start_time,period_end_time,next_renewal_time,current_price_term{term,currency,price},next_price_term{term,currency,price}" -G https://graph.oculus.com/application/subscriptions
{
"data": [
{
"id": "1231b2c3d4e5f6g7h8i9j0",
"sku": "OPTIONAL_SUBSCRIPTION",
"owner": {
"id": "3559884437424131"
},
"current_price_term": {
"price": "1.99",
"term": "MONTHLY",
"currency": "USD"
},
"next_price_term": {
"price": "1.99",
"term": "MONTHLY",
"currency": "USD"
},
"is_active": false,
"is_trial": false,
"period_start_time": "2021-03-09T13:04:20+0000",
"period_end_time": "2021-03-09T13:04:20+0000",
"next_renewal_time": "2021-03-09T13:04:20+0000"
},
],
"paging": {
"cursors": {
"before": "QVFIUlliZAnlkTEVnUkFkVTBJZAW9lMWprR0dkaGtuQjhTT0lTdzRiTEo1dkstSXoybDVRWEFFUzA0RURfQjVMMUxXZAzJ4VENTV1RadU9uejFaUmlIUlo4cUlR",
"after": "QVFIUlZAGTmllREUwcWdJRkhGcUtBWXZA2WWFvSkJHMlJ1dnpfVVRLU2ZAPNHc1MjVCbXc0d3YyWi1meU1DNjhQWTBJaldrcDIxVkpxNWZAMSmNfa2lOcldVTUhB"
}
}
}
POST https://graph.oculus.com/application/cancel_subscription
Parameter | Required or Optional | Description | Type | Example |
---|---|---|---|---|
owner_alias | Optional | Username of the subscriber | string | abc |
owner_id | Optional | The ID of the owner of a subscription requesting cancelation for. | string | |
sku | Required | The SKU associated with the subscription owned by the user. This sku must match the SKU of the current active subscription. | string | “bronze_tier” |
cancel_reason | Required | Reason for canceling the subscription. | int | 0 |
owner_id
or an owner_alias
is required to make the request.owner_alias
. For more information, see Complete a Data Use Checkup.0
as the cancel_reason
argument.cancel_reason
. This argument is an integer and the following cancel reason codes are supported.Code | Description |
---|---|
0 | Other/Testing |
1 | Pricing of the app |
2 | Content of the app |
3 | Usage of the app |
4 | Purchase by mistake |
5 | Technical Issues |
Field | Definition | Type |
---|---|---|
success | Set to true if a subscription was successfully canceled. | boolean |
https://graph.oculus.com/application/cancel_subscription
POST
{
"owner_alias": <owner_alias>,
"sku": test_sku,
"cancel_reason": 0
}
$ curl -X POST https://graph.oculus.com/application/cancel_subscription -d "access_token=<ACCESS_TOKEN>" -d “owner_alias=<OWNER_ALIAS>” -d “sku=test_sku” -d “cancel_reason=0”
{
"success": true
}
https://graph.oculus.com/application/cancel_subscription
POST
{
"'owner_id'": <owner_id>,
"sku": test_sku,
"cancel_reason": 0
}
$ curl -X POST https://graph.oculus.com/application/cancel_subscription -d "access_token=<ACCESS_TOKEN>" -d “owner_id=<OWNER_ID>” -d “sku=test_sku” -d “cancel_reason=0”
{
"success": true
}
next_renewal_time
will include the total amount of extended time after the current period end date.POST https://graph.oculus.com/application/extend_subscription
Parameter | Required or Optional | Description | Type | Example |
---|---|---|---|---|
owner_id | Optional | The ID of the owner of a subscription receiving the extension. | string | |
owner_alias | Optional | Username of the subscriber | string | abc |
number_of_days | Required | The number of days to extend a subscription | int | 14 |
sku | Required | The SKU associated with the subscription owned by the user. This sku must match the SKU of the current active subscription. | string | “bronze_tier” |
owner_id
or an owner_alias
is required to make the request.owner_alias
. For more information, see Complete a Data Use Checkup.Field | Definition | Type |
---|---|---|
success | Set to true if a subscription was successfully extended by the number of days provided in the request. | boolean |
https://graph.oculus.com/application/extend_subscription
POST
{
"owner_id": $OWNER_ID
"sku": "bronze_tier"
"number_of_days": 14
}
$ curl -X POST https://graph.oculus.com/application/extend_subscription -d "access_token=<ACCESS_TOKEN>" -d "owner_id=<OWNER_ID>" -d "sku=bronze_tier" -d "number_of_days=14"
{
"success": true
}
cancellation_time
field from the Server API endpoint for subscriptions.
If you cancel by alias, there is no supported way to verify via the API.cancel_reason
argument.owner_alias
. For more information, see Complete a Data Use Checkup.