Skip to content

QbilSoftware/econnect-psb-php

Repository files navigation

Econnect PSB PHP client

PHP SDK for econnect PSB (https://accp-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

Manual Installation

Download the files and include autoload.php:

<?php
require_once('/path/to/econnect-psb-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();

$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}');

$salesInvoiceApi = new EConnect\Psb\Api\SalesInvoiceApi(
    new GuzzleHttp\Client(),
    $config,
);

$yourPartyId = "senderPartyId";
$filePath = "./Ubl.xml";
$receiverPartyId = null;

$salesInvoiceApi->sendSalesInvoice($yourPartyId, $filePath, $receiverPartyId);

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.
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.
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.
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.
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

Authentication schemes defined for the API:

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.10.0
  • Build package: org.openapitools.codegen.languages.PhpClientCodegen