Switch fare in search results

It will recalculate by switching the fare of the route.

GET /v1/{format}/course/recalculate

parameters

Name Type Description
format string Specify response data format. Required.
Possible Values:
- xml: xml data format
- json: json data format
key string access key. Mandatory
serializeData string serialized route data. Mandatory
checkEngineVersion string When performing complete reproduction of serialized route data, activate the identical check of the engine version of the serialized data at the point of creation and of reproduction. If the engine version differs, it will return an error. Optional.
Possible values:
- true: Check
- false: Do not check
Default: true
fareIndex string Designate rate of utilized shipping. multiple specifications possible. Omit only when designating other ~Index. Default is no designation
chargeIndex string Usage charge designation. multiple specifications possible. Omit only when designating other ~Index. Default is no designation
vehicleIndex string Designation of fixed term railroad cars. multiple specifications possible. Omit only when designating other ~Index. Default is no designation
nikukanteikiIndex string Designation for two-zone commuter pass. multiple specifications possible. Omit only when designating other ~Index. Default is no designation.
When you want to get two-zone commuter pass charge, you need to specify the serialized route data which can be obtaind by route search with specifying the search condition to "use second section fixed term". You can specify the search condition by search condition generator.
addRouteData bool Designate whether Route information shows in results. Omission possible.
Cost which can be designated:
- true: include
- false: don't include
Default: false
resultDetail string Attach detailed information to the results. Designation is possible only if addRouteData=true. Omission is possible. Omission will lead to the general result.
Cost which can be designated:
- addCorporation:to the route corporation attach

About specifying the state

For fare charge, specify the index value of the option you want to useResultSet / Course / Price. For the commuter pass, specify the index value of the option you want to useResultSet / Course / PassStatus. There is a price factor that differ by vehicle in the same section only for the one-month period, but we do not use that index. Multiple indexes can be specified, but if you specify more than one amount in the same section, only one of the specified indexes will be selected.

 <Price selected="false" toLineIndex="1" kind="Charge" index="1" fromLineIndex="1">
   <Name>指定席</Name>
   <Type>Reserved</Type>
 </Price>
 <Price selected="true" toLineIndex="1" kind="Charge" index="2" fromLineIndex="1">
   <Name>自由席</Name>
   <Type>Free</Type>
 </Price>
 <Price selected="false" toLineIndex="1" kind="Charge" index="3" fromLineIndex="1">
   <Name>グリーン</Name>
   <Type>Green</Type>
 </Price>

In case of changing the above fare from an unreserved seat to Green

GET /v1/xml/course/recalculate?key=your_access_key_here&chargeIndex=3&serializeData=...

Even when specifying as done below, either the reserved seat or Green will switch around. (Amount of money for the same section cannot be selected at the same time.)

GET /v1/xml/course/recalculate?key=your_access_key_here&chargeIndex=1:3&serializeData=...

response

route search same as

example

GET /v1/xml/course/recalculate?key=your_access_key_here&chargeIndex=1&serializeData=SHlUczAxLjAwLjA0rAQBAAAAJFEzAQIAAQAAAAEAAgAAAAgAAf9_Av_3AwAAAAAAAAABACxZAAB6ZQAAAAAAAAoAgQAAAFjQAAEABiRRMwG2AwAATwQAAAIAAQABAAEAAQABAAAAAAABAAEAAgAAAA**--T3221233232319:F3321122120:A23121141:--e4a50ff03c9fbdde4ca29552efa8e824c937453d
<?xml version="1.0" encoding="UTF-8"?>
<ResultSet apiVersion="1.14.0.0" engineVersion="201404_01a">
  <Course dataType="onTimetable">
    <Price kind="FareSummary">
      <Oneway>8510</Oneway>
      <Round>17020</Round>
    </Price>
    <Price kind="Fare" index="1" fromLineIndex="1" toLineIndex="1" fareRevisionStatus="none" selected="true">
      <Oneway>8510</Oneway>
      <Round>17020</Round>
      <Type>Fare</Type>
    </Price>
    <Price kind="ChargeSummary">
      <Oneway>5740</Oneway>
      <Round>11480</Round>
    </Price>
    <Price kind="Charge" index="1" fromLineIndex="1" toLineIndex="1" fareRevisionStatus="none" selected="true">
      <Oneway>5740</Oneway>
      <Round>11480</Round>
      <Name>指定席</Name>
      <Type>Reserved</Type>
      <Rate area="Main">High</Rate>
    </Price>
    <Price kind="Charge" index="2" fromLineIndex="1" toLineIndex="1" fareRevisionStatus="none" selected="false">
      <Oneway>4730</Oneway>
      <Round>9460</Round>
      <Name>自由席</Name>
      <Type>Free</Type>
    </Price>
    <Price>
    :
    </Price>
  </Course>
</ResultSet>
GET /v1/json/course/recalculate?key=your_access_key_here&chargeIndex=1&serializeData=SHlUczAxLjAwLjA0rAQBAAAAJFEzAQIAAQAAAAEAAgAAAAgAAf9_Av_3AwAAAAAAAAABACxZAAB6ZQAAAAAAAAoAgQAAAFjQAAEABiRRMwG2AwAATwQAAAIAAQABAAEAAQABAAAAAAABAAEAAgAAAA**--T3221233232319:F3321122120:A23121141:--e4a50ff03c9fbdde4ca29552efa8e824c937453d
{
  "ResultSet": {
    "apiVersion": "1.14.0.0",
    "engineVersion": "201404_01a",
    "Course": {
      "dataType": "onTimetable",
      "Price": [
        {
          "kind": "FareSummary",
          "Oneway": "8510",
          "Round": "17020"
        },
        {
          "kind": "Fare",
          "index": "1",
          "fromLineIndex": "1",
          "toLineIndex": "1",
          "fareRevisionStatus": "none",
          "selected": "true",
          "Oneway": "8510",
          "Round": "17020",
          "Type": "Fare"
        },
        {
          "kind": "ChargeSummary",
          "Oneway": "5740",
          "Round": "11480"
        },
        {
          "kind": "Charge",
          "index": "1",
          "fromLineIndex": "1",
          "toLineIndex": "1",
          "fareRevisionStatus": "none",
          "selected": "true",
          "Oneway": "5740",
          "Round": "11480",
          "Name": "指定席",
          "Type": "Reserved",
          "Rate": {
            "text": "High",
            "area": "Main"
          }
        },
        {
          "kind": "Charge",
          "index": "2",
          "fromLineIndex": "1",
          "toLineIndex": "1",
          "fareRevisionStatus": "none",
          "selected": "false",
          "Oneway": "4730",
          "Round": "9460",
          "Name": "自由席",
          "Type": "Free"
        },
        {
          :
        }
      ]
    }
  }
}