Skip to content

Retrieve a payment intent

GET
/v1/payment_intents/{id}
curl --request GET \
--url https://api.example.com/v1/payment_intents/example \
--header 'Authorization: Bearer <token>'
id
required
string

The object’s id.

The intent.

Media typeapplication/json
object
id
required
string
object
required
string
Allowed value: payment_intent
amount
required

In the currency’s minor unit.

integer
amount_received
required

The amount paid: amount once succeeded, and 0 until then.

integer
currency
required

A three-letter ISO 4217 code, in lower case.

string
/^[a-z]{3}$/
payment_method_types
required

The chosen method, such as [qrph], once there is one. Until then, the methods that can take this payment now: confirm with one. In an event for an intent with no method, the methods you allowed at creation, or null if you allowed any.

Array<string> | null
channel
required

Where the payment is taken: ecommerce for every intent your server creates. Payments taken on terminals will say pos (Pending).

string
status
required
string
Allowed values: requires_payment_method requires_confirmation requires_action processing succeeded canceled
next_action
required
One of:
object
type
required
string
Allowed value: qrph_display_qr_code
qrph_display_qr_code
required
object
data
required

The QR payload. Render it as a QR code for the customer to scan with their banking app.

string
expires_at
required

When the code stops being payable, as a Unix timestamp.

integer | null
last_payment_error
required
One of:
object
code
required

card_declined: the card was declined. expired_card: the card has expired (test mode only today). payment_intent_authentication_failure: the customer did not complete the card’s authentication. payment_intent_payment_attempt_failed: the attempt failed, or the customer left without paying. payment_intent_payment_attempt_expired: the customer did not pay in time.

string
Allowed values: card_declined expired_card payment_intent_authentication_failure payment_intent_payment_attempt_failed payment_intent_payment_attempt_expired
decline_code

Why the card was declined, when the decline names a reason. Test mode only today: it appears when you simulate a decline with a decline_reason (see Simulate a payment’s outcome), and a live decline does not carry it yet, so never depend on it there.

string
Allowed values: insufficient_funds do_not_honor expired_card
message
required

Words you can show the customer. May be reworded, so never branch on it.

string
cancellation_reason
required

The reason given when it was canceled, if any.

string | null
Allowed values: requested_by_customer duplicate fraudulent abandoned
canceled_at
required

When it was canceled, as a Unix timestamp.

integer | null
description
required
string | null
metadata
required

The metadata you gave it. {} if none.

object
key
additional properties
string
livemode
required
boolean
created
required

When it was created, as a Unix timestamp.

integer
Example
{
"id": "pi_01j9x2m8k4q7r5t3v6w8y0z2a4",
"object": "payment_intent",
"currency": "php",
"payment_method_types": [
"card",
"qrph"
],
"channel": "ecommerce",
"status": "requires_payment_method",
"next_action": {
"type": "qrph_display_qr_code"
},
"last_payment_error": {
"code": "card_declined",
"decline_code": "insufficient_funds"
},
"cancellation_reason": "requested_by_customer",
"created": 1790411400
}
X-Request-ID
string

This request’s id. Quote it when you contact support.

authentication_failure: access_token_required when no token was sent, invalid_access_token when it is not valid, has expired, or is a client secret. Sent with a WWW-Authenticate: Bearer header, which adds error="invalid_token" when a token was sent.

Media typeapplication/json
object
error
required
object
type
required
string
Allowed values: validation_failure authentication_failure authorization_failure not_found conflict timeout_or_in_progress policy_rejection invariant_violation rate_limited dependency_failure
code
required

A stable name for this refusal. Branch on this, never on message.

string
message
required

For the developer reading a log. May be reworded.

string
param
required

The field or parameter at fault, when there is one.

string | null
request_id
required
string | null
Example
{
"error": {
"type": "validation_failure"
}
}

authorization_failure with merchant_mismatch: a Merchant-Id header, query parameter or body field names a merchant or tenant other than the key’s.

Media typeapplication/json
object
error
required
object
type
required
string
Allowed values: validation_failure authentication_failure authorization_failure not_found conflict timeout_or_in_progress policy_rejection invariant_violation rate_limited dependency_failure
code
required

A stable name for this refusal. Branch on this, never on message.

string
message
required

For the developer reading a log. May be reworded.

string
param
required

The field or parameter at fault, when there is one.

string | null
request_id
required
string | null
Example
{
"error": {
"type": "validation_failure"
}
}

not_found: resource_missing for an id this key cannot see, route_missing for a path that does not exist.

Media typeapplication/json
object
error
required
object
type
required
string
Allowed values: validation_failure authentication_failure authorization_failure not_found conflict timeout_or_in_progress policy_rejection invariant_violation rate_limited dependency_failure
code
required

A stable name for this refusal. Branch on this, never on message.

string
message
required

For the developer reading a log. May be reworded.

string
param
required

The field or parameter at fault, when there is one.

string | null
request_id
required
string | null
Example
{
"error": {
"type": "validation_failure"
}
}

dependency_failure with service_unavailable: something on our side, or a payment network behind it, did not answer. This call only reads, so nothing was changed; retry.

Media typeapplication/json
object
error
required
object
type
required
string
Allowed values: validation_failure authentication_failure authorization_failure not_found conflict timeout_or_in_progress policy_rejection invariant_violation rate_limited dependency_failure
code
required

A stable name for this refusal. Branch on this, never on message.

string
message
required

For the developer reading a log. May be reworded.

string
param
required

The field or parameter at fault, when there is one.

string | null
request_id
required
string | null
Example
{
"error": {
"type": "validation_failure"
}
}