Skip to main content
POST
Cancel a PaymentIntent

Authorizations

x-auth-token
string
header
required

The API token for login provided by UQPAY.

Headers

x-on-behalf-of
string

Specifies the sub-account on whose behalf the request is made. This should be set to the account_id, which can be retrieved via the List Connected Accounts. If omitted or empty, the request is executed using the master account. More information at Connected Accounts.

x-idempotency-key
string<uuid>
required

A unique identifier (UUID) used to maintain operation idempotency, ensuring that repeated executions of the same operation do not result in unintended effects or duplication. It helps preserve data consistency in the face of network errors, retries, or failures.

x-client-id
string
required

The API client id generated by UQPAY

Path Parameters

id
string
required

The unique ID of a payment intent.

Example:

"PI1925112193204883441"

Body

application/json
cancellation_reason
string

Reason for canceling this PaymentIntent. Possible values are: duplicate, fraudulent, requested_by_customer, or abandoned

Example:

"abandoned"

Response

200 - application/json

Payment intent cancelled successfully

payment_intent_id
string
required

Unique identifier for the PaymentIntent

Maximum string length: 36
Example:

"b1c2d3e4-f5a6-b7c8-d9e0-f1a2b3c4d5e6"

amount
string
required

Payment amount. This is the order amount you would like to charge your customer.

Example:

"10.12"

currency
string
required

Three-letter currency code

Example:

"SGD"

intent_status
enum<string>
required

Status of this PaymentIntent.

  • REQUIRES_PAYMENT_METHOD: The PaymentIntent is waiting for the confirm request.
  • REQUIRES_CUSTOMER_ACTION: The PaymentIntent is waiting for further customer action of authentication, e.g. 3DS verification and QR code scan. Please check the next_action.
  • REQUIRES_CAPTURE: The PaymentIntent is waiting for your capture to complete the payment.
  • PENDING: The PaymentIntent is pending the final result from the provider. No further action is required.
  • SUCCEEDED: The PaymentIntent has succeeded. The payment is complete.
  • CANCELLED: The PaymentIntent has been canceled by your request. The payment is closed.
  • FAILED: The PaymentIntent has failed.
  • PARTIALLY_CAPTURED: A partially captured authorization has an outstanding balance; do not submit another capture.
  • EXPIRED: The pre-authorization expired and was released.
Available options:
PARTIALLY_CAPTURED,
EXPIRED,
REQUIRES_PAYMENT_METHOD,
REQUIRES_CUSTOMER_ACTION,
REQUIRES_CAPTURE,
PENDING,
SUCCEEDED,
CANCELLED,
FAILED
Example:

"SUCCEEDED"

current_funds_action
object

Refund or authorization-release details, when available in Retrieve or List PaymentIntents.

capture_records
object[]

Capture records returned by Retrieve and List PaymentIntents.

authorization_type
enum<string>

Authorization mode for this payment.

Available options:
authorization,
pre_authorization
authorization_expires_at
string<date-time> | null

Pre-authorization expiry. Null when no expiry is recorded. Use the returned time rather than a fixed holding period.

available_to_capture
string

Remaining pre-authorized amount available for capture. A final capture consumes the available authorization; inspect capture_records for channel processing results.

available_to_void
string

Remaining pre-authorized amount, equal to available_to_capture. A positive value alone does not mean cancellation is permitted.

description
string

Descriptor while creating a PaymentIntent.

Maximum string length: 255
available_payment_method_types
string[] | null

Available payment method types for this PaymentIntent.

captured_amount
string

Aggregate capture amount recorded on the PaymentIntent. Capture acceptance can update this value before channel completion; check capture_records for processing results.

Example:

"10.12"

customer
object

Snapshot of the customer associated with this PaymentIntent. Returned when customer or customer_id was supplied at creation time. The customer's unique identifier is exposed at the top level as customer_id; the id field is not included inside this object.

customer_id
string

ID of the customer associated with this PaymentIntent. Empty for guest checkout.

Maximum string length: 36
Example:

"cus_asyknf3wlfxhs1s6plamk80i8v"

cancel_time

Cancellation timestamp; an empty string when no cancellation time is recorded.

cancellation_reason
string

Reason for canceling this PaymentIntent.

Example:

"Order cancelled"

client_secret
string

PaymentIntent's client secret for browser or app. Returned by PaymentIntent create API or PaymentIntent retrieve API. The provided client_secret is valid for 60 minutes.

Example:

"eyJhbGciOiJI***********ujNdZ1DF9CqWEfF1jphxI"

merchant_order_id
string

The merchant reference id created in merchant's system that corresponds to this PaymentIntent

Maximum string length: 36
Example:

"1bf70d90-9ed0-48ce-9370-9bd7ef6ab9ee"

metadata
object | null

Metadata associated with the payment. Returns null when no metadata is set.

next_action
object | null

Null when no next action is available; otherwise follow the returned action instructions.

return_url
string

The web page URL or application scheme URI to redirect the customer after payment authentication.

Example:

"https://127.0.0.1:8080/api/v1/callback"

create_time
string<date/time>

Time at which this PaymentIntent was created.

Example:

"2024-03-01T00:00:00+08:00"

complete_time

Completion timestamp; an empty string when no completion time is recorded.

update_time
string<date/time>

Last time at which this PaymentIntent was updated or operated on.

Example:

"2024-03-01T00:00:00+08:00"

latest_payment_attempt
Latest payment attempt · object

Latest PaymentAttempt; null when no payment attempt is available.