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 to retrieve a payment
Section titled “When to retrieve a payment”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.
Payment key
Section titled “Payment key”To retrieve a payment, use the unique key returned when the payment was created.
For example:
pi-01j1ps8zf4jgnk0c3dnd477sp1Store this key with the corresponding order or payment in your system when you create the payment.
Request
Section titled “Request”Send the payment key as part of the request URL.
Use the payment state
Section titled “Use the payment state”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.
Payment Account Reference (PAR)
Section titled “Payment Account Reference (PAR)”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" }}Next step
Section titled “Next step”If your application displays payment methods before creating the payment, retrieve the payment methods available for your merchant.
Retrieve the payment methods available for your merchant and use them when creating a payment.

