curl --request POST \
--url https://api.useopenwrench.com/api/external/v1/supplier/invoice/invoices \
--header 'Content-Type: application/json' \
--header 'OW-KEY: <api-key>' \
--header 'X-API-KEY: <api-key>' \
--data '
{
"workOrderId": 123,
"id": 123,
"scope": "<string>",
"externalWorkOrderId": "<string>",
"buyerInvoiceTypeId": 123,
"buyerInvoiceTypeDetail": [
{}
],
"supplierInvoiceTypeId": 123,
"supplierInvoiceTypeDetail": [
{}
],
"buyerCustomFieldValues": [
{}
],
"supplierCustomFieldValues": [
{}
],
"paymentTerms": "<string>",
"poNumber": "<string>",
"glCode": "<string>",
"dueDate": "2023-11-07T05:31:56Z",
"isApproved": true,
"duePaymentAt": "2023-11-07T05:31:56Z",
"dateOfInvoice": "2023-11-07T05:31:56Z",
"invoiceNumber": "<string>",
"invoiceNotes": [
{
"text": "<string>",
"noteAddedBy": "<string>",
"noteAddedAt": "2023-11-07T05:31:56Z",
"id": 123,
"photo": "<string>",
"video": "<string>",
"audio": "<string>",
"otherFile": "<string>",
"elements": [
{
"type": "<string>",
"value": "<string>",
"userObject": {
"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"
}
}
],
"noteReadDetails": [
{
"readAt": "2023-11-07T05:31:56Z",
"readBy": "<string>",
"readByContact": {
"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"
}
}
],
"noteAddedByContact": {
"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"
},
"noteType": "<string>",
"noteAddedByType": "<string>",
"caption": "<string>",
"isNoteAwaitingResponse": true
}
],
"invoiceTaxRate": "<string>",
"invoiceTax": "<string>",
"invoiceTotalBeforeTax": "<string>",
"invoiceTotalAfterTax": "<string>",
"laborTaxRate": "<string>",
"laborTax": "<string>",
"laborTotalBeforeTax": "<string>",
"laborLineItems": [
{
"numberOfTech": 123,
"seconds": 123,
"description": "<string>",
"roleType": "<string>",
"laborType": "<string>",
"hourlyRate": "<string>",
"amount": "<string>"
}
],
"materialTaxRate": "<string>",
"materialTax": "<string>",
"materialTotalBeforeTax": "<string>",
"materialLineItems": [
{
"unitType": "<string>",
"quantity": "<string>",
"description": "<string>",
"partNumber": "<string>",
"partId": 123,
"equipmentNumber": "<string>",
"equipmentId": 123,
"unitPrice": "<string>",
"amount": "<string>"
}
],
"travelTaxRate": "<string>",
"travelTax": "<string>",
"travelTotalBeforeTax": "<string>",
"travelLineItems": [
{
"description": "<string>",
"amount": "<string>"
}
],
"freightTaxRate": "<string>",
"freightTax": "<string>",
"freightTotalBeforeTax": "<string>",
"freightLineItems": [
{
"description": "<string>",
"amount": "<string>"
}
],
"miscTaxRate": "<string>",
"miscTax": "<string>",
"miscTotalBeforeTax": "<string>",
"miscLineItems": [
{
"description": "<string>",
"amount": "<string>"
}
],
"taxLineItems": [
{
"taxType": "<string>",
"amount": "<string>"
}
],
"disputeNotes": [
{
"text": "<string>",
"noteAddedBy": "<string>",
"noteAddedAt": "2023-11-07T05:31:56Z",
"id": 123,
"photo": "<string>",
"video": "<string>",
"audio": "<string>",
"otherFile": "<string>",
"elements": [
{
"type": "<string>",
"value": "<string>",
"userObject": {
"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"
}
}
],
"noteReadDetails": [
{
"readAt": "2023-11-07T05:31:56Z",
"readBy": "<string>",
"readByContact": {
"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"
}
}
],
"noteAddedByContact": {
"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"
},
"noteType": "<string>",
"noteAddedByType": "<string>",
"caption": "<string>",
"isNoteAwaitingResponse": true
}
],
"attachments": [
{
"fileName": "<string>",
"fileId": "<string>"
}
],
"invoicePDFLink": "<string>",
"invoicePDFWatermarkedLink": "<string>",
"owGeneratedPDF": true,
"serviceCallIds": [
123
],
"autoPublishOnApproval": true,
"createdBy": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"publishedBy": "<string>",
"publishedAt": "2023-11-07T05:31:56Z",
"isAiParsed": true,
"isAiParsedEdited": true,
"aiParseMismatchSignedByEmail": "<string>"
}
'import requests
url = "https://api.useopenwrench.com/api/external/v1/supplier/invoice/invoices"
payload = {
"workOrderId": 123,
"id": 123,
"scope": "<string>",
"externalWorkOrderId": "<string>",
"buyerInvoiceTypeId": 123,
"buyerInvoiceTypeDetail": [{}],
"supplierInvoiceTypeId": 123,
"supplierInvoiceTypeDetail": [{}],
"buyerCustomFieldValues": [{}],
"supplierCustomFieldValues": [{}],
"paymentTerms": "<string>",
"poNumber": "<string>",
"glCode": "<string>",
"dueDate": "2023-11-07T05:31:56Z",
"isApproved": True,
"duePaymentAt": "2023-11-07T05:31:56Z",
"dateOfInvoice": "2023-11-07T05:31:56Z",
"invoiceNumber": "<string>",
"invoiceNotes": [
{
"text": "<string>",
"noteAddedBy": "<string>",
"noteAddedAt": "2023-11-07T05:31:56Z",
"id": 123,
"photo": "<string>",
"video": "<string>",
"audio": "<string>",
"otherFile": "<string>",
"elements": [
{
"type": "<string>",
"value": "<string>",
"userObject": {
"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"
}
}
],
"noteReadDetails": [
{
"readAt": "2023-11-07T05:31:56Z",
"readBy": "<string>",
"readByContact": {
"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"
}
}
],
"noteAddedByContact": {
"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"
},
"noteType": "<string>",
"noteAddedByType": "<string>",
"caption": "<string>",
"isNoteAwaitingResponse": True
}
],
"invoiceTaxRate": "<string>",
"invoiceTax": "<string>",
"invoiceTotalBeforeTax": "<string>",
"invoiceTotalAfterTax": "<string>",
"laborTaxRate": "<string>",
"laborTax": "<string>",
"laborTotalBeforeTax": "<string>",
"laborLineItems": [
{
"numberOfTech": 123,
"seconds": 123,
"description": "<string>",
"roleType": "<string>",
"laborType": "<string>",
"hourlyRate": "<string>",
"amount": "<string>"
}
],
"materialTaxRate": "<string>",
"materialTax": "<string>",
"materialTotalBeforeTax": "<string>",
"materialLineItems": [
{
"unitType": "<string>",
"quantity": "<string>",
"description": "<string>",
"partNumber": "<string>",
"partId": 123,
"equipmentNumber": "<string>",
"equipmentId": 123,
"unitPrice": "<string>",
"amount": "<string>"
}
],
"travelTaxRate": "<string>",
"travelTax": "<string>",
"travelTotalBeforeTax": "<string>",
"travelLineItems": [
{
"description": "<string>",
"amount": "<string>"
}
],
"freightTaxRate": "<string>",
"freightTax": "<string>",
"freightTotalBeforeTax": "<string>",
"freightLineItems": [
{
"description": "<string>",
"amount": "<string>"
}
],
"miscTaxRate": "<string>",
"miscTax": "<string>",
"miscTotalBeforeTax": "<string>",
"miscLineItems": [
{
"description": "<string>",
"amount": "<string>"
}
],
"taxLineItems": [
{
"taxType": "<string>",
"amount": "<string>"
}
],
"disputeNotes": [
{
"text": "<string>",
"noteAddedBy": "<string>",
"noteAddedAt": "2023-11-07T05:31:56Z",
"id": 123,
"photo": "<string>",
"video": "<string>",
"audio": "<string>",
"otherFile": "<string>",
"elements": [
{
"type": "<string>",
"value": "<string>",
"userObject": {
"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"
}
}
],
"noteReadDetails": [
{
"readAt": "2023-11-07T05:31:56Z",
"readBy": "<string>",
"readByContact": {
"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"
}
}
],
"noteAddedByContact": {
"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"
},
"noteType": "<string>",
"noteAddedByType": "<string>",
"caption": "<string>",
"isNoteAwaitingResponse": True
}
],
"attachments": [
{
"fileName": "<string>",
"fileId": "<string>"
}
],
"invoicePDFLink": "<string>",
"invoicePDFWatermarkedLink": "<string>",
"owGeneratedPDF": True,
"serviceCallIds": [123],
"autoPublishOnApproval": True,
"createdBy": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"publishedBy": "<string>",
"publishedAt": "2023-11-07T05:31:56Z",
"isAiParsed": True,
"isAiParsedEdited": True,
"aiParseMismatchSignedByEmail": "<string>"
}
headers = {
"X-API-KEY": "<api-key>",
"OW-KEY": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'X-API-KEY': '<api-key>',
'OW-KEY': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
workOrderId: 123,
id: 123,
scope: '<string>',
externalWorkOrderId: '<string>',
buyerInvoiceTypeId: 123,
buyerInvoiceTypeDetail: [{}],
supplierInvoiceTypeId: 123,
supplierInvoiceTypeDetail: [{}],
buyerCustomFieldValues: [{}],
supplierCustomFieldValues: [{}],
paymentTerms: '<string>',
poNumber: '<string>',
glCode: '<string>',
dueDate: '2023-11-07T05:31:56Z',
isApproved: true,
duePaymentAt: '2023-11-07T05:31:56Z',
dateOfInvoice: '2023-11-07T05:31:56Z',
invoiceNumber: '<string>',
invoiceNotes: [
{
text: '<string>',
noteAddedBy: '<string>',
noteAddedAt: '2023-11-07T05:31:56Z',
id: 123,
photo: '<string>',
video: '<string>',
audio: '<string>',
otherFile: '<string>',
elements: [
{
type: '<string>',
value: '<string>',
userObject: {
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'
}
}
],
noteReadDetails: [
{
readAt: '2023-11-07T05:31:56Z',
readBy: '<string>',
readByContact: {
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'
}
}
],
noteAddedByContact: {
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'
},
noteType: '<string>',
noteAddedByType: '<string>',
caption: '<string>',
isNoteAwaitingResponse: true
}
],
invoiceTaxRate: '<string>',
invoiceTax: '<string>',
invoiceTotalBeforeTax: '<string>',
invoiceTotalAfterTax: '<string>',
laborTaxRate: '<string>',
laborTax: '<string>',
laborTotalBeforeTax: '<string>',
laborLineItems: [
{
numberOfTech: 123,
seconds: 123,
description: '<string>',
roleType: '<string>',
laborType: '<string>',
hourlyRate: '<string>',
amount: '<string>'
}
],
materialTaxRate: '<string>',
materialTax: '<string>',
materialTotalBeforeTax: '<string>',
materialLineItems: [
{
unitType: '<string>',
quantity: '<string>',
description: '<string>',
partNumber: '<string>',
partId: 123,
equipmentNumber: '<string>',
equipmentId: 123,
unitPrice: '<string>',
amount: '<string>'
}
],
travelTaxRate: '<string>',
travelTax: '<string>',
travelTotalBeforeTax: '<string>',
travelLineItems: [{description: '<string>', amount: '<string>'}],
freightTaxRate: '<string>',
freightTax: '<string>',
freightTotalBeforeTax: '<string>',
freightLineItems: [{description: '<string>', amount: '<string>'}],
miscTaxRate: '<string>',
miscTax: '<string>',
miscTotalBeforeTax: '<string>',
miscLineItems: [{description: '<string>', amount: '<string>'}],
taxLineItems: [{taxType: '<string>', amount: '<string>'}],
disputeNotes: [
{
text: '<string>',
noteAddedBy: '<string>',
noteAddedAt: '2023-11-07T05:31:56Z',
id: 123,
photo: '<string>',
video: '<string>',
audio: '<string>',
otherFile: '<string>',
elements: [
{
type: '<string>',
value: '<string>',
userObject: {
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'
}
}
],
noteReadDetails: [
{
readAt: '2023-11-07T05:31:56Z',
readBy: '<string>',
readByContact: {
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'
}
}
],
noteAddedByContact: {
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'
},
noteType: '<string>',
noteAddedByType: '<string>',
caption: '<string>',
isNoteAwaitingResponse: true
}
],
attachments: [{fileName: '<string>', fileId: '<string>'}],
invoicePDFLink: '<string>',
invoicePDFWatermarkedLink: '<string>',
owGeneratedPDF: true,
serviceCallIds: [123],
autoPublishOnApproval: true,
createdBy: '<string>',
createdAt: '2023-11-07T05:31:56Z',
publishedBy: '<string>',
publishedAt: '2023-11-07T05:31:56Z',
isAiParsed: true,
isAiParsedEdited: true,
aiParseMismatchSignedByEmail: '<string>'
})
};
fetch('https://api.useopenwrench.com/api/external/v1/supplier/invoice/invoices', 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/invoice/invoices",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'workOrderId' => 123,
'id' => 123,
'scope' => '<string>',
'externalWorkOrderId' => '<string>',
'buyerInvoiceTypeId' => 123,
'buyerInvoiceTypeDetail' => [
[
]
],
'supplierInvoiceTypeId' => 123,
'supplierInvoiceTypeDetail' => [
[
]
],
'buyerCustomFieldValues' => [
[
]
],
'supplierCustomFieldValues' => [
[
]
],
'paymentTerms' => '<string>',
'poNumber' => '<string>',
'glCode' => '<string>',
'dueDate' => '2023-11-07T05:31:56Z',
'isApproved' => true,
'duePaymentAt' => '2023-11-07T05:31:56Z',
'dateOfInvoice' => '2023-11-07T05:31:56Z',
'invoiceNumber' => '<string>',
'invoiceNotes' => [
[
'text' => '<string>',
'noteAddedBy' => '<string>',
'noteAddedAt' => '2023-11-07T05:31:56Z',
'id' => 123,
'photo' => '<string>',
'video' => '<string>',
'audio' => '<string>',
'otherFile' => '<string>',
'elements' => [
[
'type' => '<string>',
'value' => '<string>',
'userObject' => [
'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'
]
]
],
'noteReadDetails' => [
[
'readAt' => '2023-11-07T05:31:56Z',
'readBy' => '<string>',
'readByContact' => [
'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'
]
]
],
'noteAddedByContact' => [
'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'
],
'noteType' => '<string>',
'noteAddedByType' => '<string>',
'caption' => '<string>',
'isNoteAwaitingResponse' => true
]
],
'invoiceTaxRate' => '<string>',
'invoiceTax' => '<string>',
'invoiceTotalBeforeTax' => '<string>',
'invoiceTotalAfterTax' => '<string>',
'laborTaxRate' => '<string>',
'laborTax' => '<string>',
'laborTotalBeforeTax' => '<string>',
'laborLineItems' => [
[
'numberOfTech' => 123,
'seconds' => 123,
'description' => '<string>',
'roleType' => '<string>',
'laborType' => '<string>',
'hourlyRate' => '<string>',
'amount' => '<string>'
]
],
'materialTaxRate' => '<string>',
'materialTax' => '<string>',
'materialTotalBeforeTax' => '<string>',
'materialLineItems' => [
[
'unitType' => '<string>',
'quantity' => '<string>',
'description' => '<string>',
'partNumber' => '<string>',
'partId' => 123,
'equipmentNumber' => '<string>',
'equipmentId' => 123,
'unitPrice' => '<string>',
'amount' => '<string>'
]
],
'travelTaxRate' => '<string>',
'travelTax' => '<string>',
'travelTotalBeforeTax' => '<string>',
'travelLineItems' => [
[
'description' => '<string>',
'amount' => '<string>'
]
],
'freightTaxRate' => '<string>',
'freightTax' => '<string>',
'freightTotalBeforeTax' => '<string>',
'freightLineItems' => [
[
'description' => '<string>',
'amount' => '<string>'
]
],
'miscTaxRate' => '<string>',
'miscTax' => '<string>',
'miscTotalBeforeTax' => '<string>',
'miscLineItems' => [
[
'description' => '<string>',
'amount' => '<string>'
]
],
'taxLineItems' => [
[
'taxType' => '<string>',
'amount' => '<string>'
]
],
'disputeNotes' => [
[
'text' => '<string>',
'noteAddedBy' => '<string>',
'noteAddedAt' => '2023-11-07T05:31:56Z',
'id' => 123,
'photo' => '<string>',
'video' => '<string>',
'audio' => '<string>',
'otherFile' => '<string>',
'elements' => [
[
'type' => '<string>',
'value' => '<string>',
'userObject' => [
'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'
]
]
],
'noteReadDetails' => [
[
'readAt' => '2023-11-07T05:31:56Z',
'readBy' => '<string>',
'readByContact' => [
'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'
]
]
],
'noteAddedByContact' => [
'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'
],
'noteType' => '<string>',
'noteAddedByType' => '<string>',
'caption' => '<string>',
'isNoteAwaitingResponse' => true
]
],
'attachments' => [
[
'fileName' => '<string>',
'fileId' => '<string>'
]
],
'invoicePDFLink' => '<string>',
'invoicePDFWatermarkedLink' => '<string>',
'owGeneratedPDF' => true,
'serviceCallIds' => [
123
],
'autoPublishOnApproval' => true,
'createdBy' => '<string>',
'createdAt' => '2023-11-07T05:31:56Z',
'publishedBy' => '<string>',
'publishedAt' => '2023-11-07T05:31:56Z',
'isAiParsed' => true,
'isAiParsedEdited' => true,
'aiParseMismatchSignedByEmail' => '<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/invoice/invoices"
payload := strings.NewReader("{\n \"workOrderId\": 123,\n \"id\": 123,\n \"scope\": \"<string>\",\n \"externalWorkOrderId\": \"<string>\",\n \"buyerInvoiceTypeId\": 123,\n \"buyerInvoiceTypeDetail\": [\n {}\n ],\n \"supplierInvoiceTypeId\": 123,\n \"supplierInvoiceTypeDetail\": [\n {}\n ],\n \"buyerCustomFieldValues\": [\n {}\n ],\n \"supplierCustomFieldValues\": [\n {}\n ],\n \"paymentTerms\": \"<string>\",\n \"poNumber\": \"<string>\",\n \"glCode\": \"<string>\",\n \"dueDate\": \"2023-11-07T05:31:56Z\",\n \"isApproved\": true,\n \"duePaymentAt\": \"2023-11-07T05:31:56Z\",\n \"dateOfInvoice\": \"2023-11-07T05:31:56Z\",\n \"invoiceNumber\": \"<string>\",\n \"invoiceNotes\": [\n {\n \"text\": \"<string>\",\n \"noteAddedBy\": \"<string>\",\n \"noteAddedAt\": \"2023-11-07T05:31:56Z\",\n \"id\": 123,\n \"photo\": \"<string>\",\n \"video\": \"<string>\",\n \"audio\": \"<string>\",\n \"otherFile\": \"<string>\",\n \"elements\": [\n {\n \"type\": \"<string>\",\n \"value\": \"<string>\",\n \"userObject\": {\n \"email\": \"<string>\",\n \"nameGiven\": \"<string>\",\n \"nameFamily\": \"<string>\",\n \"contactType\": \"<string>\",\n \"title\": \"<string>\",\n \"department\": \"<string>\",\n \"facilityId\": 123,\n \"isSharedContact\": true,\n \"readOnlyAccess\": true,\n \"invitedByEmail\": \"<string>\",\n \"invitedAt\": \"2023-11-07T05:31:56Z\",\n \"epaCertificationType\": \"<string>\",\n \"epaCertificationNumber\": \"<string>\",\n \"createdAt\": \"2023-11-07T05:31:56Z\",\n \"updatedAt\": \"2023-11-07T05:31:56Z\"\n }\n }\n ],\n \"noteReadDetails\": [\n {\n \"readAt\": \"2023-11-07T05:31:56Z\",\n \"readBy\": \"<string>\",\n \"readByContact\": {\n \"email\": \"<string>\",\n \"nameGiven\": \"<string>\",\n \"nameFamily\": \"<string>\",\n \"contactType\": \"<string>\",\n \"title\": \"<string>\",\n \"department\": \"<string>\",\n \"facilityId\": 123,\n \"isSharedContact\": true,\n \"readOnlyAccess\": true,\n \"invitedByEmail\": \"<string>\",\n \"invitedAt\": \"2023-11-07T05:31:56Z\",\n \"epaCertificationType\": \"<string>\",\n \"epaCertificationNumber\": \"<string>\",\n \"createdAt\": \"2023-11-07T05:31:56Z\",\n \"updatedAt\": \"2023-11-07T05:31:56Z\"\n }\n }\n ],\n \"noteAddedByContact\": {\n \"email\": \"<string>\",\n \"nameGiven\": \"<string>\",\n \"nameFamily\": \"<string>\",\n \"contactType\": \"<string>\",\n \"title\": \"<string>\",\n \"department\": \"<string>\",\n \"facilityId\": 123,\n \"isSharedContact\": true,\n \"readOnlyAccess\": true,\n \"invitedByEmail\": \"<string>\",\n \"invitedAt\": \"2023-11-07T05:31:56Z\",\n \"epaCertificationType\": \"<string>\",\n \"epaCertificationNumber\": \"<string>\",\n \"createdAt\": \"2023-11-07T05:31:56Z\",\n \"updatedAt\": \"2023-11-07T05:31:56Z\"\n },\n \"noteType\": \"<string>\",\n \"noteAddedByType\": \"<string>\",\n \"caption\": \"<string>\",\n \"isNoteAwaitingResponse\": true\n }\n ],\n \"invoiceTaxRate\": \"<string>\",\n \"invoiceTax\": \"<string>\",\n \"invoiceTotalBeforeTax\": \"<string>\",\n \"invoiceTotalAfterTax\": \"<string>\",\n \"laborTaxRate\": \"<string>\",\n \"laborTax\": \"<string>\",\n \"laborTotalBeforeTax\": \"<string>\",\n \"laborLineItems\": [\n {\n \"numberOfTech\": 123,\n \"seconds\": 123,\n \"description\": \"<string>\",\n \"roleType\": \"<string>\",\n \"laborType\": \"<string>\",\n \"hourlyRate\": \"<string>\",\n \"amount\": \"<string>\"\n }\n ],\n \"materialTaxRate\": \"<string>\",\n \"materialTax\": \"<string>\",\n \"materialTotalBeforeTax\": \"<string>\",\n \"materialLineItems\": [\n {\n \"unitType\": \"<string>\",\n \"quantity\": \"<string>\",\n \"description\": \"<string>\",\n \"partNumber\": \"<string>\",\n \"partId\": 123,\n \"equipmentNumber\": \"<string>\",\n \"equipmentId\": 123,\n \"unitPrice\": \"<string>\",\n \"amount\": \"<string>\"\n }\n ],\n \"travelTaxRate\": \"<string>\",\n \"travelTax\": \"<string>\",\n \"travelTotalBeforeTax\": \"<string>\",\n \"travelLineItems\": [\n {\n \"description\": \"<string>\",\n \"amount\": \"<string>\"\n }\n ],\n \"freightTaxRate\": \"<string>\",\n \"freightTax\": \"<string>\",\n \"freightTotalBeforeTax\": \"<string>\",\n \"freightLineItems\": [\n {\n \"description\": \"<string>\",\n \"amount\": \"<string>\"\n }\n ],\n \"miscTaxRate\": \"<string>\",\n \"miscTax\": \"<string>\",\n \"miscTotalBeforeTax\": \"<string>\",\n \"miscLineItems\": [\n {\n \"description\": \"<string>\",\n \"amount\": \"<string>\"\n }\n ],\n \"taxLineItems\": [\n {\n \"taxType\": \"<string>\",\n \"amount\": \"<string>\"\n }\n ],\n \"disputeNotes\": [\n {\n \"text\": \"<string>\",\n \"noteAddedBy\": \"<string>\",\n \"noteAddedAt\": \"2023-11-07T05:31:56Z\",\n \"id\": 123,\n \"photo\": \"<string>\",\n \"video\": \"<string>\",\n \"audio\": \"<string>\",\n \"otherFile\": \"<string>\",\n \"elements\": [\n {\n \"type\": \"<string>\",\n \"value\": \"<string>\",\n \"userObject\": {\n \"email\": \"<string>\",\n \"nameGiven\": \"<string>\",\n \"nameFamily\": \"<string>\",\n \"contactType\": \"<string>\",\n \"title\": \"<string>\",\n \"department\": \"<string>\",\n \"facilityId\": 123,\n \"isSharedContact\": true,\n \"readOnlyAccess\": true,\n \"invitedByEmail\": \"<string>\",\n \"invitedAt\": \"2023-11-07T05:31:56Z\",\n \"epaCertificationType\": \"<string>\",\n \"epaCertificationNumber\": \"<string>\",\n \"createdAt\": \"2023-11-07T05:31:56Z\",\n \"updatedAt\": \"2023-11-07T05:31:56Z\"\n }\n }\n ],\n \"noteReadDetails\": [\n {\n \"readAt\": \"2023-11-07T05:31:56Z\",\n \"readBy\": \"<string>\",\n \"readByContact\": {\n \"email\": \"<string>\",\n \"nameGiven\": \"<string>\",\n \"nameFamily\": \"<string>\",\n \"contactType\": \"<string>\",\n \"title\": \"<string>\",\n \"department\": \"<string>\",\n \"facilityId\": 123,\n \"isSharedContact\": true,\n \"readOnlyAccess\": true,\n \"invitedByEmail\": \"<string>\",\n \"invitedAt\": \"2023-11-07T05:31:56Z\",\n \"epaCertificationType\": \"<string>\",\n \"epaCertificationNumber\": \"<string>\",\n \"createdAt\": \"2023-11-07T05:31:56Z\",\n \"updatedAt\": \"2023-11-07T05:31:56Z\"\n }\n }\n ],\n \"noteAddedByContact\": {\n \"email\": \"<string>\",\n \"nameGiven\": \"<string>\",\n \"nameFamily\": \"<string>\",\n \"contactType\": \"<string>\",\n \"title\": \"<string>\",\n \"department\": \"<string>\",\n \"facilityId\": 123,\n \"isSharedContact\": true,\n \"readOnlyAccess\": true,\n \"invitedByEmail\": \"<string>\",\n \"invitedAt\": \"2023-11-07T05:31:56Z\",\n \"epaCertificationType\": \"<string>\",\n \"epaCertificationNumber\": \"<string>\",\n \"createdAt\": \"2023-11-07T05:31:56Z\",\n \"updatedAt\": \"2023-11-07T05:31:56Z\"\n },\n \"noteType\": \"<string>\",\n \"noteAddedByType\": \"<string>\",\n \"caption\": \"<string>\",\n \"isNoteAwaitingResponse\": true\n }\n ],\n \"attachments\": [\n {\n \"fileName\": \"<string>\",\n \"fileId\": \"<string>\"\n }\n ],\n \"invoicePDFLink\": \"<string>\",\n \"invoicePDFWatermarkedLink\": \"<string>\",\n \"owGeneratedPDF\": true,\n \"serviceCallIds\": [\n 123\n ],\n \"autoPublishOnApproval\": true,\n \"createdBy\": \"<string>\",\n \"createdAt\": \"2023-11-07T05:31:56Z\",\n \"publishedBy\": \"<string>\",\n \"publishedAt\": \"2023-11-07T05:31:56Z\",\n \"isAiParsed\": true,\n \"isAiParsedEdited\": true,\n \"aiParseMismatchSignedByEmail\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", 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.post("https://api.useopenwrench.com/api/external/v1/supplier/invoice/invoices")
.header("X-API-KEY", "<api-key>")
.header("OW-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"workOrderId\": 123,\n \"id\": 123,\n \"scope\": \"<string>\",\n \"externalWorkOrderId\": \"<string>\",\n \"buyerInvoiceTypeId\": 123,\n \"buyerInvoiceTypeDetail\": [\n {}\n ],\n \"supplierInvoiceTypeId\": 123,\n \"supplierInvoiceTypeDetail\": [\n {}\n ],\n \"buyerCustomFieldValues\": [\n {}\n ],\n \"supplierCustomFieldValues\": [\n {}\n ],\n \"paymentTerms\": \"<string>\",\n \"poNumber\": \"<string>\",\n \"glCode\": \"<string>\",\n \"dueDate\": \"2023-11-07T05:31:56Z\",\n \"isApproved\": true,\n \"duePaymentAt\": \"2023-11-07T05:31:56Z\",\n \"dateOfInvoice\": \"2023-11-07T05:31:56Z\",\n \"invoiceNumber\": \"<string>\",\n \"invoiceNotes\": [\n {\n \"text\": \"<string>\",\n \"noteAddedBy\": \"<string>\",\n \"noteAddedAt\": \"2023-11-07T05:31:56Z\",\n \"id\": 123,\n \"photo\": \"<string>\",\n \"video\": \"<string>\",\n \"audio\": \"<string>\",\n \"otherFile\": \"<string>\",\n \"elements\": [\n {\n \"type\": \"<string>\",\n \"value\": \"<string>\",\n \"userObject\": {\n \"email\": \"<string>\",\n \"nameGiven\": \"<string>\",\n \"nameFamily\": \"<string>\",\n \"contactType\": \"<string>\",\n \"title\": \"<string>\",\n \"department\": \"<string>\",\n \"facilityId\": 123,\n \"isSharedContact\": true,\n \"readOnlyAccess\": true,\n \"invitedByEmail\": \"<string>\",\n \"invitedAt\": \"2023-11-07T05:31:56Z\",\n \"epaCertificationType\": \"<string>\",\n \"epaCertificationNumber\": \"<string>\",\n \"createdAt\": \"2023-11-07T05:31:56Z\",\n \"updatedAt\": \"2023-11-07T05:31:56Z\"\n }\n }\n ],\n \"noteReadDetails\": [\n {\n \"readAt\": \"2023-11-07T05:31:56Z\",\n \"readBy\": \"<string>\",\n \"readByContact\": {\n \"email\": \"<string>\",\n \"nameGiven\": \"<string>\",\n \"nameFamily\": \"<string>\",\n \"contactType\": \"<string>\",\n \"title\": \"<string>\",\n \"department\": \"<string>\",\n \"facilityId\": 123,\n \"isSharedContact\": true,\n \"readOnlyAccess\": true,\n \"invitedByEmail\": \"<string>\",\n \"invitedAt\": \"2023-11-07T05:31:56Z\",\n \"epaCertificationType\": \"<string>\",\n \"epaCertificationNumber\": \"<string>\",\n \"createdAt\": \"2023-11-07T05:31:56Z\",\n \"updatedAt\": \"2023-11-07T05:31:56Z\"\n }\n }\n ],\n \"noteAddedByContact\": {\n \"email\": \"<string>\",\n \"nameGiven\": \"<string>\",\n \"nameFamily\": \"<string>\",\n \"contactType\": \"<string>\",\n \"title\": \"<string>\",\n \"department\": \"<string>\",\n \"facilityId\": 123,\n \"isSharedContact\": true,\n \"readOnlyAccess\": true,\n \"invitedByEmail\": \"<string>\",\n \"invitedAt\": \"2023-11-07T05:31:56Z\",\n \"epaCertificationType\": \"<string>\",\n \"epaCertificationNumber\": \"<string>\",\n \"createdAt\": \"2023-11-07T05:31:56Z\",\n \"updatedAt\": \"2023-11-07T05:31:56Z\"\n },\n \"noteType\": \"<string>\",\n \"noteAddedByType\": \"<string>\",\n \"caption\": \"<string>\",\n \"isNoteAwaitingResponse\": true\n }\n ],\n \"invoiceTaxRate\": \"<string>\",\n \"invoiceTax\": \"<string>\",\n \"invoiceTotalBeforeTax\": \"<string>\",\n \"invoiceTotalAfterTax\": \"<string>\",\n \"laborTaxRate\": \"<string>\",\n \"laborTax\": \"<string>\",\n \"laborTotalBeforeTax\": \"<string>\",\n \"laborLineItems\": [\n {\n \"numberOfTech\": 123,\n \"seconds\": 123,\n \"description\": \"<string>\",\n \"roleType\": \"<string>\",\n \"laborType\": \"<string>\",\n \"hourlyRate\": \"<string>\",\n \"amount\": \"<string>\"\n }\n ],\n \"materialTaxRate\": \"<string>\",\n \"materialTax\": \"<string>\",\n \"materialTotalBeforeTax\": \"<string>\",\n \"materialLineItems\": [\n {\n \"unitType\": \"<string>\",\n \"quantity\": \"<string>\",\n \"description\": \"<string>\",\n \"partNumber\": \"<string>\",\n \"partId\": 123,\n \"equipmentNumber\": \"<string>\",\n \"equipmentId\": 123,\n \"unitPrice\": \"<string>\",\n \"amount\": \"<string>\"\n }\n ],\n \"travelTaxRate\": \"<string>\",\n \"travelTax\": \"<string>\",\n \"travelTotalBeforeTax\": \"<string>\",\n \"travelLineItems\": [\n {\n \"description\": \"<string>\",\n \"amount\": \"<string>\"\n }\n ],\n \"freightTaxRate\": \"<string>\",\n \"freightTax\": \"<string>\",\n \"freightTotalBeforeTax\": \"<string>\",\n \"freightLineItems\": [\n {\n \"description\": \"<string>\",\n \"amount\": \"<string>\"\n }\n ],\n \"miscTaxRate\": \"<string>\",\n \"miscTax\": \"<string>\",\n \"miscTotalBeforeTax\": \"<string>\",\n \"miscLineItems\": [\n {\n \"description\": \"<string>\",\n \"amount\": \"<string>\"\n }\n ],\n \"taxLineItems\": [\n {\n \"taxType\": \"<string>\",\n \"amount\": \"<string>\"\n }\n ],\n \"disputeNotes\": [\n {\n \"text\": \"<string>\",\n \"noteAddedBy\": \"<string>\",\n \"noteAddedAt\": \"2023-11-07T05:31:56Z\",\n \"id\": 123,\n \"photo\": \"<string>\",\n \"video\": \"<string>\",\n \"audio\": \"<string>\",\n \"otherFile\": \"<string>\",\n \"elements\": [\n {\n \"type\": \"<string>\",\n \"value\": \"<string>\",\n \"userObject\": {\n \"email\": \"<string>\",\n \"nameGiven\": \"<string>\",\n \"nameFamily\": \"<string>\",\n \"contactType\": \"<string>\",\n \"title\": \"<string>\",\n \"department\": \"<string>\",\n \"facilityId\": 123,\n \"isSharedContact\": true,\n \"readOnlyAccess\": true,\n \"invitedByEmail\": \"<string>\",\n \"invitedAt\": \"2023-11-07T05:31:56Z\",\n \"epaCertificationType\": \"<string>\",\n \"epaCertificationNumber\": \"<string>\",\n \"createdAt\": \"2023-11-07T05:31:56Z\",\n \"updatedAt\": \"2023-11-07T05:31:56Z\"\n }\n }\n ],\n \"noteReadDetails\": [\n {\n \"readAt\": \"2023-11-07T05:31:56Z\",\n \"readBy\": \"<string>\",\n \"readByContact\": {\n \"email\": \"<string>\",\n \"nameGiven\": \"<string>\",\n \"nameFamily\": \"<string>\",\n \"contactType\": \"<string>\",\n \"title\": \"<string>\",\n \"department\": \"<string>\",\n \"facilityId\": 123,\n \"isSharedContact\": true,\n \"readOnlyAccess\": true,\n \"invitedByEmail\": \"<string>\",\n \"invitedAt\": \"2023-11-07T05:31:56Z\",\n \"epaCertificationType\": \"<string>\",\n \"epaCertificationNumber\": \"<string>\",\n \"createdAt\": \"2023-11-07T05:31:56Z\",\n \"updatedAt\": \"2023-11-07T05:31:56Z\"\n }\n }\n ],\n \"noteAddedByContact\": {\n \"email\": \"<string>\",\n \"nameGiven\": \"<string>\",\n \"nameFamily\": \"<string>\",\n \"contactType\": \"<string>\",\n \"title\": \"<string>\",\n \"department\": \"<string>\",\n \"facilityId\": 123,\n \"isSharedContact\": true,\n \"readOnlyAccess\": true,\n \"invitedByEmail\": \"<string>\",\n \"invitedAt\": \"2023-11-07T05:31:56Z\",\n \"epaCertificationType\": \"<string>\",\n \"epaCertificationNumber\": \"<string>\",\n \"createdAt\": \"2023-11-07T05:31:56Z\",\n \"updatedAt\": \"2023-11-07T05:31:56Z\"\n },\n \"noteType\": \"<string>\",\n \"noteAddedByType\": \"<string>\",\n \"caption\": \"<string>\",\n \"isNoteAwaitingResponse\": true\n }\n ],\n \"attachments\": [\n {\n \"fileName\": \"<string>\",\n \"fileId\": \"<string>\"\n }\n ],\n \"invoicePDFLink\": \"<string>\",\n \"invoicePDFWatermarkedLink\": \"<string>\",\n \"owGeneratedPDF\": true,\n \"serviceCallIds\": [\n 123\n ],\n \"autoPublishOnApproval\": true,\n \"createdBy\": \"<string>\",\n \"createdAt\": \"2023-11-07T05:31:56Z\",\n \"publishedBy\": \"<string>\",\n \"publishedAt\": \"2023-11-07T05:31:56Z\",\n \"isAiParsed\": true,\n \"isAiParsedEdited\": true,\n \"aiParseMismatchSignedByEmail\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.useopenwrench.com/api/external/v1/supplier/invoice/invoices")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-KEY"] = '<api-key>'
request["OW-KEY"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"workOrderId\": 123,\n \"id\": 123,\n \"scope\": \"<string>\",\n \"externalWorkOrderId\": \"<string>\",\n \"buyerInvoiceTypeId\": 123,\n \"buyerInvoiceTypeDetail\": [\n {}\n ],\n \"supplierInvoiceTypeId\": 123,\n \"supplierInvoiceTypeDetail\": [\n {}\n ],\n \"buyerCustomFieldValues\": [\n {}\n ],\n \"supplierCustomFieldValues\": [\n {}\n ],\n \"paymentTerms\": \"<string>\",\n \"poNumber\": \"<string>\",\n \"glCode\": \"<string>\",\n \"dueDate\": \"2023-11-07T05:31:56Z\",\n \"isApproved\": true,\n \"duePaymentAt\": \"2023-11-07T05:31:56Z\",\n \"dateOfInvoice\": \"2023-11-07T05:31:56Z\",\n \"invoiceNumber\": \"<string>\",\n \"invoiceNotes\": [\n {\n \"text\": \"<string>\",\n \"noteAddedBy\": \"<string>\",\n \"noteAddedAt\": \"2023-11-07T05:31:56Z\",\n \"id\": 123,\n \"photo\": \"<string>\",\n \"video\": \"<string>\",\n \"audio\": \"<string>\",\n \"otherFile\": \"<string>\",\n \"elements\": [\n {\n \"type\": \"<string>\",\n \"value\": \"<string>\",\n \"userObject\": {\n \"email\": \"<string>\",\n \"nameGiven\": \"<string>\",\n \"nameFamily\": \"<string>\",\n \"contactType\": \"<string>\",\n \"title\": \"<string>\",\n \"department\": \"<string>\",\n \"facilityId\": 123,\n \"isSharedContact\": true,\n \"readOnlyAccess\": true,\n \"invitedByEmail\": \"<string>\",\n \"invitedAt\": \"2023-11-07T05:31:56Z\",\n \"epaCertificationType\": \"<string>\",\n \"epaCertificationNumber\": \"<string>\",\n \"createdAt\": \"2023-11-07T05:31:56Z\",\n \"updatedAt\": \"2023-11-07T05:31:56Z\"\n }\n }\n ],\n \"noteReadDetails\": [\n {\n \"readAt\": \"2023-11-07T05:31:56Z\",\n \"readBy\": \"<string>\",\n \"readByContact\": {\n \"email\": \"<string>\",\n \"nameGiven\": \"<string>\",\n \"nameFamily\": \"<string>\",\n \"contactType\": \"<string>\",\n \"title\": \"<string>\",\n \"department\": \"<string>\",\n \"facilityId\": 123,\n \"isSharedContact\": true,\n \"readOnlyAccess\": true,\n \"invitedByEmail\": \"<string>\",\n \"invitedAt\": \"2023-11-07T05:31:56Z\",\n \"epaCertificationType\": \"<string>\",\n \"epaCertificationNumber\": \"<string>\",\n \"createdAt\": \"2023-11-07T05:31:56Z\",\n \"updatedAt\": \"2023-11-07T05:31:56Z\"\n }\n }\n ],\n \"noteAddedByContact\": {\n \"email\": \"<string>\",\n \"nameGiven\": \"<string>\",\n \"nameFamily\": \"<string>\",\n \"contactType\": \"<string>\",\n \"title\": \"<string>\",\n \"department\": \"<string>\",\n \"facilityId\": 123,\n \"isSharedContact\": true,\n \"readOnlyAccess\": true,\n \"invitedByEmail\": \"<string>\",\n \"invitedAt\": \"2023-11-07T05:31:56Z\",\n \"epaCertificationType\": \"<string>\",\n \"epaCertificationNumber\": \"<string>\",\n \"createdAt\": \"2023-11-07T05:31:56Z\",\n \"updatedAt\": \"2023-11-07T05:31:56Z\"\n },\n \"noteType\": \"<string>\",\n \"noteAddedByType\": \"<string>\",\n \"caption\": \"<string>\",\n \"isNoteAwaitingResponse\": true\n }\n ],\n \"invoiceTaxRate\": \"<string>\",\n \"invoiceTax\": \"<string>\",\n \"invoiceTotalBeforeTax\": \"<string>\",\n \"invoiceTotalAfterTax\": \"<string>\",\n \"laborTaxRate\": \"<string>\",\n \"laborTax\": \"<string>\",\n \"laborTotalBeforeTax\": \"<string>\",\n \"laborLineItems\": [\n {\n \"numberOfTech\": 123,\n \"seconds\": 123,\n \"description\": \"<string>\",\n \"roleType\": \"<string>\",\n \"laborType\": \"<string>\",\n \"hourlyRate\": \"<string>\",\n \"amount\": \"<string>\"\n }\n ],\n \"materialTaxRate\": \"<string>\",\n \"materialTax\": \"<string>\",\n \"materialTotalBeforeTax\": \"<string>\",\n \"materialLineItems\": [\n {\n \"unitType\": \"<string>\",\n \"quantity\": \"<string>\",\n \"description\": \"<string>\",\n \"partNumber\": \"<string>\",\n \"partId\": 123,\n \"equipmentNumber\": \"<string>\",\n \"equipmentId\": 123,\n \"unitPrice\": \"<string>\",\n \"amount\": \"<string>\"\n }\n ],\n \"travelTaxRate\": \"<string>\",\n \"travelTax\": \"<string>\",\n \"travelTotalBeforeTax\": \"<string>\",\n \"travelLineItems\": [\n {\n \"description\": \"<string>\",\n \"amount\": \"<string>\"\n }\n ],\n \"freightTaxRate\": \"<string>\",\n \"freightTax\": \"<string>\",\n \"freightTotalBeforeTax\": \"<string>\",\n \"freightLineItems\": [\n {\n \"description\": \"<string>\",\n \"amount\": \"<string>\"\n }\n ],\n \"miscTaxRate\": \"<string>\",\n \"miscTax\": \"<string>\",\n \"miscTotalBeforeTax\": \"<string>\",\n \"miscLineItems\": [\n {\n \"description\": \"<string>\",\n \"amount\": \"<string>\"\n }\n ],\n \"taxLineItems\": [\n {\n \"taxType\": \"<string>\",\n \"amount\": \"<string>\"\n }\n ],\n \"disputeNotes\": [\n {\n \"text\": \"<string>\",\n \"noteAddedBy\": \"<string>\",\n \"noteAddedAt\": \"2023-11-07T05:31:56Z\",\n \"id\": 123,\n \"photo\": \"<string>\",\n \"video\": \"<string>\",\n \"audio\": \"<string>\",\n \"otherFile\": \"<string>\",\n \"elements\": [\n {\n \"type\": \"<string>\",\n \"value\": \"<string>\",\n \"userObject\": {\n \"email\": \"<string>\",\n \"nameGiven\": \"<string>\",\n \"nameFamily\": \"<string>\",\n \"contactType\": \"<string>\",\n \"title\": \"<string>\",\n \"department\": \"<string>\",\n \"facilityId\": 123,\n \"isSharedContact\": true,\n \"readOnlyAccess\": true,\n \"invitedByEmail\": \"<string>\",\n \"invitedAt\": \"2023-11-07T05:31:56Z\",\n \"epaCertificationType\": \"<string>\",\n \"epaCertificationNumber\": \"<string>\",\n \"createdAt\": \"2023-11-07T05:31:56Z\",\n \"updatedAt\": \"2023-11-07T05:31:56Z\"\n }\n }\n ],\n \"noteReadDetails\": [\n {\n \"readAt\": \"2023-11-07T05:31:56Z\",\n \"readBy\": \"<string>\",\n \"readByContact\": {\n \"email\": \"<string>\",\n \"nameGiven\": \"<string>\",\n \"nameFamily\": \"<string>\",\n \"contactType\": \"<string>\",\n \"title\": \"<string>\",\n \"department\": \"<string>\",\n \"facilityId\": 123,\n \"isSharedContact\": true,\n \"readOnlyAccess\": true,\n \"invitedByEmail\": \"<string>\",\n \"invitedAt\": \"2023-11-07T05:31:56Z\",\n \"epaCertificationType\": \"<string>\",\n \"epaCertificationNumber\": \"<string>\",\n \"createdAt\": \"2023-11-07T05:31:56Z\",\n \"updatedAt\": \"2023-11-07T05:31:56Z\"\n }\n }\n ],\n \"noteAddedByContact\": {\n \"email\": \"<string>\",\n \"nameGiven\": \"<string>\",\n \"nameFamily\": \"<string>\",\n \"contactType\": \"<string>\",\n \"title\": \"<string>\",\n \"department\": \"<string>\",\n \"facilityId\": 123,\n \"isSharedContact\": true,\n \"readOnlyAccess\": true,\n \"invitedByEmail\": \"<string>\",\n \"invitedAt\": \"2023-11-07T05:31:56Z\",\n \"epaCertificationType\": \"<string>\",\n \"epaCertificationNumber\": \"<string>\",\n \"createdAt\": \"2023-11-07T05:31:56Z\",\n \"updatedAt\": \"2023-11-07T05:31:56Z\"\n },\n \"noteType\": \"<string>\",\n \"noteAddedByType\": \"<string>\",\n \"caption\": \"<string>\",\n \"isNoteAwaitingResponse\": true\n }\n ],\n \"attachments\": [\n {\n \"fileName\": \"<string>\",\n \"fileId\": \"<string>\"\n }\n ],\n \"invoicePDFLink\": \"<string>\",\n \"invoicePDFWatermarkedLink\": \"<string>\",\n \"owGeneratedPDF\": true,\n \"serviceCallIds\": [\n 123\n ],\n \"autoPublishOnApproval\": true,\n \"createdBy\": \"<string>\",\n \"createdAt\": \"2023-11-07T05:31:56Z\",\n \"publishedBy\": \"<string>\",\n \"publishedAt\": \"2023-11-07T05:31:56Z\",\n \"isAiParsed\": true,\n \"isAiParsedEdited\": true,\n \"aiParseMismatchSignedByEmail\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"type": "<string>",
"data": {
"id": 123,
"status": "<string>",
"scope": "<string>",
"externalWorkOrderId": "<string>",
"paymentTerms": "<string>",
"poNumber": "<string>",
"glCode": "<string>",
"dueDate": "2023-11-07T05:31:56Z",
"publishedAt": "2023-11-07T05:31:56Z",
"approvedAt": "2023-11-07T05:31:56Z",
"processedAt": "2023-11-07T05:31:56Z",
"markedPaidAt": "2023-11-07T05:31:56Z",
"dateOfInvoice": "2023-11-07T05:31:56Z",
"invoiceNumber": "<string>",
"invoiceNotes": [
{
"text": "<string>",
"noteAddedBy": "<string>",
"noteAddedAt": "2023-11-07T05:31:56Z",
"id": 123,
"photo": "<string>",
"video": "<string>",
"audio": "<string>",
"otherFile": "<string>",
"elements": [
{
"type": "<string>",
"value": "<string>",
"userObject": {
"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"
}
}
],
"noteReadDetails": [
{
"readAt": "2023-11-07T05:31:56Z",
"readBy": "<string>",
"readByContact": {
"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"
}
}
],
"noteAddedByContact": {
"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"
},
"noteType": "<string>",
"noteAddedByType": "<string>",
"caption": "<string>",
"isNoteAwaitingResponse": true
}
],
"invoiceTaxRate": "<string>",
"invoiceTax": "<string>",
"invoiceTotalBeforeTax": "<string>",
"invoiceTotalAfterTax": "<string>",
"laborTotalBeforeTax": "<string>",
"materialTotalBeforeTax": "<string>",
"travelTotalBeforeTax": "<string>",
"freightTotalBeforeTax": "<string>",
"miscTotalBeforeTax": "<string>",
"taxLineItems": [
{
"taxType": "<string>",
"amount": "<string>"
}
],
"attachments": [
{
"fileName": "<string>",
"fileId": "<string>"
}
],
"invoicePDFs": [
{
"orderingId": 123,
"link": "<string>"
}
],
"workOrderId": 123,
"serviceCallIds": [
123
],
"problemTypeId": 123,
"supplierFacilityId": 123,
"buyerSupplierRelationship": {},
"locationId": 123,
"buyerFacilityId": 123,
"buyerCompanyId": 123,
"isBuyerUploaded": true,
"createdBy": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"isDeleted": true,
"deletedAt": "2023-11-07T05:31:56Z",
"laborLineItems": [
{
"numberOfTech": 123,
"seconds": 123,
"description": "<string>",
"roleType": "<string>",
"laborType": "<string>",
"hourlyRate": "<string>",
"amount": "<string>"
}
],
"materialLineItems": [
{
"unitType": "<string>",
"quantity": "<string>",
"description": "<string>",
"partNumber": "<string>",
"partId": 123,
"equipmentNumber": "<string>",
"equipmentId": 123,
"unitPrice": "<string>",
"amount": "<string>"
}
],
"travelLineItems": [
{
"description": "<string>",
"amount": "<string>"
}
],
"freightLineItems": [
{
"description": "<string>",
"amount": "<string>"
}
],
"miscLineItems": [
{
"description": "<string>",
"amount": "<string>"
}
]
},
"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>"
}Create a draft invoice
Creates an invoice in “draft” status for the API key’s supplier facility. Not available to internal-service-team keys. Saving an invoice can also transition the associated work order’s status per the invoice-status to work-order-status mapping.
curl --request POST \
--url https://api.useopenwrench.com/api/external/v1/supplier/invoice/invoices \
--header 'Content-Type: application/json' \
--header 'OW-KEY: <api-key>' \
--header 'X-API-KEY: <api-key>' \
--data '
{
"workOrderId": 123,
"id": 123,
"scope": "<string>",
"externalWorkOrderId": "<string>",
"buyerInvoiceTypeId": 123,
"buyerInvoiceTypeDetail": [
{}
],
"supplierInvoiceTypeId": 123,
"supplierInvoiceTypeDetail": [
{}
],
"buyerCustomFieldValues": [
{}
],
"supplierCustomFieldValues": [
{}
],
"paymentTerms": "<string>",
"poNumber": "<string>",
"glCode": "<string>",
"dueDate": "2023-11-07T05:31:56Z",
"isApproved": true,
"duePaymentAt": "2023-11-07T05:31:56Z",
"dateOfInvoice": "2023-11-07T05:31:56Z",
"invoiceNumber": "<string>",
"invoiceNotes": [
{
"text": "<string>",
"noteAddedBy": "<string>",
"noteAddedAt": "2023-11-07T05:31:56Z",
"id": 123,
"photo": "<string>",
"video": "<string>",
"audio": "<string>",
"otherFile": "<string>",
"elements": [
{
"type": "<string>",
"value": "<string>",
"userObject": {
"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"
}
}
],
"noteReadDetails": [
{
"readAt": "2023-11-07T05:31:56Z",
"readBy": "<string>",
"readByContact": {
"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"
}
}
],
"noteAddedByContact": {
"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"
},
"noteType": "<string>",
"noteAddedByType": "<string>",
"caption": "<string>",
"isNoteAwaitingResponse": true
}
],
"invoiceTaxRate": "<string>",
"invoiceTax": "<string>",
"invoiceTotalBeforeTax": "<string>",
"invoiceTotalAfterTax": "<string>",
"laborTaxRate": "<string>",
"laborTax": "<string>",
"laborTotalBeforeTax": "<string>",
"laborLineItems": [
{
"numberOfTech": 123,
"seconds": 123,
"description": "<string>",
"roleType": "<string>",
"laborType": "<string>",
"hourlyRate": "<string>",
"amount": "<string>"
}
],
"materialTaxRate": "<string>",
"materialTax": "<string>",
"materialTotalBeforeTax": "<string>",
"materialLineItems": [
{
"unitType": "<string>",
"quantity": "<string>",
"description": "<string>",
"partNumber": "<string>",
"partId": 123,
"equipmentNumber": "<string>",
"equipmentId": 123,
"unitPrice": "<string>",
"amount": "<string>"
}
],
"travelTaxRate": "<string>",
"travelTax": "<string>",
"travelTotalBeforeTax": "<string>",
"travelLineItems": [
{
"description": "<string>",
"amount": "<string>"
}
],
"freightTaxRate": "<string>",
"freightTax": "<string>",
"freightTotalBeforeTax": "<string>",
"freightLineItems": [
{
"description": "<string>",
"amount": "<string>"
}
],
"miscTaxRate": "<string>",
"miscTax": "<string>",
"miscTotalBeforeTax": "<string>",
"miscLineItems": [
{
"description": "<string>",
"amount": "<string>"
}
],
"taxLineItems": [
{
"taxType": "<string>",
"amount": "<string>"
}
],
"disputeNotes": [
{
"text": "<string>",
"noteAddedBy": "<string>",
"noteAddedAt": "2023-11-07T05:31:56Z",
"id": 123,
"photo": "<string>",
"video": "<string>",
"audio": "<string>",
"otherFile": "<string>",
"elements": [
{
"type": "<string>",
"value": "<string>",
"userObject": {
"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"
}
}
],
"noteReadDetails": [
{
"readAt": "2023-11-07T05:31:56Z",
"readBy": "<string>",
"readByContact": {
"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"
}
}
],
"noteAddedByContact": {
"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"
},
"noteType": "<string>",
"noteAddedByType": "<string>",
"caption": "<string>",
"isNoteAwaitingResponse": true
}
],
"attachments": [
{
"fileName": "<string>",
"fileId": "<string>"
}
],
"invoicePDFLink": "<string>",
"invoicePDFWatermarkedLink": "<string>",
"owGeneratedPDF": true,
"serviceCallIds": [
123
],
"autoPublishOnApproval": true,
"createdBy": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"publishedBy": "<string>",
"publishedAt": "2023-11-07T05:31:56Z",
"isAiParsed": true,
"isAiParsedEdited": true,
"aiParseMismatchSignedByEmail": "<string>"
}
'import requests
url = "https://api.useopenwrench.com/api/external/v1/supplier/invoice/invoices"
payload = {
"workOrderId": 123,
"id": 123,
"scope": "<string>",
"externalWorkOrderId": "<string>",
"buyerInvoiceTypeId": 123,
"buyerInvoiceTypeDetail": [{}],
"supplierInvoiceTypeId": 123,
"supplierInvoiceTypeDetail": [{}],
"buyerCustomFieldValues": [{}],
"supplierCustomFieldValues": [{}],
"paymentTerms": "<string>",
"poNumber": "<string>",
"glCode": "<string>",
"dueDate": "2023-11-07T05:31:56Z",
"isApproved": True,
"duePaymentAt": "2023-11-07T05:31:56Z",
"dateOfInvoice": "2023-11-07T05:31:56Z",
"invoiceNumber": "<string>",
"invoiceNotes": [
{
"text": "<string>",
"noteAddedBy": "<string>",
"noteAddedAt": "2023-11-07T05:31:56Z",
"id": 123,
"photo": "<string>",
"video": "<string>",
"audio": "<string>",
"otherFile": "<string>",
"elements": [
{
"type": "<string>",
"value": "<string>",
"userObject": {
"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"
}
}
],
"noteReadDetails": [
{
"readAt": "2023-11-07T05:31:56Z",
"readBy": "<string>",
"readByContact": {
"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"
}
}
],
"noteAddedByContact": {
"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"
},
"noteType": "<string>",
"noteAddedByType": "<string>",
"caption": "<string>",
"isNoteAwaitingResponse": True
}
],
"invoiceTaxRate": "<string>",
"invoiceTax": "<string>",
"invoiceTotalBeforeTax": "<string>",
"invoiceTotalAfterTax": "<string>",
"laborTaxRate": "<string>",
"laborTax": "<string>",
"laborTotalBeforeTax": "<string>",
"laborLineItems": [
{
"numberOfTech": 123,
"seconds": 123,
"description": "<string>",
"roleType": "<string>",
"laborType": "<string>",
"hourlyRate": "<string>",
"amount": "<string>"
}
],
"materialTaxRate": "<string>",
"materialTax": "<string>",
"materialTotalBeforeTax": "<string>",
"materialLineItems": [
{
"unitType": "<string>",
"quantity": "<string>",
"description": "<string>",
"partNumber": "<string>",
"partId": 123,
"equipmentNumber": "<string>",
"equipmentId": 123,
"unitPrice": "<string>",
"amount": "<string>"
}
],
"travelTaxRate": "<string>",
"travelTax": "<string>",
"travelTotalBeforeTax": "<string>",
"travelLineItems": [
{
"description": "<string>",
"amount": "<string>"
}
],
"freightTaxRate": "<string>",
"freightTax": "<string>",
"freightTotalBeforeTax": "<string>",
"freightLineItems": [
{
"description": "<string>",
"amount": "<string>"
}
],
"miscTaxRate": "<string>",
"miscTax": "<string>",
"miscTotalBeforeTax": "<string>",
"miscLineItems": [
{
"description": "<string>",
"amount": "<string>"
}
],
"taxLineItems": [
{
"taxType": "<string>",
"amount": "<string>"
}
],
"disputeNotes": [
{
"text": "<string>",
"noteAddedBy": "<string>",
"noteAddedAt": "2023-11-07T05:31:56Z",
"id": 123,
"photo": "<string>",
"video": "<string>",
"audio": "<string>",
"otherFile": "<string>",
"elements": [
{
"type": "<string>",
"value": "<string>",
"userObject": {
"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"
}
}
],
"noteReadDetails": [
{
"readAt": "2023-11-07T05:31:56Z",
"readBy": "<string>",
"readByContact": {
"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"
}
}
],
"noteAddedByContact": {
"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"
},
"noteType": "<string>",
"noteAddedByType": "<string>",
"caption": "<string>",
"isNoteAwaitingResponse": True
}
],
"attachments": [
{
"fileName": "<string>",
"fileId": "<string>"
}
],
"invoicePDFLink": "<string>",
"invoicePDFWatermarkedLink": "<string>",
"owGeneratedPDF": True,
"serviceCallIds": [123],
"autoPublishOnApproval": True,
"createdBy": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"publishedBy": "<string>",
"publishedAt": "2023-11-07T05:31:56Z",
"isAiParsed": True,
"isAiParsedEdited": True,
"aiParseMismatchSignedByEmail": "<string>"
}
headers = {
"X-API-KEY": "<api-key>",
"OW-KEY": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'X-API-KEY': '<api-key>',
'OW-KEY': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
workOrderId: 123,
id: 123,
scope: '<string>',
externalWorkOrderId: '<string>',
buyerInvoiceTypeId: 123,
buyerInvoiceTypeDetail: [{}],
supplierInvoiceTypeId: 123,
supplierInvoiceTypeDetail: [{}],
buyerCustomFieldValues: [{}],
supplierCustomFieldValues: [{}],
paymentTerms: '<string>',
poNumber: '<string>',
glCode: '<string>',
dueDate: '2023-11-07T05:31:56Z',
isApproved: true,
duePaymentAt: '2023-11-07T05:31:56Z',
dateOfInvoice: '2023-11-07T05:31:56Z',
invoiceNumber: '<string>',
invoiceNotes: [
{
text: '<string>',
noteAddedBy: '<string>',
noteAddedAt: '2023-11-07T05:31:56Z',
id: 123,
photo: '<string>',
video: '<string>',
audio: '<string>',
otherFile: '<string>',
elements: [
{
type: '<string>',
value: '<string>',
userObject: {
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'
}
}
],
noteReadDetails: [
{
readAt: '2023-11-07T05:31:56Z',
readBy: '<string>',
readByContact: {
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'
}
}
],
noteAddedByContact: {
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'
},
noteType: '<string>',
noteAddedByType: '<string>',
caption: '<string>',
isNoteAwaitingResponse: true
}
],
invoiceTaxRate: '<string>',
invoiceTax: '<string>',
invoiceTotalBeforeTax: '<string>',
invoiceTotalAfterTax: '<string>',
laborTaxRate: '<string>',
laborTax: '<string>',
laborTotalBeforeTax: '<string>',
laborLineItems: [
{
numberOfTech: 123,
seconds: 123,
description: '<string>',
roleType: '<string>',
laborType: '<string>',
hourlyRate: '<string>',
amount: '<string>'
}
],
materialTaxRate: '<string>',
materialTax: '<string>',
materialTotalBeforeTax: '<string>',
materialLineItems: [
{
unitType: '<string>',
quantity: '<string>',
description: '<string>',
partNumber: '<string>',
partId: 123,
equipmentNumber: '<string>',
equipmentId: 123,
unitPrice: '<string>',
amount: '<string>'
}
],
travelTaxRate: '<string>',
travelTax: '<string>',
travelTotalBeforeTax: '<string>',
travelLineItems: [{description: '<string>', amount: '<string>'}],
freightTaxRate: '<string>',
freightTax: '<string>',
freightTotalBeforeTax: '<string>',
freightLineItems: [{description: '<string>', amount: '<string>'}],
miscTaxRate: '<string>',
miscTax: '<string>',
miscTotalBeforeTax: '<string>',
miscLineItems: [{description: '<string>', amount: '<string>'}],
taxLineItems: [{taxType: '<string>', amount: '<string>'}],
disputeNotes: [
{
text: '<string>',
noteAddedBy: '<string>',
noteAddedAt: '2023-11-07T05:31:56Z',
id: 123,
photo: '<string>',
video: '<string>',
audio: '<string>',
otherFile: '<string>',
elements: [
{
type: '<string>',
value: '<string>',
userObject: {
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'
}
}
],
noteReadDetails: [
{
readAt: '2023-11-07T05:31:56Z',
readBy: '<string>',
readByContact: {
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'
}
}
],
noteAddedByContact: {
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'
},
noteType: '<string>',
noteAddedByType: '<string>',
caption: '<string>',
isNoteAwaitingResponse: true
}
],
attachments: [{fileName: '<string>', fileId: '<string>'}],
invoicePDFLink: '<string>',
invoicePDFWatermarkedLink: '<string>',
owGeneratedPDF: true,
serviceCallIds: [123],
autoPublishOnApproval: true,
createdBy: '<string>',
createdAt: '2023-11-07T05:31:56Z',
publishedBy: '<string>',
publishedAt: '2023-11-07T05:31:56Z',
isAiParsed: true,
isAiParsedEdited: true,
aiParseMismatchSignedByEmail: '<string>'
})
};
fetch('https://api.useopenwrench.com/api/external/v1/supplier/invoice/invoices', 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/invoice/invoices",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'workOrderId' => 123,
'id' => 123,
'scope' => '<string>',
'externalWorkOrderId' => '<string>',
'buyerInvoiceTypeId' => 123,
'buyerInvoiceTypeDetail' => [
[
]
],
'supplierInvoiceTypeId' => 123,
'supplierInvoiceTypeDetail' => [
[
]
],
'buyerCustomFieldValues' => [
[
]
],
'supplierCustomFieldValues' => [
[
]
],
'paymentTerms' => '<string>',
'poNumber' => '<string>',
'glCode' => '<string>',
'dueDate' => '2023-11-07T05:31:56Z',
'isApproved' => true,
'duePaymentAt' => '2023-11-07T05:31:56Z',
'dateOfInvoice' => '2023-11-07T05:31:56Z',
'invoiceNumber' => '<string>',
'invoiceNotes' => [
[
'text' => '<string>',
'noteAddedBy' => '<string>',
'noteAddedAt' => '2023-11-07T05:31:56Z',
'id' => 123,
'photo' => '<string>',
'video' => '<string>',
'audio' => '<string>',
'otherFile' => '<string>',
'elements' => [
[
'type' => '<string>',
'value' => '<string>',
'userObject' => [
'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'
]
]
],
'noteReadDetails' => [
[
'readAt' => '2023-11-07T05:31:56Z',
'readBy' => '<string>',
'readByContact' => [
'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'
]
]
],
'noteAddedByContact' => [
'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'
],
'noteType' => '<string>',
'noteAddedByType' => '<string>',
'caption' => '<string>',
'isNoteAwaitingResponse' => true
]
],
'invoiceTaxRate' => '<string>',
'invoiceTax' => '<string>',
'invoiceTotalBeforeTax' => '<string>',
'invoiceTotalAfterTax' => '<string>',
'laborTaxRate' => '<string>',
'laborTax' => '<string>',
'laborTotalBeforeTax' => '<string>',
'laborLineItems' => [
[
'numberOfTech' => 123,
'seconds' => 123,
'description' => '<string>',
'roleType' => '<string>',
'laborType' => '<string>',
'hourlyRate' => '<string>',
'amount' => '<string>'
]
],
'materialTaxRate' => '<string>',
'materialTax' => '<string>',
'materialTotalBeforeTax' => '<string>',
'materialLineItems' => [
[
'unitType' => '<string>',
'quantity' => '<string>',
'description' => '<string>',
'partNumber' => '<string>',
'partId' => 123,
'equipmentNumber' => '<string>',
'equipmentId' => 123,
'unitPrice' => '<string>',
'amount' => '<string>'
]
],
'travelTaxRate' => '<string>',
'travelTax' => '<string>',
'travelTotalBeforeTax' => '<string>',
'travelLineItems' => [
[
'description' => '<string>',
'amount' => '<string>'
]
],
'freightTaxRate' => '<string>',
'freightTax' => '<string>',
'freightTotalBeforeTax' => '<string>',
'freightLineItems' => [
[
'description' => '<string>',
'amount' => '<string>'
]
],
'miscTaxRate' => '<string>',
'miscTax' => '<string>',
'miscTotalBeforeTax' => '<string>',
'miscLineItems' => [
[
'description' => '<string>',
'amount' => '<string>'
]
],
'taxLineItems' => [
[
'taxType' => '<string>',
'amount' => '<string>'
]
],
'disputeNotes' => [
[
'text' => '<string>',
'noteAddedBy' => '<string>',
'noteAddedAt' => '2023-11-07T05:31:56Z',
'id' => 123,
'photo' => '<string>',
'video' => '<string>',
'audio' => '<string>',
'otherFile' => '<string>',
'elements' => [
[
'type' => '<string>',
'value' => '<string>',
'userObject' => [
'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'
]
]
],
'noteReadDetails' => [
[
'readAt' => '2023-11-07T05:31:56Z',
'readBy' => '<string>',
'readByContact' => [
'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'
]
]
],
'noteAddedByContact' => [
'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'
],
'noteType' => '<string>',
'noteAddedByType' => '<string>',
'caption' => '<string>',
'isNoteAwaitingResponse' => true
]
],
'attachments' => [
[
'fileName' => '<string>',
'fileId' => '<string>'
]
],
'invoicePDFLink' => '<string>',
'invoicePDFWatermarkedLink' => '<string>',
'owGeneratedPDF' => true,
'serviceCallIds' => [
123
],
'autoPublishOnApproval' => true,
'createdBy' => '<string>',
'createdAt' => '2023-11-07T05:31:56Z',
'publishedBy' => '<string>',
'publishedAt' => '2023-11-07T05:31:56Z',
'isAiParsed' => true,
'isAiParsedEdited' => true,
'aiParseMismatchSignedByEmail' => '<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/invoice/invoices"
payload := strings.NewReader("{\n \"workOrderId\": 123,\n \"id\": 123,\n \"scope\": \"<string>\",\n \"externalWorkOrderId\": \"<string>\",\n \"buyerInvoiceTypeId\": 123,\n \"buyerInvoiceTypeDetail\": [\n {}\n ],\n \"supplierInvoiceTypeId\": 123,\n \"supplierInvoiceTypeDetail\": [\n {}\n ],\n \"buyerCustomFieldValues\": [\n {}\n ],\n \"supplierCustomFieldValues\": [\n {}\n ],\n \"paymentTerms\": \"<string>\",\n \"poNumber\": \"<string>\",\n \"glCode\": \"<string>\",\n \"dueDate\": \"2023-11-07T05:31:56Z\",\n \"isApproved\": true,\n \"duePaymentAt\": \"2023-11-07T05:31:56Z\",\n \"dateOfInvoice\": \"2023-11-07T05:31:56Z\",\n \"invoiceNumber\": \"<string>\",\n \"invoiceNotes\": [\n {\n \"text\": \"<string>\",\n \"noteAddedBy\": \"<string>\",\n \"noteAddedAt\": \"2023-11-07T05:31:56Z\",\n \"id\": 123,\n \"photo\": \"<string>\",\n \"video\": \"<string>\",\n \"audio\": \"<string>\",\n \"otherFile\": \"<string>\",\n \"elements\": [\n {\n \"type\": \"<string>\",\n \"value\": \"<string>\",\n \"userObject\": {\n \"email\": \"<string>\",\n \"nameGiven\": \"<string>\",\n \"nameFamily\": \"<string>\",\n \"contactType\": \"<string>\",\n \"title\": \"<string>\",\n \"department\": \"<string>\",\n \"facilityId\": 123,\n \"isSharedContact\": true,\n \"readOnlyAccess\": true,\n \"invitedByEmail\": \"<string>\",\n \"invitedAt\": \"2023-11-07T05:31:56Z\",\n \"epaCertificationType\": \"<string>\",\n \"epaCertificationNumber\": \"<string>\",\n \"createdAt\": \"2023-11-07T05:31:56Z\",\n \"updatedAt\": \"2023-11-07T05:31:56Z\"\n }\n }\n ],\n \"noteReadDetails\": [\n {\n \"readAt\": \"2023-11-07T05:31:56Z\",\n \"readBy\": \"<string>\",\n \"readByContact\": {\n \"email\": \"<string>\",\n \"nameGiven\": \"<string>\",\n \"nameFamily\": \"<string>\",\n \"contactType\": \"<string>\",\n \"title\": \"<string>\",\n \"department\": \"<string>\",\n \"facilityId\": 123,\n \"isSharedContact\": true,\n \"readOnlyAccess\": true,\n \"invitedByEmail\": \"<string>\",\n \"invitedAt\": \"2023-11-07T05:31:56Z\",\n \"epaCertificationType\": \"<string>\",\n \"epaCertificationNumber\": \"<string>\",\n \"createdAt\": \"2023-11-07T05:31:56Z\",\n \"updatedAt\": \"2023-11-07T05:31:56Z\"\n }\n }\n ],\n \"noteAddedByContact\": {\n \"email\": \"<string>\",\n \"nameGiven\": \"<string>\",\n \"nameFamily\": \"<string>\",\n \"contactType\": \"<string>\",\n \"title\": \"<string>\",\n \"department\": \"<string>\",\n \"facilityId\": 123,\n \"isSharedContact\": true,\n \"readOnlyAccess\": true,\n \"invitedByEmail\": \"<string>\",\n \"invitedAt\": \"2023-11-07T05:31:56Z\",\n \"epaCertificationType\": \"<string>\",\n \"epaCertificationNumber\": \"<string>\",\n \"createdAt\": \"2023-11-07T05:31:56Z\",\n \"updatedAt\": \"2023-11-07T05:31:56Z\"\n },\n \"noteType\": \"<string>\",\n \"noteAddedByType\": \"<string>\",\n \"caption\": \"<string>\",\n \"isNoteAwaitingResponse\": true\n }\n ],\n \"invoiceTaxRate\": \"<string>\",\n \"invoiceTax\": \"<string>\",\n \"invoiceTotalBeforeTax\": \"<string>\",\n \"invoiceTotalAfterTax\": \"<string>\",\n \"laborTaxRate\": \"<string>\",\n \"laborTax\": \"<string>\",\n \"laborTotalBeforeTax\": \"<string>\",\n \"laborLineItems\": [\n {\n \"numberOfTech\": 123,\n \"seconds\": 123,\n \"description\": \"<string>\",\n \"roleType\": \"<string>\",\n \"laborType\": \"<string>\",\n \"hourlyRate\": \"<string>\",\n \"amount\": \"<string>\"\n }\n ],\n \"materialTaxRate\": \"<string>\",\n \"materialTax\": \"<string>\",\n \"materialTotalBeforeTax\": \"<string>\",\n \"materialLineItems\": [\n {\n \"unitType\": \"<string>\",\n \"quantity\": \"<string>\",\n \"description\": \"<string>\",\n \"partNumber\": \"<string>\",\n \"partId\": 123,\n \"equipmentNumber\": \"<string>\",\n \"equipmentId\": 123,\n \"unitPrice\": \"<string>\",\n \"amount\": \"<string>\"\n }\n ],\n \"travelTaxRate\": \"<string>\",\n \"travelTax\": \"<string>\",\n \"travelTotalBeforeTax\": \"<string>\",\n \"travelLineItems\": [\n {\n \"description\": \"<string>\",\n \"amount\": \"<string>\"\n }\n ],\n \"freightTaxRate\": \"<string>\",\n \"freightTax\": \"<string>\",\n \"freightTotalBeforeTax\": \"<string>\",\n \"freightLineItems\": [\n {\n \"description\": \"<string>\",\n \"amount\": \"<string>\"\n }\n ],\n \"miscTaxRate\": \"<string>\",\n \"miscTax\": \"<string>\",\n \"miscTotalBeforeTax\": \"<string>\",\n \"miscLineItems\": [\n {\n \"description\": \"<string>\",\n \"amount\": \"<string>\"\n }\n ],\n \"taxLineItems\": [\n {\n \"taxType\": \"<string>\",\n \"amount\": \"<string>\"\n }\n ],\n \"disputeNotes\": [\n {\n \"text\": \"<string>\",\n \"noteAddedBy\": \"<string>\",\n \"noteAddedAt\": \"2023-11-07T05:31:56Z\",\n \"id\": 123,\n \"photo\": \"<string>\",\n \"video\": \"<string>\",\n \"audio\": \"<string>\",\n \"otherFile\": \"<string>\",\n \"elements\": [\n {\n \"type\": \"<string>\",\n \"value\": \"<string>\",\n \"userObject\": {\n \"email\": \"<string>\",\n \"nameGiven\": \"<string>\",\n \"nameFamily\": \"<string>\",\n \"contactType\": \"<string>\",\n \"title\": \"<string>\",\n \"department\": \"<string>\",\n \"facilityId\": 123,\n \"isSharedContact\": true,\n \"readOnlyAccess\": true,\n \"invitedByEmail\": \"<string>\",\n \"invitedAt\": \"2023-11-07T05:31:56Z\",\n \"epaCertificationType\": \"<string>\",\n \"epaCertificationNumber\": \"<string>\",\n \"createdAt\": \"2023-11-07T05:31:56Z\",\n \"updatedAt\": \"2023-11-07T05:31:56Z\"\n }\n }\n ],\n \"noteReadDetails\": [\n {\n \"readAt\": \"2023-11-07T05:31:56Z\",\n \"readBy\": \"<string>\",\n \"readByContact\": {\n \"email\": \"<string>\",\n \"nameGiven\": \"<string>\",\n \"nameFamily\": \"<string>\",\n \"contactType\": \"<string>\",\n \"title\": \"<string>\",\n \"department\": \"<string>\",\n \"facilityId\": 123,\n \"isSharedContact\": true,\n \"readOnlyAccess\": true,\n \"invitedByEmail\": \"<string>\",\n \"invitedAt\": \"2023-11-07T05:31:56Z\",\n \"epaCertificationType\": \"<string>\",\n \"epaCertificationNumber\": \"<string>\",\n \"createdAt\": \"2023-11-07T05:31:56Z\",\n \"updatedAt\": \"2023-11-07T05:31:56Z\"\n }\n }\n ],\n \"noteAddedByContact\": {\n \"email\": \"<string>\",\n \"nameGiven\": \"<string>\",\n \"nameFamily\": \"<string>\",\n \"contactType\": \"<string>\",\n \"title\": \"<string>\",\n \"department\": \"<string>\",\n \"facilityId\": 123,\n \"isSharedContact\": true,\n \"readOnlyAccess\": true,\n \"invitedByEmail\": \"<string>\",\n \"invitedAt\": \"2023-11-07T05:31:56Z\",\n \"epaCertificationType\": \"<string>\",\n \"epaCertificationNumber\": \"<string>\",\n \"createdAt\": \"2023-11-07T05:31:56Z\",\n \"updatedAt\": \"2023-11-07T05:31:56Z\"\n },\n \"noteType\": \"<string>\",\n \"noteAddedByType\": \"<string>\",\n \"caption\": \"<string>\",\n \"isNoteAwaitingResponse\": true\n }\n ],\n \"attachments\": [\n {\n \"fileName\": \"<string>\",\n \"fileId\": \"<string>\"\n }\n ],\n \"invoicePDFLink\": \"<string>\",\n \"invoicePDFWatermarkedLink\": \"<string>\",\n \"owGeneratedPDF\": true,\n \"serviceCallIds\": [\n 123\n ],\n \"autoPublishOnApproval\": true,\n \"createdBy\": \"<string>\",\n \"createdAt\": \"2023-11-07T05:31:56Z\",\n \"publishedBy\": \"<string>\",\n \"publishedAt\": \"2023-11-07T05:31:56Z\",\n \"isAiParsed\": true,\n \"isAiParsedEdited\": true,\n \"aiParseMismatchSignedByEmail\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", 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.post("https://api.useopenwrench.com/api/external/v1/supplier/invoice/invoices")
.header("X-API-KEY", "<api-key>")
.header("OW-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"workOrderId\": 123,\n \"id\": 123,\n \"scope\": \"<string>\",\n \"externalWorkOrderId\": \"<string>\",\n \"buyerInvoiceTypeId\": 123,\n \"buyerInvoiceTypeDetail\": [\n {}\n ],\n \"supplierInvoiceTypeId\": 123,\n \"supplierInvoiceTypeDetail\": [\n {}\n ],\n \"buyerCustomFieldValues\": [\n {}\n ],\n \"supplierCustomFieldValues\": [\n {}\n ],\n \"paymentTerms\": \"<string>\",\n \"poNumber\": \"<string>\",\n \"glCode\": \"<string>\",\n \"dueDate\": \"2023-11-07T05:31:56Z\",\n \"isApproved\": true,\n \"duePaymentAt\": \"2023-11-07T05:31:56Z\",\n \"dateOfInvoice\": \"2023-11-07T05:31:56Z\",\n \"invoiceNumber\": \"<string>\",\n \"invoiceNotes\": [\n {\n \"text\": \"<string>\",\n \"noteAddedBy\": \"<string>\",\n \"noteAddedAt\": \"2023-11-07T05:31:56Z\",\n \"id\": 123,\n \"photo\": \"<string>\",\n \"video\": \"<string>\",\n \"audio\": \"<string>\",\n \"otherFile\": \"<string>\",\n \"elements\": [\n {\n \"type\": \"<string>\",\n \"value\": \"<string>\",\n \"userObject\": {\n \"email\": \"<string>\",\n \"nameGiven\": \"<string>\",\n \"nameFamily\": \"<string>\",\n \"contactType\": \"<string>\",\n \"title\": \"<string>\",\n \"department\": \"<string>\",\n \"facilityId\": 123,\n \"isSharedContact\": true,\n \"readOnlyAccess\": true,\n \"invitedByEmail\": \"<string>\",\n \"invitedAt\": \"2023-11-07T05:31:56Z\",\n \"epaCertificationType\": \"<string>\",\n \"epaCertificationNumber\": \"<string>\",\n \"createdAt\": \"2023-11-07T05:31:56Z\",\n \"updatedAt\": \"2023-11-07T05:31:56Z\"\n }\n }\n ],\n \"noteReadDetails\": [\n {\n \"readAt\": \"2023-11-07T05:31:56Z\",\n \"readBy\": \"<string>\",\n \"readByContact\": {\n \"email\": \"<string>\",\n \"nameGiven\": \"<string>\",\n \"nameFamily\": \"<string>\",\n \"contactType\": \"<string>\",\n \"title\": \"<string>\",\n \"department\": \"<string>\",\n \"facilityId\": 123,\n \"isSharedContact\": true,\n \"readOnlyAccess\": true,\n \"invitedByEmail\": \"<string>\",\n \"invitedAt\": \"2023-11-07T05:31:56Z\",\n \"epaCertificationType\": \"<string>\",\n \"epaCertificationNumber\": \"<string>\",\n \"createdAt\": \"2023-11-07T05:31:56Z\",\n \"updatedAt\": \"2023-11-07T05:31:56Z\"\n }\n }\n ],\n \"noteAddedByContact\": {\n \"email\": \"<string>\",\n \"nameGiven\": \"<string>\",\n \"nameFamily\": \"<string>\",\n \"contactType\": \"<string>\",\n \"title\": \"<string>\",\n \"department\": \"<string>\",\n \"facilityId\": 123,\n \"isSharedContact\": true,\n \"readOnlyAccess\": true,\n \"invitedByEmail\": \"<string>\",\n \"invitedAt\": \"2023-11-07T05:31:56Z\",\n \"epaCertificationType\": \"<string>\",\n \"epaCertificationNumber\": \"<string>\",\n \"createdAt\": \"2023-11-07T05:31:56Z\",\n \"updatedAt\": \"2023-11-07T05:31:56Z\"\n },\n \"noteType\": \"<string>\",\n \"noteAddedByType\": \"<string>\",\n \"caption\": \"<string>\",\n \"isNoteAwaitingResponse\": true\n }\n ],\n \"invoiceTaxRate\": \"<string>\",\n \"invoiceTax\": \"<string>\",\n \"invoiceTotalBeforeTax\": \"<string>\",\n \"invoiceTotalAfterTax\": \"<string>\",\n \"laborTaxRate\": \"<string>\",\n \"laborTax\": \"<string>\",\n \"laborTotalBeforeTax\": \"<string>\",\n \"laborLineItems\": [\n {\n \"numberOfTech\": 123,\n \"seconds\": 123,\n \"description\": \"<string>\",\n \"roleType\": \"<string>\",\n \"laborType\": \"<string>\",\n \"hourlyRate\": \"<string>\",\n \"amount\": \"<string>\"\n }\n ],\n \"materialTaxRate\": \"<string>\",\n \"materialTax\": \"<string>\",\n \"materialTotalBeforeTax\": \"<string>\",\n \"materialLineItems\": [\n {\n \"unitType\": \"<string>\",\n \"quantity\": \"<string>\",\n \"description\": \"<string>\",\n \"partNumber\": \"<string>\",\n \"partId\": 123,\n \"equipmentNumber\": \"<string>\",\n \"equipmentId\": 123,\n \"unitPrice\": \"<string>\",\n \"amount\": \"<string>\"\n }\n ],\n \"travelTaxRate\": \"<string>\",\n \"travelTax\": \"<string>\",\n \"travelTotalBeforeTax\": \"<string>\",\n \"travelLineItems\": [\n {\n \"description\": \"<string>\",\n \"amount\": \"<string>\"\n }\n ],\n \"freightTaxRate\": \"<string>\",\n \"freightTax\": \"<string>\",\n \"freightTotalBeforeTax\": \"<string>\",\n \"freightLineItems\": [\n {\n \"description\": \"<string>\",\n \"amount\": \"<string>\"\n }\n ],\n \"miscTaxRate\": \"<string>\",\n \"miscTax\": \"<string>\",\n \"miscTotalBeforeTax\": \"<string>\",\n \"miscLineItems\": [\n {\n \"description\": \"<string>\",\n \"amount\": \"<string>\"\n }\n ],\n \"taxLineItems\": [\n {\n \"taxType\": \"<string>\",\n \"amount\": \"<string>\"\n }\n ],\n \"disputeNotes\": [\n {\n \"text\": \"<string>\",\n \"noteAddedBy\": \"<string>\",\n \"noteAddedAt\": \"2023-11-07T05:31:56Z\",\n \"id\": 123,\n \"photo\": \"<string>\",\n \"video\": \"<string>\",\n \"audio\": \"<string>\",\n \"otherFile\": \"<string>\",\n \"elements\": [\n {\n \"type\": \"<string>\",\n \"value\": \"<string>\",\n \"userObject\": {\n \"email\": \"<string>\",\n \"nameGiven\": \"<string>\",\n \"nameFamily\": \"<string>\",\n \"contactType\": \"<string>\",\n \"title\": \"<string>\",\n \"department\": \"<string>\",\n \"facilityId\": 123,\n \"isSharedContact\": true,\n \"readOnlyAccess\": true,\n \"invitedByEmail\": \"<string>\",\n \"invitedAt\": \"2023-11-07T05:31:56Z\",\n \"epaCertificationType\": \"<string>\",\n \"epaCertificationNumber\": \"<string>\",\n \"createdAt\": \"2023-11-07T05:31:56Z\",\n \"updatedAt\": \"2023-11-07T05:31:56Z\"\n }\n }\n ],\n \"noteReadDetails\": [\n {\n \"readAt\": \"2023-11-07T05:31:56Z\",\n \"readBy\": \"<string>\",\n \"readByContact\": {\n \"email\": \"<string>\",\n \"nameGiven\": \"<string>\",\n \"nameFamily\": \"<string>\",\n \"contactType\": \"<string>\",\n \"title\": \"<string>\",\n \"department\": \"<string>\",\n \"facilityId\": 123,\n \"isSharedContact\": true,\n \"readOnlyAccess\": true,\n \"invitedByEmail\": \"<string>\",\n \"invitedAt\": \"2023-11-07T05:31:56Z\",\n \"epaCertificationType\": \"<string>\",\n \"epaCertificationNumber\": \"<string>\",\n \"createdAt\": \"2023-11-07T05:31:56Z\",\n \"updatedAt\": \"2023-11-07T05:31:56Z\"\n }\n }\n ],\n \"noteAddedByContact\": {\n \"email\": \"<string>\",\n \"nameGiven\": \"<string>\",\n \"nameFamily\": \"<string>\",\n \"contactType\": \"<string>\",\n \"title\": \"<string>\",\n \"department\": \"<string>\",\n \"facilityId\": 123,\n \"isSharedContact\": true,\n \"readOnlyAccess\": true,\n \"invitedByEmail\": \"<string>\",\n \"invitedAt\": \"2023-11-07T05:31:56Z\",\n \"epaCertificationType\": \"<string>\",\n \"epaCertificationNumber\": \"<string>\",\n \"createdAt\": \"2023-11-07T05:31:56Z\",\n \"updatedAt\": \"2023-11-07T05:31:56Z\"\n },\n \"noteType\": \"<string>\",\n \"noteAddedByType\": \"<string>\",\n \"caption\": \"<string>\",\n \"isNoteAwaitingResponse\": true\n }\n ],\n \"attachments\": [\n {\n \"fileName\": \"<string>\",\n \"fileId\": \"<string>\"\n }\n ],\n \"invoicePDFLink\": \"<string>\",\n \"invoicePDFWatermarkedLink\": \"<string>\",\n \"owGeneratedPDF\": true,\n \"serviceCallIds\": [\n 123\n ],\n \"autoPublishOnApproval\": true,\n \"createdBy\": \"<string>\",\n \"createdAt\": \"2023-11-07T05:31:56Z\",\n \"publishedBy\": \"<string>\",\n \"publishedAt\": \"2023-11-07T05:31:56Z\",\n \"isAiParsed\": true,\n \"isAiParsedEdited\": true,\n \"aiParseMismatchSignedByEmail\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.useopenwrench.com/api/external/v1/supplier/invoice/invoices")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-KEY"] = '<api-key>'
request["OW-KEY"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"workOrderId\": 123,\n \"id\": 123,\n \"scope\": \"<string>\",\n \"externalWorkOrderId\": \"<string>\",\n \"buyerInvoiceTypeId\": 123,\n \"buyerInvoiceTypeDetail\": [\n {}\n ],\n \"supplierInvoiceTypeId\": 123,\n \"supplierInvoiceTypeDetail\": [\n {}\n ],\n \"buyerCustomFieldValues\": [\n {}\n ],\n \"supplierCustomFieldValues\": [\n {}\n ],\n \"paymentTerms\": \"<string>\",\n \"poNumber\": \"<string>\",\n \"glCode\": \"<string>\",\n \"dueDate\": \"2023-11-07T05:31:56Z\",\n \"isApproved\": true,\n \"duePaymentAt\": \"2023-11-07T05:31:56Z\",\n \"dateOfInvoice\": \"2023-11-07T05:31:56Z\",\n \"invoiceNumber\": \"<string>\",\n \"invoiceNotes\": [\n {\n \"text\": \"<string>\",\n \"noteAddedBy\": \"<string>\",\n \"noteAddedAt\": \"2023-11-07T05:31:56Z\",\n \"id\": 123,\n \"photo\": \"<string>\",\n \"video\": \"<string>\",\n \"audio\": \"<string>\",\n \"otherFile\": \"<string>\",\n \"elements\": [\n {\n \"type\": \"<string>\",\n \"value\": \"<string>\",\n \"userObject\": {\n \"email\": \"<string>\",\n \"nameGiven\": \"<string>\",\n \"nameFamily\": \"<string>\",\n \"contactType\": \"<string>\",\n \"title\": \"<string>\",\n \"department\": \"<string>\",\n \"facilityId\": 123,\n \"isSharedContact\": true,\n \"readOnlyAccess\": true,\n \"invitedByEmail\": \"<string>\",\n \"invitedAt\": \"2023-11-07T05:31:56Z\",\n \"epaCertificationType\": \"<string>\",\n \"epaCertificationNumber\": \"<string>\",\n \"createdAt\": \"2023-11-07T05:31:56Z\",\n \"updatedAt\": \"2023-11-07T05:31:56Z\"\n }\n }\n ],\n \"noteReadDetails\": [\n {\n \"readAt\": \"2023-11-07T05:31:56Z\",\n \"readBy\": \"<string>\",\n \"readByContact\": {\n \"email\": \"<string>\",\n \"nameGiven\": \"<string>\",\n \"nameFamily\": \"<string>\",\n \"contactType\": \"<string>\",\n \"title\": \"<string>\",\n \"department\": \"<string>\",\n \"facilityId\": 123,\n \"isSharedContact\": true,\n \"readOnlyAccess\": true,\n \"invitedByEmail\": \"<string>\",\n \"invitedAt\": \"2023-11-07T05:31:56Z\",\n \"epaCertificationType\": \"<string>\",\n \"epaCertificationNumber\": \"<string>\",\n \"createdAt\": \"2023-11-07T05:31:56Z\",\n \"updatedAt\": \"2023-11-07T05:31:56Z\"\n }\n }\n ],\n \"noteAddedByContact\": {\n \"email\": \"<string>\",\n \"nameGiven\": \"<string>\",\n \"nameFamily\": \"<string>\",\n \"contactType\": \"<string>\",\n \"title\": \"<string>\",\n \"department\": \"<string>\",\n \"facilityId\": 123,\n \"isSharedContact\": true,\n \"readOnlyAccess\": true,\n \"invitedByEmail\": \"<string>\",\n \"invitedAt\": \"2023-11-07T05:31:56Z\",\n \"epaCertificationType\": \"<string>\",\n \"epaCertificationNumber\": \"<string>\",\n \"createdAt\": \"2023-11-07T05:31:56Z\",\n \"updatedAt\": \"2023-11-07T05:31:56Z\"\n },\n \"noteType\": \"<string>\",\n \"noteAddedByType\": \"<string>\",\n \"caption\": \"<string>\",\n \"isNoteAwaitingResponse\": true\n }\n ],\n \"invoiceTaxRate\": \"<string>\",\n \"invoiceTax\": \"<string>\",\n \"invoiceTotalBeforeTax\": \"<string>\",\n \"invoiceTotalAfterTax\": \"<string>\",\n \"laborTaxRate\": \"<string>\",\n \"laborTax\": \"<string>\",\n \"laborTotalBeforeTax\": \"<string>\",\n \"laborLineItems\": [\n {\n \"numberOfTech\": 123,\n \"seconds\": 123,\n \"description\": \"<string>\",\n \"roleType\": \"<string>\",\n \"laborType\": \"<string>\",\n \"hourlyRate\": \"<string>\",\n \"amount\": \"<string>\"\n }\n ],\n \"materialTaxRate\": \"<string>\",\n \"materialTax\": \"<string>\",\n \"materialTotalBeforeTax\": \"<string>\",\n \"materialLineItems\": [\n {\n \"unitType\": \"<string>\",\n \"quantity\": \"<string>\",\n \"description\": \"<string>\",\n \"partNumber\": \"<string>\",\n \"partId\": 123,\n \"equipmentNumber\": \"<string>\",\n \"equipmentId\": 123,\n \"unitPrice\": \"<string>\",\n \"amount\": \"<string>\"\n }\n ],\n \"travelTaxRate\": \"<string>\",\n \"travelTax\": \"<string>\",\n \"travelTotalBeforeTax\": \"<string>\",\n \"travelLineItems\": [\n {\n \"description\": \"<string>\",\n \"amount\": \"<string>\"\n }\n ],\n \"freightTaxRate\": \"<string>\",\n \"freightTax\": \"<string>\",\n \"freightTotalBeforeTax\": \"<string>\",\n \"freightLineItems\": [\n {\n \"description\": \"<string>\",\n \"amount\": \"<string>\"\n }\n ],\n \"miscTaxRate\": \"<string>\",\n \"miscTax\": \"<string>\",\n \"miscTotalBeforeTax\": \"<string>\",\n \"miscLineItems\": [\n {\n \"description\": \"<string>\",\n \"amount\": \"<string>\"\n }\n ],\n \"taxLineItems\": [\n {\n \"taxType\": \"<string>\",\n \"amount\": \"<string>\"\n }\n ],\n \"disputeNotes\": [\n {\n \"text\": \"<string>\",\n \"noteAddedBy\": \"<string>\",\n \"noteAddedAt\": \"2023-11-07T05:31:56Z\",\n \"id\": 123,\n \"photo\": \"<string>\",\n \"video\": \"<string>\",\n \"audio\": \"<string>\",\n \"otherFile\": \"<string>\",\n \"elements\": [\n {\n \"type\": \"<string>\",\n \"value\": \"<string>\",\n \"userObject\": {\n \"email\": \"<string>\",\n \"nameGiven\": \"<string>\",\n \"nameFamily\": \"<string>\",\n \"contactType\": \"<string>\",\n \"title\": \"<string>\",\n \"department\": \"<string>\",\n \"facilityId\": 123,\n \"isSharedContact\": true,\n \"readOnlyAccess\": true,\n \"invitedByEmail\": \"<string>\",\n \"invitedAt\": \"2023-11-07T05:31:56Z\",\n \"epaCertificationType\": \"<string>\",\n \"epaCertificationNumber\": \"<string>\",\n \"createdAt\": \"2023-11-07T05:31:56Z\",\n \"updatedAt\": \"2023-11-07T05:31:56Z\"\n }\n }\n ],\n \"noteReadDetails\": [\n {\n \"readAt\": \"2023-11-07T05:31:56Z\",\n \"readBy\": \"<string>\",\n \"readByContact\": {\n \"email\": \"<string>\",\n \"nameGiven\": \"<string>\",\n \"nameFamily\": \"<string>\",\n \"contactType\": \"<string>\",\n \"title\": \"<string>\",\n \"department\": \"<string>\",\n \"facilityId\": 123,\n \"isSharedContact\": true,\n \"readOnlyAccess\": true,\n \"invitedByEmail\": \"<string>\",\n \"invitedAt\": \"2023-11-07T05:31:56Z\",\n \"epaCertificationType\": \"<string>\",\n \"epaCertificationNumber\": \"<string>\",\n \"createdAt\": \"2023-11-07T05:31:56Z\",\n \"updatedAt\": \"2023-11-07T05:31:56Z\"\n }\n }\n ],\n \"noteAddedByContact\": {\n \"email\": \"<string>\",\n \"nameGiven\": \"<string>\",\n \"nameFamily\": \"<string>\",\n \"contactType\": \"<string>\",\n \"title\": \"<string>\",\n \"department\": \"<string>\",\n \"facilityId\": 123,\n \"isSharedContact\": true,\n \"readOnlyAccess\": true,\n \"invitedByEmail\": \"<string>\",\n \"invitedAt\": \"2023-11-07T05:31:56Z\",\n \"epaCertificationType\": \"<string>\",\n \"epaCertificationNumber\": \"<string>\",\n \"createdAt\": \"2023-11-07T05:31:56Z\",\n \"updatedAt\": \"2023-11-07T05:31:56Z\"\n },\n \"noteType\": \"<string>\",\n \"noteAddedByType\": \"<string>\",\n \"caption\": \"<string>\",\n \"isNoteAwaitingResponse\": true\n }\n ],\n \"attachments\": [\n {\n \"fileName\": \"<string>\",\n \"fileId\": \"<string>\"\n }\n ],\n \"invoicePDFLink\": \"<string>\",\n \"invoicePDFWatermarkedLink\": \"<string>\",\n \"owGeneratedPDF\": true,\n \"serviceCallIds\": [\n 123\n ],\n \"autoPublishOnApproval\": true,\n \"createdBy\": \"<string>\",\n \"createdAt\": \"2023-11-07T05:31:56Z\",\n \"publishedBy\": \"<string>\",\n \"publishedAt\": \"2023-11-07T05:31:56Z\",\n \"isAiParsed\": true,\n \"isAiParsedEdited\": true,\n \"aiParseMismatchSignedByEmail\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"type": "<string>",
"data": {
"id": 123,
"status": "<string>",
"scope": "<string>",
"externalWorkOrderId": "<string>",
"paymentTerms": "<string>",
"poNumber": "<string>",
"glCode": "<string>",
"dueDate": "2023-11-07T05:31:56Z",
"publishedAt": "2023-11-07T05:31:56Z",
"approvedAt": "2023-11-07T05:31:56Z",
"processedAt": "2023-11-07T05:31:56Z",
"markedPaidAt": "2023-11-07T05:31:56Z",
"dateOfInvoice": "2023-11-07T05:31:56Z",
"invoiceNumber": "<string>",
"invoiceNotes": [
{
"text": "<string>",
"noteAddedBy": "<string>",
"noteAddedAt": "2023-11-07T05:31:56Z",
"id": 123,
"photo": "<string>",
"video": "<string>",
"audio": "<string>",
"otherFile": "<string>",
"elements": [
{
"type": "<string>",
"value": "<string>",
"userObject": {
"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"
}
}
],
"noteReadDetails": [
{
"readAt": "2023-11-07T05:31:56Z",
"readBy": "<string>",
"readByContact": {
"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"
}
}
],
"noteAddedByContact": {
"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"
},
"noteType": "<string>",
"noteAddedByType": "<string>",
"caption": "<string>",
"isNoteAwaitingResponse": true
}
],
"invoiceTaxRate": "<string>",
"invoiceTax": "<string>",
"invoiceTotalBeforeTax": "<string>",
"invoiceTotalAfterTax": "<string>",
"laborTotalBeforeTax": "<string>",
"materialTotalBeforeTax": "<string>",
"travelTotalBeforeTax": "<string>",
"freightTotalBeforeTax": "<string>",
"miscTotalBeforeTax": "<string>",
"taxLineItems": [
{
"taxType": "<string>",
"amount": "<string>"
}
],
"attachments": [
{
"fileName": "<string>",
"fileId": "<string>"
}
],
"invoicePDFs": [
{
"orderingId": 123,
"link": "<string>"
}
],
"workOrderId": 123,
"serviceCallIds": [
123
],
"problemTypeId": 123,
"supplierFacilityId": 123,
"buyerSupplierRelationship": {},
"locationId": 123,
"buyerFacilityId": 123,
"buyerCompanyId": 123,
"isBuyerUploaded": true,
"createdBy": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"isDeleted": true,
"deletedAt": "2023-11-07T05:31:56Z",
"laborLineItems": [
{
"numberOfTech": 123,
"seconds": 123,
"description": "<string>",
"roleType": "<string>",
"laborType": "<string>",
"hourlyRate": "<string>",
"amount": "<string>"
}
],
"materialLineItems": [
{
"unitType": "<string>",
"quantity": "<string>",
"description": "<string>",
"partNumber": "<string>",
"partId": 123,
"equipmentNumber": "<string>",
"equipmentId": 123,
"unitPrice": "<string>",
"amount": "<string>"
}
],
"travelLineItems": [
{
"description": "<string>",
"amount": "<string>"
}
],
"freightLineItems": [
{
"description": "<string>",
"amount": "<string>"
}
],
"miscLineItems": [
{
"description": "<string>",
"amount": "<string>"
}
]
},
"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>"
}Authorizations
OpenWrench shared secret. Required on every request alongside X-API-KEY; issued together with your API key.
Body
Invoice create payload (verified against the shared invoice constructor). status is always forced to "draft", supplierFacilityId to the API key's facility and isBuyerUploaded to false; caller values for them are ignored. Monetary values are strings validated as parseable numbers. Unknown fields are ignored.
REQUIRED. Work order the invoice bills; must exist. locationId, buyerFacilityId, buyerCompanyId, spendCategoryId and problemTypeId are derived from it.
Existing invoice id (update semantics)
InvoiceFieldTypeDetails objects
InvoiceFieldTypeDetails objects
CustomFieldValue objects
CustomFieldValue objects
Defaults to the work order's poNumber
ISO 8601 date-time
ISO 8601 date-time
ISO 8601 date-time
Show child attributes
Show child attributes
Must parse as a number if present (all monetary strings below likewise)
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Defaults to "0"
Show child attributes
Show child attributes
Each amount must parse as a number
Show child attributes
Show child attributes
Validated against the invoice currency's allowed tax types (currently only CAD: GST/HST/PST); rejected otherwise
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Must be a valid URL; becomes the single invoicePDFs entry
Must be a valid URL; becomes the single invoicePDFsWatermarked entry
Default false
Defaults to all service calls associated with the work order when omitted/empty
Default false
ISO 8601 date-time
ISO 8601 date-time
Client-asserted AI-parse provenance; default false
Default false
Response
Successful response
Entity type label, e.g. "Invoice". 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.
Invoice in its external-API projection (InvoiceExternalAPI = full Invoice fields with buyerSupplierRelationship replaced by an external projection). Abridged - the full model carries approval-hierarchy, dispute and hydrated relation fields. For third-party suppliers responses are masked.
Show child attributes
Show child attributes
"ok" on success
ok