Skip to content

Retrieve a payment

Retrieve the latest state and details of an ICEPAY payment.

Retrieve a payment when your application needs to explicitly check its current state.

A common use case is when the customer returns to your application after completing or cancelling the payment flow.

When the customer returns to your redirectUrl, you can retrieve the payment once to confirm its current state before showing the appropriate result to the customer.

For example, you can use the response to decide whether to show:

  • a payment confirmation;
  • a pending payment message;
  • an expired or cancelled payment message.

To retrieve a payment, use the unique key returned when the payment was created.

For example:

pi-01j1ps8zf4jgnk0c3dnd477sp1

Store this key with the corresponding order or payment in your system when you create the payment.

Send the payment key as part of the request URL.

The response contains the latest information available for the payment, including its status and financialStatus.

Use the payment state to determine what should happen in your application, but keep the state stored in your system synchronised through webhooks.

For a detailed explanation of the available states, see the Payment lifecycle.

The paymentMethod.paymentAccountReference field contains the Payment Account Reference (PAR).

For example, a completed card payment contains the following response excerpt:

{
"status": "completed",
"paymentMethod": {
"type": "card",
"paymentAccountReference": "WCJ205PL1SMPX85WGKNBY89HNZ38J"
}
}

If your application displays payment methods before creating the payment, retrieve the payment methods available for your merchant.


Payment methods

Retrieve the payment methods available for your merchant and use them when creating a payment.