Refund selection data before/after v2.46
AnsweredHello,
As I'm reviewing further changes to the Orders API from refunds after version 2.46, I have a few questions/requests regarding the data changes in the Selections object. Please let me know if someone can help with these, thanks!
- Can you provide a JSON example of a refunded item(selection) which has a modifier on it?
- Can I presume that if an item is refunded, the modifier will always be treated as refunded? Or alternatively will a modifier have its own ‘refundDetails’ object when refunded?
- Can you provide a JSON example of a refunded item which has an applied service charge on it? I was able to find it referenced in documentation that this is possible, but I did not find any examples in documentation.
- When an item is "deferred", like the sale of a gift card, we pull this data and may choose to treat it differently than a standard item depending on client requests. Is it possible to refund a deferred item, just like it would be with a standard item? If there is any difference in the JSON, can you offer example JSON?
- When an item is refunded, in the “refundTransaction” data object, we’ve only see an “entityType” value of “RefundTransaction”. Are there any other possible values that could populate here?
-
Hi Sean,
I've provided a JSON example of a refunded item selection with a modifier and one without. You'll also be able to see a fixed delivery charge of one dollar that's been refunded.
A deferred item can be refunded and this doesn't change the refund details in the order JSON, the "deferred" value would remain the same.
We will only populate "RefundTransaction" as the entityType.
If there's anything else I can clarify, please let me know and here's the sample JSON below:
"selections": [
{
"guid": "",
"entityType": "MenuItemSelection",
"externalId": null,
"deferred": false,
"preDiscountPrice": 13.7,
"voidReason": null,
"optionGroup": null,
"displayName": "Classic Cheese",
"appliedDiscounts": [],
"modifiers": [],
"seatNumber": -1,
"voidDate": null,
"fulfillmentStatus": "SENT",
"optionGroupPricingMode": null,
"salesCategory": null,
"selectionType": "NONE",
"price": 13.7,
"voided": false,
"appliedTaxes": [
{
"guid": "",
"entityType": "AppliedTaxRate",
"taxRate": {
"guid": "",
"entityType": "TaxRate"
},
"rate": 0.0625,
"name": "STATE TAX",
"taxAmount": 0.86,
"type": "PERCENT",
"facilitatorCollectAndRemitTax": false
},
{
"guid": "",
"entityType": "AppliedTaxRate",
"taxRate": {
"guid": "",
"entityType": "TaxRate"
},
"rate": 0.0075,
"name": "CITY TAX",
"taxAmount": 0.1,
"type": "PERCENT",
"facilitatorCollectAndRemitTax": false
}
],
"itemGroup": {
"guid": "",
"entityType": "MenuGroup",
"externalId": null
},
"item": {
"guid": "",
"entityType": "MenuItem",
"externalId": null
},
"taxInclusion": "NOT_INCLUDED",
"quantity": 1.0,
"receiptLinePrice": 13.7,
"unitOfMeasure": "NONE",
"refundDetails": {
"refundAmount": 13.7,
"taxRefundAmount": 0.96,
"refundTransaction": {
"guid": "",
"entityType": "RefundTransaction"
}
},
"tax": 0.96,
"diningOption": null,
"voidBusinessDate": null,
"createdDate": "2021-05-20T00:11:50.036+0000",
"preModifier": null,
"modifiedDate": "2021-05-20T18:28:53.526+0000"
},
{
"guid": "",
"entityType": "MenuItemSelection",
"externalId": null,
"deferred": false,
"preDiscountPrice": 5.85,
"voidReason": null,
"optionGroup": null,
"displayName": "Roast Beef",
"appliedDiscounts": [],
"modifiers": [
{
"guid": "",
"entityType": "MenuItemSelection",
"externalId": null,
"deferred": false,
"preDiscountPrice": 0.0,
"voidReason": null,
"optionGroup": {
"guid": "",
"entityType": "MenuOptionGroup",
"externalId": null
},
"displayName": "Wheat",
"appliedDiscounts": [],
"modifiers": [],
"seatNumber": -1,
"voidDate": null,
"fulfillmentStatus": "SENT",
"optionGroupPricingMode": "ADJUSTS_PRICE",
"salesCategory": null,
"selectionType": "NONE",
"price": 0.0,
"voided": false,
"appliedTaxes": [],
"itemGroup": null,
"item": {
"guid": "",
"entityType": "MenuItem",
"externalId": null
},
"taxInclusion": "INHERITED",
"quantity": 1.0,
"receiptLinePrice": 0.0,
"unitOfMeasure": "NONE",
"refundDetails": {
"refundAmount": 0.0,
"taxRefundAmount": 0.0,
"refundTransaction": {
"guid": "",
"entityType": "RefundTransaction"
}
},
"tax": 0.0,
"diningOption": null,
"voidBusinessDate": null,
"createdDate": "2021-05-20T00:11:50.041+0000",
"preModifier": null,
"modifiedDate": "2021-05-20T18:28:53.527+0000"
}
],
"seatNumber": -1,
"voidDate": null,
"fulfillmentStatus": "SENT",
"optionGroupPricingMode": null,
"salesCategory": null,
"selectionType": "NONE",
"price": 5.85,
"voided": false,
"appliedTaxes": [
{
"guid": "",
"entityType": "AppliedTaxRate",
"taxRate": {
"guid": "",
"entityType": "TaxRate"
},
"rate": 0.0625,
"name": "STATE TAX",
"taxAmount": 0.36,
"type": "PERCENT",
"facilitatorCollectAndRemitTax": false
},
{
"guid": "",
"entityType": "AppliedTaxRate",
"taxRate": {
"guid": "",
"entityType": "TaxRate"
},
"rate": 0.0075,
"name": "CITY TAX",
"taxAmount": 0.04,
"type": "PERCENT",
"facilitatorCollectAndRemitTax": false
}
],
"itemGroup": {
"guid": "",
"entityType": "MenuGroup",
"externalId": null
},
"item": {
"guid": "",
"entityType": "MenuItem",
"externalId": null
},
"taxInclusion": "INCLUDED",
"quantity": 1.0,
"receiptLinePrice": 6.25,
"unitOfMeasure": "NONE",
"refundDetails": {
"refundAmount": 5.85,
"taxRefundAmount": 0.4,
"refundTransaction": {
"guid": "",
"entityType": "RefundTransaction"
}
},
"tax": 0.4,
"diningOption": null,
"voidBusinessDate": null,
"createdDate": "2021-05-20T00:11:50.066+0000",
"preModifier": null,
"modifiedDate": "2021-05-20T18:28:53.526+0000"
}
],
"voidBusinessDate": null,
"createdDate": "2021-05-20T00:11:50.078+0000",
"deleted": false,
"createdDevice": {
"id": ""
},
"closedDate": "2021-05-21T08:13:15.396+0000",
"deletedDate": "1970-01-01T00:00:00.000+0000",
"modifiedDate": "2021-05-21T08:13:15.396+0000",
"taxAmount": 1.36,
"appliedServiceCharges": [
{
"guid": "",
"entityType": "AppliedServiceCharge",
"externalId": null,
"delivery": false,
"serviceCharge": {
"guid": "",
"entityType": "ServiceCharge",
"externalId": null
},
"taxable": false,
"serviceChargeCalculation": null,
"refundDetails": {
"refundAmount": 1.0,
"taxRefundAmount": 0.0,
"refundTransaction": {
"guid": "",
"entityType": "RefundTransaction"
}
},
"chargeType": "FIXED",
"name": "Delivery",
"gratuity": true,
"chargeAmount": 1.0,
"takeout": false,
"appliedTaxes": []
}
],
"customer": null
}
],
"deleted": false,
"createdDevice": {
"id": ""
},
"createdDate": "2021-05-20T00:11:50.157+0000",
"closedDate": "2021-05-21T08:13:15.396+0000",
"deletedDate": "1970-01-01T00:00:00.000+0000",
"modifiedDate": "2021-05-21T08:13:15.396+0000",
"promisedDate": null,
"pricingFeatures": [
"TAXESV2"
]
}0 -
Hi Will,
Thank you for the response, but I'm not seeing a JSON example with a modifier. Is it possible it didn't attach or paste fully?
Thanks,
Sean0 -
Hi Sean,
That's precisely what happened and it shrunk my post, sorry for the troubles while I get used to Zendesk :). I've amended my code snippet and included more of the response but please let me know if there's anything else I can clarify!
- Will
0 -
Hi @...,
It has been a while since I've commented on this thread, but I do have another question that goes along with this, so I'm hoping you may be able to help? I'm curious if a user can refund just a modifier, and if so, will we see the refundDetails object just within the modifiers object and not the the selections object?
I'll give a real-world example: Someone orders a Coffee as their selection which costs $2.00. They have 2 modifiers on the coffee, $1 for an added espresso shot, and $1 for an added flavor shot. The employee making the coffee forgets the flavor shot, so they refund the flavor shot modifier and give the customer back $1.00.
If this scenario is possible in the POS, I expect we will see a refundDetails object within the modifier object based on past JSON examples, but will we also see a refundDetails object within the selections object, even though the selection itself(the Coffee) is not refunded? If this can occur, is it possible to mock up a JSON example to show how this would appear within the orders response?
Thanks!
0 -
Hi Sean Hutchinson, I can absolutely do that for you. I'll run some test and get back to you on this thread with an example to reference. Great idea and I'll update this thread soon!
0 -
Hi Sean Hutchinson, to confirm here refunds can't be applied to a specific modifier and when applied to an item, this would apply to all modifiers related to the item entity. Therefore the example provided above is still the best reference for the refund object but please let me know if there's anything else I can clarify here for you.
0 -
Hi @..., that answers my question, thank you!
0 -
Hi @Will Reynolds, I wanted to enquire about the deletedDate, which is set to 1970. My response also has a "deletedDate" of 1970. However, that date is 53 years ago. Is this a glitch?
0 -
Hello Amiteshwar Mann, great question! The date 1970-01-01T00:00:00.000+0000 is actually the UNIX epoch, so this is expected. The time stamps that you see for the various dates in our orders API response are the date and time expressed in milliseconds from the UNIX epoch, January 1, 1970 00:00:00 UTC. So if the entity you're looking at, like deletedDate, has this 1970 date it means no event has taken place in Toast to change the date, like order deletion in this example. Basically indicating this order has not be deleted. I hope this helps!
0
Please sign in to leave a comment.
Comments
9 comments