📜  https: ravesandboxapi.flutterwave.com flwv3-pug getpaidx api v2 verify (1)

📅  最后修改于: 2023-12-03 14:42:00.930000             🧑  作者: Mango

Flutterwave RaveSandboxAPI: verify API

The Flutterwave RaveSandboxAPI Verify API is a payment verification endpoint that enables developers easily verify payment transactions made through the Flutterwave payment gateway.


Endpoint URL

The API endpoint URL is https://ravesandboxapi.flutterwave.com/flwv3-pug/getpaidx/api/v2/verify


HTTP Request Method

This API endpoint accepts HTTP POST requests only.


Request Parameters

The following request parameters are required:

  • SECKEY: This is your merchant secret key. It is required for authorization and authentication purposes.
  • txref: This is the Flutterwave transaction reference ID for the payment transaction which you want to verify.

Example request payload:

{
    "SECKEY": "FLWSECK_TEST-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx-X",
    "txref": "your-transaction-ref-id"
}

Response

Successful API requests will return the same payload as the initial transaction that was made. The only difference is that the status parameter will be set to successful and the chargeResponseCode parameter will be set to 00.

Example response payload:

{
    "status": "success",
    "message": "Tx Fetched",
    "data": {
        "id": 549,
        "txRef": "test-transaction-12345",
        "flwRef": "FLW-MOCK-597d35740b59e78915e5da6b5e6d11e6",
        "device_fingerprint": "69e6b7f0b72037aa8428b70fbe03986c",
        "amount": 100,
        "currency": "NGN",
        "charged_amount": 100,
        "appFee": 0,
        "merchantFee": 0,
        "processorResponse": "Approved by Financial Institution",
        "authModelUsed": "DIRECT",
        "paymentType": "card",
        "card": {
            "cardBIN": "543889",
            "last4digits": "3273",
            "brand": "MASTERCARD",
            "issuerCountry": "UNITED STATES",
            "issuerName": "BANK OF AMERICA, N.A."
        },
        "customer": {
            "id": 126950,
            "name": "customer-name",
            "email": "customer-email@example.com",
            "phone": "08098765432",
            "createdAt": "2022-03-25T18:20:12.000Z",
            "updatedAt": "2022-03-25T18:20:12.000Z"
        },
        "status": "successful",
        "paymentPlan": null,
        "createdAt": "2022-03-25T18:20:15.000Z",
        "updatedAt": "2022-03-25T18:21:09.000Z",
        "deletedAt": null,
        "meta": null,
        "chargeResponseCode": "00",
        "chargeResponseMessage": "Approved by Financial Institution",
        "authorizeURL": null,
        "paymentId": null,
        "createdAtString": "2022-03-25 18:20",
        "updatedAtString": "2022-03-25 18:21"
    }
}

Errors

When there is an error, the response body will contain an error property with the error message. Some of the possible error responses include:

  • Invalid SECKEY``: This error occurs when the merchant secret key is invalid or incorrect.
  • Invalid charge reference: This error occurs when the specified txref does not exist or is invalid.
  • Service Unavailable: This error occurs when there is a problem with the Flutterwave API server or endpoint.
  • Insufficient Permission: This error occurs when the merchant does not have sufficient permissions to make use of the API endpoint.

Example error response payload:

{
  "status": "error",
  "message": "We could not verify this transaction. Please try again or contact support."
}

Conclusion

With the Flutterwave RaveSandboxAPI Verify API, you can easily verify your transactions and ensure that your customers get a flawless payment experience.