on 08-18-2023 11:42 PM
Hello all,
We are trying to schedule a receipt cancellation for "temporary"/"preliminary" receipts, so that they do not accumulate on CCOM in large quantities for long periods.
However, we can't figure out the correct request. Here's our last try and the resulting error message ("missing organizational unit id"):
We have tried several additional properties, such as posGroupId and others, but can't figure out what we're missing. Can anyone help? sebastian.magin maybe?
Thanks and best regards,
Joerg.
Hi Joerg,
I would suggest you to use a combination of the following two requests:
The GET request will give you the full receipt from the manager.
The PUT request allows you to update a receipt.
You need another request to find the list of parked receipts. The following endpoint is unofficial so be careful when you use it.
GET internal/receipt/parked?posSystemId=<prefix>
This endpoint returns a list of parked receipts. It requires the prefix of a posSystem as a query-parameter.
When you combine the above mentioned request you can achieve your task. First of all use the parked receipt endpoint to fetch the list of parked receipts and identify the receipts that you want to cancel. Then you use the IDs those receipts to fetch the full receipt from the manager. Finally, you adapt the receipt and update it using a PUT request.
Best regards,
Sebastian
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello sebastian.magin
I have prepared the process as you indicated. However, when I execute the PUT request, I am getting the response:
{ "errorCode" : "8", "errorMessage" : "Entity already exists" }
cancel_receipt() {
response=`curl $verbose -G "$baseurl/api/internal/sync/receipts/$1" -H "X-Csrf-Token: $token" -b $cookiejar -s`
echo "{\"receipt\": $response }" | jq '.receipt.status = "6"' > $tmp
response=`curl $verbose -X PUT "$baseurl/api/internal/sync/receipts/$1" -H "X-Csrf-Token: $token" -H "Content-Type: application/json" -d @$tmp -b $cookiejar -s`
echo $response
}
This is the function I am executing, basically just wrapping the receipt object and changing the status to 6...
Please let me know what could be wrong here...
Thanks!
Joerg.
User | Count |
---|---|
2 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.