Other shop systems

Do you operate your own in-house e-commerce platform? This document will assist you in implementing the necessary interfaces to our PunchOut gateway.

You create and subsequently update customer records via the PunchCommerce web interface. For each customer, the supplier maintains the following parameters:

Entry URL The URL of the online shop to which the customer is redirected following successful authentication

Customer ID (uID) Value passed to the entry URL to identify the customer

Accessing your online shop

Once the customer has been successfully authenticated on our gateway, they are redirected to the entry URL defined in the customer configuration.

PunchCommerce currently supports the ‘classic’ PunchOut, PunchOut within an iFrame inside the calling e-procurement or ERP system, and PunchOut in a separate browser window.

The entry URL is expanded to include the parameters sID (session identifier) and uID (customer ID), so that the final URL is structured according to the following scheme:

https://{hostname}.{domain}.{tld}/punchcommerce/authenticate?sID={UUID}&uID= {customer.identifier}

It must be ensured that all headers which prevent embedding as an iFrame and access to cookies from the main frame during the PunchOut session are temporarily removed whilst the user is logged in.

Validation of the PunchOut session (sID) Before logging the customer in, you should also validate the sID. This ensures that the session has not yet expired and that the login is taking place via PunchCommerce.

https://punchcommerce.de/gateway/v3/session/validate?sID={sID}&uID={uID}

As an Enterprise customer, you must adapt your domain accordingly:

https://{enterprise-domain}/gateway/v3/session/validate?sID={sID}&uID={uID}

The user in your system must be configured to allow the uID to be maintained on the customer record. The sID is generated by us for each PunchOut session and corresponds to a UUID.

As this is typically a service user and several people use the same service user within the context of the PunchOut, it must be ensured that different shopping baskets can be used in parallel in different sessions of the same service user.

The shopping basket must be empty at the start of a PunchOut session.

General requirements during the PunchOut session

  • During the PunchOut session, the SameSite attribute must be set to ‘none’ and the Secure attribute to ‘1’ for all cookies relevant to the session
  • The X-Frame-Options header must be removed during the PunchOut session, if present
  • The checkout process is replaced by the PunchOut shopping basket overview and the redirection to PunchCommerce
  • The label for the relevant user action ‘Checkout’ is replaced accordingly with the label ‘PunchOut’ or ‘Back to the e-procurement system’

Returning the shopping basket

Once the customer has finished filling their basket, the basket must be sent back to our gateway as a JSON object together with the session identifier (sID). Surcharges or discounts are passed to our gateway as separate basket items – this also applies to delivery charges.

{ 
  "basket":[
    {
    "product_ordernumber": "23762", "product_name": "Parchment paper", "quantity": 1,
      "item_price": 2.623,
    "price": 2.623,
    "price_net": 2.2042016806723, "tax_rate": 19,
      "product": {
    "id": "21312432343",
    "ordernumber": "23762",
    "brand": "Netzdirektion",
      "brand_ordernumber": "67906",
    "title": "Parchment paper",
    "category": "Test category",
    "description": "1/8 sheet, white",
      "description_long": "67906 Parchment paper 1/8 sheet, white", "image_url": "",
    "price": 2.623,
    "tax_rate": 19,
      "purchase_unit": 12.5, "reference_unit": 1,
    "unit": "kg",
    "unit_name": "kg", "packaging_unit": "Carton", "weight": 0,
    "shipping_time": 8, 
 "classification_type": "ECLASS", 
 "classification": "90909090", 
      "custom_field1": "0.19", 
 "custom_field2": "BX",
    ...
    "custom_field10": null 
  }
  ]
}

An HTTP POST request must be sent to the following address; the request body should contain the shopping basket in accordance with the structure shown below.

https://www.punchcommerce.de/gateway/v3/return?sID={UUID}

PunchCommerce applies the field mapping defined for the customer to the shopping basket and transmits the shopping basket to the calling e-procurement system via the relevant PunchOut protocol. Details can be found in the current Swagger documentation.

Links

PunchCommerce® ist ein Produkt der Netzdirektion GmbH