Switch fare in search results


 Attention!

This page has not been fully translated into English yet. It is possible that some parts of description may contains old information. Please see Japanese Documents if you need the latest and accurate information.

It will recalculate by switching the fare of the route.

GET /v1/{format}/course/recalculate

parameters

Name Type Description
format string Specifying the response data format. Required.
Possible values:
- xml: xml format data
- json: json format data.
key string Your access key. Required.
serializeData string serialized route data. Required
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 or teikiKind. Default is no designation
chargeIndex string Usage charge designation. multiple specifications possible. Omit only when designating other ~Index or teikiKind. Default is no designation
vehicleIndex string Designation of fixed term railroad cars. multiple specifications possible. Omit only when designating other ~Index or teikiKind. Default is no designation
passClassIndex string 定期券の種類を含む、各事業者が定めた定期券の指定。複数指定可。他の~IndexまたはteikiKindを指定した場合のみ省略可。省略時は指定なし。nikukanteikiIndexと排他。
定期券の種類を利用した金額を得たい場合は、 探索条件に「二区間定期券を利用する」を設定した経路探索経路シリアライズデータを指定する必要があります。探索条件の設定は探索条件生成で行うことができます。
nikukanteikiIndex string passClassIndexと同様。ただし、定期券の種類のみ指定できます。
※二区間定期券への運賃切り替えにおいて、nikukanteikiIndexは非推奨としています。これから開発を始める方は、passClassIndexをご利用ください。
teikiKind string Switch value of commuter pass type. Omit only when designating ~Index. Default is no designation.
Available Value:
- bussiness: Commute
- university: Student Discount (University)
- highSchool: Student Discount (High School)
- juniorHighSchool: Student Discount (Junior High School)
addRouteData bool Designate whether Route information shows in results. Omission possible.
Cost which can be designated:
- true: include
- false: don't include
Default: false
addChange string 結果にRouteの情報を含む場合、Routeの情報に次の路線への乗り換えに便利な乗車位置情報を付加します。addRouteDataにtrueを指定した場合、かつダイヤによる探索時のみ有効。省略可。
指定できる値:
- true: 付加します
- false: 付加しません
Default: false
addStop string Add list of stop stations to the sections in the Line elements. Only effective when you perform route search by operation diagram. Optional.
Possible values:
- true: add stop stations to the response.
- false: do not add stop stations to the response.
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"
        },
        {
          :
        }
      ]
    }
  }
}
ページ上部へ