Skip to main content

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

NameTypeDetailsMandatoryDescription
idintegerPath parameterYOperation ID returned by the init endpoint.
payment_methodobjectYPayment method with wallet token. See section below.

payment_method parameter

NameTypeDetailsMandatoryDescription
typestringAPPLE_PAY or GOOGLE_PAYYWallet type. Must match the type used in the init call for this operation.
tokenstringMax length 10000YBase64-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 (containing data, 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.

NameTypeMandatoryDescription
idintegerYOperation ID.
referencestringYMerchant payment reference.
amountintegerYPayment amount in cents.
currencystringYISO 4217 currency code.
statusstringYPayment status: SUCCESS, AUTHORIZED, FAILED, OPEN, WAITING, ERROR, TIMED_OUT.
flowstringYPayment flow type (e.g. API).
processing_timeintegerNUnix timestamp of when the payment was processed.
account_idintegerYMerchant account ID.
merchant_idintegerYAPI feature ID.
merchant_loginstringYAPI feature login.
descriptionstringNPayment description.
contractstringNPay contract name (e.g. Apple Pay, Google Pay).
descriptorstringNStatement descriptor shown on the cardholder's statement.
preauth_expiration_datestringNPre-authorization expiration date (preauth only).
settlement_dateintegerNUnix timestamp of settlement date.
failure_categorystringNFailure category code when status is FAILED.
failure_messagestringNHuman-readable failure message when status is FAILED.
customerobjectNCustomer details (email, ip).
payment_methodobjectNPayment 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"
}
]
}