> This page is for MVS Pay.

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.mvscloud.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.mvscloud.com/_mcp/server.

# Create a card-not-present (keyed) sale

POST https://pay.mvscloud.com/api/virtual-terminal
Content-Type: application/json

Processes a keyed / card-not-present sale as a confirmed payment_intent. Supply either a one-time `token` (fresh keyed card) or a saved `paymentInstrumentId`. Pass `idempotencyId` to make retries safe; one is generated server-side if omitted.

Reference: https://docs.mvscloud.com/mvs-pay/api/payments/create-virtual-terminal-sale

## Authentication

- `x-api-key` header (required) — A scoped MvsPayApiKey, e.g. `mvspay_live_…`. Mint and scope keys from the dashboard (Settings → API Keys).

## Request

### Body (application/json)

This endpoint expects a VirtualTerminalSaleRequest.

- `amount` (integer, required) — Minor units (cents); minimum 50 ($0.50).
- `currency` (string, optional, default: USD)
- `token` (string, optional) — One-time token for a freshly keyed card.
- `paymentInstrumentId` (string, optional) — A saved payment-method id.
- `customerId` (string, optional)
- `customerName` (string, optional)
- `description` (string, optional)
- `invoiceReference` (string, optional)
- `tags` (map from string to any, optional)
- `merchantId` (string, optional) — Override the resolved merchant.
- `locationId` (string, optional)
- `idempotencyId` (string, optional) — Client-supplied idempotency id; generated server-side if omitted.

## Response

### 200

The confirmed sale.

- `success` (boolean, required)
- `payment` (PaymentResponse, required) — Hyperswitch payment_intent response. Loosely typed; extra Hyperswitch fields pass through.

## Errors

### 400 Bad Request Error

Invalid request (e.g. malformed JSON, missing required field, amount below minimum).

- `error` (ErrorResponseError, required)

### 401 Unauthorized Error

Missing or invalid API key.

- `error` (ErrorResponseError, required)

### 500 Internal Server Error

Unexpected server error.

- `error` (ErrorResponseError, required)

### 502 Bad Gateway Error

The payments engine (Hyperswitch/connector) returned an error.

- `error` (ErrorResponseError, required)

## Types

### PaymentResponse

Hyperswitch payment_intent response. Loosely typed; extra Hyperswitch fields pass through.

- `payment_id` (string, required)
- `status` (string, required) — e.g. requires_payment_method, requires_confirmation, succeeded, processing, cancelled.
- `amount` (integer, required) — Minor units (cents).
- `currency` (string, required)
- `client_secret` (string, optional) — Mounted by the browser SDK to confirm with the card.
- `merchant_id` (string, optional)
- `connector` (string, optional) — Connector chosen by Hyperswitch (may be null).
- `metadata` (map from string to any, optional) — Includes server-stamped mvs_org_id / mvs_org_slug.

### ErrorResponseError

- `code` (string, required) — e.g. UNAUTHORIZED, FORBIDDEN, ERROR.
- `message` (string, required)
- `details` (map from string to any, optional)

## Examples

**Request**

```json
{
  "amount": 5000,
  "currency": "USD",
  "token": "tok_keyed_abc123",
  "customerName": "Jane Roe",
  "invoiceReference": "1042",
  "idempotencyId": "mvspay_org_acme_1719000000_ab12cd34ef"
}
```

**Response**

```json
{
  "success": true,
  "payment": {
    "payment_id": "string",
    "status": "string",
    "amount": 1,
    "currency": "string",
    "client_secret": "string",
    "merchant_id": "string",
    "connector": "string",
    "metadata": {}
  }
}
```

**SDK Code**

```python Payments_createVirtualTerminalSale_example
import requests

url = "https://pay.mvscloud.com/api/virtual-terminal"

payload = {
    "amount": 5000,
    "currency": "USD",
    "token": "tok_keyed_abc123",
    "customerName": "Jane Roe",
    "invoiceReference": "1042",
    "idempotencyId": "mvspay_org_acme_1719000000_ab12cd34ef"
}
headers = {
    "x-api-key": "<apiKey>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript Payments_createVirtualTerminalSale_example
const url = 'https://pay.mvscloud.com/api/virtual-terminal';
const options = {
  method: 'POST',
  headers: {'x-api-key': '<apiKey>', 'Content-Type': 'application/json'},
  body: '{"amount":5000,"currency":"USD","token":"tok_keyed_abc123","customerName":"Jane Roe","invoiceReference":"1042","idempotencyId":"mvspay_org_acme_1719000000_ab12cd34ef"}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Payments_createVirtualTerminalSale_example
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://pay.mvscloud.com/api/virtual-terminal"

	payload := strings.NewReader("{\n  \"amount\": 5000,\n  \"currency\": \"USD\",\n  \"token\": \"tok_keyed_abc123\",\n  \"customerName\": \"Jane Roe\",\n  \"invoiceReference\": \"1042\",\n  \"idempotencyId\": \"mvspay_org_acme_1719000000_ab12cd34ef\"\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("x-api-key", "<apiKey>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Payments_createVirtualTerminalSale_example
require 'uri'
require 'net/http'

url = URI("https://pay.mvscloud.com/api/virtual-terminal")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"amount\": 5000,\n  \"currency\": \"USD\",\n  \"token\": \"tok_keyed_abc123\",\n  \"customerName\": \"Jane Roe\",\n  \"invoiceReference\": \"1042\",\n  \"idempotencyId\": \"mvspay_org_acme_1719000000_ab12cd34ef\"\n}"

response = http.request(request)
puts response.read_body
```

```java Payments_createVirtualTerminalSale_example
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://pay.mvscloud.com/api/virtual-terminal")
  .header("x-api-key", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"amount\": 5000,\n  \"currency\": \"USD\",\n  \"token\": \"tok_keyed_abc123\",\n  \"customerName\": \"Jane Roe\",\n  \"invoiceReference\": \"1042\",\n  \"idempotencyId\": \"mvspay_org_acme_1719000000_ab12cd34ef\"\n}")
  .asString();
```

```php Payments_createVirtualTerminalSale_example
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://pay.mvscloud.com/api/virtual-terminal', [
  'body' => '{
  "amount": 5000,
  "currency": "USD",
  "token": "tok_keyed_abc123",
  "customerName": "Jane Roe",
  "invoiceReference": "1042",
  "idempotencyId": "mvspay_org_acme_1719000000_ab12cd34ef"
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'x-api-key' => '<apiKey>',
  ],
]);

echo $response->getBody();
```

```csharp Payments_createVirtualTerminalSale_example
using RestSharp;

var client = new RestClient("https://pay.mvscloud.com/api/virtual-terminal");
var request = new RestRequest(Method.POST);
request.AddHeader("x-api-key", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"amount\": 5000,\n  \"currency\": \"USD\",\n  \"token\": \"tok_keyed_abc123\",\n  \"customerName\": \"Jane Roe\",\n  \"invoiceReference\": \"1042\",\n  \"idempotencyId\": \"mvspay_org_acme_1719000000_ab12cd34ef\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Payments_createVirtualTerminalSale_example
import Foundation

let headers = [
  "x-api-key": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = [
  "amount": 5000,
  "currency": "USD",
  "token": "tok_keyed_abc123",
  "customerName": "Jane Roe",
  "invoiceReference": "1042",
  "idempotencyId": "mvspay_org_acme_1719000000_ab12cd34ef"
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://pay.mvscloud.com/api/virtual-terminal")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```