Documentation Sweet Pricing API

POST / events

This endpoint accepts event data from mobile apps. When the user views an in-app store or makes a purchase, this endpoint tracks the event.

Our Android and iOS client libraries track the 'view variant' event when the user views an in-app store, and the 'purchase' event when the user makes an in-app purchase. The mobile device buffers up these events and periodically sends them to this endpoint.

This endpoint accepts a batch of events for efficiency. Each event contains details about the user, their mobile device and event-specific properties such as product group ID or price.

We do not process events immediately, so you will not see instant results from the GET /variants/:variantId/stats endpoint, for example. This endpoint adds events to a queue for processing, and we normally process events within a few seconds.

URL

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

Header

Field Type Description
Authorization String

Header of form api-key <API key>

Authorization: api-key <API Key>

Body

Field Type Description
batch Object[]

Array of events.

batch.messageId String
batch.type String
batch.channel String
batch.context Object
batch.context.app Object
batch.context.app.build Number
batch.context.app.name String
batch.context.app.namespace String
batch.context.app.version String
batch.context.traits Object
batch.context.traits.anonymousId String
batch.context.traits.userId String
batch.context.library Object
batch.context.library.name String
batch.context.library.version String
batch.context.os Object
batch.context.os.name String
batch.context.os.version String
batch.context.timezone String
batch.context.screen Object
batch.context.screen.density Number
batch.context.screen.width Number
batch.context.screen.height Number
batch.context.userAgent String
batch.context.locale String
batch.context.device Object
batch.context.device.id String
batch.context.device.manufacturer String
batch.context.device.model String
batch.context.device.name String
batch.context.network Object
batch.context.network.wifi Boolean
batch.context.network.carrier String
batch.context.network.bluetooth Boolean
batch.context.network.cellular Boolean
batch.event String
batch.properties Object
batch.properties.productId Mixed

Object|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.