Submit wallet payment token
Submits a wallet payment token for processing. The wallet type (Apple Pay or Google Pay) is determined from the operation metadata set during init.
Apple Pay: Call this from the onpaymentauthorized callback of your ApplePaySession. Based on the returned status, call session.completePayment() with either ApplePaySession.STATUS_SUCCESS or ApplePaySession.STATUS_FAILURE.
Google Pay: Call this after receiving payment data from paymentsClient.loadPaymentData(). The payment_method.token field should contain the tokenization data from the wallet.
- URL syntax: /api/v2/merchant/payment/{id}/wallet
- Method: POST
Request parameters
| Name | Type | Details | Mandatory | Description |
|---|---|---|---|---|
| id | integer | Path parameter | Y | Operation ID returned by the init endpoint. |
| payment_method | object | Y | Payment method with wallet token. See section below. |
payment_method parameter
| Name | Type | Details | Mandatory | Description |
|---|---|---|---|---|
| type | string | APPLE_PAY or GOOGLE_PAY | Y | Wallet type. Must match the type used in the init call for this operation. |
| token | string | Max length 10000 | Y | Base64-encoded wallet payment token. The token content (after decoding) must be valid JSON. |
Token encoding
- Apple Pay: Base64-encode the JSON object from
event.payment.token.paymentData(containingdata,signature,header,version).btoa(JSON.stringify(event.payment.token.paymentData)) - Google Pay: Base64-encode the JSON string from
paymentData.paymentMethodData.tokenizationData.token.btoa(paymentData.paymentMethodData.tokenizationData.token)
Example request — Apple Pay
{
"payment_method": {
"type": "APPLE_PAY",
"token": "eyJkYXRhIjoiYmFzZTY0X2VuY3J5cHRlZF9wYXltZW50X2RhdGEuLi4iLCJzaWduYXR1cmUiOiJiYXNlNjRfc2lnbmF0dXJlLi4uIiwiaGVhZGVyIjp7ImVwaGVtZXJhbFB1YmxpY0tleSI6ImJhc2U2NF9rZXkuLi4iLCJwdWJsaWNLZXlIYXNoIjoiYmFzZTY0X2hhc2guLi4iLCJ0cmFuc2FjdGlvbklkIjoiYWJjMTIzZGVmNDU2In0sInZlcnNpb24iOiJFQ192MSJ9"
}
}
Example request — Google Pay
{
"payment_method": {
"type": "GOOGLE_PAY",
"token": "eyJzaWduYXR1cmUiOiJNRVlDSVFEQ2ZiLi4uIiwiaW50ZXJtZWRpYXRlU2lnbmluZ0tleSI6eyJzaWduZWRLZXkiOiJ7XCJrZXlWYWx1ZVwiOlwiTUZrdy4uLlwifSIsInNpZ25hdHVyZXMiOlsiTUVRQ0lELi4uIl19LCJwcm90b2NvbFZlcnNpb24iOiJFQ3YyIiwic2lnbmVkTWVzc2FnZSI6IntcImVuY3J5cHRlZE1lc3NhZ2VcIjpcImgyZDguLi5cIn0ifQ=="
}
}
Response parameters
The response contains a payment object — see Payment object reference.
| Name | Type | Mandatory | Description |
|---|---|---|---|
| id | integer | Y | Operation ID. |
| reference | string | Y | Merchant payment reference. |
| amount | integer | Y | Payment amount in cents. |
| currency | string | Y | ISO 4217 currency code. |
| status | string | Y | Payment status: SUCCESS, AUTHORIZED, FAILED, OPEN, WAITING, ERROR, TIMED_OUT. |
| flow | string | Y | Payment flow type (e.g. API). |
| processing_time | integer | N | Unix timestamp of when the payment was processed. |
| account_id | integer | Y | Merchant account ID. |
| merchant_id | integer | Y | API feature ID. |
| merchant_login | string | Y | API feature login. |
| description | string | N | Payment description. |
| contract | string | N | Pay contract name (e.g. Apple Pay, Google Pay). |
| descriptor | string | N | Statement descriptor shown on the cardholder's statement. |
| preauth_expiration_date | string | N | Pre-authorization expiration date (preauth only). |
| settlement_date | integer | N | Unix timestamp of settlement date. |
| failure_category | string | N | Failure category code when status is FAILED. |
| failure_message | string | N | Human-readable failure message when status is FAILED. |
| customer | object | N | Customer details (email, ip). |
| payment_method | object | N | Payment method details including type, display (masked card number), and details (scheme, exp_month, exp_year). |
Example response — Apple Pay
{
"payment": {
"id": 370529,
"reference": "order-20260223-001",
"amount": 1999,
"currency": "EUR",
"status": "SUCCESS",
"flow": "API",
"processing_time": 1708300015,
"account_id": 10033,
"merchant_id": 139112,
"merchant_login": "139112001",
"description": "Order #001",
"contract": "Apple Pay",
"descriptor": "MY STORE",
"customer": {
"email": "john@example.com",
"ip": "203.0.113.42"
},
"payment_method": {
"class": "payment_method",
"type": "APPLE_PAY",
"validation_status": "NOT_SUPPORTED",
"validation_date": null,
"invalid_reason": null,
"display": "4591-72xx-xxxx-4003",
"details": {
"class": "payment_method_details",
"scheme": "VISA",
"exp_month": "01",
"exp_year": "2030"
}
}
}
}
Example response — Google Pay
{
"payment": {
"id": 370530,
"reference": "order-20260223-002",
"amount": 1999,
"currency": "EUR",
"status": "SUCCESS",
"flow": "API",
"processing_time": 1708300020,
"account_id": 10033,
"merchant_id": 139112,
"merchant_login": "139112001",
"description": "Order #002",
"contract": "Google Pay",
"descriptor": "MY STORE",
"customer": {
"email": "john@example.com",
"ip": "203.0.113.42"
},
"payment_method": {
"class": "payment_method",
"type": "GOOGLE_PAY",
"validation_status": "NOT_SUPPORTED",
"validation_date": null,
"invalid_reason": null,
"display": "5349-45xx-xxxx-8433",
"details": {
"class": "payment_method_details",
"scheme": "MASTERCARD",
"exp_month": "06",
"exp_year": "2028"
}
}
}
}
Error responses
Missing payment_method (400)
{
"error_code": 400,
"errors": [
{
"class": "error",
"message": "payment_method is required"
}
]
}
Missing token (400)
{
"error_code": 400,
"errors": [
{
"class": "error",
"message": "payment_method.token is required"
}
]
}
Type mismatch (400)
{
"error_code": 400,
"errors": [
{
"class": "error",
"message": "payment_method.type mismatch: expected APPLE_PAY, got GOOGLE_PAY"
}
]
}
Payment already processed (400)
{
"error_code": 400,
"errors": [
{
"class": "error",
"message": "Payment has already been processed"
}
]
}
Payment processing failed (500)
{
"error_code": 500,
"errors": [
{
"class": "error",
"message": "Payment processing failed"
}
]
}
Payment processor failure (502)
{
"error_code": 502,
"errors": [
{
"class": "error",
"message": "Failed to process wallet payment"
}
]
}