Update a purchase request's status
curl --request PATCH \
--url https://api.useopenwrench.com/api/external/v1/supplier/inventory/purchase_requests/{id}/{status} \
--header 'OW-KEY: <api-key>' \
--header 'X-API-KEY: <api-key>'import requests
url = "https://api.useopenwrench.com/api/external/v1/supplier/inventory/purchase_requests/{id}/{status}"
headers = {
"X-API-KEY": "<api-key>",
"OW-KEY": "<api-key>"
}
response = requests.patch(url, headers=headers)
print(response.text)const options = {method: 'PATCH', headers: {'X-API-KEY': '<api-key>', 'OW-KEY': '<api-key>'}};
fetch('https://api.useopenwrench.com/api/external/v1/supplier/inventory/purchase_requests/{id}/{status}', 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_requests/{id}/{status}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_HTTPHEADER => [
"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"
"net/http"
"io"
)
func main() {
url := "https://api.useopenwrench.com/api/external/v1/supplier/inventory/purchase_requests/{id}/{status}"
req, _ := http.NewRequest("PATCH", url, nil)
req.Header.Add("X-API-KEY", "<api-key>")
req.Header.Add("OW-KEY", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://api.useopenwrench.com/api/external/v1/supplier/inventory/purchase_requests/{id}/{status}")
.header("X-API-KEY", "<api-key>")
.header("OW-KEY", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.useopenwrench.com/api/external/v1/supplier/inventory/purchase_requests/{id}/{status}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["X-API-KEY"] = '<api-key>'
request["OW-KEY"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"type": "<string>",
"data": {
"name": "<string>",
"status": "requested",
"currencyId": "<string>",
"supplierFacilityId": 123,
"supplierCompanyId": 123,
"createdByEmail": "<string>",
"isDeleted": true,
"id": 123,
"purchaseRequestUniqueId": 123,
"purchaseRequestCustomIdentifier": "<string>",
"description": "<string>",
"stockLocationId": 123,
"stockLocation": {
"name": "<string>",
"isMobile": true,
"supplierFacilityId": 123,
"supplierCompanyId": 123,
"isActive": true,
"allowEquipmentForwarding": true,
"isDeleted": true,
"id": 123,
"warehouseId": "<string>",
"images": [
"<string>"
],
"description": "<string>",
"address": {},
"latitude": 123,
"longitude": 123,
"timeZoneId": "<string>",
"locationId": 123,
"burdenRates": [
{
"year": 123,
"rate": "<string>"
}
],
"taxRates": [
{
"year": 123,
"rate": "<string>"
}
],
"purchaseOrderPrefix": "<string>",
"glCode": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"deletedAt": "2023-11-07T05:31:56Z"
},
"locationId": 123,
"location": {
"id": 123,
"storeId": "<string>",
"name": "<string>",
"brandId": 123,
"brandAssetGroupId": 123,
"description": "<string>",
"isActive": true,
"openDate": "2023-11-07T05:31:56Z",
"closeDate": "2023-11-07T05:31:56Z",
"operatingHours": {},
"phoneNumber": "<string>",
"locationTypeId": 123,
"locationTypeDetails": [
{}
],
"notes": "<string>",
"internalNotes": "<string>",
"images": [
"<string>"
],
"internalAttachments": [
{
"fileName": "<string>",
"fileId": "<string>"
}
],
"primaryContactsEmails": [
"<string>"
],
"facilityInChargeEmails": [
"<string>"
],
"sendApprovedInvoicesToEmails": [
"<string>"
],
"sendApprovedQuotesToEmails": [
"<string>"
],
"storeAssociateEmails": [
"<string>"
],
"fieldTechEmails": [
"<string>"
],
"timeZoneId": "<string>",
"regionId": 123,
"region": {
"name": "<string>",
"buyerCompanyId": 123,
"hasChildren": true,
"isDeleted": true,
"id": 123,
"hierarchyName": "<string>",
"parentId": 123,
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"deletedAt": "2023-11-07T05:31:56Z"
},
"purchaseOrderPrefix": "<string>",
"isLeased": true,
"leaseStartDate": "2023-11-07T05:31:56Z",
"leaseEndDate": "2023-11-07T05:31:56Z",
"taxRate": "<string>",
"countryCode": "<string>",
"buyerFacilityId": 123,
"buyerCompanyId": 123,
"totalWOCount": 123,
"totalNotClosedWOCount": 123,
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"isDeleted": true,
"deletedAt": "2023-11-07T05:31:56Z"
},
"totalCost": 123,
"workOrderId": 123,
"warrantyAssetId": 123,
"partIds": "<string>",
"equipmentTypeIds": "<string>",
"internalNotes": "<string>",
"createdByContact": {
"email": "<string>",
"nameGiven": "<string>",
"nameFamily": "<string>",
"contactType": "<string>",
"title": "<string>",
"department": "<string>",
"facilityId": 123,
"isSharedContact": true,
"readOnlyAccess": true,
"invitedByEmail": "<string>",
"invitedAt": "2023-11-07T05:31:56Z",
"epaCertificationType": "<string>",
"epaCertificationNumber": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
},
"approvedOrDeclinedOrCancelledAt": "2023-11-07T05:31:56Z",
"approvedOrDeclinedOrCancelledByEmail": "<string>",
"partSupplierPurchaseRequestLineItems": [
{
"status": "<string>",
"supplierPurchaseRequestId": 123,
"isEquipmentLine": true,
"partUomId": 123,
"partCurrencyId": "<string>",
"equipmentUomId": 123,
"equipmentCurrencyId": "<string>",
"supplierFacilityId": 123,
"supplierCompanyId": 123,
"isDeleted": true,
"id": 123,
"stockLocationId": 123,
"locationId": 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"
},
"partCatalogId": 123,
"partQuantity": 123,
"partReceivedQuantity": 123,
"partUnitCost": 123,
"partCost": 123,
"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"
},
"equipmentCatalogId": 123,
"equipmentQuantity": 123,
"equipmentReceivedQuantity": 123,
"equipmentUnitCost": 123,
"equipmentCost": 123,
"associatedPurchaseOrderLineItemId": 123,
"glCodeForPurchaseOrderLineItem": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"deletedAt": "2023-11-07T05:31:56Z"
}
],
"equipmentSupplierPurchaseRequestLineItems": [
{
"status": "<string>",
"supplierPurchaseRequestId": 123,
"isEquipmentLine": true,
"partUomId": 123,
"partCurrencyId": "<string>",
"equipmentUomId": 123,
"equipmentCurrencyId": "<string>",
"supplierFacilityId": 123,
"supplierCompanyId": 123,
"isDeleted": true,
"id": 123,
"stockLocationId": 123,
"locationId": 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"
},
"partCatalogId": 123,
"partQuantity": 123,
"partReceivedQuantity": 123,
"partUnitCost": 123,
"partCost": 123,
"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"
},
"equipmentCatalogId": 123,
"equipmentQuantity": 123,
"equipmentReceivedQuantity": 123,
"equipmentUnitCost": 123,
"equipmentCost": 123,
"associatedPurchaseOrderLineItemId": 123,
"glCodeForPurchaseOrderLineItem": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"deletedAt": "2023-11-07T05:31:56Z"
}
],
"incomingLineItems": [
{
"isEquipmentLine": true,
"partUomId": 123,
"partCurrencyId": "<string>",
"equipmentUomId": 123,
"equipmentCurrencyId": "<string>",
"status": "<string>",
"partId": 123,
"partCatalogId": 123,
"partQuantity": 123,
"partUnitCost": 123,
"partCost": 123,
"equipmentTypeId": 123,
"equipmentCatalogId": 123,
"equipmentQuantity": 123,
"equipmentUnitCost": 123,
"equipmentCost": 123,
"associatedPOLineItemId": 123,
"createdAt": "2023-11-07T05:31:56Z"
}
],
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"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>"
}Purchase Requests
Update a purchase request's status
Sets the purchase request to the given status. The API key’s contact must belong to the purchase request’s supplier company. An unknown status name is rejected.
PATCH
/
v1
/
supplier
/
inventory
/
purchase_requests
/
{id}
/
{status}
Update a purchase request's status
curl --request PATCH \
--url https://api.useopenwrench.com/api/external/v1/supplier/inventory/purchase_requests/{id}/{status} \
--header 'OW-KEY: <api-key>' \
--header 'X-API-KEY: <api-key>'import requests
url = "https://api.useopenwrench.com/api/external/v1/supplier/inventory/purchase_requests/{id}/{status}"
headers = {
"X-API-KEY": "<api-key>",
"OW-KEY": "<api-key>"
}
response = requests.patch(url, headers=headers)
print(response.text)const options = {method: 'PATCH', headers: {'X-API-KEY': '<api-key>', 'OW-KEY': '<api-key>'}};
fetch('https://api.useopenwrench.com/api/external/v1/supplier/inventory/purchase_requests/{id}/{status}', 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_requests/{id}/{status}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_HTTPHEADER => [
"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"
"net/http"
"io"
)
func main() {
url := "https://api.useopenwrench.com/api/external/v1/supplier/inventory/purchase_requests/{id}/{status}"
req, _ := http.NewRequest("PATCH", url, nil)
req.Header.Add("X-API-KEY", "<api-key>")
req.Header.Add("OW-KEY", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://api.useopenwrench.com/api/external/v1/supplier/inventory/purchase_requests/{id}/{status}")
.header("X-API-KEY", "<api-key>")
.header("OW-KEY", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.useopenwrench.com/api/external/v1/supplier/inventory/purchase_requests/{id}/{status}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["X-API-KEY"] = '<api-key>'
request["OW-KEY"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"type": "<string>",
"data": {
"name": "<string>",
"status": "requested",
"currencyId": "<string>",
"supplierFacilityId": 123,
"supplierCompanyId": 123,
"createdByEmail": "<string>",
"isDeleted": true,
"id": 123,
"purchaseRequestUniqueId": 123,
"purchaseRequestCustomIdentifier": "<string>",
"description": "<string>",
"stockLocationId": 123,
"stockLocation": {
"name": "<string>",
"isMobile": true,
"supplierFacilityId": 123,
"supplierCompanyId": 123,
"isActive": true,
"allowEquipmentForwarding": true,
"isDeleted": true,
"id": 123,
"warehouseId": "<string>",
"images": [
"<string>"
],
"description": "<string>",
"address": {},
"latitude": 123,
"longitude": 123,
"timeZoneId": "<string>",
"locationId": 123,
"burdenRates": [
{
"year": 123,
"rate": "<string>"
}
],
"taxRates": [
{
"year": 123,
"rate": "<string>"
}
],
"purchaseOrderPrefix": "<string>",
"glCode": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"deletedAt": "2023-11-07T05:31:56Z"
},
"locationId": 123,
"location": {
"id": 123,
"storeId": "<string>",
"name": "<string>",
"brandId": 123,
"brandAssetGroupId": 123,
"description": "<string>",
"isActive": true,
"openDate": "2023-11-07T05:31:56Z",
"closeDate": "2023-11-07T05:31:56Z",
"operatingHours": {},
"phoneNumber": "<string>",
"locationTypeId": 123,
"locationTypeDetails": [
{}
],
"notes": "<string>",
"internalNotes": "<string>",
"images": [
"<string>"
],
"internalAttachments": [
{
"fileName": "<string>",
"fileId": "<string>"
}
],
"primaryContactsEmails": [
"<string>"
],
"facilityInChargeEmails": [
"<string>"
],
"sendApprovedInvoicesToEmails": [
"<string>"
],
"sendApprovedQuotesToEmails": [
"<string>"
],
"storeAssociateEmails": [
"<string>"
],
"fieldTechEmails": [
"<string>"
],
"timeZoneId": "<string>",
"regionId": 123,
"region": {
"name": "<string>",
"buyerCompanyId": 123,
"hasChildren": true,
"isDeleted": true,
"id": 123,
"hierarchyName": "<string>",
"parentId": 123,
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"deletedAt": "2023-11-07T05:31:56Z"
},
"purchaseOrderPrefix": "<string>",
"isLeased": true,
"leaseStartDate": "2023-11-07T05:31:56Z",
"leaseEndDate": "2023-11-07T05:31:56Z",
"taxRate": "<string>",
"countryCode": "<string>",
"buyerFacilityId": 123,
"buyerCompanyId": 123,
"totalWOCount": 123,
"totalNotClosedWOCount": 123,
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"isDeleted": true,
"deletedAt": "2023-11-07T05:31:56Z"
},
"totalCost": 123,
"workOrderId": 123,
"warrantyAssetId": 123,
"partIds": "<string>",
"equipmentTypeIds": "<string>",
"internalNotes": "<string>",
"createdByContact": {
"email": "<string>",
"nameGiven": "<string>",
"nameFamily": "<string>",
"contactType": "<string>",
"title": "<string>",
"department": "<string>",
"facilityId": 123,
"isSharedContact": true,
"readOnlyAccess": true,
"invitedByEmail": "<string>",
"invitedAt": "2023-11-07T05:31:56Z",
"epaCertificationType": "<string>",
"epaCertificationNumber": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
},
"approvedOrDeclinedOrCancelledAt": "2023-11-07T05:31:56Z",
"approvedOrDeclinedOrCancelledByEmail": "<string>",
"partSupplierPurchaseRequestLineItems": [
{
"status": "<string>",
"supplierPurchaseRequestId": 123,
"isEquipmentLine": true,
"partUomId": 123,
"partCurrencyId": "<string>",
"equipmentUomId": 123,
"equipmentCurrencyId": "<string>",
"supplierFacilityId": 123,
"supplierCompanyId": 123,
"isDeleted": true,
"id": 123,
"stockLocationId": 123,
"locationId": 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"
},
"partCatalogId": 123,
"partQuantity": 123,
"partReceivedQuantity": 123,
"partUnitCost": 123,
"partCost": 123,
"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"
},
"equipmentCatalogId": 123,
"equipmentQuantity": 123,
"equipmentReceivedQuantity": 123,
"equipmentUnitCost": 123,
"equipmentCost": 123,
"associatedPurchaseOrderLineItemId": 123,
"glCodeForPurchaseOrderLineItem": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"deletedAt": "2023-11-07T05:31:56Z"
}
],
"equipmentSupplierPurchaseRequestLineItems": [
{
"status": "<string>",
"supplierPurchaseRequestId": 123,
"isEquipmentLine": true,
"partUomId": 123,
"partCurrencyId": "<string>",
"equipmentUomId": 123,
"equipmentCurrencyId": "<string>",
"supplierFacilityId": 123,
"supplierCompanyId": 123,
"isDeleted": true,
"id": 123,
"stockLocationId": 123,
"locationId": 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"
},
"partCatalogId": 123,
"partQuantity": 123,
"partReceivedQuantity": 123,
"partUnitCost": 123,
"partCost": 123,
"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"
},
"equipmentCatalogId": 123,
"equipmentQuantity": 123,
"equipmentReceivedQuantity": 123,
"equipmentUnitCost": 123,
"equipmentCost": 123,
"associatedPurchaseOrderLineItemId": 123,
"glCodeForPurchaseOrderLineItem": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"deletedAt": "2023-11-07T05:31:56Z"
}
],
"incomingLineItems": [
{
"isEquipmentLine": true,
"partUomId": 123,
"partCurrencyId": "<string>",
"equipmentUomId": 123,
"equipmentCurrencyId": "<string>",
"status": "<string>",
"partId": 123,
"partCatalogId": 123,
"partQuantity": 123,
"partUnitCost": 123,
"partCost": 123,
"equipmentTypeId": 123,
"equipmentCatalogId": 123,
"equipmentQuantity": 123,
"equipmentUnitCost": 123,
"equipmentCost": 123,
"associatedPOLineItemId": 123,
"createdAt": "2023-11-07T05:31:56Z"
}
],
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"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>"
}Autorizaciones
OpenWrench shared secret. Required on every request alongside X-API-KEY; issued together with your API key.
Parámetros de ruta
Purchase request id
Target status
Opciones disponibles:
requested, denied, cancelled, approved, orderInProgress, ordered, partially_ordered, fulfilled, partially_fulfilled Respuesta
Successful response
Entity type label, e.g. "SupplierPurchaseRequest". 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.
Supplier purchase request (approval-hierarchy and hydrated relation fields omitted).
Show child attributes
Show child attributes
"ok" on success
Opciones disponibles:
ok