Download the PHP package malpka32/inpost-buy-sdk without Composer
On this page you can find all versions of the php package malpka32/inpost-buy-sdk. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download malpka32/inpost-buy-sdk
More information about malpka32/inpost-buy-sdk
Files in malpka32/inpost-buy-sdk
Package inpost-buy-sdk
Short Description PHP client for InPost Buy (inpsa) API
License MIT
Informations about the package inpost-buy-sdk
InPost Buy SDK (inpsa)
PHP client for the InPost Buy API (inpsa) — sell your products through InPost's marketplace. Categories, offers, orders — all wrapped in a clean, type-safe interface.
What is InPost Buy?
InPost Buy (inpsa) lets merchants integrate their product catalog and orders with InPost's platform. You publish offers, receive orders, and update their status — all via REST API. This SDK handles authentication, serialization, and mapping so you focus on business logic.
Features
- Categories — fetch product categories as a tree (read-only), with details and attributes
- Accept-Language — set response language (Polish
plor Englishen) viaLanguageenum - Offers — create single or batch offers with products, stock, and pricing; close/reopen; events; deposit types
- Offer attachments — list, upload, download, delete attachments (images etc.)
- Orders — list orders, fetch details, accept or refuse with status updates
- OAuth2 — client credentials grant (default) with in-memory caching; OAuth2 PKCE (Authorization Code flow) for merchant integrations (e.g. PrestaShop modules)
- Custom token provider — use
InPostBuyClient::createWithTokenProvider()with anyAccessTokenProviderInterface - Typed DTOs —
OfferDto,ProductDto,OrderDtoetc., no raw arrays in your code - Exceptions —
NotFoundException,BadRequestException,ServerExceptionetc. with HTTP status and error details
Requirements
- PHP 8.1+
- Symfony HttpClient (or any PSR-18-compatible client via Symfony contracts)
- ramsey/collection
Installation
Quick Start
Usage
Language (Accept-Language)
API returns localized content (category names, error messages etc.). Set language via Language enum:
Supported values: Language::Polish (pl), Language::English (en).
Categories
Categories are returned as a tree (CategoryTreeCollection — each node has id, name, parentId, children).
You can iterate the tree recursively:
Creating an Offer
An offer is built from nested DTOs: ProductDto, StockDto, PriceDto. Optionally add attributes (e.g. color, size) and dimensions.
Batch Offers
Create multiple offers in one request:
Listing and Filtering Offers
OAuth2 PKCE (merchant flow)
For integrations where merchants authorize via OAuth2 (e.g. PrestaShop modules), use PKCE flow:
Orders
Error Handling
The SDK throws specific exceptions for HTTP errors:
| Exception | HTTP |
|---|---|
BadRequestException |
400 |
UnauthorizedException |
401 |
ForbiddenException |
403 |
NotFoundException |
404 |
UnprocessableEntityException |
422 |
TooManyRequestsException |
429 |
ServerException |
5xx |
All extend malpka32\InPostBuySdk\Exception\ApiException and provide:
getStatusCode()— HTTP status codegetResponseBody()— raw response bodygetErrorResponse()— parsed error (errorCode, errorMessage, details)isRetryable()— true for 5xx and 429getRetryAfterSeconds()— fromRetry-Afterheader when available
Testing & quality
With Docker:
CI runs on push/PR (PHP 8.1–8.3): code style (PSR-12), PHPStan, tests with coverage. See Actions.
Documentation
Official InPost Buy (inpsa) API docs: inpsa-api-portal.inpost-group.com
Support the project
This project is actively maintained: we keep it in sync with InPost API changes and welcome issues and pull requests on GitHub.
If this library helps you, consider buying me a coffee — it allows me to maintain and update the library alongside InPost API changes.
License
MIT
All versions of inpost-buy-sdk with dependencies
ramsey/collection Version ^2.0
symfony/http-client-contracts Version ^2.5 || ^3.0
symfony/mime Version ^6.4 || ^7.0