Printago API
POST /v1/materials/variants/batch

Batch create variants

Create multiple variants at once All or nothing: if any name collides with an existing variant of the same material, or repeats another name in the request, no variants are created.

Requires: material.create

Request Body

Array of variant data

MaterialVariantInsert[]
Array of MaterialVariantInsert, each with:
colorrequirednullable
string
pattern: ^#([A-Fa-f0-9]{8})(;#([A-Fa-f0-9]{8}))*$
customMetadataoptional
Record<string, any>
Construct a type with a set of properties K of type T
externalIdoptionalnullable
string
filamentSystemProfileIdrequirednullable
number
filamentUserProfileIdrequirednullable
string
pattern: ^[a-z0-9]{24}$
materialIdrequired
string
pattern: ^[a-z0-9]{24}$
namerequired
string
pressureAdvanceoptionalnullable
number
min: 0max: 2
pricePer1000goptionalnullable
integer
Price per kg, in cents. Overrides the material's price when set.
sourceoptionalnullable
string
tagsrequired
string[]

Example Request

application/json
[
  {
    "name": "string",
    "externalId": "string",
    "source": "string",
    "customMetadata": {},
    "tags": [
      "string"
    ],
    "filamentUserProfileId": "string",
    "filamentSystemProfileId": 1,
    "pricePer1000g": 1,
    "materialId": "string",
    "color": "string",
    "pressureAdvance": 0
  }
]

Response Schema

MaterialVariant[]
Array of MaterialVariant, each with:
colorrequirednullable
string
pattern: ^#([A-Fa-f0-9]{8})(;#([A-Fa-f0-9]{8}))*$
createdAtrequired
string
format: date-time
customMetadataoptional
Record<string, any>
Construct a type with a set of properties K of type T
externalIdoptionalnullable
string
filamentSystemProfileIdrequirednullable
number
filamentUserProfileIdrequirednullable
string
pattern: ^[a-z0-9]{24}$
idrequired
string
pattern: ^[a-z0-9]{24}$
materialIdrequired
string
pattern: ^[a-z0-9]{24}$
namerequired
string
pressureAdvanceoptionalnullable
number
min: 0max: 2
pricePer1000goptionalnullable
integer
Price per kg, in cents. Overrides the material's price when set.
sourceoptionalnullable
string
storeIdrequired
string
pattern: ^[a-z0-9]{24}$
tagsrequired
string[]
updatedAtrequired
string
format: date-time

Example Response

201 OK — application/json
[
  {
    "name": "string",
    "materialId": "string",
    "color": "string",
    "tags": [
      "string"
    ],
    "filamentUserProfileId": "string",
    "filamentSystemProfileId": 1,
    "pricePer1000g": 1,
    "pressureAdvance": 0,
    "source": "string",
    "externalId": "string",
    "customMetadata": {},
    "id": "string",
    "storeId": "string",
    "createdAt": "2025-01-15T12:00:00.000Z",
    "updatedAt": "2025-01-15T12:00:00.000Z"
  }
]