Import API: Products

This API will import products to your shop. Please note that this API will not create/generate product variants. For variants, please see the variants import API.

Import Items Structure

$importItems

The array of $importItems should be structured as shown below. This should be passed to $padloper->import() as the first argument:

$importItems = [
  // fruit basket product
  [
    // title
    'title' => ['default' => 'Fruit Basket', 'fi' => 'Hedelmäkori', 'de' => 'Früchtekorb'],
    // ---------
    // description
    'padloper_description' => [
      // default -> english
      'default' => "Spoil someone with the luscious flavours and bright colours of our summery fruit baskets. Juicy pears are perfect for sinking your teeth into, while silky plums and fragrant mangoes melt against the tongue. For a deliciously shareable treat, there are also succulent slices of tangy pineapple. Spend over £50 to qualify for free delivery.",
      // finnish
      'fi' => "Hemmottele jotakuta kesäisten hedelmäkoriemme mehukkailla makuilla ja kirkkailla väreillä. Mehukkaat päärynät sopivat täydellisesti hampaiden upottamiseen, kun taas silkkiset luumut ja tuoksuvat mangot sulavat kieltä vasten. Herkullisen jaettavana herkkuna on myös meheviä viipaleita kirpeää ananasta. Käytä yli 50 puntaa saadaksesi ilmaisen toimituksen.",
      // german
      'de' => "Verwöhnen Sie jemanden mit den köstlichen Aromen und leuchtenden Farben unserer sommerlichen Obstkörbe. Saftige Birnen sind perfekt zum Hineinbeißen, während seidige Pflaumen und duftende Mangos auf der Zunge zergehen. Für eine köstliche Leckerei zum Teilen gibt es auch saftige Scheiben würziger Ananas. Geben Sie mehr als 50 £ aus, um sich für eine kostenlose Lieferung zu qualifizieren.",
    ],
    // ---------
    // stock
    'padloper_product_stock' => [
      'sku' => '00037235', // text
      'price' => 35.00, // float
      'comparePrice' => 39.75, // float
      'quantity' => 1200, // int
      'allowBackorders' => 0, // limited int: 0,1
      'enabled' => 1, // limited int: 0,1
    ],
    // ---------
    // images
    'padloper_images' => [
      __DIR__ . "/temp_images/mixed-fruit-basket.png",
      __DIR__ . "/temp_images/plums-1649316_1920.jpg",
      __DIR__ . "/temp_images/strawberries.jpg",
    ],
    // ---------
    // settings
    'padloper_product_settings' => [
      'shippingType' => 'physical', // limited text: "physical" | "physical_no_shipping" | "digital" | "service"
      'taxable' => 1, // limited int: 0,1
      'trackInventory' => 1, // limited int: 0,1
      'useVariants' => 1, // limited int: 0,1
      "colour" => "#00FF00", // text
    ],
    // ---------
    // product attributes (multi page field)
    // @note: for variants use!
    // @note: SETTING pages as 'title of pages'
    'padloper_product_attributes' => ['Size', 'Origin'],
    // ---------
    // downloads (multi page field)
    // @note:  SETTING with page titles OR ID
    'padloper_downloads' => ['Fruit Salad Recipes', 3336],
    // ---------
    // type (single page field)  @note: SETTING with page title
    'padloper_type' => 'Food',
    // ---------
    // brand (single page field) @note: SETTING with page ID
    'padloper_brand' => 1784,
    // ---------
    // categories (multi page field) @note: SETTING with page titles OR ID
    'padloper_categories' => ['Wedding', 'Home Living', 1813],
    // ---------
    // tags (multi page field) @note: SETTING with page titles OR ID
    'padloper_tags' => [1792, 'Perishable'],
    // ---------
    // properties @note: multi-dimensional since can have many properties!
    'padloper_product_properties' => [
      // property: weight
      [
        'value' => 3.5, // text
        'propertyID' => "Weight", // int - WILL BE CONVERTED BY API to Page ID
        'dimensionID' => "Kilograms", // int - WILL BE CONVERTED BY API  to Page ID
      ],
      // property: grade
      [
        'value' => "A", // text
        // Grade
        'propertyID' => 1774, // int
        // Premium
        'dimensionID' => "Premium", // int - WILL BE CONVERTED BY API to Page ID
      ],
      // property: quality
      [
        'value' => '999', // text
        // Quality
        'propertyID' => "Quality", // int
        // Premium
        'dimensionID' => 1780, // int
      ],

    ],
  ]
  // MORE PRODUCTS ...
];
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92

$importType

The expected import type is products. This should be passed to $padloper->import() as the second argument.

$importOptions

If required, the following import options can be passed to $padloper->import() as the third argument when importing products. This must be an array.

$importOptions = [
   // @note: setting as unpublished!
  'is_unpublished' => true
];
1
2
3
4

Example Import