Documentation Sweet Pricing API

GET / apps / :appId

This endpoint returns configuration details for a Sweet Pricing mobile app, including details of the subscription plan that is currently active.

Although you might create an app using a 'marketapp hash' (see POST /apps), this endpoint's response contains more detail about an app. It contains the platform ID (either 'Android' or 'iOS') and the writeKey that you must use when sending event data to Sweet Pricing.

Importantly, it returns the currently active subscription plan. This tells you whether your app can use Sweet Pricing Lite or Sweet Pricing Pro functionality. If you are using Pro and downgrade to Lite halfway through a billing cycle, this endpoint will continue to return 'Pro' until the end of the billing period.

URL

https://api.sweetpricing.com/v1.0/apps/:appId

Header

Field Type Description
Authorization String

Header of form api-key <API key>

Authorization: api-key <API Key>

Parameters

Field Type Description
:appId Number

App ID.

200

Field Type Description
id Number

ID of the app.

created String

ISO 8601 date of app creation.

name String

App's name.

Size: ..255

platform Object
platform.id Number

Platform ID.

platform.name String

One of 'Android' or 'iOS'.

writeKey String

Write key for this app.

plan Object
plan.isLite Boolean

True if it's the lite plan

plan.isPro Boolean

True if it's the pro plan

plan.isDynamic Boolean

True if it's the dynamic plan

plan.needBilling Boolean

True if billing details required.

marketapp Object
marketapp.hash String

Hash identifier for marketapp

{
	"id": 1,
	"created": "2016-02-17T16:40:06+00:00",
	"name": "My New App",
	"platform": {
		"id": 1,
		"name": "Android"
	},
	"writeKey": "b099e94449d816c3c200f40b5b77c858",
	"plan": {
	  "isLite": false,
	  "isPro": true,
	  "isDynamic": false,
	  "needBilling": true
	},
	"marketapp": {
	  "hash": "c099e94449d816c3c200f40b5b77c858"
	}
}

401

Name Description
401

You are not authenticated to perform the request.

403

Name Description
403

You are not allowed to view/modify this resource.

404

Name Description
404

Resource not found.