Documentation Sweet Pricing API

PUT / clients / :clientId

This endpoint allows you to update a client's details or settings, including the client's name, address and currency preferences.

You cannot provide the app property to this endpoint, unlike POST /clients. If you wish to create a new app, you should use POST /apps.

URL

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

Header

Field Type Description
Authorization String

Header of form api-key <API key>

Authorization: api-key <API Key>

Parameters

Field Type Description
:clientId Number

ID of the client.

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."
}]