Skip to content

Get payment by ID

Request

Retrieve a single payment by its unique ID. Only Bearer token authentication is required — this endpoint is not signed.

Read the status from the body, not the HTTP code. A payment that exists always returns 200, whether it succeeded or failed. The outcome is in result.paymentStatus; treating 200 as success will mark declined payments as paid. (404 means no payment with that id.)

The payment is wrapped in a result object.

Which id to use

FieldMeaning
{id} / result.idThe payment's internal UID — the value this endpoint is keyed on
result.referenceYour own merchant-side id, e.g. TXN-…

Fields that depend on status

FieldPresent when
errorMessageFAILED (not guaranteed — see below)
settled_crypto_amountCOMPLETED
crypto_tx_hashCOMPLETED
destination_walletCOMPLETED

Reading a decline

On FAILED, errorMessage carries the reason relayed from the payment processor. Numeric processor codes are translated to human-readable text before storage — for example 4004 becomes an insufficient-balance message, 4001 a CVV error, and 4018 "Payment was canceled by the user". Reasons that arrive without a code pass through verbatim, such as "Payment not funded", which means the order was created but never funded.

errorMessage is not guaranteed on every failure. Do not branch on its presence: the reliable "funds were not delivered" signal is paymentStatus: FAILED together with no crypto_tx_hash. Treat errorMessage as a human-readable explanation, not as a machine-readable status.

Field names and types

Two things here are deliberate, not typos — match them exactly:

  • Casing is mixed. camelCase for paymentStatus, paymentType, paymentMethod, cryptoAmount, cryptoCurrency, errorMessage and billingAddress; snake_case for crypto_fx, settled_crypto_amount, crypto_tx_hash and destination_wallet (and timezone_type inside created).
  • The two crypto amounts have different types. cryptoAmount is a string ("53.36000000") while settled_crypto_amount is a number (53.35). Parse each accordingly rather than assuming one shape.
Security
Bearer
Path
idstringrequired

Unique payment identifier (UUID)

curl -i -X GET \
  'https://api.napoleonpay.com/api/v1/payments/{id}' \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>'

Responses

Payment retrieved successfully

Bodyapplication/json
resultobject(Payment status)
Response
{ "result": { "id": "0199aaaa-bbbb-7ccc-dddd-eeeeffff0001", "paymentStatus": "FAILED", "created": { … }, "paymentType": "DEPOSIT", "description": "Deposit TXN-SAMPLE0000000000000001", "paymentMethod": "USER_CHOICE", "reference": "TXN-SAMPLE0000000000000001", "amount": 57.3, "cryptoAmount": "53.36000000", "cryptoCurrency": "USDC", "currency": "USD", "customer": { … }, "billingAddress": { … }, "errorMessage": "Payment not funded", "crypto_fx": 1.07383808 } }