Webapi Version 7

This documentation provides an overview of our APIs, including usage instructions, examples, and reference materials. Whether you're an experienced developer or just getting started, this guide will help you quickly get up and running with our services.

Our APIs are designed to integrate with your existing systems, allowing you to quickly implement new functionalities. We use RESTful principles and JSON/XML for data exchange, ensuring maximum compatibility and simplicity.

Important Information

To use our API, a PS in foodservice account is required. All API calls must be authenticated with an auth token that is obtained after logging in and sent in the header.

Download Documentation (PDF)

Swagger Documentation

For an interactive experience with our APIs, we recommend consulting our Swagger documentation. Swagger provides a visual interface that allows you to explore API endpoints, specify parameters, and execute test requests.

Our Swagger documentation is regularly updated to reflect changes in the API and is available via the link below.

http://webapi.psinfoodservice.com/v7/swagger/index.html
View Swagger

Validation

Validation is an essential part of our API. It ensures that the data you send is correct and consistent. With each API call, validation rules are applied to the input data.

If a validation error occurs, the API returns a clear error message with details about where and what went wrong. Validation errors are returned with HTTP status code 400.

{
    "isSucceeded": false,
    "executionTime": 71,
    "logisticId": 0,
    "error": [
        {
            "position": "productsheet.logistic.Intrastatcode",
            "errorMessage": "The value for Intrastatcode failed validation function IntrastatCodeValidator"
        }
    ]
}
View Validation Documentation

Downloads

Below you will find links to downloadable resources, including our master data in Excel format. These files contain reference data that may be useful when developing your integration.

Masters

The master data contains codes, reference tables, and sample data that you can use as a reference during development.

Download Masters (Excel)

Developer Packages

To simplify integration with our API, we offer ready-made packages for various programming environments. These packages contain all the necessary functionality to get started quickly.

NuGet Package (.NET)

Our NuGet package contains a complete client library for .NET developers. Compatible with .NET 9.0, 8.0, 7.0, 6.0, .NET Standard 2.0, and .NET Framework 4.6.2, 4.8.1.

Install-Package PSinfoodservice
Download via NuGet

PHP Package (Composer)

Our PHP package makes it easy to integrate the API into PHP projects. Installable via Composer.

composer require psinfoodservice/psinfoodserviceapi
Download via Composer

NuGet and PHP Packages

To make integrating with our API as easy as possible, we offer official client libraries for various programming environments. These libraries provide a consistent and reliable way to communicate with our APIs.

NuGet Package for .NET

For .NET developers, we offer a comprehensive client library available via NuGet. This package supports all .NET platforms, including .NET Core, .NET, and .NET Framework.

# Install via Package Manager Console
Install-Package PSinfoodservice

# Install via .NET CLI
dotnet add package PSinfoodservice

# Reference in .csproj
<PackageVersion Include="PSinfoodservice" Version="1.0.1.46" />

Key features of our NuGet package:

  • Fully type-safe API client
  • Automatic authentication
  • Error handling
  • Retry logic for reliable communication
  • Full support for async/await
  • Compatible with .NET 9.0, 8.0, 7.0, 6.0, .NET Standard 2.0, and .NET Framework 4.6.2, 4.8.1

PHP Package

For PHP projects, we offer a Composer package that is easy to integrate into any PHP application. This package is tested on PHP 8.0 and higher.

# Install via Composer
composer require psinfoodservice/psinfoodserviceapi

Key features of our PHP package:

  • PSR-18 HTTP client compatibility
  • Simple authentication
  • Automatic serialization and deserialization of JSON data
  • Comprehensive error handling

Code Examples

C#/.NET
PHP
// Instantiate the client
var client = new PSinfoodserviceClient(PSPackage.Domain.PSEnvironment.Preprod);

// Authenticate
var loginResponse = await client.Authentication.Login("your-email@example.com", "your-password");
if (loginResponse.IsSuccess && loginResponse?.Data == true) {
    Console.WriteLine("Authentication successful!");

    // Get product information
    var productSheetResponse = await client.WebApi.GetProductSheet(59, PSPackage.Enum.OutputType.All);
    if (productSheetResponse.IsSuccess) {
        Console.WriteLine($"Product name: {productSheetResponse.Data.Summary.Name.FirstOrDefault(p => p.Language == PSPackage.Dtos.Language.nl).Value}");
    }
}