Marketplaces / VeePee Technical Scope / VeePee Order Management / VeePee Cancel Order

VeePee Cancel Order

Summary of Changes: (The purpose of this table is to keep traceability and Product team to highlight the things that were changed into the scope, based on comments or discussions)

Date Version Name Applied changes
15.02.2023 1.0 Bogomil Pavlov First Publish
28.02.2023 1.1 Danail Deltchev General Clean up and rewording
Updating the logic to describe better the “per line” flow and the combination of partial and full calls working together
28.03.2023 1.2 Bogomil Pavlov Send each cancellation as a separate request

The purpose of this document is to give detailed explanation how to cancel an order on VeePee.

The marketplace supports both full order cancellations and cancellation per quantity. This means we can either cancel the full order or a specific quantity of an item in the order (2 quantity from SKU 1234) never partial within one quantity (we can’t cancel 1.5 from SKU 1234). This means that as per the Refunds send general logic we need to have validations not allowing partial quantity cancellations (pre shipment cancellation)

We can cancel an order when they have VeePee status "Pending" or "Processing” only. Which means we must have Hemi tool status “Ready For Shipping“ on the order in order to process a cancellation and we need to check on our internal status as validation.

As we can’t cancel “shipping cost” IF we’ve done partial cancellations to the order and we end up wanting to cancel every product we always need to Cancel the full order too (VeePee don’t automatically capture this). This means we need to keep track of the cancellation type request and either always do partials, followed up by a full at the end or send directly full instead of partial for the final product cancellations

We need to add also an extra validation if we try to make a partial refund only for the shipping cost because in order to cancel the shipping cost we need to cancel the whole order. So we want to have such validation and return internal error in Hemi.

Below the two calls described with their respective mappings:

Cancel Order Line (Quantity)

API Call: PUT {{BaseURL}}/orders/{orderId}/lines

https://api-pinkstaging.pink-connect.com/v4/orders/{orderId}/lines

Header Parameters: orderId - The order id returned from VeePee in the Get Orders flow (Orders > Marketplace Order ID) Body:

[
  {
    "identifierType": "OrderLineId",
    "identifier": "69743",
    "quantity": 1
  }
]

Sample Request: PUT https://api-pinkstaging.pink-connect.com/v4/orders/3645/lines

[
  {
    "identifierType": "OrderLineId",
    "identifier": "69765",
    "quantity": 1
  },
  {
    "identifierType": "OrderLineId",
    "identifier": "69766",
    "quantity": 1
  }
]

Mapping:

VeePee Field Hemi Field Comment
identifierType "OrderLineId Hard coded value
identifier Order Item Line > Marketplace Order Item ID
quantity Expectation is to be always 1
Based on the amount added in Order Refund Rows we need to calculate the needed quantity and allocate the relevant Order Item Lines that are still not Shipped or already Cancelled / Returned

Sample Response:

If there is empty response it means success. Otherwise we will receive an error that we have to store accordingly. Please note we are still expecting to receive a status code in the 200s most notably 200 or 204 for success.

If we have an order with two products and we do two partials cancellations the whole order will be cancelled

Please note this flow works per line, meaning we might end up having to make multiple calls for the same Hemi Refund. We are to handle this as standard as per the abstraction with Partial success status where and if needed, use row Refund Row statuses and of course update the Order Item Lines accordingly

Also we want to process each order payment refund row as a single request. For example if we have an order with more than one Order Payments with type = “refund“ and status = “pending“ we want to send each cancellation one by one.

Cancel Full Order

API Call: PUT {{BaseURL}}/orders/{orderId}/status/{newStatus}

API Docs: https://api-pinkstaging.pink-connect.com/v4/orders/{orderId}/status/{newStatus}

Header Parameters: orderId - The order id returned from VeePee in the Get Orders flow (Orders > Marketplace Order ID) newStatus - "CANCELLED"

Body:

{   "reason": "Our Of Stock" }


Sample Request: PUT https://api-pinkstaging.pink-connect.com/v4/orders/12345/status/CANCELLED

{ "reason": "Our Of Stock"   }


Mapping:

VeePee Field Hemi Field Comment
reason Order Payment Details > Reason

Sample Response:


If there is empty response it means success. Otherwise we will receive an error that we need to store accordingly. Please note we are still expecting to receive a status code in the 200s most notably 200 or 204 for success

We want all abstraction requirements to fit here too as per the Link Here.

Is this article helpful?
0 0 0