curl --request PUT \
--url https://api.useopenwrench.com/api/external/v1/supplier/inventory/purchase_order_receipts \
--header 'Content-Type: application/json' \
--header 'OW-KEY: <api-key>' \
--header 'X-API-KEY: <api-key>' \
--data '
{
"receiptNumber": "<string>",
"purchaseOrderLineItemId": 123,
"purchaseOrderId": 123,
"receivedQuantity": 123,
"updatedBy": "<string>",
"supplierFacilityId": 123,
"id": 123,
"partId": 123,
"equipmentTypeId": 123,
"equipmentSerialNumbers": [
"<string>"
],
"assetTypeId": 123,
"pricePerQuantity": 123,
"invoiceNumber": "<string>",
"invoiceCurrency": "<string>",
"invoiceTotal": "<string>",
"exchangeRate": "<string>",
"invoiceTotalPostExchange": "<string>",
"equipmentPerStockLocationReceiptValues": [
{
"id": 123,
"serialNumber": "<string>",
"assetNumber": "<string>"
}
],
"assetReceiptValues": [
{
"id": 123,
"serialNumber": "<string>",
"assetNumber": "<string>"
}
],
"receiptValuesWithoutId": [
{
"serialNumber": "<string>",
"assetNumber": "<string>"
}
]
}
'import requests
url = "https://api.useopenwrench.com/api/external/v1/supplier/inventory/purchase_order_receipts"
payload = {
"receiptNumber": "<string>",
"purchaseOrderLineItemId": 123,
"purchaseOrderId": 123,
"receivedQuantity": 123,
"updatedBy": "<string>",
"supplierFacilityId": 123,
"id": 123,
"partId": 123,
"equipmentTypeId": 123,
"equipmentSerialNumbers": ["<string>"],
"assetTypeId": 123,
"pricePerQuantity": 123,
"invoiceNumber": "<string>",
"invoiceCurrency": "<string>",
"invoiceTotal": "<string>",
"exchangeRate": "<string>",
"invoiceTotalPostExchange": "<string>",
"equipmentPerStockLocationReceiptValues": [
{
"id": 123,
"serialNumber": "<string>",
"assetNumber": "<string>"
}
],
"assetReceiptValues": [
{
"id": 123,
"serialNumber": "<string>",
"assetNumber": "<string>"
}
],
"receiptValuesWithoutId": [
{
"serialNumber": "<string>",
"assetNumber": "<string>"
}
]
}
headers = {
"X-API-KEY": "<api-key>",
"OW-KEY": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {
'X-API-KEY': '<api-key>',
'OW-KEY': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
receiptNumber: '<string>',
purchaseOrderLineItemId: 123,
purchaseOrderId: 123,
receivedQuantity: 123,
updatedBy: '<string>',
supplierFacilityId: 123,
id: 123,
partId: 123,
equipmentTypeId: 123,
equipmentSerialNumbers: ['<string>'],
assetTypeId: 123,
pricePerQuantity: 123,
invoiceNumber: '<string>',
invoiceCurrency: '<string>',
invoiceTotal: '<string>',
exchangeRate: '<string>',
invoiceTotalPostExchange: '<string>',
equipmentPerStockLocationReceiptValues: [{id: 123, serialNumber: '<string>', assetNumber: '<string>'}],
assetReceiptValues: [{id: 123, serialNumber: '<string>', assetNumber: '<string>'}],
receiptValuesWithoutId: [{serialNumber: '<string>', assetNumber: '<string>'}]
})
};
fetch('https://api.useopenwrench.com/api/external/v1/supplier/inventory/purchase_order_receipts', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.useopenwrench.com/api/external/v1/supplier/inventory/purchase_order_receipts",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'receiptNumber' => '<string>',
'purchaseOrderLineItemId' => 123,
'purchaseOrderId' => 123,
'receivedQuantity' => 123,
'updatedBy' => '<string>',
'supplierFacilityId' => 123,
'id' => 123,
'partId' => 123,
'equipmentTypeId' => 123,
'equipmentSerialNumbers' => [
'<string>'
],
'assetTypeId' => 123,
'pricePerQuantity' => 123,
'invoiceNumber' => '<string>',
'invoiceCurrency' => '<string>',
'invoiceTotal' => '<string>',
'exchangeRate' => '<string>',
'invoiceTotalPostExchange' => '<string>',
'equipmentPerStockLocationReceiptValues' => [
[
'id' => 123,
'serialNumber' => '<string>',
'assetNumber' => '<string>'
]
],
'assetReceiptValues' => [
[
'id' => 123,
'serialNumber' => '<string>',
'assetNumber' => '<string>'
]
],
'receiptValuesWithoutId' => [
[
'serialNumber' => '<string>',
'assetNumber' => '<string>'
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"OW-KEY: <api-key>",
"X-API-KEY: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.useopenwrench.com/api/external/v1/supplier/inventory/purchase_order_receipts"
payload := strings.NewReader("{\n \"receiptNumber\": \"<string>\",\n \"purchaseOrderLineItemId\": 123,\n \"purchaseOrderId\": 123,\n \"receivedQuantity\": 123,\n \"updatedBy\": \"<string>\",\n \"supplierFacilityId\": 123,\n \"id\": 123,\n \"partId\": 123,\n \"equipmentTypeId\": 123,\n \"equipmentSerialNumbers\": [\n \"<string>\"\n ],\n \"assetTypeId\": 123,\n \"pricePerQuantity\": 123,\n \"invoiceNumber\": \"<string>\",\n \"invoiceCurrency\": \"<string>\",\n \"invoiceTotal\": \"<string>\",\n \"exchangeRate\": \"<string>\",\n \"invoiceTotalPostExchange\": \"<string>\",\n \"equipmentPerStockLocationReceiptValues\": [\n {\n \"id\": 123,\n \"serialNumber\": \"<string>\",\n \"assetNumber\": \"<string>\"\n }\n ],\n \"assetReceiptValues\": [\n {\n \"id\": 123,\n \"serialNumber\": \"<string>\",\n \"assetNumber\": \"<string>\"\n }\n ],\n \"receiptValuesWithoutId\": [\n {\n \"serialNumber\": \"<string>\",\n \"assetNumber\": \"<string>\"\n }\n ]\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("X-API-KEY", "<api-key>")
req.Header.Add("OW-KEY", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://api.useopenwrench.com/api/external/v1/supplier/inventory/purchase_order_receipts")
.header("X-API-KEY", "<api-key>")
.header("OW-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"receiptNumber\": \"<string>\",\n \"purchaseOrderLineItemId\": 123,\n \"purchaseOrderId\": 123,\n \"receivedQuantity\": 123,\n \"updatedBy\": \"<string>\",\n \"supplierFacilityId\": 123,\n \"id\": 123,\n \"partId\": 123,\n \"equipmentTypeId\": 123,\n \"equipmentSerialNumbers\": [\n \"<string>\"\n ],\n \"assetTypeId\": 123,\n \"pricePerQuantity\": 123,\n \"invoiceNumber\": \"<string>\",\n \"invoiceCurrency\": \"<string>\",\n \"invoiceTotal\": \"<string>\",\n \"exchangeRate\": \"<string>\",\n \"invoiceTotalPostExchange\": \"<string>\",\n \"equipmentPerStockLocationReceiptValues\": [\n {\n \"id\": 123,\n \"serialNumber\": \"<string>\",\n \"assetNumber\": \"<string>\"\n }\n ],\n \"assetReceiptValues\": [\n {\n \"id\": 123,\n \"serialNumber\": \"<string>\",\n \"assetNumber\": \"<string>\"\n }\n ],\n \"receiptValuesWithoutId\": [\n {\n \"serialNumber\": \"<string>\",\n \"assetNumber\": \"<string>\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.useopenwrench.com/api/external/v1/supplier/inventory/purchase_order_receipts")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["X-API-KEY"] = '<api-key>'
request["OW-KEY"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"receiptNumber\": \"<string>\",\n \"purchaseOrderLineItemId\": 123,\n \"purchaseOrderId\": 123,\n \"receivedQuantity\": 123,\n \"updatedBy\": \"<string>\",\n \"supplierFacilityId\": 123,\n \"id\": 123,\n \"partId\": 123,\n \"equipmentTypeId\": 123,\n \"equipmentSerialNumbers\": [\n \"<string>\"\n ],\n \"assetTypeId\": 123,\n \"pricePerQuantity\": 123,\n \"invoiceNumber\": \"<string>\",\n \"invoiceCurrency\": \"<string>\",\n \"invoiceTotal\": \"<string>\",\n \"exchangeRate\": \"<string>\",\n \"invoiceTotalPostExchange\": \"<string>\",\n \"equipmentPerStockLocationReceiptValues\": [\n {\n \"id\": 123,\n \"serialNumber\": \"<string>\",\n \"assetNumber\": \"<string>\"\n }\n ],\n \"assetReceiptValues\": [\n {\n \"id\": 123,\n \"serialNumber\": \"<string>\",\n \"assetNumber\": \"<string>\"\n }\n ],\n \"receiptValuesWithoutId\": [\n {\n \"serialNumber\": \"<string>\",\n \"assetNumber\": \"<string>\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"type": "<string>",
"data": {
"receiptNumber": "<string>",
"purchaseOrderLineItemId": 123,
"purchaseOrderId": 123,
"receivedQuantity": 123,
"receivedBy": "<string>",
"receivedOnWorkOrderCompletion": true,
"supplierFacilityId": 123,
"isDeleted": true,
"id": 123,
"partId": 123,
"part": {
"name": "<string>",
"uomId": 123,
"isActive": true,
"isStocked": true,
"supplierCompanyId": 123,
"isDeleted": true,
"id": 123,
"partUUID": "<string>",
"manufacturerId": "<string>",
"manufacturerName": "<string>",
"partNumber": "<string>",
"aliasPartId": "<string>",
"images": [
"<string>"
],
"description": "<string>",
"cost": 123,
"defaultVendorId": 123,
"defaultVendor": {
"name": "<string>",
"currencyId": "<string>",
"isActive": true,
"supplierFacilityId": 123,
"isDeleted": true,
"id": 123,
"vendorId": "<string>",
"address": {},
"email": "<string>",
"logoUrl": "<string>",
"phoneNumber": "<string>",
"paymentTerms": "<string>",
"shippingTerms": "<string>",
"orderingEmails": [
"<string>"
],
"accountManagerEmails": [
"<string>"
],
"accountManagerContacts": [
{
"email": "<string>",
"name": "<string>",
"vendorId": 123,
"supplierFacilityId": 123,
"phoneNumber": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}
],
"salesRepEmails": [
"<string>"
],
"salesRepContacts": [
{
"email": "<string>",
"name": "<string>",
"vendorId": 123,
"supplierFacilityId": 123,
"phoneNumber": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}
],
"accountsPayableEmails": [
"<string>"
],
"accountsPayableContacts": [
{
"email": "<string>",
"name": "<string>",
"vendorId": 123,
"supplierFacilityId": 123,
"phoneNumber": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}
],
"defaultWarrantyMonths": 123,
"notes": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"deletedAt": "2023-11-07T05:31:56Z"
},
"defaultPartCatalogId": 123,
"assetTypeId": 123,
"assetModelId": 123,
"glCode": "<string>",
"partEquipmentVendorCount": 123,
"labelIds": [
123
],
"labels": [
"<string>"
],
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"deletedAt": "2023-11-07T05:31:56Z"
},
"equipmentTypeId": 123,
"equipmentType": {
"modelName": "<string>",
"isActive": true,
"supplierFacilityId": 123,
"supplierCompanyId": 123,
"isDeleted": true,
"id": 123,
"equipmentTypeNumber": "<string>",
"aliasEquipmentTypeNumber": "<string>",
"manufacturerId": "<string>",
"manufacturerName": "<string>",
"images": [
"<string>"
],
"description": "<string>",
"cost": 123,
"defaultVendorId": 123,
"defaultVendor": {
"name": "<string>",
"currencyId": "<string>",
"isActive": true,
"supplierFacilityId": 123,
"isDeleted": true,
"id": 123,
"vendorId": "<string>",
"address": {},
"email": "<string>",
"logoUrl": "<string>",
"phoneNumber": "<string>",
"paymentTerms": "<string>",
"shippingTerms": "<string>",
"orderingEmails": [
"<string>"
],
"accountManagerEmails": [
"<string>"
],
"accountManagerContacts": [
{
"email": "<string>",
"name": "<string>",
"vendorId": 123,
"supplierFacilityId": 123,
"phoneNumber": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}
],
"salesRepEmails": [
"<string>"
],
"salesRepContacts": [
{
"email": "<string>",
"name": "<string>",
"vendorId": 123,
"supplierFacilityId": 123,
"phoneNumber": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}
],
"accountsPayableEmails": [
"<string>"
],
"accountsPayableContacts": [
{
"email": "<string>",
"name": "<string>",
"vendorId": 123,
"supplierFacilityId": 123,
"phoneNumber": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}
],
"defaultWarrantyMonths": 123,
"notes": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"deletedAt": "2023-11-07T05:31:56Z"
},
"defaultEquipmentCatalogId": 123,
"assetTypeId": 123,
"assetType": {
"name": "<string>",
"usesRefrigerant": true,
"buyerCompanyId": 123,
"isDeleted": true,
"id": 123,
"primarySpendCategory": 123,
"attachments": [
{
"fileName": "<string>",
"fileId": "<string>"
}
],
"allProblemTypeIds": [
123
],
"allProblemTypeIdsAsString": "<string>",
"allProblemTypes": [
{
"id": 123,
"name": "<string>",
"buyerCompanyId": 123,
"hasChildren": true
}
],
"allProblemTypesName": "<string>",
"allSpendCategories": [
123
],
"depreciationClassId": 123,
"depreciationClassName": "<string>",
"requiredFields": [
{}
],
"optionalFields": [
{}
],
"replaceMarkupOnOriginalCost": 123,
"replacementThreshold": 123,
"applianceCategory": "<string>",
"refrigerantTypeCode": "<string>",
"fullChargeLb": 123,
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"deletedAt": "2023-11-07T05:31:56Z"
},
"glCode": "<string>",
"partEquipmentVendorCount": 123,
"isAssociatedWithOtherEntities": true,
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"deletedAt": "2023-11-07T05:31:56Z"
},
"equipmentSerialNumbers": [
"<string>"
],
"assetTypeId": 123,
"pricePerQuantity": 123,
"invoiceNumber": "<string>",
"invoiceCurrency": "<string>",
"invoiceTotal": "<string>",
"exchangeRate": "<string>",
"invoiceTotalPostExchange": "<string>",
"equipmentPerStockLocationReceiptValues": [
{
"id": 123,
"serialNumber": "<string>",
"assetNumber": "<string>"
}
],
"assetReceiptValues": [
{
"id": 123,
"serialNumber": "<string>",
"assetNumber": "<string>"
}
],
"receiptValuesWithoutId": [
{
"serialNumber": "<string>",
"assetNumber": "<string>"
}
],
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"updatedBy": "<string>",
"deletedAt": "2023-11-07T05:31:56Z"
},
"status": "ok"
}{
"message": "<string>",
"type": "<string>",
"status": "error",
"traceId": "<string>"
}{
"message": "<string>",
"type": "<string>",
"status": "error",
"traceId": "<string>"
}{
"message": "<string>",
"type": "<string>",
"status": "error",
"traceId": "<string>"
}Update a purchase order receipt
Updates a purchase-order receipt (receiving stock against a PO line item). Verified payload below; a negative receivedQuantity records a return.
curl --request PUT \
--url https://api.useopenwrench.com/api/external/v1/supplier/inventory/purchase_order_receipts \
--header 'Content-Type: application/json' \
--header 'OW-KEY: <api-key>' \
--header 'X-API-KEY: <api-key>' \
--data '
{
"receiptNumber": "<string>",
"purchaseOrderLineItemId": 123,
"purchaseOrderId": 123,
"receivedQuantity": 123,
"updatedBy": "<string>",
"supplierFacilityId": 123,
"id": 123,
"partId": 123,
"equipmentTypeId": 123,
"equipmentSerialNumbers": [
"<string>"
],
"assetTypeId": 123,
"pricePerQuantity": 123,
"invoiceNumber": "<string>",
"invoiceCurrency": "<string>",
"invoiceTotal": "<string>",
"exchangeRate": "<string>",
"invoiceTotalPostExchange": "<string>",
"equipmentPerStockLocationReceiptValues": [
{
"id": 123,
"serialNumber": "<string>",
"assetNumber": "<string>"
}
],
"assetReceiptValues": [
{
"id": 123,
"serialNumber": "<string>",
"assetNumber": "<string>"
}
],
"receiptValuesWithoutId": [
{
"serialNumber": "<string>",
"assetNumber": "<string>"
}
]
}
'import requests
url = "https://api.useopenwrench.com/api/external/v1/supplier/inventory/purchase_order_receipts"
payload = {
"receiptNumber": "<string>",
"purchaseOrderLineItemId": 123,
"purchaseOrderId": 123,
"receivedQuantity": 123,
"updatedBy": "<string>",
"supplierFacilityId": 123,
"id": 123,
"partId": 123,
"equipmentTypeId": 123,
"equipmentSerialNumbers": ["<string>"],
"assetTypeId": 123,
"pricePerQuantity": 123,
"invoiceNumber": "<string>",
"invoiceCurrency": "<string>",
"invoiceTotal": "<string>",
"exchangeRate": "<string>",
"invoiceTotalPostExchange": "<string>",
"equipmentPerStockLocationReceiptValues": [
{
"id": 123,
"serialNumber": "<string>",
"assetNumber": "<string>"
}
],
"assetReceiptValues": [
{
"id": 123,
"serialNumber": "<string>",
"assetNumber": "<string>"
}
],
"receiptValuesWithoutId": [
{
"serialNumber": "<string>",
"assetNumber": "<string>"
}
]
}
headers = {
"X-API-KEY": "<api-key>",
"OW-KEY": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {
'X-API-KEY': '<api-key>',
'OW-KEY': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
receiptNumber: '<string>',
purchaseOrderLineItemId: 123,
purchaseOrderId: 123,
receivedQuantity: 123,
updatedBy: '<string>',
supplierFacilityId: 123,
id: 123,
partId: 123,
equipmentTypeId: 123,
equipmentSerialNumbers: ['<string>'],
assetTypeId: 123,
pricePerQuantity: 123,
invoiceNumber: '<string>',
invoiceCurrency: '<string>',
invoiceTotal: '<string>',
exchangeRate: '<string>',
invoiceTotalPostExchange: '<string>',
equipmentPerStockLocationReceiptValues: [{id: 123, serialNumber: '<string>', assetNumber: '<string>'}],
assetReceiptValues: [{id: 123, serialNumber: '<string>', assetNumber: '<string>'}],
receiptValuesWithoutId: [{serialNumber: '<string>', assetNumber: '<string>'}]
})
};
fetch('https://api.useopenwrench.com/api/external/v1/supplier/inventory/purchase_order_receipts', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.useopenwrench.com/api/external/v1/supplier/inventory/purchase_order_receipts",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'receiptNumber' => '<string>',
'purchaseOrderLineItemId' => 123,
'purchaseOrderId' => 123,
'receivedQuantity' => 123,
'updatedBy' => '<string>',
'supplierFacilityId' => 123,
'id' => 123,
'partId' => 123,
'equipmentTypeId' => 123,
'equipmentSerialNumbers' => [
'<string>'
],
'assetTypeId' => 123,
'pricePerQuantity' => 123,
'invoiceNumber' => '<string>',
'invoiceCurrency' => '<string>',
'invoiceTotal' => '<string>',
'exchangeRate' => '<string>',
'invoiceTotalPostExchange' => '<string>',
'equipmentPerStockLocationReceiptValues' => [
[
'id' => 123,
'serialNumber' => '<string>',
'assetNumber' => '<string>'
]
],
'assetReceiptValues' => [
[
'id' => 123,
'serialNumber' => '<string>',
'assetNumber' => '<string>'
]
],
'receiptValuesWithoutId' => [
[
'serialNumber' => '<string>',
'assetNumber' => '<string>'
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"OW-KEY: <api-key>",
"X-API-KEY: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.useopenwrench.com/api/external/v1/supplier/inventory/purchase_order_receipts"
payload := strings.NewReader("{\n \"receiptNumber\": \"<string>\",\n \"purchaseOrderLineItemId\": 123,\n \"purchaseOrderId\": 123,\n \"receivedQuantity\": 123,\n \"updatedBy\": \"<string>\",\n \"supplierFacilityId\": 123,\n \"id\": 123,\n \"partId\": 123,\n \"equipmentTypeId\": 123,\n \"equipmentSerialNumbers\": [\n \"<string>\"\n ],\n \"assetTypeId\": 123,\n \"pricePerQuantity\": 123,\n \"invoiceNumber\": \"<string>\",\n \"invoiceCurrency\": \"<string>\",\n \"invoiceTotal\": \"<string>\",\n \"exchangeRate\": \"<string>\",\n \"invoiceTotalPostExchange\": \"<string>\",\n \"equipmentPerStockLocationReceiptValues\": [\n {\n \"id\": 123,\n \"serialNumber\": \"<string>\",\n \"assetNumber\": \"<string>\"\n }\n ],\n \"assetReceiptValues\": [\n {\n \"id\": 123,\n \"serialNumber\": \"<string>\",\n \"assetNumber\": \"<string>\"\n }\n ],\n \"receiptValuesWithoutId\": [\n {\n \"serialNumber\": \"<string>\",\n \"assetNumber\": \"<string>\"\n }\n ]\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("X-API-KEY", "<api-key>")
req.Header.Add("OW-KEY", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://api.useopenwrench.com/api/external/v1/supplier/inventory/purchase_order_receipts")
.header("X-API-KEY", "<api-key>")
.header("OW-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"receiptNumber\": \"<string>\",\n \"purchaseOrderLineItemId\": 123,\n \"purchaseOrderId\": 123,\n \"receivedQuantity\": 123,\n \"updatedBy\": \"<string>\",\n \"supplierFacilityId\": 123,\n \"id\": 123,\n \"partId\": 123,\n \"equipmentTypeId\": 123,\n \"equipmentSerialNumbers\": [\n \"<string>\"\n ],\n \"assetTypeId\": 123,\n \"pricePerQuantity\": 123,\n \"invoiceNumber\": \"<string>\",\n \"invoiceCurrency\": \"<string>\",\n \"invoiceTotal\": \"<string>\",\n \"exchangeRate\": \"<string>\",\n \"invoiceTotalPostExchange\": \"<string>\",\n \"equipmentPerStockLocationReceiptValues\": [\n {\n \"id\": 123,\n \"serialNumber\": \"<string>\",\n \"assetNumber\": \"<string>\"\n }\n ],\n \"assetReceiptValues\": [\n {\n \"id\": 123,\n \"serialNumber\": \"<string>\",\n \"assetNumber\": \"<string>\"\n }\n ],\n \"receiptValuesWithoutId\": [\n {\n \"serialNumber\": \"<string>\",\n \"assetNumber\": \"<string>\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.useopenwrench.com/api/external/v1/supplier/inventory/purchase_order_receipts")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["X-API-KEY"] = '<api-key>'
request["OW-KEY"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"receiptNumber\": \"<string>\",\n \"purchaseOrderLineItemId\": 123,\n \"purchaseOrderId\": 123,\n \"receivedQuantity\": 123,\n \"updatedBy\": \"<string>\",\n \"supplierFacilityId\": 123,\n \"id\": 123,\n \"partId\": 123,\n \"equipmentTypeId\": 123,\n \"equipmentSerialNumbers\": [\n \"<string>\"\n ],\n \"assetTypeId\": 123,\n \"pricePerQuantity\": 123,\n \"invoiceNumber\": \"<string>\",\n \"invoiceCurrency\": \"<string>\",\n \"invoiceTotal\": \"<string>\",\n \"exchangeRate\": \"<string>\",\n \"invoiceTotalPostExchange\": \"<string>\",\n \"equipmentPerStockLocationReceiptValues\": [\n {\n \"id\": 123,\n \"serialNumber\": \"<string>\",\n \"assetNumber\": \"<string>\"\n }\n ],\n \"assetReceiptValues\": [\n {\n \"id\": 123,\n \"serialNumber\": \"<string>\",\n \"assetNumber\": \"<string>\"\n }\n ],\n \"receiptValuesWithoutId\": [\n {\n \"serialNumber\": \"<string>\",\n \"assetNumber\": \"<string>\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"type": "<string>",
"data": {
"receiptNumber": "<string>",
"purchaseOrderLineItemId": 123,
"purchaseOrderId": 123,
"receivedQuantity": 123,
"receivedBy": "<string>",
"receivedOnWorkOrderCompletion": true,
"supplierFacilityId": 123,
"isDeleted": true,
"id": 123,
"partId": 123,
"part": {
"name": "<string>",
"uomId": 123,
"isActive": true,
"isStocked": true,
"supplierCompanyId": 123,
"isDeleted": true,
"id": 123,
"partUUID": "<string>",
"manufacturerId": "<string>",
"manufacturerName": "<string>",
"partNumber": "<string>",
"aliasPartId": "<string>",
"images": [
"<string>"
],
"description": "<string>",
"cost": 123,
"defaultVendorId": 123,
"defaultVendor": {
"name": "<string>",
"currencyId": "<string>",
"isActive": true,
"supplierFacilityId": 123,
"isDeleted": true,
"id": 123,
"vendorId": "<string>",
"address": {},
"email": "<string>",
"logoUrl": "<string>",
"phoneNumber": "<string>",
"paymentTerms": "<string>",
"shippingTerms": "<string>",
"orderingEmails": [
"<string>"
],
"accountManagerEmails": [
"<string>"
],
"accountManagerContacts": [
{
"email": "<string>",
"name": "<string>",
"vendorId": 123,
"supplierFacilityId": 123,
"phoneNumber": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}
],
"salesRepEmails": [
"<string>"
],
"salesRepContacts": [
{
"email": "<string>",
"name": "<string>",
"vendorId": 123,
"supplierFacilityId": 123,
"phoneNumber": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}
],
"accountsPayableEmails": [
"<string>"
],
"accountsPayableContacts": [
{
"email": "<string>",
"name": "<string>",
"vendorId": 123,
"supplierFacilityId": 123,
"phoneNumber": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}
],
"defaultWarrantyMonths": 123,
"notes": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"deletedAt": "2023-11-07T05:31:56Z"
},
"defaultPartCatalogId": 123,
"assetTypeId": 123,
"assetModelId": 123,
"glCode": "<string>",
"partEquipmentVendorCount": 123,
"labelIds": [
123
],
"labels": [
"<string>"
],
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"deletedAt": "2023-11-07T05:31:56Z"
},
"equipmentTypeId": 123,
"equipmentType": {
"modelName": "<string>",
"isActive": true,
"supplierFacilityId": 123,
"supplierCompanyId": 123,
"isDeleted": true,
"id": 123,
"equipmentTypeNumber": "<string>",
"aliasEquipmentTypeNumber": "<string>",
"manufacturerId": "<string>",
"manufacturerName": "<string>",
"images": [
"<string>"
],
"description": "<string>",
"cost": 123,
"defaultVendorId": 123,
"defaultVendor": {
"name": "<string>",
"currencyId": "<string>",
"isActive": true,
"supplierFacilityId": 123,
"isDeleted": true,
"id": 123,
"vendorId": "<string>",
"address": {},
"email": "<string>",
"logoUrl": "<string>",
"phoneNumber": "<string>",
"paymentTerms": "<string>",
"shippingTerms": "<string>",
"orderingEmails": [
"<string>"
],
"accountManagerEmails": [
"<string>"
],
"accountManagerContacts": [
{
"email": "<string>",
"name": "<string>",
"vendorId": 123,
"supplierFacilityId": 123,
"phoneNumber": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}
],
"salesRepEmails": [
"<string>"
],
"salesRepContacts": [
{
"email": "<string>",
"name": "<string>",
"vendorId": 123,
"supplierFacilityId": 123,
"phoneNumber": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}
],
"accountsPayableEmails": [
"<string>"
],
"accountsPayableContacts": [
{
"email": "<string>",
"name": "<string>",
"vendorId": 123,
"supplierFacilityId": 123,
"phoneNumber": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}
],
"defaultWarrantyMonths": 123,
"notes": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"deletedAt": "2023-11-07T05:31:56Z"
},
"defaultEquipmentCatalogId": 123,
"assetTypeId": 123,
"assetType": {
"name": "<string>",
"usesRefrigerant": true,
"buyerCompanyId": 123,
"isDeleted": true,
"id": 123,
"primarySpendCategory": 123,
"attachments": [
{
"fileName": "<string>",
"fileId": "<string>"
}
],
"allProblemTypeIds": [
123
],
"allProblemTypeIdsAsString": "<string>",
"allProblemTypes": [
{
"id": 123,
"name": "<string>",
"buyerCompanyId": 123,
"hasChildren": true
}
],
"allProblemTypesName": "<string>",
"allSpendCategories": [
123
],
"depreciationClassId": 123,
"depreciationClassName": "<string>",
"requiredFields": [
{}
],
"optionalFields": [
{}
],
"replaceMarkupOnOriginalCost": 123,
"replacementThreshold": 123,
"applianceCategory": "<string>",
"refrigerantTypeCode": "<string>",
"fullChargeLb": 123,
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"deletedAt": "2023-11-07T05:31:56Z"
},
"glCode": "<string>",
"partEquipmentVendorCount": 123,
"isAssociatedWithOtherEntities": true,
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"deletedAt": "2023-11-07T05:31:56Z"
},
"equipmentSerialNumbers": [
"<string>"
],
"assetTypeId": 123,
"pricePerQuantity": 123,
"invoiceNumber": "<string>",
"invoiceCurrency": "<string>",
"invoiceTotal": "<string>",
"exchangeRate": "<string>",
"invoiceTotalPostExchange": "<string>",
"equipmentPerStockLocationReceiptValues": [
{
"id": 123,
"serialNumber": "<string>",
"assetNumber": "<string>"
}
],
"assetReceiptValues": [
{
"id": 123,
"serialNumber": "<string>",
"assetNumber": "<string>"
}
],
"receiptValuesWithoutId": [
{
"serialNumber": "<string>",
"assetNumber": "<string>"
}
],
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"updatedBy": "<string>",
"deletedAt": "2023-11-07T05:31:56Z"
},
"status": "ok"
}{
"message": "<string>",
"type": "<string>",
"status": "error",
"traceId": "<string>"
}{
"message": "<string>",
"type": "<string>",
"status": "error",
"traceId": "<string>"
}{
"message": "<string>",
"type": "<string>",
"status": "error",
"traceId": "<string>"
}Auktoriseringar
OpenWrench shared secret. Required on every request alongside X-API-KEY; issued together with your API key.
Kropp
Receipt update payload (verified against the shared receipt constructor). Unknown fields are ignored.
REQUIRED
REQUIRED
REQUIRED
REQUIRED; must not be 0. Negative values record a return
REQUIRED. Email recorded as the updater (and as receiver for a new receipt)
REQUIRED
Receipt id to update; the stored receivedBy/receivedOnWorkOrderCompletion/createdAt are preserved
Serial/asset numbers per received equipment unit. Not allowed on returns; the list size must equal receivedQuantity; serial/asset numbers already in use are rejected
Show child attributes
Show child attributes
Same rules as equipmentPerStockLocationReceiptValues, validated against existing assets on the purchase order
Show child attributes
Show child attributes
Same size rules; not allowed on returns
Show child attributes
Show child attributes
Svar
Successful response
Entity type label, e.g. "SupplierPurchaseOrderReceipt". Endpoints that derive it via Scala reflection (most generic list/get endpoints) may return the fully qualified server class name instead (e.g. "models.workorder.WorkOrder"); treat this field as informational.
Show child attributes
Show child attributes
"ok" on success
ok