😎Vérifier un transfert

Il existe trois façons de connaître le statut d'un transfert :

  1. Confirmez que la référence de la transaction correspond à celle que vous avez générée.

  2. Vérifiez l'exactitude du statut de la transaction. Le statut de la transaction doit être success for successful payments. pour les transferts réussis. Pour en savoir plus sur les statuts de transaction, voir la section Statut de transaction.

  3. Vérifier que la devise du transfert correspond à la devise attendue.

  4. Assurez-vous que le montant payé est égal ou supérieur au montant prévu. Si le montant est supérieur, vous pouvez fournir au client la valeur correspondante et rembourser l'excédent.

Pour authentifier un paiement, utilisez le point de terminaison "vérifier la transaction", en spécifiant l'identifiant de la transaction dans l'URL. Vous pouvez obtenir l'id de la transaction à partir du champ data.id dans la réponse après la création de la transaction, ainsi que dans le contenu du Webhook pour toute transaction.

Demande

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

Paramètres

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

  • Method: GET

NomTypeExigéDescription

paymentId

String

Yes

L'id de l'opération de transfert à vérifier.

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:

{
  "success": true,
  "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.

  • 401 Unauthorized: This error is returned if you didn't provide a valid authorization token in your request.

  • 404 Not Found: This error is returned if the provided paymentId doesn't correspond to any transaction in the system.

  • 500 Internal Server Error: This error indicates an unexpected issue on the server while processing your request.

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 example

Veuillez remplacer payoutId par l'identifiant de la transaction de paiement et your_token par votre jeton d'autorisation valide dans les extraits de code ci-dessous.

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

Response example

You'll get a response that looks like this:

{
  "success": true,
  "message": "Payout transaction fetched successfully",
  "data": {
    "id": "abc123",
    "status": "success",
    "is_processed": true,
    "processed_at": "2023-05-21T12:00:00Z",
    "amount": 100.0,
    "currency": "USD",
    "amount_formatted": "$100.00",
    "description": "Purchase of goods",
    "return_url": "https://example.com/return",
    "environment": "production",
    "initiated_at": "2023-05-21T11:00:00Z",
    "checkout_url": "https://example.com/checkout",
    "payment_phone_number": "+1234567890",
    "app": {
      "id": "app1",
      "name": "Example App",
      "icon_url": "https://example.com/icon.png"
    },
    "customer": {
      "id": "cust1",
      "first_name": "John",
      "last_name": "Doe",
      "email": "john.doe@example.com",
      "phone": "+1234567890",
      "address": "123 Main St",
      "city": "Springfield",
      "state": "IL",
      "country_code": "US",
      "country": "United States",
      "zip_code": "62701",
      "environment": "production",
      "created_at": "2023-01-01T00:00:00Z",
      "updated_at": "2023-05-21T00:00:00Z"
    },
    "method": {
      "name": "Credit Card",
      "code": "cc",
      "icon_url": "https://example.com/cc.png",
      "environment": "production"
    },
    "gateway": {
      "name": "Stripe",
      "account_name": "Acme Corp",
      "code": "stripe",
      "icon_url": "https://example.com/stripe.png",
      "environment": "production"
    },
    "metadata": {
      "custom_field1": "custom_value1",
      "custom_field2": "custom_value2"
    },
  }
}

The transaction details are contained in the data object. For instance:

  • The status of the transaction is in data.status.

  • The details of the customer are in the data.customer field.

  • The data.amount field says how much the customer was charged.

  • Some fields will vary depending on the type of transaction or state of the transaction.

  • The data.method field contains the payment method used by the customer.

  • The data.gateway field contains the payment gateway used to process the transaction.

  • The data.metadata field contains any custom metadata you may have provided when creating the transaction.

  • The data.context field contains the context of the transaction.

  • The data.app field contains the app details.

Field NameDescription

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.

Last updated