Happy Business Starts Here

Different representation of Usage entity when querying by account vs when querying by Id

Highlighted

Different representation of Usage entity when querying by account vs when querying by Id

When I get Usages by Account, I get the following response:

 

{
"id": "2c92c0f86ab55102016aba103aca180c",
"accountId": "2c92c0fb6ab55ba3016ab9e59d5d6e00",
"accountNumber": "AU-A-00062636",
"accountName": "TestActiveBondi",
"subscriptionNumber": null,
"chargeNumber": null,
"unitOfMeasure": "UOM-Travel-InternetUsage",
"quantity": 100,
"submissionDateTime": "2019-05-14 22:58:19",
"startDateTime": "2019-05-03 00:00:00",
"status": "Pending",
"sourceName": "API",
"Currency__c": null,
"ZZ_OriginalChargeName__c": "Internet Data - 100GB",
"UnitPrice__c": null,
"Count__c": null,
"Location__c": null,
"LocalUOM__c": null,
"ZZ_TravellingFlag__c": "1",
"Total__c": null,
"ZZ_SiteName__c": "Auckland towers",
"ZZ_MyFloorTransactionId__c": "cc8f879c-d9a2-45d6-a353-0969e572049f",
"ZZ_SiteCode__c": "AKL01"
}

 

If I query the same Usage by Id, I get the following response:

 

{
"AccountNumber": "AU-A-00062636",
"ZZ_SiteCode__c": "AKL01",
"Id": "2c92c0f86ab55102016aba103aca180c",
"SubmissionDateTime": "2019-05-14T22:58:19.000-07:00",
"ZZ_SiteName__c": "Auckland towers",
"UOM": "UOM-Travel-InternetUsage",
"AccountId": "2c92c0fb6ab55ba3016ab9e59d5d6e00",
"Quantity": 100,
"Description": "New Description",
"ZZ_MyFloorTransactionId__c": "cc8f879c-d9a2-45d6-a353-0969e572049f",
"CreatedById": "2c92c0f869e31ebf0169fbb3fabb0b93",
"CreatedDate": "2019-05-14T22:56:26.000-07:00",
"EndDateTime": "2019-05-03T00:00:00.000-07:00",
"ZZ_TravellingFlag__c": "1",
"RbeStatus": "Pending",
"UpdatedById": "2c92c0f869e31ebf0169fbb3fabb0b93",
"StartDateTime": "2019-05-03T00:00:00.000-07:00",
"ZZ_OriginalChargeName__c": "Internet Data - 100GB",
"SourceType": "API",
"UpdatedDate": "2019-05-14T22:58:19.000-07:00"
}

 

The date-time representation in one is totally different from the date-times in other. Also, there is no EndDateTime when getting the Usages by Account vs Getting Usages by Id. The properties are also Pascal-Case in one and Camel-Case in another. Even though it is the same entity and entity type.

Tags (1)
1 REPLY 1
Support SME

Re: Different representation of Usage entity when querying by account vs when querying by Id

Hi @ankurlalit 

For rest call Get usage by account https://rest.zuora.com/v1/usage/accounts/{account-key}, the startDateTime and submissionDateTime are in "2013-03-27 15:48:53" format. Reference: https://www.zuora.com/developer/api-reference/#operation/GET_Usage 

 

For rest call Get usage by usage id https://rest.zuora.com/v1/object/usage/{id}, the UpdatedDate, SubmissionDateTime, CreatedDate, StartDateTime, and EndDateTime are in "2016-10-20T05:41:36.000+02:00" format. Reference:https://www.zuora.com/developer/api-reference/#operation/Object_GETUsage

 

The root cause of this the Actions and Objects rest call will be converted to soap call by our api proxy and caused the inconsistent behavior. Background information can be found in https://community.zuora.com/t5/Engineering-Blog/Moving-Fast-from-SOAP-to-REST/ba-p/16160

https://knowledgecenter.zuora.com/DC_Developers/BC_ZOQL#Date_and_dateTime_Values_in_Filter_Statement...

 

Please let us know if you have further concern. Thanks.