---
title: "Request to provide the next list of commands to be executed on a device"
method: POST
path: "/getCardCommands"
---

# Request to provide the next list of commands to be executed on a device

`POST /getCardCommands`

This method is used by TSH to request the pending commands to be executed on a device.</br> It is used for reading/updating the content of a device (e.g. topup).</br> The TES has to return the list of commands that needs to be executed on the device after checking the previous commands responses.</br>

## Headers

- `x-actor-id` string, required

## Request body

- GetCardCommandsReq
  - `requestHeader` RequestHeader, required
    - `requestId` string, required — Unique request identifier
    - `sessionId` string, required — Unique session identifier used to trace the calls across systems during a use case.
    - `generationDateTime` string, date-time — Date time representing when the request or response has been generated.<br/>RFC3339 format.<br/> Examples:<li>"2018-12-24T17:32:28Z"<li>"2019-10-02T10:00:00-05:00"
  - `issuerId` string, required
  - `cardId` string, required — Unique identifier of the card.
  - `purchaseId` string — The Purchase Identifier. Unique for each purchase.<br/> It is provided when the call is related to topup initiated from wallet.
  - `deviceId` string, required — The Device Identifier. Unique for each device.
  - `operation` 'READ_BALANCE' | 'UPDATE_BALANCE' | 'UPDATE_CONFIG' | 'UPDATE_PLAN' | 'ERASE_CARD' | 'PARK_CARD' | 'BLOCK_AND_READ_CARD' — The operation for which the commands are requested
  - `responses` object[] — List of the responses executed on the device.
    - `id` string — ID of the command that has been executed.</br> Extracted from the original message.
    - `name` string — Descriptive name of the command that has been executed.</br> Extracted from the original message and appended with "_RESP"
    - `value` string — Hex encoded string command response
  - `responseTimeMs` number, double — Total time of all executed commands listed in responses array in milliseconds.
  - `statusCode` number — Status code to the request |Status code | Description| |-------|-------| |0|OK| |111|Missing mandatory parameter| |112|Bad parameter format| |113|Unknown issuer| |117|Unknown device| |118|Unknown session| |119|Unknown virtual card| |159|Card is blacklisted| |160|Card is deleted| |162|Card has unsufficient balance| |163|Card product not eligible| |167|Card is already provisioned| |172|Invalid card, unsupported system code| |173|Invalid card, unsupported service| |177|Invalid card, invalid area data| |178|Invalid card, card status is in-station| |191|Card is expired| |192|Reader mode attempt exceeded allowed threshold| |221|Device or wallet server not accessible| |231|Device unexpected error| |232|Device out of memory error| |321|Operation already on-going for this device| |322|Time to live of the operation expired| |323|Operation incomplete| |911|Operation failed| |921|Unexpected server error|
  - `statusMessage` string — Textual status message

## Response `200`

getCardCommands response payload

- GetCardCommandsRes
  - `responseHeader` ResponseHeader, required
    - `responseId` string, required — Unique response identifier
    - `sessionId` string, required — Unique session identifier used to trace the calls across systems during a use case.
    - `generationDateTime` string, date-time — Date time representing when the request or response has been generated.<br/>RFC3339 format.<br/> Examples:<li>"2018-12-24T17:32:28Z"<li>"2019-10-02T10:00:00-05:00"
    - `statusCode` number, required — Status code to the request |Status code | Description| |-------|-------| |0|OK| |111|Missing mandatory parameter| |112|Bad parameter format| |113|Unknown issuer| |118|Unknown session| |119|Unknown virtual card| |432|Operation is not allowed with current card state| |911|Operation failed| |921|Unexpected server error|
    - `statusMessage` string — Textual status message
  - `commands` object[] — List of commands to be executed on the device.
    - `id` string — ID of the command
    - `name` string — Descriptive name of the command
    - `value` string — Hex encoded string command value

## Other responses

- `500` — Internal Server Error

---

[API](https://skmtc.net/thalescloud/apis/d1-oauth-api.md) · [All operations](https://skmtc.net/thalescloud/apis/d1-oauth-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/thalescloud/d1-oauth-api/revisions/96089514858c/schema)
