Sts Ticketing API

General information

Some of the endpoints needs user to be logged in using their email, use swagger to determine which of the endpoint requires email in the header. If you get following error, this means you need to send an email in the header:

                    
                            {
                                "logId": 10,
                                "message": "An error has occured : , email missing in header"
                            }
                        
                    

Please use login button shown in the header just above the help button, it will display a popup where you can enter email, please ignore password field. the email should be sent in the header as a "Base" after converting it to base64.

                    
                            1) var user = Convert.ToBase64String(Encoding.UTF8.GetBytes(YourEmail));
                            2) var authHeader = new AuthenticationHeaderValue("Base", user);
                        
                    

Now use this header to do call to endpoints, which requires the email.

Sample test account

Sample account for testing Sts ticketing API.

                    
                            {
                                email    : apptest341+1@gmail.com, apptest341+5@gmail.com                                
                            }
                        
                    

Sample error object

                    
                            {
                                "logId": 10,
                                "message": "An error has occured : , email missing in header"
                            }
                        
                    

Sample success object

For instance, GetPayMethods returns following, whereas some of the end point also return empty content.

                    
                            [
                                "AmericanExpress",
                                "Master",
                                "Visa",
                                "Sepa"
                            ]
                        
                    

Signup

                        
                            {
                            "phoneNumber": "123456789",
                            "birthDate": "2019-10-07T09:21:51.396Z",
                            "firstName": "TestFirstName",
                            "lastName": "TestLastName",
                            "gender": "Male",
                            "dataProtectionRulesAcceptanceDate": "2019-10-07T09:21:51.397Z",
                            "dataProtectionRulesAccepted": true,
                            "generalTermsAndConditionsAcceptanceDate": "2019-10-07T09:21:51.397Z",
                            "generalTermsAndConditionsAccepted": true,
                            "email": "YourEmail@gmail.com",
                            "password": "123456789"
                            }
                        
                    

ChangeUserData

                    
                            {
                                "userPassword": "kEnn!w123",
                                "phoneNumber": "123456",
                                "birthDate": "2000-10-18T08:54:58.383Z",
                                "firstName": "Fname11",
                                "lastName": "Lname11"
                            }
                        
                    

CreateAddress

                    
                            {
                                "addressType": "AddressInvoice",
                                "salutation": "Sir",
                                "firstname": "FName",
                                "lastname": "LName",
                                "isCompanyAddress": false,
                                "houseNumber": "122",
                                "houseNumberAddition": "",
                                "street": "Neustr 65",
                                "zip": "12345",
                                "city": "Neustadt",
                                "countryCode": "49"
                            }
                        
                    

EditAddressSample

                    
                            {
                                "Id": "F23F3608E02F3DBCC76479555A396DCDE57E4B",
                                "addressType": "AddressInvoice",
                                "salutation": "Sir",
                                "firstname": "FName1",
                                "lastname": "LName1",
                                "isCompanyAddress": false,
                                "houseNumber": "122",
                                "houseNumberAddition": "",
                                "street": "Neustr 65",
                                "zip": "12345",
                                "city": "Neustadt",
                                "countryCode": "49"
                            }
                        
                    

CreateSepaPayMethod

                    
                            {
                                "Gender": 1,
                                "FirstName": "UnitTest",
                                "LastName": "Sepa Ger",
                                "Iban": "AT022050302101023600",
                                "Bic": null,
                                "EMail": "apptest341+swms@gmail.com",
                                "BirthDate": "1990-11-10T00:00:00",
                                "HouseNumber": "3",
                                "City": "Erfurt",
                                "Street": "Test Strasse",
                                "PostalCode": "99999",
                                "MandateAuthorized": true,
                                "Type": 5,
                            }
                        
                    

CreateCreditCardPayMethodSample

                    
                        {
                            "CVC": "222",
                            "Holder": "UnitTest Visa",
                            "CreditCardNumber": "4111111111111111",
                            "ExpirationDate": "2022-10-01T00:00:00",
                            "EMail": "apptest341+5@gmail.com",
                            "FirstName": "Dummy",
                            "LastName": "BVG",
                            "Street": "Holzmarktstraße",
                            "Housenumber": "15-17",
                            "PostCode": "10179",
                            "Place": "Berlin",
                            "Birth": "1960-01-01T00:00:00",
                            "Country": "de",
                            "Type": 0,
                        }
                    
                    

DeactivatePayMethodSample (Sepa)

                    
                        {
                            "id": "E33A2B17E0323ABCC76479555A396DCAE47548",
                            "info": "AT02************3600",
                            "holder": "UnitTest Sepa Ger",
                            "validTo": "2099-12-31T00:00:00",
                            "type": "Sepa"
                        }
                    
                    

DeactivatePayMethodSample (Credit Card)

                    
                        {
                            "id": "E33A2B17E0323ABCC76479555A396DCAE4744F",
                            "info": "VIS / ************1111 / 202210",
                            "holder": "UnitTest Visa",
                            "validTo": "2022-10-31T00:00:00",
                            "type": "Visa"
                        }
                    
                    

FindTariffPoints

With search term:

                    
                        {
                            "search": "Alexanderplatz"
                        }
                    
                    

With search term and contraint:

                    
                        {
                            "search": "Halensee",
                            "tariffPointConstraint": {
                                                        "Type": 0,
                                                        "ModesOfTransport": [
                                                                             8
                                                                            ],
                                                        "Location": {
                                                                    "Longitude": 13.290151,
                                                                    "Latitude": 52.496698,
                                                                    "Radius": 10.0
                                                                    }
                                                     }
                        }
                    
                    

With Location:

                    
                        {
                            "location" :{
                            "longitude": 13.290151,
                            "latitude": 52.496698,
                            "radius": 10.0
                            }
                        }
                    
                    

With Location and Constriant:

                    
                        {
                            "location": {
                                         "longitude": 13.375794,
                                         "latitude": 52.533474,
                                         "radius": 750
                                        },
                             "tariffPointConstraint": {
                                                       "id": "9001203",
                                                        "type": 0
                                                      }
                        }
                    
                    

FindProducts

Use FindTariffPoints(startStationName) to get start station then again FindTariffPoint(destianationStationName) to get destintation name and create a tarriff relation as shown following to find products:

                        
                            {
                            "tripDate":"2020-06-18T12:13:30.810Z",
                            "relation":{
                            "Start":{
                            "Id":"10011"
                            },
                            "Destination":{
                            "Id":"10023"
                            },
                            "Vias":null
                            }
                            }

                        
                    

Order Shopping Cart

                        
                            {
                            "shoppingCart": {
                            "items": [
                            {
                            "product": {
                            "productId": "1FD4FCE9C9579E40957174B6C767CB5B2F3D1DBB453633E56D",
                            "productClassId": "15",
                            "groupNameResourceId": "LBL_G_1",
                            "productNameResourceId": "LBL_PG_HESSENTICKET",
                            "productDetailResourceId": "LBL_PG_INFO_HESSENTICKET",
                            "productHintResourceId": "LBL_TI_15_50",
                            "name": "Hessenticket bis 5 Personen",
                            "price": 36,
                            "currency": "EUR",
                            "tarifId": "RMV",
                            "tarifInfo": "09.06.2019",
                            "validityRules": {
                            "permittedPurchaseTimeFrame": [],
                            "maxPurchaseDate": "2019-11-25T10:59:47.9371785",
                            "selectionUnit": "Day",
                            "mustStartAtTheBeginningOf": "None"
                            },
                            "maxEntitlementCount": 1,
                            "buyingWithoutEntitlementActivationPossible": false,
                            "doNotCreateTicketOnPurchase": false,
                            "requestedCredentials": "NameOnly",
                            "referenceData": {
                            "type": "SuitableAccountData",
                            "birthDate": "0001-01-01T00:00:00",
                            "gender": "NotProvided",
                            "idmEdiaType": "None"
                            },
                            "relation": {
                            "vias": []
                            },
                            "productParameterSets": [
                            {
                            "productParameters": {
                            "travellerParameter": {
                            "count": 5,
                            "lessAllowed": true,
                            "travellers": [{
                            "firstName": "FName1",
                            "lastName": "LName1"
                            },
                            {
                            "firstName": "FName2",
                            "lastName": "LName3"
                            }],
                            "type": "TravellerName"
                            },
                            "tripDateParameter": {
                            "timeValidityUnit": "Day",
                            "purchaseInAdvanceAllowed": true,
                            "purchaseInAdvanceRestrictions": [],
                            "purchaseInAdvanceTimeWindow": 604800,
                            "selectedDate": "0001-01-01T00:00:00",
                            "tripDateNowSelected": true,
                            "type": "TripDate"
                            }
                            }
                            }
                            ],
                            "requiredParameters": [
                            "TripDate",
                            "TravellerName"
                            ]
                            }
                            }
                            ]
                            },
                            "payMethod": {
                            "id": "0CDAEBF0DE5889178D465A9591378D4E56416F"
                            },
                            "billingAddressId": "1DDFF6EFDE458E178D465A95913688415F406A"
                            }
                        
                    

Create Customer

                        
                            {
                            "firstName": "New",
                            "lastName": "Wick",
                            "birthday": "1989-01-30T10:01:18.737Z",
                            "gender": "male",
                            "address":
                            {
                            "addressType": "AddressInvoice",
                            "invoiceEmail" : "YourInvoiceEmail@gmail.com",
                            "isCompanyAddress": false,
                            "companyName": "",
                            "attn": "",
                            "firstname": "John",
                            "lastname": "Wick",
                            "salutation": "Sir",
                            "street": "neustr",
                            "houseNumber": "1",
                            "houseNumberAddition": "1",
                            "zip": "45289",
                            "city": "Seustadt",
                            "countryCode": "49"
                            },
                            "email": "YourEmail@gmail.com",
                            "dataProtectionRulesAccepted": true,
                            "generalTermsAndConditionsAccepted": true
                            }