curl --request PUT \
--url https://api.useopenwrench.com/api/external/v1/partners/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/partners/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/partners/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/partners/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/partners/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/partners/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/partners/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>",
"images": [
"<string>"
],
"uomId": 123,
"isActive": true,
"partEquipmentVendorCount": 123,
"isStocked": true,
"supplierCompanyId": 123,
"isDeleted": true,
"id": 123,
"partUUID": "<string>",
"manufacturerId": "<string>",
"manufacturerName": "<string>",
"partNumber": "<string>",
"aliasPartId": "<string>",
"description": "<string>",
"cost": 123,
"unitOfMeasure": {},
"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,
"defaultPartCatalog": {},
"assetTypeId": 123,
"assetType": {},
"assetModelId": 123,
"assetModel": {},
"glCode": "<string>",
"isAssociatedWithOtherEntities": true,
"customFieldDetails": [
{}
],
"labelIds": [
123
],
"labels": [
"<string>"
],
"partLabels": [
{
"label": "<string>",
"associatedPartsCount": 123,
"supplierCompanyId": 123,
"isDeleted": true,
"id": 123,
"color": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"deletedAt": "2023-11-07T05:31:56Z"
}
],
"supplierCompany": {},
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"deletedAt": "2023-11-07T05:31:56Z"
},
"equipmentTypeId": 123,
"equipmentType": {
"modelName": "<string>",
"images": [
"<string>"
],
"isActive": true,
"partEquipmentVendorCount": 123,
"supplierFacilityId": 123,
"supplierCompanyId": 123,
"isDeleted": true,
"id": 123,
"equipmentTypeNumber": "<string>",
"aliasEquipmentTypeNumber": "<string>",
"manufacturerId": "<string>",
"manufacturerName": "<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,
"defaultEquipmentCatalog": {},
"assetTypeId": 123,
"assetType": {},
"glCode": "<string>",
"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>",
"receiveByContact": {},
"equipmentPerStockLocationReceiptValues": [
{
"id": 123,
"serialNumber": "<string>",
"assetNumber": "<string>"
}
],
"assetReceiptValues": [
{
"id": 123,
"serialNumber": "<string>",
"assetNumber": "<string>"
}
],
"receiptValuesWithoutId": [
{
"serialNumber": "<string>",
"assetNumber": "<string>"
}
],
"supplierFacility": {},
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"updatedBy": "<string>",
"updatedByContact": {},
"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>"
}{
"message": "<string>",
"type": "<string>",
"status": "error",
"traceId": "<string>"
}Update a purchase order receipt
Updates a purchase order receipt (identified by id in the request body). On this endpoint updatedBy and supplierFacilityId must be supplied in the body — they are not derived from the API key. receivedQuantity must be non-zero (negative records a return); receipt-value arrays, when sent, must match receivedQuantity in length, may not accompany a return, and their serial/asset numbers must not already exist. Updating a receipt adjusts the received quantities/costs on the associated purchase order line item and stock records. Returns the updated receipt.
curl --request PUT \
--url https://api.useopenwrench.com/api/external/v1/partners/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/partners/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/partners/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/partners/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/partners/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/partners/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/partners/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>",
"images": [
"<string>"
],
"uomId": 123,
"isActive": true,
"partEquipmentVendorCount": 123,
"isStocked": true,
"supplierCompanyId": 123,
"isDeleted": true,
"id": 123,
"partUUID": "<string>",
"manufacturerId": "<string>",
"manufacturerName": "<string>",
"partNumber": "<string>",
"aliasPartId": "<string>",
"description": "<string>",
"cost": 123,
"unitOfMeasure": {},
"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,
"defaultPartCatalog": {},
"assetTypeId": 123,
"assetType": {},
"assetModelId": 123,
"assetModel": {},
"glCode": "<string>",
"isAssociatedWithOtherEntities": true,
"customFieldDetails": [
{}
],
"labelIds": [
123
],
"labels": [
"<string>"
],
"partLabels": [
{
"label": "<string>",
"associatedPartsCount": 123,
"supplierCompanyId": 123,
"isDeleted": true,
"id": 123,
"color": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"deletedAt": "2023-11-07T05:31:56Z"
}
],
"supplierCompany": {},
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"deletedAt": "2023-11-07T05:31:56Z"
},
"equipmentTypeId": 123,
"equipmentType": {
"modelName": "<string>",
"images": [
"<string>"
],
"isActive": true,
"partEquipmentVendorCount": 123,
"supplierFacilityId": 123,
"supplierCompanyId": 123,
"isDeleted": true,
"id": 123,
"equipmentTypeNumber": "<string>",
"aliasEquipmentTypeNumber": "<string>",
"manufacturerId": "<string>",
"manufacturerName": "<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,
"defaultEquipmentCatalog": {},
"assetTypeId": 123,
"assetType": {},
"glCode": "<string>",
"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>",
"receiveByContact": {},
"equipmentPerStockLocationReceiptValues": [
{
"id": 123,
"serialNumber": "<string>",
"assetNumber": "<string>"
}
],
"assetReceiptValues": [
{
"id": 123,
"serialNumber": "<string>",
"assetNumber": "<string>"
}
],
"receiptValuesWithoutId": [
{
"serialNumber": "<string>",
"assetNumber": "<string>"
}
],
"supplierFacility": {},
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"updatedBy": "<string>",
"updatedByContact": {},
"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>"
}{
"message": "<string>",
"type": "<string>",
"status": "error",
"traceId": "<string>"
}Autorisations
Supplier partner API key. Rate limited to 10 requests per 20-second window.
OpenWrench shared secret. Required on every request alongside X-API-KEY; issued together with your API key.
Corps
Purchase order receipt update payload (fields consumed by the server, verified from source). Supply id to identify the receipt being updated; when id is present the existing receipt's receivedBy, receivedOnWorkOrderCompletion and createdAt are preserved. NOTE: on this endpoint updatedBy and supplierFacilityId are read from the request body (they are not derived from the API key) and are required. receivedQuantity must be non-zero; a negative value records a return. When any of the receipt-value arrays is sent for a positive quantity, its length must equal receivedQuantity, none may be sent for a return (negative quantity), and serial/asset numbers must not already exist. Unknown fields are ignored.
Quantity received; must be non-zero. Negative records a return
Email recorded as the updater (also used as receivedBy for a new receipt)
Id of the receipt to update
Per-unit serial/asset numbers for received stock equipment; length must equal receivedQuantity
Show child attributes
Show child attributes
Per-unit serial/asset numbers for received assets; length must equal receivedQuantity
Show child attributes
Show child attributes
Per-unit serial/asset numbers without an id; length must equal receivedQuantity
Show child attributes
Show child attributes
Réponse
Successful response