{
  "openapi" : "3.1.0",
  "info" : {
    "title" : "OneQrew PunchOut",
    "version" : "1.0.0",
    "description" : "Provides various services for communication between OneQrew partners and traders."
  },
  "paths" : {
    "/qpunchout/api/v1/items/prices-and-availabilities" : {
      "post" : {
        "operationId" : "post-qpunchout-api-v1-items-prices-and-availabilities",
        "summary" : "Request prices and/or availabilities",
        "description" : "Prices and/or availabilities for one or more items can be requested by providing a list of items.\n",
        "requestBody" : {
          "required" : true,
          "content" : {
            "application/json" : {
              "examples" : {
                "example1" : {
                  "value" : {
                    "onlyAvailabilitiesPreferred" : false,
                    "onlyPricesPreferred" : false,
                    "zipCode" : "12345",
                    "country" : "DE",
                    "items" : [ {
                      "position" : "5980936a-8fe5-477f-93e1-6f81e2afcb99",
                      "itemNumber" : "1235678"
                    }, {
                      "position" : "3455a9d7-f5b5-4770-8aae-fa166b1ae8c3",
                      "itemNumber" : "87654321"
                    }, {
                      "position" : "4912ce4e-38a6-41a2-8cf5-13467e264476",
                      "itemNumber" : "234567"
                    } ]
                  }
                }
              }
            }
          }
        },
        "responses" : {
          "200" : {
            "description" : "",
            "content" : {
              "application/json" : {
                "examples" : {
                  "example1" : {
                    "value" : {
                      "items" : [ {
                        "position" : "5980936a-8fe5-477f-93e1-6f81e2afcb99",
                        "itemNumber" : "1235678",
                        "pricePerUnit" : 40.0,
                        "priceScales" : [ {
                          "quantity" : 100,
                          "pricePerUnit" : 38.0
                        }, {
                          "quantity" : 1000,
                          "pricePerUnit" : 34.0
                        } ],
                        "minOrderQuantity" : 1,
                        "orderStep" : 1,
                        "priceQuantity" : 1,
                        "stockInfo" : "IN_STOCK",
                        "stockQuantity" : 1000,
                        "unit" : "PCE"
                      }, {
                        "position" : "3455a9d7-f5b5-4770-8aae-fa166b1ae8c3",
                        "itemNumber" : "87654321",
                        "pricePerUnit" : 20.0,
                        "minOrderQuantity" : 25,
                        "orderStep" : 25,
                        "priceQuantity" : 100,
                        "stockInfo" : "LOW_STOCK",
                        "stockQuantity" : 50,
                        "unit" : "MTR"
                      }, {
                        "position" : "4912ce4e-38a6-41a2-8cf5-13467e264476",
                        "itemNumber" : "234567",
                        "messages" : [ {
                          "message" : "The item number '234567' is unknown",
                          "messageLevel" : "ERROR"
                        } ]
                      } ]
                    }
                  }
                }
              }
            }
          },
          "400" : {
            "description" : "Malformed request",
            "content" : {
              "application/json" : {
                "examples" : {
                  "example1" : {
                    "value" : {
                      "messages" : [ {
                        "message" : "An unexpected error occurred",
                        "messageLevel" : "ERROR"
                      } ]
                    }
                  }
                }
              }
            }
          },
          "401" : {
            "description" : "Authentication required but none provided",
            "content" : {
              "application/json" : { }
            }
          },
          "403" : {
            "description" : "Invalid authentication or missing permission",
            "content" : {
              "application/json" : { }
            }
          },
          "404" : {
            "description" : "Resource not found",
            "content" : {
              "application/json" : { }
            }
          },
          "405" : {
            "description" : "Incorrect request method, e.g. GET instead of POST",
            "content" : {
              "application/json" : { }
            }
          },
          "500" : {
            "description" : "Unexpected server-side error",
            "content" : {
              "application/json" : { }
            }
          }
        }
      }
    },
    "/qpunchout/api/v1/checkout/compute" : {
      "post" : {
        "operationId" : "post-qpunchout-api-v1-checkout-compute",
        "summary" : "Compute trader checkout options and prices",
        "description" : "Validates trader-specific checkout selections and computes item prices, cost positions and messages.\n",
        "requestBody" : {
          "required" : true,
          "content" : {
            "application/json" : {
              "examples" : {
                "example1" : {
                  "value" : {
                    "order" : {
                      "orderType" : "ORDER",
                      "shippingType" : "DELIVERY",
                      "desiredDeliveryDate" : "2026-03-20",
                      "shippingAddress" : {
                        "name1" : "Muster GmbH",
                        "street" : "Musterstraße 1",
                        "zipCode" : "71384",
                        "city" : "Weinstadt",
                        "countryCode" : "DE"
                      }
                    },
                    "trader" : {
                      "shippingMethodId" : "delivery",
                      "paymentMethodId" : "invoice",
                      "tourId" : null,
                      "pickupSiteId" : null,
                      "customFields" : {
                        "customerAccountAssignment" : ""
                      },
                      "items" : [ {
                        "positionId" : "74bc7bc5-54e3-451f-ad38-70964a8ec85d",
                        "traderItemNumber" : "ART-1000",
                        "quantity" : 10
                      } ]
                    }
                  }
                }
              }
            }
          }
        },
        "responses" : {
          "200" : {
            "description" : "",
            "content" : {
              "application/json" : {
                "examples" : {
                  "example1" : {
                    "value" : {
                      "order" : {
                        "desiredDeliveryDateRequired" : true
                      },
                      "trader" : {
                        "netSum" : 129.9,
                        "messages" : [ ],
                        "shippingMethod" : {
                          "selectedId" : "delivery",
                          "values" : [ {
                            "id" : "delivery",
                            "name" : "Lieferung"
                          } ]
                        },
                        "paymentMethod" : {
                          "selectedId" : "invoice",
                          "values" : [ {
                            "id" : "invoice",
                            "name" : "Rechnung"
                          } ]
                        },
                        "items" : [ {
                          "positionId" : "74bc7bc5-54e3-451f-ad38-70964a8ec85d",
                          "traderItemNumber" : "ART-1000",
                          "quantity" : 10,
                          "netPrice" : 119.9,
                          "netPricePerUnit" : 11.99,
                          "priceScales" : [ {
                            "quantity" : 100,
                            "pricePerUnit" : 10.99
                          } ],
                          "stockInfo" : "IN_STOCK",
                          "stockQuantity" : 1000,
                          "unit" : "PCE",
                          "messages" : [ ]
                        } ],
                        "costPositions" : [ {
                          "itemNumber" : "S",
                          "price" : 9.9,
                          "shortText" : "Versandkosten"
                        } ]
                      }
                    }
                  }
                }
              }
            }
          },
          "400" : {
            "description" : "The request is invalid or cannot be processed",
            "content" : {
              "application/json" : {
                "examples" : {
                  "example1" : {
                    "value" : {
                      "trader" : {
                        "messages" : [ {
                          "message" : "An unexpected error occurred",
                          "messageLevel" : "ERROR"
                        } ]
                      }
                    }
                  }
                }
              }
            }
          },
          "401" : {
            "description" : "Authentication required but none provided",
            "content" : {
              "application/json" : { }
            }
          },
          "403" : {
            "description" : "Invalid authentication or missing permission",
            "content" : {
              "application/json" : { }
            }
          },
          "404" : {
            "description" : "Resource not found",
            "content" : {
              "application/json" : { }
            }
          },
          "405" : {
            "description" : "Incorrect request method, e.g. GET instead of POST",
            "content" : {
              "application/json" : { }
            }
          },
          "500" : {
            "description" : "Unexpected server-side error",
            "content" : {
              "application/json" : { }
            }
          }
        }
      }
    },
    "/qpunchout/api/v1/checkout/finalize" : {
      "post" : {
        "operationId" : "post-qpunchout-api-v1-checkout-finalize",
        "summary" : "Finalize the trader checkout",
        "description" : "Executes the trader-side checkout for the assigned items and returns the finalized trader result.\n",
        "requestBody" : {
          "required" : true,
          "content" : {
            "application/json" : {
              "examples" : {
                "example1" : {
                  "value" : {
                    "order" : {
                      "punchoutOrderNumber" : "1304711",
                      "orderType" : "ORDER",
                      "shippingType" : "DELIVERY",
                      "desiredDeliveryDate" : "2026-03-20",
                      "shippingAddress" : {
                        "name1" : "Muster GmbH",
                        "street" : "Musterstraße 1",
                        "zipCode" : "71384",
                        "city" : "Weinstadt",
                        "countryCode" : "DE"
                      }
                    },
                    "trader" : {
                      "shippingMethodId" : "delivery",
                      "paymentMethodId" : "invoice",
                      "tourId" : "tour-a",
                      "pickupSiteId" : null,
                      "customFields" : {
                        "customerAccountAssignment" : "4711"
                      },
                      "items" : [ {
                        "positionId" : "74bc7bc5-54e3-451f-ad38-70964a8ec85d",
                        "traderItemNumber" : "ART-1000",
                        "quantity" : 10
                      } ]
                    }
                  }
                }
              }
            }
          }
        },
        "responses" : {
          "200" : {
            "description" : "",
            "content" : {
              "application/json" : {
                "examples" : {
                  "example1" : {
                    "value" : {
                      "trader" : {
                        "netSum" : 129.9,
                        "messages" : [ ],
                        "paymentMethodId" : "invoice",
                        "shippingMethodId" : "delivery",
                        "pickupSiteId" : null,
                        "tourId" : "tour-a",
                        "customFields" : {
                          "customerAccountAssignment" : {
                            "label" : "Kostenstelle",
                            "value" : "4711",
                            "type" : "STRING",
                            "messages" : [ ]
                          }
                        },
                        "items" : [ {
                          "positionId" : "74bc7bc5-54e3-451f-ad38-70964a8ec85d",
                          "traderItemNumber" : "ART-1000",
                          "quantity" : 10,
                          "netPrice" : 119.9,
                          "netPricePerUnit" : 11.99,
                          "priceScales" : [ {
                            "quantity" : 100,
                            "pricePerUnit" : 10.99
                          } ],
                          "stockInfo" : "IN_STOCK",
                          "stockQuantity" : 1000,
                          "unit" : "PCE",
                          "messages" : [ ]
                        } ],
                        "costPositions" : [ {
                          "itemNumber" : "S",
                          "price" : 9.9,
                          "shortText" : "Versandkosten"
                        } ],
                        "traderBasketUrl" : "https://example.org/ordercenter/4711",
                        "traderShopOrderNumber" : "SO-100045",
                        "traderErpBasketNumber" : "ERP-4711"
                      }
                    }
                  }
                }
              }
            }
          },
          "400" : {
            "description" : "The request is invalid or cannot be processed",
            "content" : {
              "application/json" : {
                "examples" : {
                  "example1" : {
                    "value" : {
                      "trader" : {
                        "messages" : [ {
                          "message" : "An unexpected error occurred",
                          "messageLevel" : "ERROR"
                        } ]
                      }
                    }
                  }
                }
              }
            }
          },
          "401" : {
            "description" : "Authentication required but none provided",
            "content" : {
              "application/json" : { }
            }
          },
          "403" : {
            "description" : "Invalid authentication or missing permission",
            "content" : {
              "application/json" : { }
            }
          },
          "404" : {
            "description" : "Resource not found",
            "content" : {
              "application/json" : { }
            }
          },
          "405" : {
            "description" : "Incorrect request method, e.g. GET instead of POST",
            "content" : {
              "application/json" : { }
            }
          },
          "500" : {
            "description" : "Unexpected server-side error",
            "content" : {
              "application/json" : { }
            }
          }
        }
      }
    }
  }
}