Happy Business Starts Here

0 Kudos

Include "CreatedDate" and "UpdatedDate" Fields in REST GET Call that Queries Objects

We are using GET Transaction Invoice (GET /v1/transactions/invoices/accounts/{account-key}) and want to compare that to unbilled Orders, to calculate unbilled amount for multiple Orders on one Subscription (since GET Order Billing Info only supports unbilled amount for a single order).

The InvoiceDate that is returned from GET /v1/transactions/invoices/accounts/{account-key} is not dateTime, so we cannot easily compare it to the Order date, which is dateTime, to see if the Invoice or Order was created first. 

To work around, we are going to use Action Query (POST /v1/action/query) or CRUD Get Invoice (GET /v1/object/invoice/{id}) to get the CreatedDate of Invoice if the invoiceDate and orderDate are the same day, since CreatedDate is a dateTime that we can compare to the orderDate.

We request that CreatedDate and UpdatedDate be returned for any GET API call that is a query for an object, but especially GET /v1/transactions/invoices/accounts/{account-key} so that these secondary calls are not needed.