Skip to content

QbilSoftware/econnect-psb-php

Folders and files

NameName
Last commit message
Last commit date
Mar 6, 2025
Mar 6, 2025
Mar 7, 2025
Mar 6, 2025
Nov 25, 2024
Nov 25, 2024
Nov 25, 2024
Nov 25, 2024
Nov 25, 2024
Mar 6, 2025
Mar 6, 2025
Nov 25, 2024
Mar 6, 2025
Nov 25, 2024

Repository files navigation

OpenAPIClient-php

PHP SDK for econnect PSB (https://psb.econnect.eu/?urls.primaryName=V1)

Installation & Usage

Requirements

PHP 8.2 and later.

Composer

To install the bindings via Composer, add the following to composer.json:

{
  "repositories": [
    {
      "type": "vcs",
      "url": "https://github.com/QbilSoftware/econnect-psb-php.git"
    }
  ],
  "require": {
    "QbilSoftware/econnect-psb-php": "@dev-main"
  }
}

Then run composer install

Your project is free to choose the http client of your choice Please require packages that will provide http client functionality: https://packagist.org/providers/psr/http-client-implementation https://packagist.org/providers/php-http/async-client-implementation https://packagist.org/providers/psr/http-factory-implementation

As an example:

composer require guzzlehttp/guzzle php-http/guzzle7-adapter http-interop/http-factory-guzzle

Manual Installation

Download the files and include autoload.php:

<?php
require_once('/path/to/OpenAPIClient-php/vendor/autoload.php');

Getting Started

Please follow the installation procedure and then run the following:

<?php
require_once(__DIR__ . '/vendor/autoload.php');



// Configure API key authorization: Subscription-Key
$config = EConnect\Psb\Configuration::getDefaultConfiguration()->setApiKey('Subscription-Key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = EConnect\Psb\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Subscription-Key', 'Bearer');

$config
    ->setUsername("{username}")
    ->setPassword("{password}");
    ->setHost("https://psb.econnect.eu")
    ->setApiKey('Subscription-Key', '{subscription key}');
    
$authN = new \EConnect\Psb\Authentication($config);
$authN->login('{clientId}', '{clientSecret}');

$apiInstance = new EConnect\Psb\Api\HookApi(
    // If you want use custom http client, pass your client which implements `Psr\Http\Client\ClientInterface`.
    // This is optional, `Psr18ClientDiscovery` will be used to find http client. For instance `GuzzleHttp\Client` implements that interface
    new GuzzleHttp\Client(),
    $config
);

try {
    $result = $apiInstance->getHookConfigs();
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling HookApi->getHookConfigs: ', $e->getMessage(), PHP_EOL;
}

API Endpoints

All URIs are relative to http://localhost

Class Method HTTP request Description
HookApi getHookConfigs GET /api/v1/hook Get registered environment hooks.
HookApi getHooks GET /api/v1/{partyId}/hook Get registered hooks.
HookApi removeHookConfig DELETE /api/v1/hook/{hookId} Delete default hook.
HookApi sendHookPing GET /api/v1/{partyId}/hook/ping Send ping to hook(s).
HookApi setHookConfig PUT /api/v1/hook Add or update environment hook.
HookApi subscribe PUT /api/v1/{partyId}/hook Add or update hook.
HookApi unSubscribe DELETE /api/v1/{partyId}/hook/{hookId} Delete hook.
MeApi getUser GET /api/v1/me Get user.
MeApi getUserParty GET /api/v1/me/party Get parties.
PeppolApi getDeliveryOptions GET /api/v1/peppol/deliveryOption Advanced recipient party lookup in Peppol.
PurchaseInvoiceApi deletePurchaseInvoice DELETE /api/v1/{partyId}/purchaseInvoice/{documentId} Delete purchase invoice.
PurchaseInvoiceApi downloadPurchaseInvoice GET /api/v1/{partyId}/purchaseInvoice/{documentId}/download Download purchase invoice.
PurchaseInvoiceApi getPurchaseInvoiceStatuses GET /api/v1/{partyId}/purchaseInvoice/{documentId}/status Get purchase invoice statuses (FOR DEBUGGING ONLY).
PurchaseInvoiceApi queryRecipientPartyForInvoiceResponse POST /api/v1/{partyId}/purchaseInvoice/queryRecipientParty Lookup the recipient party (seller/supplier) for possible delivery.
PurchaseInvoiceApi recognizePurchaseInvoice POST /api/v1/{partyId}/purchaseInvoice/recognize Recognize purchase invoice.
PurchaseInvoiceApi sendInvoiceResponse POST /api/v1/{partyId}/purchaseInvoice/{documentId}/response Send invoice response to let the seller know the status of the received invoice.
PurchaseOrderApi apiV1PartyIdPurchaseOrderDocumentIdStatusGet GET /api/v1/{partyId}/purchaseOrder/{documentId}/status Get purchase order statuses (FOR DEBUGGING ONLY).
PurchaseOrderApi apiV1PartyIdPurchaseOrderQueryRecipientPartyPost POST /api/v1/{partyId}/purchaseOrder/queryRecipientParty Lookup the recipient party (seller) for possible delivery.
PurchaseOrderApi sendOrderCancellation POST /api/v1/{partyId}/purchaseOrder/{documentId}/cancel Send order cancellation to let the seller know the order is cancelled.
PurchaseOrderApi sendPurchaseOrder POST /api/v1/{partyId}/purchaseOrder/send Send a purchase order.
SalesInvoiceApi getSalesInvoiceStatuses GET /api/v1/{partyId}/salesInvoice/{documentId}/status Get sales invoice statuses (FOR DEBUGGING ONLY).
SalesInvoiceApi queryRecipientPartyForSalesInvoice POST /api/v1/{partyId}/salesInvoice/queryRecipientParty Lookup the recipient party (buyer/customer) for possible delivery.
SalesInvoiceApi recognizeSalesInvoice POST /api/v1/{partyId}/salesInvoice/recognize Recognize sales invoice.
SalesInvoiceApi sendSalesInvoice POST /api/v1/{partyId}/salesInvoice/send Send an invoice.
SalesOrderApi deleteSalesOrder DELETE /api/v1/{partyId}/salesOrder/{documentId} Delete sales order.
SalesOrderApi downloadSalesOrder GET /api/v1/{partyId}/salesOrder/{documentId}/download Download sales order.
SalesOrderApi getSalesOrderStatuses GET /api/v1/{partyId}/salesOrder/{documentId}/status Get sales order statuses (FOR DEBUGGING ONLY).
SalesOrderApi queryRecipientPartyForOrderResponse POST /api/v1/{partyId}/salesOrder/queryRecipientParty Lookup the recipient party (buyer/customer) for possible delivery.
SalesOrderApi sendOrderResponse POST /api/v1/{partyId}/salesOrder/{documentId}/response Send order response to let the buyer know the status of the received order.
UserApi addOrUpdateUser PUT /api/v1/user Add or update users.
UserApi addOrUpdateUserParty PUT /api/v1/user/{name}/party Add or update user's party.
UserApi deleteUser DELETE /api/v1/user/{name} Delete user.
UserApi deleteUserParty DELETE /api/v1/user/{name}/party/{partyId} Removes user's party.
UserApi getUserParties GET /api/v1/user/{name}/party Get user's parties.
UserApi getUsers GET /api/v1/user List users.

Models

Authorization

Bearer

  • Type: OAuth
  • Flow: implicit
  • Authorization URL: https://identity.econnect.eu/connect/authorize
  • Scopes:
    • ap: Procurement Service Bus API
    • vpd: Validated Party Service API

Subscription-Key

  • Type: API key
  • API key parameter name: Subscription-Key
  • Location: HTTP header

Tests

To run the tests, use:

composer install
vendor/bin/phpunit

Author

[email protected]

About this package

This PHP package is automatically generated by the OpenAPI Generator project:

  • API version: 1.0
    • Generator version: 7.12.0
  • Build package: org.openapitools.codegen.languages.PhpClientCodegen