Modifying the shopping cart

A shopping cart can be modified in the following cases:

  • a partial cancellationConcerns transactions that appear in the Transactions in progress tab of the Merchant Back Office. A partial cancellation of an order can be made if:
    • it has not been not captured (in the Back Office)
    • it has not been enabled by Klarna.
    For all modifications, it is mandatory to recreate the shopping cart with all the elements that it must contain.
  • a partial refundConcerns transactions that appear in the Transactions in progress tab of the Merchant Back Office. A partial cancellation of an order can be made if it has been captured. For all modifications, it is mandatory to submit all the contents of the shopping cart. If some elements should not be included, their quantity must be equal to 0. The only field to be modified is quantity (downward).

To modify a shopping cart (partial cancellation or partial refund):

  1. Use the updatePaymentDetails operation of v5 Web Services.

    Web Services are developed following the SOAP protocol (Simple Object Access Protocol) v1.2 and are described by the following wsdl file:

  2. Populate the HEADER of your request in order to transmit the value of the shopId, requestId, timestamp, mode and authToken attributes.
    Fore more information, see the documentation available in our online document archive https://payzen.io/de-DE/
  3. Populate the BODY of your request with the updatePaymentDetails object.
    updatePaymentDetails contains the following parameters:
    Object Format Required
    queryRequest queryRequest
    shoppingCartRequest shoppingCartRequest
  4. Populate the queryRequest object with the uuid attribute.Corresponds to the unique transaction reference. This attribute allows to target the transaction that is subject to modification.
  5. Populate the shoppingCartRequest object with the following attributes:
    Table 1. Object shoppingCartRequest
    shoppingCartRequest
    Attribute Required Format
    insuranceAmount

    Amount of insurance

    n..3
    shippingAmount

    Shipping fees.

    n..3
    cartItemInfo

    Customizable fields for adding shopping cart elements.

    The cartItemInfo attribute consists of subobjects:

    • productLabel : product name Its format is "string".
    • productType : product type. Its format is "string (enum)".
      Table 1. Values associated with productType
      Value Description
      FOOD_AND_GROCERY Food and grocery
      AUTOMOTIVE Cars / Moto
      ENTERTAINMENT Entertainment / Culture
      HOME_AND_GARDEN Home and gardening
      HOME_APPLIANCE Household appliances
      AUCTION_AND_GROUP_BUYING Auctions and group purchasing
      FLOWERS_AND_GIFTS| Flowers and presents
      COMPUTER_AND_SOFTWARE Computers and software
      HEALTH_AND_BEAUTY Health and beauty
      SERVICE_FOR_INDIVIDUAL Services for individuals
      SERVICE_FOR_BUSINESS Services for companies
      SPORTS Sports
      CLOTHING_AND_ACCESSORIES Clothes and accessories
      TRAVEL Travel
      HOME_AUDIO_PHOTO_VIDEO Sound, image and video
      TELEPHONY Telephony
    • productRef : product reference. Its format is "string".
    • productQty : product quantity. Its format is "integer".
    • productAmount : product amount in cents. Its format is "string".
    • productVat : tax amount on the product. Its format is "string".

    Example:

    <cartItemInfo>
             		<productLabel>CHIPS</productLabel>
             		<productType>FOOD_AND_GROCERY</productType>
             		<productRef>188545</productRef>
             		<productQty>10</productQty>
             		<productAmount>10000</productAmount>         		
    </cartItemInfo>
    cartItemInfo
    Note:
    If an attribute is deleted in a request, it is permanently deleted. To compensate for any errors or omissions, all fields are required. We recommend to send them in the request even if one of them is set to 0 or is empty.