getCancellationPositions.php
SM JSON Cancellation Positions Service
Endpoint: getCancellationPositions.php
This service takes a ticket (type 1) and returns the original sale position as a cancellation and also a cancellation fee position.
Parameters:
user: SM user name for authenticationpassword: SM user password for authenticationticket: the ticket code which needs to be cancelledlangid: the language ID to which the webshop is currently set
Return Values of the JSON Structure:
success: true or falsestatus: numeric status, see table below for detailsdata: if success is true, returns a JSON structure containing the cancellation and cancellation fee positions
Status Codes:
- 0: Execution of the service succeeded
- 102: Cannot connect to database
- 103: Authentication failure
- 104: No valid arguments given
- 105: CancellationFees is empty
- 106: CancellationFees is not valid JSON
- 107: Cancellation fees item doesn't exist
- 108: Ticket doesn't exist or isn't of type 1
- 109: Ticket hasn't been sold in a transaction
- 110: Ticket $ticket is in the past
Examples:
Request: /getCancellationPositions.php?user=user&password=password&ticket=6122310356388&langid=1
Successful response
{
"success": true,
"status": 0,
"data":
{
"positions":
{
"orig_pos":
{
"positionid": null,
"branchnr": null,
"hostnr": null,
"billnr": null,
"pos": "1",
"quantity": "1",
"title": "Auto-3.5t MBU",
"option1": "2024-01-17 16:02:00",
"option2": "2024-04-17 16:02:00",
"posprice": -27,
"posdiscount": "0",
"posreduction": 0,
"posamount": -27,
"vatamount": -2.023127,
"itemnr": "35508",
"vatratenr": "2",
"barcode": "6122310356388",
"usernr": "0",
"status": "-1",
"accountbooked": -1,
"salesbooked": 0,
"stockbooked": -1,
"discountable": "-1",
"discountnr": "0",
"LastUpdate": "2024-01-18 08:33:53",
"IsDeleted": "0",
"SortOrder": "0",
"Option3": "{\"platenumber\":\"ZH861840\",\"countrycode\":\"CH\"}",
"BasicPrice": null,
"BasketGrossAmount": null,
"BasketGrossDiscountPercentage": null,
"BasketGrossDiscountedAmount": null,
"ItemPriceLevel": null,
"PromotionData": null
},
"cancellationfee_pos":
{
"positionid": null,
"branchnr": null,
"hostnr": null,
"billnr": null,
"pos": "",
"quantity": 1,
"title": "Stornierungsgebühr 6 Tage vor Reise",
"option1": "",
"option2": "",
"posprice": 24.3,
"posdiscount": 0,
"posreduction": 0,
"posamount": 24.3,
"vatamount": 1.8208140610545793,
"itemnr": "35666",
"vatratenr": "2",
"barcode": "",
"usernr": 0,
"status": -1,
"accountbooked": -1,
"salesbooked": 0,
"stockbooked": -1,
"discountable": 0,
"discountnr": 0,
"IsDeleted": 0,
"SortOrder": 0,
"Option3": "",
"BasicPrice": null,
"BasketGrossAmount": null,
"BasketGrossDiscountPercentage": null,
"BasketGrossDiscountedAmount": null,
"ItemPriceLevel": null,
"PromotionData": null
}
}
}
}