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

# Create a Wallet Merchant Session

POST https://api.crisscross.money/v1/payment/wallet/merchant-session
Content-Type: application/json

Validates a wallet merchant session and returns an opaque `merchantSession` to hand back to
the wallet on the customer's device.

Required for **Apple Pay** when you render the wallet button yourself and submit the token
from your own server. Google Pay has no equivalent step, and neither the hosted checkout nor
the default (non-manual) SDK mode needs this call — both make it for you.

You supply only the session and the `validationUrl` the wallet gave you. The merchant
identifier, payment domain and certificates are resolved by CrissCross from `sessionId`, so
none of them are ever exposed to you or to the browser. See the
[Server Integration guide](/wallets-server-integration).


Reference: https://docs.crisscross.money/api-reference/collect/payments/payment-initiation/create-wallet-merchant-session

## Request

### Body (application/json)

This endpoint expects a WalletMerchantSessionRequest.

- `sessionId` (string, required) — The checkout session the wallet payment belongs to.
- `provider` (enum, required) — The wallet requesting validation. Only `apple-pay` requires a merchant session.
  - Allowed values: `apple-pay`
- `validationUrl` (string, required) — The validation URL supplied by the wallet on the customer's device. Forward it unaltered; it is issued per wallet interaction. CrissCross validates this value before using it: it must be an HTTPS URL on an Apple Pay validation host, and anything else is rejected with `422` rather than requested. Never construct or rewrite it — pass through exactly what the wallet gave you.

## Response

### 201

Merchant session created. Return `merchantSession` to the browser unaltered, as JSON — it is validated as an opaque whole and is single-use and short-lived. Do not cache, re-serialise or log it.

- `merchantSession` (map from string to any, required) — Opaque merchant session to return to the browser unaltered. Treat it as a payment credential for as long as it is valid.

## Errors

### 400 Bad Request Error

Invalid request parameters.

- `message` (string, required) — Human-readable description of what went wrong.
- `error` (string, required) — Error category. Most endpoints return the HTTP reason phrase (e.g. "Bad Request", "Unauthorized", "Conflict", "Unprocessable Entity", "Internal Server Error"). Some return a machine-readable snake_case code instead — notably the FX and rate-lock rejections on checkout session creation and payment initiation, where several distinct codes share a single HTTP status. Where a code is present it is the finer discriminator and is safe to branch on.
- `statusCode` (integer, required) — HTTP status code, mirroring the response header. The response header is the source of truth.

### 401 Unauthorized Error

Unauthorized.

- `message` (string, required) — Human-readable description of what went wrong.
- `error` (string, required) — Error category. Most endpoints return the HTTP reason phrase (e.g. "Bad Request", "Unauthorized", "Conflict", "Unprocessable Entity", "Internal Server Error"). Some return a machine-readable snake_case code instead — notably the FX and rate-lock rejections on checkout session creation and payment initiation, where several distinct codes share a single HTTP status. Where a code is present it is the finer discriminator and is safe to branch on.
- `statusCode` (integer, required) — HTTP status code, mirroring the response header. The response header is the source of truth.

### 404 Not Found Error

Checkout session not found.

- `message` (string, required) — Human-readable description of what went wrong.
- `error` (string, required) — Error category. Most endpoints return the HTTP reason phrase (e.g. "Bad Request", "Unauthorized", "Conflict", "Unprocessable Entity", "Internal Server Error"). Some return a machine-readable snake_case code instead — notably the FX and rate-lock rejections on checkout session creation and payment initiation, where several distinct codes share a single HTTP status. Where a code is present it is the finer discriminator and is safe to branch on.
- `statusCode` (integer, required) — HTTP status code, mirroring the response header. The response header is the source of truth.

### 422 Unprocessable Entity Error

Unprocessable Entity. Also returned when the wallet is not enabled for the session, when the domain presenting the button is not a verified payment domain — see [Wallet Configuration](/wallets-configuration) — or when `validationUrl` is not an HTTPS URL on an Apple Pay validation host.

- `message` (string, required) — Human-readable description of what went wrong.
- `error` (string, required) — Error category. Most endpoints return the HTTP reason phrase (e.g. "Bad Request", "Unauthorized", "Conflict", "Unprocessable Entity", "Internal Server Error"). Some return a machine-readable snake_case code instead — notably the FX and rate-lock rejections on checkout session creation and payment initiation, where several distinct codes share a single HTTP status. Where a code is present it is the finer discriminator and is safe to branch on.
- `statusCode` (integer, required) — HTTP status code, mirroring the response header. The response header is the source of truth.

## Examples

**Request**

```json
{
  "sessionId": "01951c8a-7c3d-7e1f-9d4a-2b3c4d5e6f70",
  "provider": "apple-pay",
  "validationUrl": "https://apple-pay-gateway.apple.com/paymentservices/paymentSession"
}
```

**Response**

```json
{
  "merchantSession": {}
}
```

**SDK Code**

```python
import requests

url = "https://api.crisscross.money/v1/payment/wallet/merchant-session"

payload = {
    "sessionId": "01951c8a-7c3d-7e1f-9d4a-2b3c4d5e6f70",
    "provider": "apple-pay",
    "validationUrl": "https://apple-pay-gateway.apple.com/paymentservices/paymentSession"
}
headers = {"Content-Type": "application/json"}

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

print(response.json())
```

```javascript
const url = 'https://api.crisscross.money/v1/payment/wallet/merchant-session';
const options = {
  method: 'POST',
  headers: {'Content-Type': 'application/json'},
  body: '{"sessionId":"01951c8a-7c3d-7e1f-9d4a-2b3c4d5e6f70","provider":"apple-pay","validationUrl":"https://apple-pay-gateway.apple.com/paymentservices/paymentSession"}'
};

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

```go
package main

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

func main() {

	url := "https://api.crisscross.money/v1/payment/wallet/merchant-session"

	payload := strings.NewReader("{\n  \"sessionId\": \"01951c8a-7c3d-7e1f-9d4a-2b3c4d5e6f70\",\n  \"provider\": \"apple-pay\",\n  \"validationUrl\": \"https://apple-pay-gateway.apple.com/paymentservices/paymentSession\"\n}")

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

	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
require 'uri'
require 'net/http'

url = URI("https://api.crisscross.money/v1/payment/wallet/merchant-session")

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

request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n  \"sessionId\": \"01951c8a-7c3d-7e1f-9d4a-2b3c4d5e6f70\",\n  \"provider\": \"apple-pay\",\n  \"validationUrl\": \"https://apple-pay-gateway.apple.com/paymentservices/paymentSession\"\n}"

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

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

HttpResponse<String> response = Unirest.post("https://api.crisscross.money/v1/payment/wallet/merchant-session")
  .header("Content-Type", "application/json")
  .body("{\n  \"sessionId\": \"01951c8a-7c3d-7e1f-9d4a-2b3c4d5e6f70\",\n  \"provider\": \"apple-pay\",\n  \"validationUrl\": \"https://apple-pay-gateway.apple.com/paymentservices/paymentSession\"\n}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.crisscross.money/v1/payment/wallet/merchant-session', [
  'body' => '{
  "sessionId": "01951c8a-7c3d-7e1f-9d4a-2b3c4d5e6f70",
  "provider": "apple-pay",
  "validationUrl": "https://apple-pay-gateway.apple.com/paymentservices/paymentSession"
}',
  'headers' => [
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp
using RestSharp;

var client = new RestClient("https://api.crisscross.money/v1/payment/wallet/merchant-session");
var request = new RestRequest(Method.POST);
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"sessionId\": \"01951c8a-7c3d-7e1f-9d4a-2b3c4d5e6f70\",\n  \"provider\": \"apple-pay\",\n  \"validationUrl\": \"https://apple-pay-gateway.apple.com/paymentservices/paymentSession\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = ["Content-Type": "application/json"]
let parameters = [
  "sessionId": "01951c8a-7c3d-7e1f-9d4a-2b3c4d5e6f70",
  "provider": "apple-pay",
  "validationUrl": "https://apple-pay-gateway.apple.com/paymentservices/paymentSession"
] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://api.crisscross.money/v1/payment/wallet/merchant-session")! 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()
```