Skip to main content

Get Payment Intent

You can retrieve the detailed status and information of a specific payment intent by using Modem Pay's H2H API. This is useful for tracking the state of created payment intents, managing checkout or payment flows, or building payment history in your application.

If the payment intent you query has expired or has been archived by Modem Pay’s system, the API will return the transaction that was originally created and linked to that payment intent instead. This ensures you can still obtain the final payment outcome even if the intent itself has been collected by the archiver.

Endpoint

Use the following endpoint to fetch a payment intent by its unique id:

GET https://api.modempay.com/v1/payments/:id
  • Replace :id with either the payment intent ID (e.g., 9dd51f25-e5da-4995-974f-0b383357bc09).

Request Example

curl -X GET "https://api.modempay.com/v1/payments/9dd51f25-e5da-4995-974f-0b383357bc09" \
-H "Authorization: Bearer YOUR_API_KEY"

Successful Response

If the payment intent is found, a JSON response with intent details is returned. A typical payment intent response looks like:

{
"id": "9dd51f25-e5da-4995-974f-0b383357bc09",
"metadata": {},
"custom_fields": [],
"custom_fields_values": {},
"is_session": false,
"risk_score": {},
"transaction_fee": 0,
"notification_channels": [],
"type_of_payment": "regular",
"amount": 100,
"test_mode": false,
"business_id": "120c298f-b736-49c1-8220-8a8c84a5d8f3",
"account_id": "199bf17b-0b5a-45c0-a5b0-1d29f5f173c9",
"currency": "GMD",
"payment_methods": ["wallet"],
"idempotency_key": "lHLDer5n4",
"intent_secret": "95d9ad68e8ac64a100b5a883abcb811062d9",
"status": "requires_payment_method",
"payment_method_options": [],
"token": "eyJhbGciOiJIUzI1Ni....HI3YQvfFd3ULmo6b4b4EGxWfLU4",
"transaction_fee_type": "business",
"business_name": "Merchant",
"updatedAt": "2025-11-10T09:30:36.308Z",
"createdAt": "2025-11-10T09:30:36.308Z",
"payment_method": null,
"payment_method_object": null,
"title": null,
"description": null,
"customer": null,
"return_url": null,
"cancel_url": null,
"link": null,
"payment_link_id": null,
"customer_name": null,
"customer_phone": null,
"customer_email": null,
"otp_code": null,
"otp_token": null,
"invoice": null,
"order": null,
"plan": null,
"subscription": null,
"coupon": null,
"discount": null,
"sub_total": null,
"network": null,
"account_number": null,
"callback_url": null,
"usd_fx_rate": null,
"external_reference": null,
"reference": null,
"sub_account": null
}

If the payment intent has been archived or expired, you will instead receive the linked transaction object. A transaction response looks like:

{
"id": "3a703077-d0c2-4d44-a304-adbc37c84879",
"payment_intent_id": "cd33b10e-cb8a-48e5-a5d6-e2c0e659028e",
"amount": 11,
"currency": "GMD",
"source": "online",
"status": "completed",
"transaction_reference": "MP-20260217-131523-78C3C7D6",
"reference": "cos-232hn5spg8v48",
"payment_method": "wave",
"risk_score": {},
"payment_method_id": "d8ec7405-0485-47aa-b58e-ab6d173ba4ef",
"customer": null,
"customer_name": null,
"customer_phone": null,
"customer_email": null,
"payment_account": ".... 3716",
"metadata": {...},
"payment_metadata": {},
"type": "payment",
"custom_fields_values": {},
"payment_link_id": null,
"account_id": "34e12f5f-3ecc-4b5e-bfda-07a3c74763ae",
"business_id": "120c298f-b736-49c1-8220-8a8c84a5d8f3",
"test_mode": false,
"failure_reason": null,
"transaction_fee": 1,
"transaction_fee_type": "business",
"coupon": null,
"discount": null,
"sub_total": null,
"requires_auth": false,
"auth_length": 0,
"auth_mode": "confirm",
"_dnc": {},
"launch_url": "...",
"openExternal": true,
"notes": null,
"edited": false,
"paid_date": null,
"terminal_id": null,
"createdAt": "2026-02-17T13:15:23.636Z",
"updatedAt": "2026-02-17T13:15:49.151Z",
"PaymentGateway": {...},
"Business": {...}
}
  • These fields are illustrative; your response will include all available data for either the payment intent or the transaction, depending on which is returned.

Error Handling

If neither a payment intent nor a linked transaction is found, you'll receive a standard error response:

{
"message": "Transaction not found"
}

You may also receive other error messages if your request is invalid or your API key is missing/incorrect.

Notes

  • Always keep your API key secure and do not share it publicly.
  • Refer to the Errors documentation for details on error formats and troubleshooting.

If you need to retrieve a list of payment intents or filter by criteria (e.g., date range, status), please contact support or refer to future API updates.