RailzwayDocs
API referenceFare API v1

Catalog and rates

GET
/v1/products

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/products"
{  "nextPageToken": "string",  "products": [    {      "createTime": "2019-08-24T14:15:22Z",      "displayName": "string",      "meter": "string",      "name": "string",      "presentationGroupKeys": [        "string"      ],      "pricingGroupKeys": [        "string"      ],      "tags": [        "string"      ],      "type": "PRODUCT_TYPE_UNSPECIFIED"    }  ]}
POST
/v1/products

Query Parameters

productId*string
requestId?string

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Product is a sellable SKU and the basic unit of an invoice line.

Response Body

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/v1/products?productId=string" \  -H "Content-Type: application/json" \  -d '{    "displayName": "string",    "type": "PRODUCT_TYPE_UNSPECIFIED"  }'
{  "createTime": "2019-08-24T14:15:22Z",  "displayName": "string",  "meter": "string",  "name": "string",  "presentationGroupKeys": [    "string"  ],  "pricingGroupKeys": [    "string"  ],  "tags": [    "string"  ],  "type": "PRODUCT_TYPE_UNSPECIFIED"}
GET
/v1/products/{name}

Path Parameters

name*string

Response Body

application/json

application/json

application/json

application/json

application/json

curl -X GET "https://example.com/v1/products/string"
{  "createTime": "2019-08-24T14:15:22Z",  "displayName": "string",  "meter": "string",  "name": "string",  "presentationGroupKeys": [    "string"  ],  "pricingGroupKeys": [    "string"  ],  "tags": [    "string"  ],  "type": "PRODUCT_TYPE_UNSPECIFIED"}
GET
/v1/rateCards

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/rateCards"
{  "nextPageToken": "string",  "rateCards": [    {      "createTime": "2019-08-24T14:15:22Z",      "currencyCode": "string",      "displayName": "string",      "name": "string",      "rates": [        {          "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"            }          },          "id": "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"            }          }        }      ]    }  ]}
POST
/v1/rateCards

Query Parameters

rateCardId*string
requestId?string

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

RateCard is a currency-specific collection of product rates.

Response Body

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/v1/rateCards?rateCardId=string" \  -H "Content-Type: application/json" \  -d '{    "currencyCode": "string",    "displayName": "string"  }'
{  "createTime": "2019-08-24T14:15:22Z",  "currencyCode": "string",  "displayName": "string",  "name": "string",  "rates": [    {      "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"        }      },      "id": "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"        }      }    }  ]}
GET
/v1/rateCards/{name}

Path Parameters

name*string

Response Body

application/json

application/json

application/json

application/json

application/json

curl -X GET "https://example.com/v1/rateCards/string"
{  "createTime": "2019-08-24T14:15:22Z",  "currencyCode": "string",  "displayName": "string",  "name": "string",  "rates": [    {      "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"        }      },      "id": "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"        }      }    }  ]}
POST
/v1/rateCards/{parent}/rates

Path Parameters

parent*string

Query Parameters

requestId?string

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Rate assigns one pricing model to a product for a non-overlapping period.

Rate assigns one pricing model to a product for a non-overlapping period.

Response Body

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/v1/rateCards/string/rates" \  -H "Content-Type: application/json" \  -d '{    "effectivePeriod": {      "startTime": "2019-08-24T14:15:22Z"    },    "product": "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"    }  },  "id": "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"    }  }}