# Token Vault service API

This is an API reference for the Token Vault service, which provides endpoints to create and manage tokens and related cryptographic data.

Version: 1.0.0

## Servers

Production environment
```
https://api-services.pxp.io/api/v1
```

Sandbox environment
```
https://api-services.test.pxp.io/api/v1
```

## Download OpenAPI description

[Token Vault service API](https://developer.pxp.io/_bundle/apis/token-vault.yaml)

## Other

### Create gateway token

 - [POST /token-vault/{ownerType}/{ownerId}/vaults/gateway-tokens](https://developer.pxp.io/apis/token-vault/other/create-gateway-token.md): Request to create a gateway token, which is used to represent sensitive payment data in a secure and tokenised form.

### Create scheme token

 - [POST /token-vault/{ownerType}/{ownerId}/vaults/scheme-tokens](https://developer.pxp.io/apis/token-vault/other/create-scheme-token.md): Request to create a scheme token, representing payment data according to scheme rules.

### Get scheme token

 - [GET /token-vault/{ownerType}/{ownerId}/vaults/scheme-tokens/{schemeTokenId}](https://developer.pxp.io/apis/token-vault/other/get-scheme-token.md): Request to get a scheme token and its status

### Create scheme token cryptogram

 - [POST /token-vault/{ownerType}/{ownerId}/vaults/scheme-tokens/{schemeTokenId}/cryptograms](https://developer.pxp.io/apis/token-vault/other/create-scheme-token-cryptogram.md): Request to create a scheme token cryptogram, a secure cryptographic representation of the token.

### Get masked card data related to gateway token

 - [GET /token-vault/{ownerType}/{ownerId}/vaults/gateway-tokens/{gatewayTokenId}/card-data](https://developer.pxp.io/apis/token-vault/other/get-masked-card-related-to-gateway-token.md): Request to get card data related to the gateway token. The returned sensitive data is unencrypted but masked to ensure security.

### Get encrypted card data related to gateway token

 - [GET /token-vault/{ownerType}/{ownerId}/vaults/gateway-tokens/{gatewayTokenId}/card-data/encrypted](https://developer.pxp.io/apis/token-vault/other/get-encrypted-card-related-to-gateway-token.md): Request to get card data related to the gateway token. The returned sensitive data is encrypted for enhanced security.

### Store card verification code for card

 - [PUT /token-vault/{ownerType}/{ownerId}/vaults/gateway-tokens/{gatewayTokenId}/card-verification-code](https://developer.pxp.io/apis/token-vault/other/store-security-code.md): Request to store the card verification code (CVC) for a card associated with a gateway token.

### Revoke gateway token consent

 - [DELETE /token-vault/{ownerType}/{ownerId}/vaults/gateway-tokens/{gatewayTokenId}/user-consents/{merchantId}/{merchantShopperId}](https://developer.pxp.io/apis/token-vault/other/revoke-gateway-token-consent.md): Revokes user consent for a specific gateway token associated with a merchant shopper. This action prevents the token from being used for future transactions until consent is granted again.

### Revoke scheme token consent

 - [DELETE /token-vault/{ownerType}/{ownerId}/vaults/scheme-tokens/{schemeTokenId}/user-consents/{merchantId}/{merchantShopperId}](https://developer.pxp.io/apis/token-vault/other/revoke-scheme-token-consent.md): Revokes user consent for a specific scheme token associated with a merchant shopper. This action prevents the token from being used for future transactions until consent is granted again.

