RailzwayDocs
API referenceFare API v1

Subscriptions

GET
/v1/customers/{parent}/subscriptions

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/subscriptions"
{  "nextPageToken": "string",  "subscriptions": [    {      "contract": "string",      "createTime": "2019-08-24T14:15:22Z",      "effectivePeriod": {        "endTime": "2019-08-24T14:15:22Z",        "startTime": "2019-08-24T14:15:22Z"      },      "items": [        {          "dimensions": {            "property1": "string",            "property2": "string"          },          "product": "string",          "quantity": {            "value": "string"          }        }      ],      "name": "string",      "status": "SUBSCRIPTION_STATUS_UNSPECIFIED"    }  ]}
POST
/v1/customers/{parent}/subscriptions

Path Parameters

parent*string

Query Parameters

subscriptionId*string
requestId?string

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Subscription represents a customer's recurring product enrollment.

Response Body

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/v1/customers/string/subscriptions?subscriptionId=string" \  -H "Content-Type: application/json" \  -d '{    "contract": "string",    "effectivePeriod": {      "startTime": "2019-08-24T14:15:22Z"    },    "items": [      {        "product": "string",        "quantity": {          "value": "string"        }      }    ]  }'
{  "contract": "string",  "createTime": "2019-08-24T14:15:22Z",  "effectivePeriod": {    "endTime": "2019-08-24T14:15:22Z",    "startTime": "2019-08-24T14:15:22Z"  },  "items": [    {      "dimensions": {        "property1": "string",        "property2": "string"      },      "product": "string",      "quantity": {        "value": "string"      }    }  ],  "name": "string",  "status": "SUBSCRIPTION_STATUS_UNSPECIFIED"}
GET
/v1/customers/{name}/subscriptions/{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/subscriptions/string"
{  "contract": "string",  "createTime": "2019-08-24T14:15:22Z",  "effectivePeriod": {    "endTime": "2019-08-24T14:15:22Z",    "startTime": "2019-08-24T14:15:22Z"  },  "items": [    {      "dimensions": {        "property1": "string",        "property2": "string"      },      "product": "string",      "quantity": {        "value": "string"      }    }  ],  "name": "string",  "status": "SUBSCRIPTION_STATUS_UNSPECIFIED"}
POST
/v1/customers/{name}/subscriptions/{name_1}:cancel

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/subscriptions/string:cancel" \  -H "Content-Type: application/json" \  -d '{    "effectiveTime": "2019-08-24T14:15:22Z"  }'
{  "contract": "string",  "createTime": "2019-08-24T14:15:22Z",  "effectivePeriod": {    "endTime": "2019-08-24T14:15:22Z",    "startTime": "2019-08-24T14:15:22Z"  },  "items": [    {      "dimensions": {        "property1": "string",        "property2": "string"      },      "product": "string",      "quantity": {        "value": "string"      }    }  ],  "name": "string",  "status": "SUBSCRIPTION_STATUS_UNSPECIFIED"}
POST
/v1/customers/{name}/subscriptions/{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/subscriptions/string:scheduleAmendment" \  -H "Content-Type: application/json" \  -d '{    "amendment": {      "effectiveTime": "2019-08-24T14:15:22Z",      "items": [        {          "product": "string",          "quantity": {            "value": "string"          }        }      ],      "prorationBehavior": "PRORATION_BEHAVIOR_UNSPECIFIED",      "reason": "string"    }  }'
{  "createTime": "2019-08-24T14:15:22Z",  "effectiveTime": "2019-08-24T14:15:22Z",  "items": [    {      "dimensions": {        "property1": "string",        "property2": "string"      },      "product": "string",      "quantity": {        "value": "string"      }    }  ],  "name": "string",  "prorationBehavior": "PRORATION_BEHAVIOR_UNSPECIFIED",  "reason": "string",  "status": "AMENDMENT_STATUS_UNSPECIFIED"}
GET
/v1/customers/{name}/subscriptions/{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/subscriptions/string/amendments/string"
{  "createTime": "2019-08-24T14:15:22Z",  "effectiveTime": "2019-08-24T14:15:22Z",  "items": [    {      "dimensions": {        "property1": "string",        "property2": "string"      },      "product": "string",      "quantity": {        "value": "string"      }    }  ],  "name": "string",  "prorationBehavior": "PRORATION_BEHAVIOR_UNSPECIFIED",  "reason": "string",  "status": "AMENDMENT_STATUS_UNSPECIFIED"}
GET
/v1/customers/{parent}/subscriptions/{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/subscriptions/string/amendments"
{  "amendments": [    {      "createTime": "2019-08-24T14:15:22Z",      "effectiveTime": "2019-08-24T14:15:22Z",      "items": [        {          "dimensions": {            "property1": "string",            "property2": "string"          },          "product": "string",          "quantity": {            "value": "string"          }        }      ],      "name": "string",      "prorationBehavior": "PRORATION_BEHAVIOR_UNSPECIFIED",      "reason": "string",      "status": "AMENDMENT_STATUS_UNSPECIFIED"    }  ],  "nextPageToken": "string"}
POST
/v1/customers/{name}/subscriptions/{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/subscriptions/string/amendments/string:cancel" \  -H "Content-Type: application/json" \  -d '{    "reason": "string"  }'
{  "createTime": "2019-08-24T14:15:22Z",  "effectiveTime": "2019-08-24T14:15:22Z",  "items": [    {      "dimensions": {        "property1": "string",        "property2": "string"      },      "product": "string",      "quantity": {        "value": "string"      }    }  ],  "name": "string",  "prorationBehavior": "PRORATION_BEHAVIOR_UNSPECIFIED",  "reason": "string",  "status": "AMENDMENT_STATUS_UNSPECIFIED"}