> For the complete documentation index, see [llms.txt](https://pingpay.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://pingpay.gitbook.io/docs/pingpay-api/hosted-checkout/retrieve-checkout.md).

# Retrieve Checkout

This page explains how to retrieve Ping checkout sessions you have created.

***

## **Retrieve Checkout Session**

The `GET /checkout/sessions/{sessionId}` endpoint retrieves the current state of an existing checkout session.&#x20;

This endpoint is typically used to:

* Confirm the final status of a checkout after redirect
* Poll for updates on a pending session
* Display checkout details in an application

Retrieving a checkout session does not execute or modify a payment. It only returns the current session state.

***

### **Endpoint**

```shellscript
GET /checkout/sessions/{sessionId}
```

***

### **Headers**

```http
x-publishable-key: pk_test_123456
```

***

### **Path Parameter**

| Name        | Type   | Required | Description                           |
| ----------- | ------ | -------- | ------------------------------------- |
| `sessionID` | string | Yes      | The unique ID of the checkout session |

Example:

```shellscript
GET /checkout/sessions/cs_123
```

***

### **Response**

A successful response returns the checkout session object.

```json
{
  "session": {
    "sessionId": "cs_123",
    "status": "PENDING",
    "paymentId": "pay_456",
    "amount": {
      "assetId": "nep141:wrap.near",
      "amount": "1000000000000000000000000"
    },
    "recipient": {
      "address": "example.near",
      "chainId": "near-mainnet"
    },
    "createdAt": "2025-01-01T00:00:00.000Z",
    "expiresAt": "2025-01-01T00:15:00.000Z",
    "sessionUrl": "https://checkout.pingpay.io/session/cs_123"
  }
}
```

#### **Key fields**

* `status` — current state of the checkout session; may be one of:\
  `CREATED`, `PENDING`, `COMPLETED`, `EXPIRED`, `CANCELLED`
* `paymentId` — Identifier of the resulting payment, if one has been created
* `expiresAt` — Optional expiration timestamp for the session
* `sessionUrl` — Redirect URL for the hosted checkout (if still active)

***

#### **Notes:**

* This endpoint is **read-only**
* A `COMPLETED` status indicates the checkout flow finished successfully
* A `COMPLETED` checkout may be associated with a `paymentId`
* Use the Payments API to retrieve or track the payment itself, if required

***

### **Error Response Example**

```json
{
  "code": "NOT_FOUND",
  "message": "Checkout session not found."
}
```
