Articles

Create a single article

Changed on

This resource could be used to create an article for your point of sale.

In order to get the available products that we offer, see the 'Product Types' section. There you can also find the necessary ids required to build the payload.

In the variants array, you can enable the sizes and colours of your product.

In the configuration array, you can place designs via url. The image must be in PNG format and under 10 MB. At this moment, the designs will be scaled as big as possible, keeping in mind the resolution of the chosen design and the limits of the print area.

Maximum print size of a design

The placement area of a view (printAreas[].widthMm / heightMm in GET /productTypes/{productTypeId}) can be larger than the limit of the print type. In that case, the print type limit and the resolution of the design set the maximum size. The required DPI per print type is returned in printType[].dpi of GET /productTypes/{productTypeId} (use the entry with id 17 for DD and 32 for DTF).

Calculation:

  1. Calculate the size of the design at the required DPI: px / DPI × 25.4 (mm)
  2. Limit the result to the print type limit: maxWidth = min(widthResult, print type max width), maxHeight = min(heightResult, print type max height)
  3. Keep the aspect ratio (ratio = width px / height px): height = maxWidth / ratio. If that height is more than maxHeight, use width = maxHeight × ratio and height = maxHeight instead.

Worked example, product type 2372 (FRONT and BACK have the same limits):

  • Placement area: 379.98 × 480.08 mm
  • DTF: max 350 × 450 mm, 200 DPI
  • Design 3898 × 5433 px, ratio 0.718
  • 3898 / 200 × 25.4 = 495 mm → min(495, 350) = 350 mm
  • 5433 / 200 × 25.4 = 690 mm → min(690, 450) = 450 mm
  • 350 / 0.718 = 487 mm is more than 450 mm, so the height sets the size: 450 × 0.718 = 323 mm
  • Result: max 323 × 450 mm

If a submitted size is larger than this maximum, the request is rejected with 422. The response contains the print method (printType) and the submitted size per view (submittedSizes), see the designTooBigForPrintType example.

Additionally, you can use a designId returned when uploading a design via Designs endpoint.

An image object must contain at least a url or a designId. If both are present, designId will be used.

The external id fields can be used for identifying articles and variants. They are optional, but if they are present they are validated as being not duplicates, in the article context

post/articles

Request

  • Base URL
    https://api.spreadconnect.app
  • Auth
    API key in header X-SPOD-ACCESS-TOKEN

Request body

titlestring required
descriptionstring required
externalIdstring

optional id that can be used for identifying the article - validated for UUID v4

printType'DD' | 'DTF'

Optional print method to use for the article. If omitted, DD (Digital-Direct printing) is used, matching previous behaviour.

DTF (Direct-to-Film printing) is only available for merchants whose account has been activated for DTF printing. Requesting DTF without that activation is rejected with an error, as is requesting DTF for a product, appearance, or design combination that does not support it. Unknown values are rejected as well.

Example request

{
  "variants": [
    {
      "d2cPrice": 21.56,
      "externalId": "20354d7a-e4fe-47af-8ff6-187bca92f3f9"
    }
  ],
  "configurations": [
    {
      "image": {
        "url": "https://link.to.image",
        "designId": "1231"
      },
      "hotspot": "MEDIUM_FRONT"
    }
  ],
  "externalId": "20354d7a-e4fe-47af-8ff6-187bca92f3f9",
  "printType": "DD"
}

Response

OK

number required

The unique identifier of the created article

Changes

    • info

      added the optional property to the response with the status

    • info

      added the optional property to the response with the status

    • info

      added the new optional request property