Pay with Maya — "Invalid Request" error after clicking Confirm on Sandbox

I’m working on a project that integrates the Pay with Maya API (/payby/v2/paymaya/payments) for single payments. I keep running into an issue when completing the payment flow in the Sandbox environment.

What happens:

  1. My backend creates a payment via POST /payby/v2/paymaya/payments and gets back a valid paymentId + redirectUrl from the API — no errors.

  2. I open the redirect URL and the Maya payment page loads normally.

  3. I log in using the sandbox test credentials (+639900100900).

  4. The payment confirmation screen loads correctly showing the amount and transaction details.

  5. As soon as I hit “Confirm to Pay”, I get an “Invalid Request” page that says “The link you’re trying to access is invalid or has already expired” with only a “Back to Merchant” link.

    Has anyone else experienced this with Pay with Maya in the Sandbox? Is this a known sandbox issue, or is there something about the flow that requires additional configuration? Any help would be appreciated. Thanks!

Hello @pray,

I came across your thread and noticed that the error message indicates that the payment is invalid or has already expired.

Just to check, were you able to complete the login or authorize the payment within the allowed time window? The Pay with Maya is only valid for 30 minutes, after which it will expire if not completed.

1 Like

Forgot to provide the reference :sweat_smile:

Reference: Business Rules to Code for Online Payments

1 Like

Hi @pray

I tried doing a transaction on my side, it seems to be working as expected. I thought it’s similar to a previous issue I encountered.

Have you tried the recommendation from @kuro.mias22?

Hi @kuro.mias22 @Cerie , thanks for the help!

The issue has actually been working since yesterday. I don’t think it was related to the 30-minute expiry, as I was authorizing the payments within 3 minutes of creation.

It seems to be the same issue as this previous post : Maya API Sandbox Wallet Checkout returns "Invalid Request" upon confirmation (Cross-domain redirect issue)

2 Likes

@pray yeah! That’s why I also tried a transaction on my side, if it was the same issue as last time. Glad to help! :blush: