😎Transaction verification

After initiating a payment, you should confirm that the transaction was processed through Monero before crediting/debiting your customer in your application. This step ensures that the payment aligns with your expectations.

Here are some key points to verify during the payment confirmation:

  • Confirm the Transaction Reference: Ensure that the transaction reference matches the one you generated.

  • Check the Transaction Status: Verify the transaction status is marked as success for successful payments. For more information on transaction statuses, refer to the Transaction Status Section.

  • Verify the Currency: Confirm that the payment's currency matches the expected currency.

  • Ensure Correct Payment Amount: Check that the paid amount is equal to or greater than the anticipated amount. If the amount is higher, provide the customer with the corresponding value and refund the surplus.

To authenticate a payment, use the verify transaction endpoint. Specify the transaction ID in the URL. You can obtain the transaction ID from the data.id field in the response after creating a transaction, as well as from the webhook payload for any transaction.

Request

GET /v1/payments/{paymentId}/verify HTTP/1.1
Host: https://api.moneroo.io
Authorization: Bearer YOUR_SECRET_KEY
Content-Type: application/json
Accept: application/json

Parameters

  • Endpoint: /v1/payments/{paymentId}/verify

  • Method: GET

NameTypeRequiredDescription

paymentId

String

Yes

The unique ID of the payment transaction to verify.

Response Structure

The response from this API endpoint will be in the standard Moneroo API response format. You'll get a response that looks like this:

{
  "message": "Payment transaction fetched successfully",
  "data": {
    // Details of the payment transaction
  }
}

Successful Response:

Upon successful retrieval, the endpoint returns a HTTP status code of 200, and the details of the payment transaction in the response body.

Error Responses:

If there's an issue with your request, the API will return an error response. The type of error response depends on the nature of the issue. Check out our response format page for more information.

Security considerations

This endpoint requires a bearer token for authentication. The bearer token must be included in the Authorization header of the request. Ensure the token is kept secure and not shared or exposed inappropriately.

Request examples

Please replace 'paymentId' with the actual payment transaction ID and 'your_token' with your valid authorization token in the code snippets above.

curl --location --request GET 'https://api.moneroo.io/v1/payments/{paymentId}/verify' \
--header 'Authorization: Bearer YOUR_TOKEN'

Response example

You'll get a response that looks like this:

{
    "message": "Payment transaction fetched successfully!",
    "data": {
        "id": "k4su1ii7abdz",
        "status": "success",
        "is_processed": false,
        "processed_at": null,
        "amount": 200,
        "amount_formatted": "XOF 200",
        "currency": {
            "name": "CFA Franc BCEAO",
            "symbol": "XOF",
            "symbol_first": false,
            "decimals": 0,
            "decimal_mark": ",",
            "thousands_separator": ".",
            "subunit": "Centime",
            "subunit_to_unit": 100,
            "symbol_native": "XOF",
            "decimal_digits": 0,
            "rounding": 0,
            "code": "XOF",
            "name_plural": "CFA francs BCEAO",
            "icon_url": "https://assets.cdn.moneroo.io/currencies/XOF.svg"
        },
        "description": "Payment for order #124",
        "return_url": "https://axaship.com?paymentId=k4su1ii7abdz&paymentStatus=success",
        "environment": "sandbox",
        "initiated_at": "2024-01-31T14:46:13.000000Z",
        "metadata": {
            "order_id": "124",
            "customer_id": "124"
        },
        "app": {
            "id": "01HHJYSA4VCBVK135N4KTYF76J",
            "name": "Smarthome",
            "website_url": "https://www.smarthome.com",
            "icon_url": "https://assets.cdn.moneroo.io/samples/business.svg",
            "created_at": "2023-12-14T01:24:17.000000Z",
            "updated_at": "2023-12-14T01:24:17.000000Z",
            "is_enabled": false
        },
        "customer": {
            "id": "tzowl42roc7z",
            "first_name": "John",
            "last_name": "Doe",