# Installment Transaction Service

Search API Reference

- [Getting Started](https://developer.visa.com/capabilities/installment-transaction-service/docs-getting-started)
- [Authentication Method](https://developer.visa.com/capabilities/installment-transaction-service/docs-authentication)
- [Release Notes](https://developer.visa.com/capabilities/installment-transaction-service/docs-release-notes)
- [Error Codes](https://developer.visa.com/pages/visa-developer-error-codes)
- [Product Terms](https://developer.visa.com/capabilities/installment-transaction-service/product-terms)
- [Request & Response Codes](https://developer.visa.com/request_response_codes)

# Device Management API

Register a Payment Terminal / IoT device for invoking Seller APIs

## Enroll Payment Terminal  v2 - Latest

This API is used by Merchant Participants who owns or maintains the Payment terminal to enroll the payment terminal. Enrollment of the payment terminal(s) is the primary step and pre-requisite to enable payment terminals to access other Device APIs to enable Installments. For enrollment of payment terminal, merchant participants need two public key IDs from Visa (to show device already knows the value of this key) and at least one device public key.

### Request

##### header Parameters

|     |     |
| --- | --- |
| ex-correlation-id | string \[ 1 .. 36 \] characters <br>Unique ID for every API request - an optional header. Generated by the API client. Used for end-to-end tracing/debugging. |
| v-c-idempotency-key | string <uuid>  36 characters <br>Unique ID for every API request - an optional header. Generated by the API client. Used for idempotency. |

##### Request Body schema: application/json

|     |     |
| --- | --- |
| deviceAlias<br>required | string \[ 1 .. 50 \] characters <br>A supplementary ID for the device defined by the client/partner enrolling this device<br>- Must be unique for this client/partner<br>- An alias is analogous to the `vDeviceID` with the difference that it is assigned by the caller of this API<br>- Examples of aliases might be serial numbers and IMEIs<br>- The alias might be used to guarantee only one subject identity is created for the same physical device<br>Example: "990000862471854" |
| deviceKeys<br>required | Array of objects \[ 1 .. 5 \] items <br>Used by Visa to authenticate the JWT (Crypto Credential) sent by the Device to establish a session.<br>- These keys are not yet registered at Visa and the JWK does not include a 'kid', this is a "JWK by value".<br>- Visa will store the Device public keys and will assign one device key id ('kid') for each of these keys. The 'kid' value for a device key is a UUID generated by the Visa and is returned in the response.<br>- At least the key with keyFunction of `AUTHENTICITY` must be provided; otherwise, a 400 error will be returned. |
| Array

|     |     |
| --- | --- |
| jwk<br>required | object<br>JWK for device keys<br>A JSON data structure that represents a cryptographic key as per [RFC 7517](https://tools.ietf.org/html/rfc7517). |
| |     |     |
| --- | --- |
| crv<br>required | string<br>Default: "P-256"<br>Applicable only for EC key type.<br>Value:"P-256"<br>Example: "P-256" |
| kty<br>required | string<br>- The "kty" (key type) parameter identifies the cryptographic algorithm family used with the key, such as "RSA" or "EC".<br>- `EC` is the only supported value, for now. Future versions may provide others.<br>Value:"EC"<br>Example: "EC" |
| x<br>required | string <byte> <br>EC x Coordinate in _base64Url_ encoded value. Applicable only for EC key type. |
| y<br>required | string <byte> <br>EC y Coordinate in _base64Url_ encoded value. Applicable only for EC key type. |
| use | string<br>The "use" (public key use) parameter identifies the intended use of the public key.<br>- Required when the JWK is used to represent the device keys<br>- Indirectly defined by the value of `keyFunction`<br>- Employed to indicate whether the key is used for encrypting data or verifying the signature on data.<br>  - `enc` must be used when the key is used for `KEY_AGREEMENT`<br>  - `sig` must be used when the key is used for `AUTHENTICITY`<br>Enum:"sig""enc"<br>Example: "enc" | |
| keyFunction<br>required | string<br>This is the purpose of this key generated by the device.<br>- Visa will store the Payment Terminal/Device public keys and will assign one device key id ('kid') for each of these keys. The 'kid' value for a device key is a UUID generated by Visa and is returned in the response<br>- Visa keys are used for `AUTHENTICITY` and `KEY_AGREEMENT`<br>  - `AUTHENTICITY` for the Visa Public Key associated to Authenticated Message in Visa responses occurring during Device Authentication. Used by Visa to authenticate the JWT (Crypto Credential) sent by the Device to establish a session<br>  - `KEY_AGREEMENT` for the Visa Static Public Key associated to Key Agreement occurring during Device Authentication<br>- At least the key with keyFunction of `AUTHENTICITY` must be provided; otherwise, a 400 error will be returned.<br>Enum:"AUTHENTICITY""KEY_AGREEMENT"<br>Example: "AUTHENTICITY" |
| keyReference | string \[ 1 .. 2 \] characters <br>- Meaningful only to the caller of this API<br>- Used, optionally, to cross-reference with the keys between the request and response. Use numbers like '1', '2', etc.<br>- If not present, the response will include the keys in the same order as the request<br>Example: "1" | |
| deviceSoftware<br>required | object<br>Provides additional device context |
| |     |     |
| --- | --- |
| name<br>required | string <= 5 characters <br>The unique name or id assigned to the software on the device<br>Example: "SA2.0" |
| version<br>required | string <= 8 characters <br>Version associated with the client software (the software making oauth2 requests)<br>- String that follows the versioning scheme, ".\[.\]"<br>  <br>  - Where the alphabet for major_version, minor_version, and patch_version is only digits.<br>  - The patch version is optional<br>- Versions must be incremental sequences as comparisons might be done on them in order to apply distinct logic<br>  - For comparison purposes the following conversion is done<br>    - Remove the '.' separating the minor and patch versions, if any, from the string<br>    - Convert the string into a float number<br>- The device clients are responsible for defining their own version numbers as long as they adhere to the scheme<br>Example: "2.0.11" | |
| visaKeys<br>required | Array of objects 2 items <br>Static public keys from Visa used for Key Agreement<br>- These 2 keys are provided by Visa (in certificates) during onboarding:<br>  - Visa certificate with public key for AUTHENTICATION<br>  - Visa certificate with public key for KEY_AGREEMENT<br>- These 2 Visa public keys must be provisioned/stored in the device after the kid is received in the enrollment response.<br>- These keys are "bound" to the vDeviceID returned in the enroll device API response.<br>- Both the Visa-generated AUTHENTICITY and KEY_AGREEMENT public keys must be present in the request.<br>Example: [{"jwk":{"kid":"eaa6db43","use":"enc"},"keyKind":"REFID","keyFunction":"AUTHENTICITY","keyReference":"1"},{"jwk":{"kid":"ffa6db45","use":"enc"},"keyKind":"REFID","keyFunction":"KEY_AGREEMENT","keyReference":"2"}] |
| Array

|     |     |
| --- | --- |
| jwk<br>required | object<br>JWK for device keys.<br>A JSON data structure that represents a cryptographic key as per [RFC 7517](https://tools.ietf.org/html/rfc7517). |
| |     |     |
| --- | --- |
| kid<br>required | string \[ 1 .. 8 \] characters <br>Key identifier for situations in which the Client Software already possesses a key known and registered at Visa.<br>Example: "eaa6db43" |
| use | string<br>The "use" (public key use) parameter identifies the intended use of the public key.<br>- Required when the JWK is used to represent the device keys<br>- Indirectly defined by the value of `keyFunction`<br>- Employed to indicate whether the key is used for encrypting data or verifying the signature on data.<br>  - `enc` must be used when the key is used for `KEY_AGREEMENT`<br>  - `sig` must be used when the key is used for `AUTHENTICITY`<br>Enum:"sig""enc"<br>Example: "enc" | |
| keyFunction<br>required | string<br>The purpose of this key generated by the device.<br>- Visa will store the Payment Terminal/Device public keys and will assign one device key id ('kid') for each of these keys. The 'kid' value for a device key is a UUID generated by Visa and is returned in the response<br>- Visa keys are used for `AUTHENTICITY` and `KEY_AGREEMENT`<br>  - `AUTHENTICITY` for the Visa Public Key associated to Authenticated Message in Visa responses occurring during Device Authentication. Used by Visa to authenticate the JWT (Crypto Credential) sent by the Device to establish a session<br>  - `KEY_AGREEMENT` for the Visa Static Public Key associated to Key Agreement occurring during Device Authentication<br>- Two keys (one each with keyFunction of `AUTHENTICITY` and `KEY_AGREEMENT`) must be provided; otherwise, a 400 error will be returned.<br>Enum:"AUTHENTICITY""KEY_AGREEMENT"<br>Example: "AUTHENTICITY" |
| keyKind<br>required | string<br>Type of the key. The value must be `REFID` as these keys refer to the certificates provided by Visa during onboarding.<br>Enum:"REFID""KEYID"<br>Example: "REFID" |
| keyReference | string \[ 1 .. 2 \] characters <br>- Meaningful only to the caller of this API<br>- Used, optionally, to cross-reference with the keys between the request and response. Use numbers like '1', '2', etc.<br>- If not present, the response will include the keys in the same order as the request<br>Example: "1" | |
| devicePreferredName | string \[ 1 .. 50 \] characters <br>Preferred name of the Payment Terminal<br>Example: "BNPL TERMINAL" |

### Responses

201
Device enrolled successfully

|     |     |
| --- | --- |
| x-via-hint | string \[ 1 .. 4096 \] characters <br>An optional hint header in response which API calller can send back to route the calls to a specific data center. |
| ex-correlation-id | string \[ 1 .. 36 \] characters <br>Unique ID for the API response; ex-correlation-id is echoed back. Used for end-to-end tracing/debugging. |
| v-c-idempotency-key | string <uuid>  36 characters <br>Unique ID for the API response. v-c-idempotency-key is echoed back. Used for idempotency. |

Response Headers

##### Response Schema: application/json

|     |     |
| --- | --- |
| vDeviceID<br>required | string<br>Visa-generated device ID for the enrolled device |
| deviceAlias | string \[ 1 .. 50 \] characters <br>A supplementary ID for the device defined by the client/partner enrolling this device<br>- Must be unique for this client/partner<br>- An alias is analogous to the `vDeviceID` with the difference that it is assigned by the caller of this API<br>- Examples of aliases might be serial numbers and IMEIs<br>- The alias might be used to guarantee only one subject identity is created for the same physical device<br>Example: "990000862471854" |
| deviceKeys | Array of objects \[ 1 .. 5 \] items <br>- Used by Visa to authenticate the JWT (Crypto Credential) sent by the Device to establish a session.<br>- Visa will store the Device public keys and will assign one device key id ('kid') for each of these keys. |
| Array

|     |     |
| --- | --- |
| jwk<br>required | object<br>JWK for device keys.<br>A JSON data structure that represents a cryptographic key as per [RFC 7517](https://tools.ietf.org/html/rfc7517). |
| |     |     |
| --- | --- |
| kid<br>required | string 36 characters <br>The kid value for a device key is a UUID generated by Visa and is assigned to the Device Key used for authentication.<br>This kid value needs to be stored in the device and is to be used during authentication (while referring to the device key)<br>Example: "eaa6db43" |
| use | string<br>The "use" (public key use) parameter identifies the intended use of the public key.<br>- Required when the JWK is used to represent the device keys<br>- Indirectly defined by the value of `keyFunction`<br>- Employed to indicate whether the key is used for encrypting data or verifying the signature on data.<br>  - `enc` must be used when the key is used for `KEY_AGREEMENT`<br>  - `sig` must be used when the key is used for `AUTHENTICITY`<br>Enum:"sig""enc"<br>Example: "enc" | |
| keyFunction | string<br>Default: "KEY_AGREEMENT"<br>The purpose of this key, which is generated by the device.<br>- Typically, device keys are used for `AUTHENTICITY`; that is, the Payment Terminal/device Public Key is associated to Payment Terminal/device Authentication<br>- Typically, Visa keys are used for `AUTHENTICITY` and `KEY_AGREEMENT`<br>  - `AUTHENTICITY` for the Visa Public Key associated to Authenticated Message in Visa responses occurring during Payment Terminal/Device Authentication<br>  - `KEY_AGREEMENT` for the Visa Static Public Key associated to Key Agreement occurring during Payment Terminal/Device Authentication<br>Enum:"AUTHENTICITY""KEY_AGREEMENT"<br>Example: "AUTHENTICITY" |
| keyKind | string<br>Type of the key. The value must be `KEYID` because the kid is generated by Visa for device keys in this response.<br>Enum:"REFID""KEYID"<br>Example: "KEYID" |
| keyReference | string \[ 1 .. 2 \] characters <br>- Meaningful only to the caller of this API<br>- Used, optionally, to cross-reference with the keys between the request and response. Use numbers like '1', '2', etc.<br>- If not present, the response will include the keys in the same order as the request<br>Example: "1" | |
| devicePreferredName | string \[ 1 .. 50 \] characters <br>Preferred name of the Payment Terminal<br>Example: "BNPL TERMINAL" |
| visaKeys | Array of objects 2 items <br>- These 2 Visa public keys must be provisioned/stored in the device.<br>- These keys are "bound" to the vDeviceID returned in the enroll device API response.<br>- Both of the Visa-generated AUTHENTICITY and KEY_AGREEMENT public keys will be present in the response.<br>Example: [{"jwk":{"kid":"eaa6db43","use":"enc"},"keyKind":"REFID","keyFunction":"AUTHENTICITY","keyReference":"1"},{"jwk":{"kid":"ffa6db45","use":"enc"},"keyKind":"REFID","keyFunction":"KEY_AGREEMENT","keyReference":"2"}] |
| Array

|     |     |
| --- | --- |
| jwk<br>required | object<br>JWK for device keys.<br>A JSON data structure that represents a cryptographic key as per [RFC 7517](https://tools.ietf.org/html/rfc7517). |
| |     |     |
| --- | --- |
| kid<br>required | string \[ 1 .. 8 \] characters <br>The kid value for a device key is a UUID generated by the Visa and is assigned to the Device Key used for authentication.<br>This kid value needs to be stored in the device and is to be used during authentication (while referring to the device key).<br>Example: "eaa6db43" |
| use | string<br>The "use" (public key use) parameter identifies the intended use of the public key.<br>- Required when the JWK is used to represent the device keys<br>- Indirectly defined by the value of `keyFunction`<br>- Employed to indicate whether the key is used for encrypting data or verifying the signature on data.<br>  - `enc` must be used when the key is used for `KEY_AGREEMENT`<br>  - `sig` must be used when the key is used for `AUTHENTICITY`<br>Enum:"sig""enc"<br>Example: "enc" | |
| keyFunction | string<br>Default: "KEY_AGREEMENT"<br>The purpose of this key, which is generated by the device.<br>- Typically, device keys are used for `AUTHENTICITY`; that is, the Payment Terminal/device Public Key is associated to Payment Terminal/device Authentication<br>- Typically, Visa keys are used for `AUTHENTICITY` and `KEY_AGREEMENT`<br>  - `AUTHENTICITY` for the Visa Public Key associated to Authenticated Message in Visa responses occurring during Payment Terminal/Device Authentication<br>  - `KEY_AGREEMENT` for the Visa Static Public Key associated to Key Agreement occurring during Payment Terminal/Device Authentication<br>Enum:"AUTHENTICITY""KEY_AGREEMENT"<br>Example: "AUTHENTICITY" |
| keyKind | string<br>Type of the key. The value must be `REFID` because the kid is the reference to the certificate (corresponding to this key type) provided by Visa during onboarding.<br>Enum:"REFID""KEYID"<br>Example: "REFID" |
| keyReference | string \[ 1 .. 2 \] characters <br>- Meaningful only to the caller of this API<br>- Used, optionally, to cross-reference with the keys between the request and response. Use numbers like '1', '2', etc.<br>- If not present, the response will include the keys in the same order as the request<br>Example: "1" | |

---

### 400
The `errorResponse.details` part of the error response can provide a list of fields that failed data validation constraints and errorResponse.reason values for this error include:

- `invalidRequest`The API server could not understand the request; for example, base64 decoding failed, the field is not in a particular format, etc.

|     |     |
| --- | --- |
| ex-correlation-id | string \[ 1 .. 36 \] characters <br>Unique ID for the API response; ex-correlation-id is echoed back. Used for end-to-end tracing/debugging. |

### Response Headers

##### Response Schema: application/json

|     |     |
| --- | --- |
| errorResponse<br>required | object<br>Standard error response body provided when there is an error. |
| |     |     |
| --- | --- |
| reason<br>required | string <= 100 characters <br>API developers must use this field to drive their error handling logic<br>Example: "invalidRequest" |
| details | Array of objects<br>Array of fields - Data validation errors should use this array to specify fields that failed validation using the location field |
| Array

|     |     |
| --- | --- |
| location<br>required | string<br>The value of this field is using an expression to point to a field that failed validation.<br>This field is required if error details are specified.<br>Example: "plan.name" |
| message | string <= 1024 characters <br>The specific error for this field<br>Example: "Must be a non-empty value" |
| reason | string <= 100 characters <br>The specific reason for this error<br>Example: "Must be a non-empty single word value" | |
| message | string <= 1024 characters <br>Every error should have a human readable message describing the error. The message can very even for the same reason, thus providing additional details. API providers are free to change the message at any point of time. API clients should not use the message field to drive their business logic or to expose it directly to the consumers via UI or other means.<br>Example: "Input parameters validation failed" |
| status | integer \[ 100 .. 600 \] <br>3-digit HTTP Status Code<br>Example: 400 | |

### Responses

#### 401
API authorized error caused due to any of the following reasons:

- x-pay-token is not present, blank, or not in a valid format.
- Timestamp field not in valid UTC timestamp format.
- Version field is invalid.
- Token's timestamp is more than 8 minutes off from the current time.
- Token hash mismatch.
- APIKey not present in request.
- APIKey is not active.
- APIKey not valid.
- APIKey not active.
- Request has more than one authentication token, which is not supported

##### Response Schema: application/json

|     |     |
| --- | --- |
| errorResponse | object<br>Standard error response body provided when there is an error. |
| |     |     |
| --- | --- |
| reason<br>required | string <= 100 characters <br>API developers must use this field to drive their error handling logic<br>Example: "invalidRequest" |
| details | Array of objects<br>Array of fields - Data validation errors should use this array to specify fields that failed validation using the location field |
| Array

### More Responses

Various response scenarios are defined, including 404, 403, 406, 409, 410, 429, 500, 503. Each error response follows the same format as specified above.
