Upsert a product

Creates or updates (upserts) a product with a specified ID.

SecurityAPI Key: SecretApiKey or HTTP: JWT
Request
path Parameters
id
required
string <= 50 characters ^[@~\-\.\w]+$

ID of the resource.

Request Body schema: application/json

Product resource.

name
required
string <= 255 characters

Name of the product.

unitLabel
string <= 50 characters
Default: "unit"

Unit label, such as per seat or per unit.

description
string or null <= 512 characters

Description of the product.

requiresShipping
boolean
Default: false

Specifies if the product requires shipping. If this value is true, shipping calculations are applied.

options
Array of strings

Product options such as color, size, and so forth. Product option values are defined in plans. For more information, see Plans.

taxCategoryId
string or null

Tax category of the product. For a complete list of supported tax categories, see TaxJar sales tax API reference. If none of the tax categories from the list are applicable for your product, use the general tax category 00000.

accountingCode
string or null

Accounting code of the product.

object or null
customFields
object (ResourceCustomFields)

Use custom fields to extend a resource scheme to include custom data that is not provided as a common field. For more information, see Custom fields.

put
/products/{id}
Request samples
application/json
{ "name": "Premium membership", "unitLabel": "seat", "description": "string", "requiresShipping": false, "options": [ "string" ], "taxCategoryId": "00000", "accountingCode": "4010", "recognition": { "debitAccountId": "string", "creditAccountId": "string" }, "customFields": { "foo": "bar" } }
Responses

200

Product updated.

Response Schema: application/json
id
string <= 50 characters

ID of the product.

name
required
string <= 255 characters

Name of the product.

unitLabel
string <= 50 characters
Default: "unit"

Unit label, such as per seat or per unit.

description
string or null <= 512 characters

Description of the product.

requiresShipping
boolean
Default: false

Specifies if the product requires shipping. If this value is true, shipping calculations are applied.

options
Array of strings

Product options such as color, size, and so forth. Product option values are defined in plans. For more information, see Plans.

taxCategoryId
string or null

Tax category of the product. For a complete list of supported tax categories, see TaxJar sales tax API reference. If none of the tax categories from the list are applicable for your product, use the general tax category 00000.

accountingCode
string or null

Accounting code of the product.

object or null
customFields
object (ResourceCustomFields)

Use custom fields to extend a resource scheme to include custom data that is not provided as a common field. For more information, see Custom fields.

createdTime
string <date-time> (CreatedTime)

Date and time which is set automatically when the resource is created.

updatedTime
string <date-time> (UpdatedTime)

Date and time which updates automatically when the resource is updated.

Array of objects (SelfLink)

Related links.

201

Product created.

401

Unauthorized access. Invalid credentials used.

403

Access forbidden.

422

Invalid data sent.

Response samples
application/json
{ "id": "prod_0YV7DES3WPC5J8JD8QTVNZBZNZ", "name": "Premium membership", "unitLabel": "seat", "description": "string", "requiresShipping": false, "options": [ "string" ], "taxCategoryId": "00000", "accountingCode": "4010", "recognition": { "debitAccountId": "string", "creditAccountId": "string" }, "customFields": { "foo": "bar" }, "createdTime": "2019-08-24T14:15:22Z", "updatedTime": "2019-08-24T14:15:22Z", "_links": [ ] }