About Related Object Names
This returns the name about objects referenced in a given response (i.e., vendorId reference on a Bill). This is only supported for /Crud/Read/ and /List/ operations for transaction objects and ListApprovers. Not required for Read and List requests.
On the Request, add an additional parameter: "related"
. Set the value as an array of strings (object types included in the Response). The example request asks for Vendor and ChartOfAccount object related to the "id".
"Related" example
Request
data={
"id" : "00n01WJGSBZHHNT181js",
"related" : [ "Vendor", "ChartOfAccount" ]
}
Response
The response includes details of requested objects. Each field that references a requested object is listed in "related" block, and mapped to the name.
"related" : {
"vendorId" : {
"name" : "Comcast - Everett Phone"
},
"payFromChartOfAccountId" : {
"accountNumber" : null,
"name" : null
}
}
When part of a Read request, response includes related names for returned objects. For example: on a Bill Read request, included are related names for references, not just on the Bill and BillLineItem.
When part of a List request, response only includes related names of the returned primary object. For example: related call on a List Bills request are references are included. (BillLineItem does not provide related names.)
These object types are returned in the object's "related" array.
Object Type(s) | Valid Related Objects for Read | Valid Related Objects for List |
---|---|---|
Bill, Vendor Credit | Vendor, ChartOfAccount, BankAccount, Department, Location, Job, Customer, Item, Employee, ActgClass | Vendor, ChartOfAccount, BankAccount |
SentPay | Vendor, ChartOfAccount, BankAccount, Bill | Vendor, ChartOfAccount, BankAccount |
Invoice, CreditMemo | Customer, Job, Item, Department, ChartOfAccount, BankAccount, Location, ActgClass | Customer, Job, Item, Department, ChartOfAccount, BankAccount, Location, ActgClass |
ReceivedPay | Customer, ChartOfAccount, BankAccount, Invoice | Customer, ChartOfAccount, BankAccount |
MoneyMovement | BankAccount | BankAccount |
RecurringBill | Vendor, ChartOfAccount, Department, Location | Vendor |
RecurringInvoice | Customer, Department, Item, Location, ActgClass, Job, User | Customer, Department, Item, Location, ActgClass, Job, User |
ListApprovers.json | N/A | User |
Read example
Request
<API_URL_EndPoint>/Crud/Read/Bill.json
data={
"id" : "00n01ATZMXYPQALAlwec",
"related" : [ "Vendor", "ChartOfAccount", "Department" ]
}
Response
{
"response_status" : 0,
"response_message" : "Success",
"response_data" : {
"entity" : "Bill",
"id" : "00n01ATZMXYPQALAlwec",
"isActive" : "1",
"vendorId" : "00901WWUFDFRQIAJnhg6",
"invoiceNumber" : "22",
"approvalStatus" : "0",
"invoiceDate" : "2013-08-14",
"dueDate" : "2013-08-29",
"glPostingDate" : null,
"amount" : 801.48,
"scheduledAmount" : 0.00,
"paidAmount" : null,
"paymentStatus" : "1",
"description" : null,
"createdTime" : "2013-08-26T16:42:39.000+0000",
"updatedTime" : "2013-08-26T16:42:46.000+0000",
"payFromBankAccountId" : "00000000000000000000",
"payFromChartOfAccountId" : "00000000000000000000",
"related" : {
"vendorId" : {
"name" : "Comcast - Everett Phone"
},
"payFromChartOfAccountId" : {
"accountNumber" : null,
"name" : null
}
},
"billLineItems" : [ {
"entity" : "BillLineItem",
"id" : "bli01FCYDZLLTEJCnn3a",
"billId" : "00n01ATZMXYPQALAlwec",
"amount" : 801.48,
"chartOfAccountId" : "0ca01NKGCHXCFHIQa7l5",
"departmentId" : "0de01ZABSRQHAPYM6vrg",
"locationId" : "00000000000000000000",
"jobId" : "00000000000000000000",
"customerId" : "00000000000000000000",
"jobBillable" : false,
"description" : "QATest bill line item 0",
"createdTime" : "2013-08-26T16:42:39.000+0000",
"updatedTime" : "2013-08-26T16:42:39.000+0000",
"lineType" : "1",
"itemId" : "00000000000000000000",
"quantity" : null,
"unitPrice" : null,
"employeeId" : "00000000000000000000",
"actgClassId" : "00000000000000000000",
"related" : {
"chartOfAccountId" : {
"accountNumber" : null,
"name" : "QATest Account 0"
},
"departmentId" : {
"name" : "QATest Department 0"
}
}
} ]
}
}