Documentation Sweet Pricing API

POST / variant

This endpoint gets the prices that your app displays to its users, after selecting a pricing model, calculating engagement and applying segmentation rules.

See our blog to see how this endpoint uses Redis and Node.js to deliver prices to your app.

URL

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

String

Field Type Description
messageId String

Unique message identifier

type String

This must equal 'variantRequest'

channel String

This must equal 'mobile'

context Object
context.app Object
context.app.build Number
context.app.name String
context.app.namespace String
context.app.version String
context.traits Object
context.traits.anonymousId String
context.traits.userId String
context.library Object
context.library.name String
context.library.version String
context.os Object
context.os.name String
context.os.version String
context.timezone String
context.screen Object
context.screen.density Number
context.screen.width Number
context.screen.height Number
context.userAgent String
context.locale String
context.device Object
context.device.id String
context.device.manufacturer String
context.device.model String
context.device.name String
context.network Object
context.network.wifi Boolean
context.network.carrier String
context.network.bluetooth Boolean
context.network.cellular Boolean
productGroupId String

ID of the product group

200

Field Type Description
id Number

ID of the variant.

skus Object

Object of SKUs for each product ID

{
	"id": 1,
	"skus": {
		"4": "com.sweetpricing.1month",
		"5": "com.sweetpricing.6month"
	}
}

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.