π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
Parameters
Endpoint:
/v1/payments/{paymentId}/verify
Method:
GET
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:
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.
Response example
You'll get a response that looks like this:
The transaction details are contained in the data object. For instance:
id
: A unique identifier for the payment transaction.status
: The current status of the transaction (success
,pending
,failed
).is_processed
: A boolean value indicating whether the transaction has been mark as processed.processed_at
: A timestamp of when the transaction was processed.null
if not processed yet.amount
: The total amount of the transaction.currency
: An object containing details of the currency used for the transaction.amount_formatted
: A string representing the formatted amount of the transaction.description
: A brief description of the payment transaction.return_url
: The URL where the user will be redirected post-transaction.environment
: Indicates the environment where the transaction was processed (sandbox
orlive
).capture
: An object detailing specifics details about payment transaction (method
,gateway
,context
)initiated_at
: The timestamp when the transaction was initiated.metadata
: An object that stores additional information passed along with the transaction.app
: An object containing information about the application through which the transaction was made.
Transaction object
id
The public ID of the transaction.
status
The status of the transaction.
is_processed
Indicates whether the transaction is processed.
processed_at
The time when the transaction was processed.
amount
The amount involved in the transaction.
currency
The currency used in the transaction.
amount_formatted
The formatted amount involved in the transaction.
description
The description of the transaction.
return_url
The URL to return to after the transaction.
environment
The environment in which the transaction occurred.
initiated_at
The time when the transaction was initiated.
checkout_url
The URL to checkout the transaction.
payment_phone_number
The phone number associated with the payment method.
app
The app associated with the transaction.
customer
The customer associated with the transaction.
method
The payment method associated with the transaction.
gateway
The payment gateway associated with the transaction.
metadata
The metadata associated with the transaction.
context
The context associated with the transaction.
capture
Object:
identifier
A unique identifier for the payment capture.
rate
The exchange rate applied to the transaction, if any. Null if not applied.
rate_formatted
The formatted string of the applied exchange rate. Null if not applied.
correction_rate
Any correction to the initial rate that was applied. Null if not applied.
phone_number
The phone number associated with the payment method.
failure_message
A message detailing any failure that occurred during capture. Null if none.
failure_error_code
The error code associated with the failure, if any. Null if no error.
failure_error_type
The type of error encountered during capture, if any. Null if no error.
metadata
Additional metadata related to the capture process.
amount
The amount that was captured.
amount_formatted
The formatted amount that was captured according to the currency rules.
currency
A nested object detailing the currency used in the capture.
method
A nested object describing the payment method used for capture.
gateway
A nested object with details about the payment gateway used.
context
A nested object containing contextual details about the transaction.
Last updated