web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Suggested Answer

Get retail transaction error message in OData

(0) ShareShare
ReportReport
Posted on by 38

I'm using OData requests to get informations of sales order in retail transactions (the sales orders are created using the Commerce/CSU API, then a job creates the retail transaction, then another job synchronize them in F&O headquarter).

When the synchronization fails, I can get the status in the RetailTransactionsAuditable entity (field is AsynchronousOrderStatus). But I don't know where I can find the error message displayed in the F&O user interface. Do you guys know which data entity it is?

Here's a example of a failed retail transaction (menu is "Retail and Commerce" > "Inquiries and reports" > "Online store transactions" :

pastedimage1678356403116v1.png

And here's the OData request to get the details:

GET /data/RetailTransactionsAuditable?cross-company=true&$filter=TransactionId eq 'CBtsToRKWv0LGyOm0y9veqM5yECr1snm'

{
"@odata.context": "">test.sandbox.operations.dynamics.com/.../$metadata
"value": [
{
"@odata.etag": "W/\"JzEsNTYzNzE0NTM0ODsyMDc1NjI2NTMsNTYzNzE1MjgyOSc=\"",
"dataAreaId": "hfxx",
"OperatingUnitNumber": "00000006",
"StoreNumber": "",
"RegisterNumber": "",
"TransactionId": "CBtsToRKWv0LGyOm0y9veqM5yECr1snm",
"TimeWhenTransactionClosed": 54523,
"IsTaxExemptedForPriceInclusive": "Yes",
"OperatingUnitRecId": 5637148336,
"OperatorID": "",
"DiscountAmount": 0,
"ModeOfDelivery": "FED-Nation",
"NetPrice": -59.18,
"LastValidationTime": "1900-01-01T00:00:00Z",
"TotalManualDiscountPercentage": 0,
"CustomerAccount": "CS929000",
"BusinessDate": "2023-02-28T12:00:00Z",
"TransactionOrderType": "SaflesOrder",
"AsynchronousOrderStatus": "Failed",
"ChannelReferenceId": "0CAB8D5MORGA",
"TransactionDate": "2023-02-28T12:00:00Z",
"RequestedReceiptDate": "2023-02-28T12:00:00Z",
"PaymentAmount": 0,
"SalesOrder": "",
"NumberOfPaymentLines": 1,
"Comment": "",
"Warehouse": "PON",
"GiftCardActiveFrom": "1900-01-01T00:00:00Z",
"TransactionType": "PendingSalesOrder",
"RequestedShipDate": "2023-02-28T12:00:00Z",
"EntryStatus": "None",
"CreatedAtRegister": "",
"GiftCardBalance": 0,
"IsTaxIncludedInPrice": "No",
"FiscalDocumentId": "",
"InvoiceComment": "",
"TaxCalculationType": "Regular",
"DiscountAmountExcludingTax": 0,
"GiftCardIdMasked": "",
"ValidationStatus": "None",
"LoyaltyCardNumber": "",
"FiscalSerialId": "",
"TransCode": "None",
"Site": "",
"GiftCardExpireDate": "1900-01-01T12:00:00Z",
"NetAmount": -69.78,
"NumberOfProducts": 2,
"Description": "",
"SkipAggregation": "No",
"CustomerAccountAsync": "",
"SalesPaymentDifference": 69.78,
"SuspendedTransactionId": "",
"Invoice": "",
"ExchangeRate": 100,
"SalesInvoiceAmount": 0,
"TotalDiscountAmount": 0,
"NumberOfProductLines": 2,
"SalesGroup": "",
"CustomerDiscount": 0,
"SaleOnAccount": "No",
"ShiftRegisterID": "",
"IncomeExpenseAmount": 0,
"StatementNumber": "",
"Channel": 5637144581,
"GrossAmount": -69.78,
"ReceiptEmail": "test@test.com",
"TransactionTime": 54522,
"CreatedOffline": "No",
"StatementCode": "",
"GiftCardIssueAmount": 0,
"ShiftID": 0,
"Currency": "EUR",
"SaleIsReturnSale": "No",
"ReceiptNumber": "",
"FinancialDimensionDisplayValue": "",
"GiftCardHistoryDetails": "",
"TotalManualDiscountAmount": 0
}
]
}

We can see the status in the response: "AsynchronousOrderStatus": "Failed". But I can't find the error message.

I have the same question (0)
  • huijij Profile Picture
    19,811 on at

    Hi sir,

    I think the methods mentioned in the old thread that you can refer to.

    community.dynamics.com/.../the-odata-api-is-not-returning-any-error-code-for-errors-to-handle-based-on-error-codes

  • JuniorD Profile Picture
    38 on at

    Hi,

    Thanks for the response, but this definitely not answer my question. I would like to know is: "how to get a retail transaction synchronization error message (like shown in the screenshot) using an OData API request"

  • huijij Profile Picture
    19,811 on at

    All fields of the current OData 'RetailTransactionsAuditable' are already displayed, but only the error status is provided without detailed error information. If you want to see detailed error information in the OData, you can customize a new one according to your requirements.

  • JuniorD Profile Picture
    38 on at

    "you can customize a new one according to your requirements."

    So I need to create a new data entity based on "RetailTransactionsAuditable", add a field, fill it using X++ code and use this entity in OData? Just to get the error details?

    That seems over-complicated. Why Microsoft does not provide this out of the box?

    Anyway, thanks for the response but I will probably don't do it, it's not worth the shot.

  • Suggested answer
    huijij Profile Picture
    19,811 on at

    I'm afraid it is not available for now. But you can create a new idea through the below URL, then ask your colleagues to raise up the votes.  

    experience.dynamics.com/.../

    Our product team has direct visibility of these ideas and they will implement it on the basis of the highest number of votes received.

    Best Regards,

  • JuniorD Profile Picture
    38 on at

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Martin Dráb Profile Picture

Martin Dráb 551 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 450 Super User 2025 Season 2

#3
BillurSamdancioglu Profile Picture

BillurSamdancioglu 278 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans