Products

On this page, we'll dive into the different product endpoints you can use to get or sync our product information. We'll look at how to list and get product information.

The product model

The product model contains all the information about a product, such as their name, ids, and images. It also contains a reference to when it was last updated. You can use this to only fetch products that have been updated since your last sync.

Properties

  • Name
    id
    Type
    string
    Description

    Unique identifier for the product. You will use this in other endpoints. For instance, to get a single product or when you're creating an order.

  • Name
    name
    Type
    string
    Description

    The product name.

  • Name
    gtin
    Type
    string
    Description

    The product GTIN.

  • Name
    mpn
    Type
    string
    Description

    The product MPN.

  • Name
    intro
    Type
    string
    Description

    A short description of the product.

  • Name
    active
    Type
    bool
    Description

    Unique identifier for the conversation associated with the contact.

  • Name
    category
    Type
    string
    Description

    A category model with all its information.

  • Name
    brand
    Type
    array
    Description

    A brand model with all its information.

  • Name
    images
    Type
    array
    Description

    A list of image urls for the product.

  • Name
    updated_at
    Type
    timestamp
    Description

    Timestamp of when the products was last updated.


GET/v1/products

List all products

This endpoint allows you to retrieve a list of products from VDH-Solar. Refer to the list at the top of this page to see which properties are included with product objects.

Query parameters

You can use the query parameters below to filter the list of products you receive from the API. You can also paginate the results. Please check the pagination section for more information.

  • Name
    name
    Type
    string
    Description

    Filter on the name of the product. This will use a %LIKE% query.

  • Name
    id
    Type
    integer
    Description

    We will do an exact match on the product id. It would be beter to use the single product endpoint for this.

  • Name
    updated_before
    Type
    timestamp
    Description

    We will only return the products that where updated before this timestamp.

  • Name
    updated_after
    Type
    timestamp
    Description

    We will only return the products that where updated after this timestamp.

Request

GET
/v1/products
$client = new \VdhSolar\ApiClient('eyJ...');

$client->products->list([
  'name' => 'EGE Solar',
  'updated_since' => 555931527,
]);

Response

{
  "data": [
    {
      "id": "1",
      "name": "EGE Solar kabel TUV 1x4 mm² zwart/100m1",
      "gtin": "H1Z2Z2",
      "mpn": "H1Z2Z2",
      "intro": "EGE Solar kabel TUV 1x4 mm² zwart/100m1",
      "active": true,
      "category": [
        "id" => 1,
        "name" => "Kabels",
      ],
      "brand": [
        "id" => 1,
        "name" => "EGE",
      ],
      "images": [
        "https://vdh-solar.nl/images/....",
        // ...
      ],
      "updated_at": 555931527,
    },
    {
      // etc...
    },
  ]
}

GET/v1/products/:id

List a single product

This endpoint allows you to to list all information about a single product. Please let us know if you need more information about a product, we will add this to the response as requested.

Request

GET
/v1/products/12345
$client = new \VdhSolar\ApiClient('eyJ...');

$client->products->get(12345);

Response

{
  "data": {
    "id": "1",
    "name": "EGE Solar kabel TUV 1x4 mm² zwart/100m1",
    "gtin": "H1Z2Z2",
    "mpn": "H1Z2Z2",
    "intro": "EGE Solar kabel TUV 1x4 mm² zwart/100m1",
    "active": true,
    "category": [
      "id" => 1,
      "name" => "Kabels",
    ],
    "brand": [
      "id" => 1,
      "name" => "EGE",
    ],
    "updated_at": 555931527,
  }
}

Was this page helpful?