RailzwayDocs
API referenceFare API v1

Contracts

GET
/v1/customers/{parent}/contracts

Path Parameters

parent*string

Query Parameters

pageSize?integer
Formatint32
pageToken?string

Response Body

application/json

application/json

application/json

application/json

application/json

curl -X GET "https://example.com/v1/customers/string/contracts"
{  "contracts": [    {      "billingAnchorDay": "string",      "createTime": "2019-08-24T14:15:22Z",      "effectivePeriod": {        "endTime": "2019-08-24T14:15:22Z",        "startTime": "2019-08-24T14:15:22Z"      },      "name": "string",      "rateCard": "string",      "rateOverrides": [        {          "baseRateId": "string",          "dimensionValues": {            "property1": "string",            "property2": "string"          },          "effectivePeriod": {            "endTime": "2019-08-24T14:15:22Z",            "startTime": "2019-08-24T14:15:22Z"          },          "flat": {            "amount": {              "amount": {                "value": "string"              },              "currencyCode": "string"            }          },          "package": {            "packagePrice": {              "amount": {                "value": "string"              },              "currencyCode": "string"            },            "packageSize": {              "value": "string"            }          },          "product": "string",          "tiered": {            "tiers": [              {                "endQuantity": {                  "value": "string"                },                "flatAmount": {                  "amount": {                    "value": "string"                  },                  "currencyCode": "string"                },                "startQuantity": {                  "value": "string"                },                "unitPrice": {                  "amount": {                    "value": "string"                  },                  "currencyCode": "string"                }              }            ]          },          "unit": {            "unitPrice": {              "amount": {                "value": "string"              },              "currencyCode": "string"            },            "unitSize": {              "value": "string"            }          }        }      ],      "status": "CONTRACT_STATUS_UNSPECIFIED"    }  ],  "nextPageToken": "string"}
POST
/v1/customers/{parent}/contracts

Path Parameters

parent*string

Query Parameters

contractId*string
requestId?string

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Contract defines a customer's negotiated billing agreement.

Response Body

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/v1/customers/string/contracts?contractId=string" \  -H "Content-Type: application/json" \  -d '{    "billingAnchorDay": "string",    "effectivePeriod": {      "startTime": "2019-08-24T14:15:22Z"    },    "rateCard": "string"  }'
{  "billingAnchorDay": "string",  "createTime": "2019-08-24T14:15:22Z",  "effectivePeriod": {    "endTime": "2019-08-24T14:15:22Z",    "startTime": "2019-08-24T14:15:22Z"  },  "name": "string",  "rateCard": "string",  "rateOverrides": [    {      "baseRateId": "string",      "dimensionValues": {        "property1": "string",        "property2": "string"      },      "effectivePeriod": {        "endTime": "2019-08-24T14:15:22Z",        "startTime": "2019-08-24T14:15:22Z"      },      "flat": {        "amount": {          "amount": {            "value": "string"          },          "currencyCode": "string"        }      },      "package": {        "packagePrice": {          "amount": {            "value": "string"          },          "currencyCode": "string"        },        "packageSize": {          "value": "string"        }      },      "product": "string",      "tiered": {        "tiers": [          {            "endQuantity": {              "value": "string"            },            "flatAmount": {              "amount": {                "value": "string"              },              "currencyCode": "string"            },            "startQuantity": {              "value": "string"            },            "unitPrice": {              "amount": {                "value": "string"              },              "currencyCode": "string"            }          }        ]      },      "unit": {        "unitPrice": {          "amount": {            "value": "string"          },          "currencyCode": "string"        },        "unitSize": {          "value": "string"        }      }    }  ],  "status": "CONTRACT_STATUS_UNSPECIFIED"}
GET
/v1/customers/{name}/contracts/{name_1}

Path Parameters

name*string
name_1*string

Response Body

application/json

application/json

application/json

application/json

application/json

curl -X GET "https://example.com/v1/customers/string/contracts/string"
{  "billingAnchorDay": "string",  "createTime": "2019-08-24T14:15:22Z",  "effectivePeriod": {    "endTime": "2019-08-24T14:15:22Z",    "startTime": "2019-08-24T14:15:22Z"  },  "name": "string",  "rateCard": "string",  "rateOverrides": [    {      "baseRateId": "string",      "dimensionValues": {        "property1": "string",        "property2": "string"      },      "effectivePeriod": {        "endTime": "2019-08-24T14:15:22Z",        "startTime": "2019-08-24T14:15:22Z"      },      "flat": {        "amount": {          "amount": {            "value": "string"          },          "currencyCode": "string"        }      },      "package": {        "packagePrice": {          "amount": {            "value": "string"          },          "currencyCode": "string"        },        "packageSize": {          "value": "string"        }      },      "product": "string",      "tiered": {        "tiers": [          {            "endQuantity": {              "value": "string"            },            "flatAmount": {              "amount": {                "value": "string"              },              "currencyCode": "string"            },            "startQuantity": {              "value": "string"            },            "unitPrice": {              "amount": {                "value": "string"              },              "currencyCode": "string"            }          }        ]      },      "unit": {        "unitPrice": {          "amount": {            "value": "string"          },          "currencyCode": "string"        },        "unitSize": {          "value": "string"        }      }    }  ],  "status": "CONTRACT_STATUS_UNSPECIFIED"}
POST
/v1/customers/{name}/contracts/{name_1}:scheduleAmendment

Path Parameters

name*string
name_1*string

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/v1/customers/string/contracts/string:scheduleAmendment" \  -H "Content-Type: application/json" \  -d '{    "amendment": {      "effectiveTime": "2019-08-24T14:15:22Z",      "reason": "string"    }  }'
{  "contractEndTime": "2019-08-24T14:15:22Z",  "createTime": "2019-08-24T14:15:22Z",  "effectiveTime": "2019-08-24T14:15:22Z",  "name": "string",  "rateCard": "string",  "rateOverrides": [    {      "baseRateId": "string",      "dimensionValues": {        "property1": "string",        "property2": "string"      },      "effectivePeriod": {        "endTime": "2019-08-24T14:15:22Z",        "startTime": "2019-08-24T14:15:22Z"      },      "flat": {        "amount": {          "amount": {            "value": "string"          },          "currencyCode": "string"        }      },      "package": {        "packagePrice": {          "amount": {            "value": "string"          },          "currencyCode": "string"        },        "packageSize": {          "value": "string"        }      },      "product": "string",      "tiered": {        "tiers": [          {            "endQuantity": {              "value": "string"            },            "flatAmount": {              "amount": {                "value": "string"              },              "currencyCode": "string"            },            "startQuantity": {              "value": "string"            },            "unitPrice": {              "amount": {                "value": "string"              },              "currencyCode": "string"            }          }        ]      },      "unit": {        "unitPrice": {          "amount": {            "value": "string"          },          "currencyCode": "string"        },        "unitSize": {          "value": "string"        }      }    }  ],  "reason": "string",  "status": "AMENDMENT_STATUS_UNSPECIFIED"}
GET
/v1/customers/{name}/contracts/{name_1}/amendments/{name_2}

Path Parameters

name*string
name_1*string
name_2*string

Response Body

application/json

application/json

application/json

application/json

application/json

curl -X GET "https://example.com/v1/customers/string/contracts/string/amendments/string"
{  "contractEndTime": "2019-08-24T14:15:22Z",  "createTime": "2019-08-24T14:15:22Z",  "effectiveTime": "2019-08-24T14:15:22Z",  "name": "string",  "rateCard": "string",  "rateOverrides": [    {      "baseRateId": "string",      "dimensionValues": {        "property1": "string",        "property2": "string"      },      "effectivePeriod": {        "endTime": "2019-08-24T14:15:22Z",        "startTime": "2019-08-24T14:15:22Z"      },      "flat": {        "amount": {          "amount": {            "value": "string"          },          "currencyCode": "string"        }      },      "package": {        "packagePrice": {          "amount": {            "value": "string"          },          "currencyCode": "string"        },        "packageSize": {          "value": "string"        }      },      "product": "string",      "tiered": {        "tiers": [          {            "endQuantity": {              "value": "string"            },            "flatAmount": {              "amount": {                "value": "string"              },              "currencyCode": "string"            },            "startQuantity": {              "value": "string"            },            "unitPrice": {              "amount": {                "value": "string"              },              "currencyCode": "string"            }          }        ]      },      "unit": {        "unitPrice": {          "amount": {            "value": "string"          },          "currencyCode": "string"        },        "unitSize": {          "value": "string"        }      }    }  ],  "reason": "string",  "status": "AMENDMENT_STATUS_UNSPECIFIED"}
GET
/v1/customers/{parent}/contracts/{parent_1}/amendments

Path Parameters

parent*string
parent_1*string

Query Parameters

pageSize?integer
Formatint32
pageToken?string

Response Body

application/json

application/json

application/json

application/json

application/json

curl -X GET "https://example.com/v1/customers/string/contracts/string/amendments"
{  "amendments": [    {      "contractEndTime": "2019-08-24T14:15:22Z",      "createTime": "2019-08-24T14:15:22Z",      "effectiveTime": "2019-08-24T14:15:22Z",      "name": "string",      "rateCard": "string",      "rateOverrides": [        {          "baseRateId": "string",          "dimensionValues": {            "property1": "string",            "property2": "string"          },          "effectivePeriod": {            "endTime": "2019-08-24T14:15:22Z",            "startTime": "2019-08-24T14:15:22Z"          },          "flat": {            "amount": {              "amount": {                "value": "string"              },              "currencyCode": "string"            }          },          "package": {            "packagePrice": {              "amount": {                "value": "string"              },              "currencyCode": "string"            },            "packageSize": {              "value": "string"            }          },          "product": "string",          "tiered": {            "tiers": [              {                "endQuantity": {                  "value": "string"                },                "flatAmount": {                  "amount": {                    "value": "string"                  },                  "currencyCode": "string"                },                "startQuantity": {                  "value": "string"                },                "unitPrice": {                  "amount": {                    "value": "string"                  },                  "currencyCode": "string"                }              }            ]          },          "unit": {            "unitPrice": {              "amount": {                "value": "string"              },              "currencyCode": "string"            },            "unitSize": {              "value": "string"            }          }        }      ],      "reason": "string",      "status": "AMENDMENT_STATUS_UNSPECIFIED"    }  ],  "nextPageToken": "string"}
POST
/v1/customers/{name}/contracts/{name_1}/amendments/{name_2}:cancel

Path Parameters

name*string
name_1*string
name_2*string

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/v1/customers/string/contracts/string/amendments/string:cancel" \  -H "Content-Type: application/json" \  -d '{    "reason": "string"  }'
{  "contractEndTime": "2019-08-24T14:15:22Z",  "createTime": "2019-08-24T14:15:22Z",  "effectiveTime": "2019-08-24T14:15:22Z",  "name": "string",  "rateCard": "string",  "rateOverrides": [    {      "baseRateId": "string",      "dimensionValues": {        "property1": "string",        "property2": "string"      },      "effectivePeriod": {        "endTime": "2019-08-24T14:15:22Z",        "startTime": "2019-08-24T14:15:22Z"      },      "flat": {        "amount": {          "amount": {            "value": "string"          },          "currencyCode": "string"        }      },      "package": {        "packagePrice": {          "amount": {            "value": "string"          },          "currencyCode": "string"        },        "packageSize": {          "value": "string"        }      },      "product": "string",      "tiered": {        "tiers": [          {            "endQuantity": {              "value": "string"            },            "flatAmount": {              "amount": {                "value": "string"              },              "currencyCode": "string"            },            "startQuantity": {              "value": "string"            },            "unitPrice": {              "amount": {                "value": "string"              },              "currencyCode": "string"            }          }        ]      },      "unit": {        "unitPrice": {          "amount": {            "value": "string"          },          "currencyCode": "string"        },        "unitSize": {          "value": "string"        }      }    }  ],  "reason": "string",  "status": "AMENDMENT_STATUS_UNSPECIFIED"}
POST
/v1/customers/{name}/contracts/{name_1}:end

Path Parameters

name*string
name_1*string

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/v1/customers/string/contracts/string:end" \  -H "Content-Type: application/json" \  -d '{    "effectiveTime": "2019-08-24T14:15:22Z"  }'
{  "billingAnchorDay": "string",  "createTime": "2019-08-24T14:15:22Z",  "effectivePeriod": {    "endTime": "2019-08-24T14:15:22Z",    "startTime": "2019-08-24T14:15:22Z"  },  "name": "string",  "rateCard": "string",  "rateOverrides": [    {      "baseRateId": "string",      "dimensionValues": {        "property1": "string",        "property2": "string"      },      "effectivePeriod": {        "endTime": "2019-08-24T14:15:22Z",        "startTime": "2019-08-24T14:15:22Z"      },      "flat": {        "amount": {          "amount": {            "value": "string"          },          "currencyCode": "string"        }      },      "package": {        "packagePrice": {          "amount": {            "value": "string"          },          "currencyCode": "string"        },        "packageSize": {          "value": "string"        }      },      "product": "string",      "tiered": {        "tiers": [          {            "endQuantity": {              "value": "string"            },            "flatAmount": {              "amount": {                "value": "string"              },              "currencyCode": "string"            },            "startQuantity": {              "value": "string"            },            "unitPrice": {              "amount": {                "value": "string"              },              "currencyCode": "string"            }          }        ]      },      "unit": {        "unitPrice": {          "amount": {            "value": "string"          },          "currencyCode": "string"        },        "unitSize": {          "value": "string"        }      }    }  ],  "status": "CONTRACT_STATUS_UNSPECIFIED"}