Documentation Sweet Pricing API

POST / clients

This endpoint will create a new client account within Sweet Pricing. It can also create a first mobile app based on an existing Android or iOS app.

Every app publisher must have a client account under which they add their mobile apps. We associate mobile apps to clients so that clients can create multiple users who manage the same apps.

You can create a client account at the same time as creating a new user account. Indeed, you can also create a client's first app in the same request. This is the recommended way to create a new client account. See the POST /users endpoint for more details.

You can optionally use this endpoint to create a client's first app, too. This is achieved by setting the app property to an object accepted by POST /apps. The only difference between performing this operation in one request, as opposed to two requests, is transactional safety. The request either creates an app and a client, or it returns with an error.

URL

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

Header

Field Type Description
Authorization String

Header of form api-key <API key>

Authorization: api-key <API Key>

Body

Field Type Description
name String

Name of the client.

Size: ..255

addressLine1 String

Line 1 of the address.

Size: ..255

addressLine2 optional String

Line 2 of the address.

Size: ..255

addressCity String

City of the address.

Size: ..255

addressPostcode String

Postcode of the address.

Size: ..255

addressCountry String

Country of the address.

Size: ..255

vat optional String

VAT number.

Size: ..255

currency Object
currency.id Number

ID of the billing currency.

terms String

Equals 'I agree' to signify the client's acceptance of the terms and conditions.

Size: ..255

app optional Object

If provided, will create the client's first app. See POST /apps.

{
	"name": "XYZ Company",
	"addressLine1": "1 High Street",
	"addressLine2": "",
	"addressCity": "Westminster",
	"addressPostcode": "A1 1AA",
	"addressCountry": "United Kingdom",
	"vat": "GB000000000",
	"currency": {
		"id": 1
	},
	"terms": "I agree"
}

200

Field Type Description
id Number

ID of the client.

createdDate String

ISO 8601 date of account creation.

name String

Name of the client.

Size: ..255

addressLine1 String

Line 1 of the address.

Size: ..255

addressLine2 optional String

Line 2 of the address.

Size: ..255

addressCity String

City of the address.

Size: ..255

addressPostcode String

Postcode of the address.

Size: ..255

addressCountry String

Country of the address.

Size: ..255

vat optional String

VAT number.

Size: ..255

currency Object
currency.id Number

ID of the billing currency.

currency.code Number

Billing currency code.

{
	"id": 1,
	"createdDate": "2016-02-17T16:40:06+00:00",
	"name": "XYZ Company",
	"addressLine1": "1 High Street",
	"addressLine2": "",
	"addressCity": "Westminster",
	"addressPostcode": "A1 1AA",
	"addressCountry": "United Kingdom",
	"vat": "GB000000000",
	"currency": {
		"id": 1,
		"code": "GBP"
	}
}

400

Name Description
InvalidName

Name not provided.

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": "Name not provided."
}]