OTTO Market API Integration in C#

Job ID: 39296253

Budget: €750 – €1,500 EUR

? Goal

The goal of this module is to develop a complete and modular API integration for the OTTO Market platform within a Windows-based middleware application.

The module consists of two parts:

1. A C# class encapsulating all required OTTO API operations such as product transfer, order retrieval, and shipping updates.
2. A graphical user interface (GUI) to allow users to configure OTTO-related settings, including credentials, price rules, and sync intervals.

? Architectural Guidelines

- The class must inherit from an abstract base class `MarketplaceConnector`.
- No direct database access is allowed.
- Data is returned through DTOs: `ProductDto`, `OrderDto`, `ShippingUpdateDto`.
- Internal helper classes and DTOs are encouraged (e.g., for auth, responses, configuration).

⚙️ Technology & Development Standards

- Target framework: .NET 9 (`net9.0`)
- Language: C# 13
- UI: Windows Desktop (WPF recommended, modern WinForms acceptable)
- API Access: HttpClient / HttpClientFactory
- JSON Handling: System.Text.Json (preferred), or Newtonsoft.Json
- Architecture: Clean Code, SOLID principles
- Logging: return messages/errors (no direct file/db logging)
- OAuth2 Authentication using Client Credentials Flow
- Unit Testing (optional, xUnit preferred)

? API Access & Authentication

OTTO Market uses OAuth2 Client Credentials Flow for authentication.
- Access Token must be requested using `client_id` and `client_secret`
- Use endpoint `POST /oauth/token` with content-type `application/x-www-form-urlencoded`
- Include `Authorization: Bearer <access_token>` in all API requests
The class should handle token renewal automatically and securely.

? Backend Class: OttoConnector

The following methods must be implemented:
- List<ProductDto> SyncProducts()
- List<OrderDto> SyncOrders()
- void SyncShippingStatus(List<ShippingUpdateDto> updates)
- bool TestConnection()

? Relevant API Endpoints

- POST /oauth/token – Token acquisition
- PUT /v2/products – Submit product data
- GET /v2/orders – Retrieve orders
- POST /v2/shipments – Submit shipping updates

Full documentation: https://api.otto.market/docs/getting-started

?️ GUI: OTTO Configuration Interface

- Graphical settings page for users to configure OTTO integration.
- Built in WPF or WinForms (.NET 9)
- Should be embedded in the middleware's settings area

Required GUI elements:

- Client ID and Secret
- Enable/Disable option
- Sync interval in minutes
- Price markup (percent)
- Default delivery time (days)
- Shipping provider selection
- Optional minimum stock
- Optional maximum stock
- Connection test button
- Save settings

? Configuration Class Example

public class OttoConfig
{
public string ClientId { get; set; }
public string ClientSecret { get; set; }
public int SyncIntervalMinutes { get; set; }
public bool Active { get; set; }
public int PriceMarkupPercent { get; set; }
public int DeliveryTimeDays { get; set; }
public string ShippingProvider { get; set; }
public int? MinStock { get; set; }
public int? MaxStock { get; set; }
}

? Recommended Internal Classes (Optional)

- OttoApiClient: Handles token management and request logic
- OttoProductModel: DTO for product sync
- OttoOrderModel: DTO for order import
- OttoShipmentModel: DTO for shipping info
- OttoConfig: Settings class used by GUI

? Deliverables

- `OttoConnector.cs`: Main integration class
- `Api/OttoApiClient.cs`: API communication + auth
- `Models/`: Internal DTOs
- `Config/OttoConfig.cs`: Serializable configuration
- `GUI/OttoConfigView.xaml`: WPF UI component
- `README.md`: Technical integration summary

✅ Summary

- Full-featured OTTO API module consisting of connector and GUI
- Follows latest .NET architecture practices
- No database access
- Ready for direct integration into the Windows middleware system