RailzwayDocs
API referenceFare API v1

Credits and commitments

GET
/v1/customers/{parent}/credits

Path Parameters

parent*string

Query Parameters

pageSize?integer
Formatint32
pageToken?string
filter?string

Response Body

application/json

application/json

application/json

application/json

application/json

curl -X GET "https://example.com/v1/customers/string/credits"
{  "credits": [    {      "amount": {        "amount": {          "value": "string"        },        "currencyCode": "string"      },      "applicableProducts": [        "string"      ],      "applicableTags": [        "string"      ],      "createTime": "2019-08-24T14:15:22Z",      "effectivePeriod": {        "endTime": "2019-08-24T14:15:22Z",        "startTime": "2019-08-24T14:15:22Z"      },      "name": "string",      "priority": 0,      "reason": "string",      "status": "GRANT_STATUS_UNSPECIFIED",      "voidTime": "2019-08-24T14:15:22Z"    }  ],  "nextPageToken": "string"}
POST
/v1/customers/{parent}/credits

Path Parameters

parent*string

Query Parameters

creditId*string
requestId?string

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

CreditGrant represents promotional or contractual value available to spend.

Response Body

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/v1/customers/string/credits?creditId=string" \  -H "Content-Type: application/json" \  -d '{    "amount": {      "amount": {        "value": "string"      },      "currencyCode": "string"    },    "effectivePeriod": {      "startTime": "2019-08-24T14:15:22Z"    },    "reason": "string"  }'
{  "amount": {    "amount": {      "value": "string"    },    "currencyCode": "string"  },  "applicableProducts": [    "string"  ],  "applicableTags": [    "string"  ],  "createTime": "2019-08-24T14:15:22Z",  "effectivePeriod": {    "endTime": "2019-08-24T14:15:22Z",    "startTime": "2019-08-24T14:15:22Z"  },  "name": "string",  "priority": 0,  "reason": "string",  "status": "GRANT_STATUS_UNSPECIFIED",  "voidTime": "2019-08-24T14:15:22Z"}
GET
/v1/customers/{name}/credits/{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/credits/string"
{  "amount": {    "amount": {      "value": "string"    },    "currencyCode": "string"  },  "applicableProducts": [    "string"  ],  "applicableTags": [    "string"  ],  "createTime": "2019-08-24T14:15:22Z",  "effectivePeriod": {    "endTime": "2019-08-24T14:15:22Z",    "startTime": "2019-08-24T14:15:22Z"  },  "name": "string",  "priority": 0,  "reason": "string",  "status": "GRANT_STATUS_UNSPECIFIED",  "voidTime": "2019-08-24T14:15:22Z"}
POST
/v1/customers/{name}/credits/{name_1}:void

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/credits/string:void" \  -H "Content-Type: application/json" \  -d '{    "reason": "string",    "requestId": "string"  }'
{  "amount": {    "amount": {      "value": "string"    },    "currencyCode": "string"  },  "applicableProducts": [    "string"  ],  "applicableTags": [    "string"  ],  "createTime": "2019-08-24T14:15:22Z",  "effectivePeriod": {    "endTime": "2019-08-24T14:15:22Z",    "startTime": "2019-08-24T14:15:22Z"  },  "name": "string",  "priority": 0,  "reason": "string",  "status": "GRANT_STATUS_UNSPECIFIED",  "voidTime": "2019-08-24T14:15:22Z"}
GET
/v1/customers/{parent}/commitments

Path Parameters

parent*string

Query Parameters

pageSize?integer
Formatint32
pageToken?string
filter?string

Response Body

application/json

application/json

application/json

application/json

application/json

curl -X GET "https://example.com/v1/customers/string/commitments"
{  "commitments": [    {      "applicableProducts": [        "string"      ],      "committedAmount": {        "amount": {          "value": "string"        },        "currencyCode": "string"      },      "contract": "string",      "costBasis": {        "amount": {          "value": "string"        },        "currencyCode": "string"      },      "createTime": "2019-08-24T14:15:22Z",      "effectivePeriod": {        "endTime": "2019-08-24T14:15:22Z",        "startTime": "2019-08-24T14:15:22Z"      },      "name": "string",      "status": "GRANT_STATUS_UNSPECIFIED",      "voidTime": "2019-08-24T14:15:22Z"    }  ],  "nextPageToken": "string"}
POST
/v1/customers/{parent}/commitments

Path Parameters

parent*string

Query Parameters

commitmentId*string
requestId?string

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Commitment represents minimum spend agreed for an effective period.

Response Body

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/v1/customers/string/commitments?commitmentId=string" \  -H "Content-Type: application/json" \  -d '{    "committedAmount": {      "amount": {        "value": "string"      },      "currencyCode": "string"    },    "contract": "string",    "costBasis": {      "amount": {        "value": "string"      },      "currencyCode": "string"    },    "effectivePeriod": {      "startTime": "2019-08-24T14:15:22Z"    }  }'
{  "applicableProducts": [    "string"  ],  "committedAmount": {    "amount": {      "value": "string"    },    "currencyCode": "string"  },  "contract": "string",  "costBasis": {    "amount": {      "value": "string"    },    "currencyCode": "string"  },  "createTime": "2019-08-24T14:15:22Z",  "effectivePeriod": {    "endTime": "2019-08-24T14:15:22Z",    "startTime": "2019-08-24T14:15:22Z"  },  "name": "string",  "status": "GRANT_STATUS_UNSPECIFIED",  "voidTime": "2019-08-24T14:15:22Z"}
GET
/v1/customers/{name}/commitments/{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/commitments/string"
{  "applicableProducts": [    "string"  ],  "committedAmount": {    "amount": {      "value": "string"    },    "currencyCode": "string"  },  "contract": "string",  "costBasis": {    "amount": {      "value": "string"    },    "currencyCode": "string"  },  "createTime": "2019-08-24T14:15:22Z",  "effectivePeriod": {    "endTime": "2019-08-24T14:15:22Z",    "startTime": "2019-08-24T14:15:22Z"  },  "name": "string",  "status": "GRANT_STATUS_UNSPECIFIED",  "voidTime": "2019-08-24T14:15:22Z"}
POST
/v1/customers/{name}/commitments/{name_1}:void

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/commitments/string:void" \  -H "Content-Type: application/json" \  -d '{    "reason": "string",    "requestId": "string"  }'
{  "applicableProducts": [    "string"  ],  "committedAmount": {    "amount": {      "value": "string"    },    "currencyCode": "string"  },  "contract": "string",  "costBasis": {    "amount": {      "value": "string"    },    "currencyCode": "string"  },  "createTime": "2019-08-24T14:15:22Z",  "effectivePeriod": {    "endTime": "2019-08-24T14:15:22Z",    "startTime": "2019-08-24T14:15:22Z"  },  "name": "string",  "status": "GRANT_STATUS_UNSPECIFIED",  "voidTime": "2019-08-24T14:15:22Z"}
GET
/v1/customers/{customer}/balance

Path Parameters

customer*string

Query Parameters

asOfTime?string
Formatdate-time

Response Body

application/json

application/json

application/json

application/json

application/json

curl -X GET "https://example.com/v1/customers/string/balance"
{  "asOfTime": "2019-08-24T14:15:22Z",  "commitmentRemaining": {    "amount": {      "value": "string"    },    "currencyCode": "string"  },  "creditRemaining": {    "amount": {      "value": "string"    },    "currencyCode": "string"  },  "customer": "string"}
GET
/v1/customers/{parent}/balanceTransactions

Path Parameters

parent*string

Query Parameters

pageSize?integer
Formatint32
pageToken?string
filter?string

Response Body

application/json

application/json

application/json

application/json

application/json

curl -X GET "https://example.com/v1/customers/string/balanceTransactions"
{  "nextPageToken": "string",  "transactions": [    {      "amount": {        "amount": {          "value": "string"        },        "currencyCode": "string"      },      "createTime": "2019-08-24T14:15:22Z",      "description": "string",      "name": "string",      "source": "string",      "type": "BALANCE_TRANSACTION_TYPE_UNSPECIFIED"    }  ]}