Documentation Sweet Pricing API

POST / apps

This endpoint creates a new app within Sweet Pricing from a marketplace app, i.e. a mobile app that pre-exists on Google Play or iTunes.

To use this endpoint, you must first find the 'marketapp hash', which is a Sweet Pricing identifier that uniquely identifies an app on the Google Play or iTunes app stores. If you use the App Finder tool to find your app, you will discover a URL of the following format:

https://sweetpricing.com/en/marketapps/<MARKETAPP_HASH>

From this URL, <MARKETAPP_HASH> is the identifier you should pass to POST /apps. This identifier is 40 hexadecimal characters in length.

You can also create a client's first app with the POST /clients or POST /users endpoints.

You cannot currently create an app that does not already exist on Google Play or iTunes. If you wish to use Sweet Pricing for such an app, please contact us.

URL

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

Header

Field Type Description
Authorization String

Header of form api-key <API key>

Authorization: api-key <API Key>

Body

Field Type Description
marketapp Object
marketapp.hash String

Hash identifier for marketapp

name Mixed

String|null App's name if marketapp.hash not specified.

platform Object
platform.id Mixed

Number|null Platform ID if marketapp.hash not specific

nextplan Object
nextplan.id Object

ID of the subscription plan.

googlePlayPublicKey Mixed

String|null Google Play public key for IAP verification.

{
	"marketapp": {
	  "hash": "c099e94449d816c3c200f40b5b77c858"
	},
	"nextplan": {
	  "id": 1
	},
	"googlePlayPublicKey": null
}

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

googlePlayPublicKey Mixed

String|null Google Play public key for IAP verification.

{
	"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"
	},
	"googlePlayPublicKey": null
}

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.

HTTP/1.1 400 Bad Request
[{
	"fieldName": "name",
	"error": "InvalidName"
	"message": "No app name provided."
}]