> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.transxact.io/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.transxact.io/_mcp/server.

# List Checkout Sessions

GET https://api.transxact.io/v1/checkout-sessions

Lists your Checkout Sessions in the key's mode, newest first, so you can reconcile payments without having kept every id. Narrow it with `status` and a `from`/`to` created range. To page, pass the `nextCursor` you got as `cursor` until it is null.

Reference: https://docs.transxact.io/api-reference/checkout-sessions/list

## Authentication

- `Authorization` header (bearer token, required) — Your secret key: sk_test_... in Test mode, sk_live_... in Live mode.

## Request

### Query parameters

- `limit` (string, optional) — 1 to 100; defaults to 10.
- `cursor` (string, optional) — The `nextCursor` from the previous page; returns the sessions older than it. Opaque: don't build or change one.
- `status` (string, optional) — Only sessions with this status: one of `pending`, `succeeded`, `failed` or `cancelled`.
- `from` (string, optional) — Only sessions created at or after this Unix ms timestamp.
- `to` (string, optional) — Only sessions created at or before this Unix ms timestamp.

## Response

### 200

A page of Checkout Sessions.

- `data` (list of CheckoutSession, required) — This page of Checkout Sessions, newest first.
- `nextCursor` (string, required, nullable) — Pass as `cursor` to get the next page; null on the last page.

## Errors

### 400 Bad Request Error

Invalid `cursor`, `status`, `from` or `to` (`invalid_request`).

- `error` (ErrorError, required) — Branch on `code`; `message` is for logs.

### 401 Unauthorized Error

Invalid or missing API key.

- `error` (ErrorError, required) — Branch on `code`; `message` is for logs.

## Types

### CheckoutSession

- `id` (string, required) — Checkout Session identifier.
- `status` (enum, required) — `pending` until the Customer pays or the session ends. `succeeded`: paid, safe to fulfil. `failed`: the payment was declined or didn't go through. `cancelled`: you cancelled it or it expired unpaid. Only `pending` ever changes, and each change sends the matching `checkout_session.*` webhook.
  - Allowed values: `pending`, `succeeded`, `failed`, `cancelled`
- `mode` (enum, required) — `test` for a session made with an `sk_test_` key, `live` for an `sk_live_` key. Webhook endpoints each hear one mode, and the payload says which it came from.
  - Allowed values: `test`, `live`
- `amount` (integer, required) — Amount to charge, in FJD cents (minor units).
- `currency` (enum, required) — Always FJD in v1.
  - Allowed values: `FJD`
- `hostedUrl` (string, required) — Transxact-hosted URL to redirect the Customer to.
- `metadata` (map from string to string, required) — Your own key/value data from creation; empty object if none was set.
- `expiresAt` (integer, required) — Unix ms timestamp after which no payment can start; a still-pending session is then cancelled.
- `invoiceNumber` (string, optional) — The Invoice number, such as `INV-0007`, when the session pays one of your Invoices; absent otherwise. Also in the webhook payload.
- `quote` (CheckoutSessionQuote, optional) — Present when you created the session with a `quote`: the USD or AUD price you sent, the FJD rate it was converted at (a decimal string), and the Unix ms time the rate was taken. `amount` is the FJD that is charged. Never shown to the Customer.

### ErrorError

Branch on `code`; `message` is for logs.

- `code` (string, required) — Stable machine-readable error code.
- `message` (string, required) — Human-readable detail, not contractual.

### CheckoutSessionQuote

Present when you created the session with a `quote`: the USD or AUD price you sent, the FJD rate it was converted at (a decimal string), and the Unix ms time the rate was taken. `amount` is the FJD that is charged. Never shown to the Customer.

- `amount` (integer, required) — The price you sent, in cents of `currency`.
- `currency` (enum, required) — USD or AUD.
  - Allowed values: `USD`, `AUD`
- `rate` (string, required) — FJD per 1 unit of `currency`, a decimal string.
- `asOf` (integer, required) — Unix ms time the rate was taken.

## Examples

**Response**

```json
{
  "data": [
    {
      "id": "cs_3f9c2b1a",
      "status": "pending",
      "mode": "test",
      "amount": 5000,
      "currency": "FJD",
      "hostedUrl": "https://transxact.io/c/cs_3f9c2b1a",
      "metadata": {
        "orderId": "9912"
      },
      "expiresAt": 1717086400000,
      "invoiceNumber": "string",
      "quote": {
        "amount": 1,
        "currency": "USD",
        "rate": "string",
        "asOf": 1
      }
    }
  ],
  "nextCursor": "1717086400000.cs_3f9c2b1a"
}
```

**SDK Code**

```python
import requests

url = "https://api.transxact.io/v1/checkout-sessions"

querystring = {"cursor":"1717086400000.cs_3f9c2b1a","from":"1717000000000","limit":"10","status":"succeeded","to":"1717086400000"}

headers = {"Authorization": "Bearer <token>"}

response = requests.get(url, headers=headers, params=querystring)

print(response.json())
```

```javascript
const url = 'https://api.transxact.io/v1/checkout-sessions?cursor=1717086400000.cs_3f9c2b1a&from=1717000000000&limit=10&status=succeeded&to=1717086400000';
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api.transxact.io/v1/checkout-sessions?cursor=1717086400000.cs_3f9c2b1a&from=1717000000000&limit=10&status=succeeded&to=1717086400000"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("Authorization", "Bearer <token>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://api.transxact.io/v1/checkout-sessions?cursor=1717086400000.cs_3f9c2b1a&from=1717000000000&limit=10&status=succeeded&to=1717086400000")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://api.transxact.io/v1/checkout-sessions?cursor=1717086400000.cs_3f9c2b1a&from=1717000000000&limit=10&status=succeeded&to=1717086400000")
  .header("Authorization", "Bearer <token>")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api.transxact.io/v1/checkout-sessions?cursor=1717086400000.cs_3f9c2b1a&from=1717000000000&limit=10&status=succeeded&to=1717086400000', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://api.transxact.io/v1/checkout-sessions?cursor=1717086400000.cs_3f9c2b1a&from=1717000000000&limit=10&status=succeeded&to=1717086400000");
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "Bearer <token>");
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = ["Authorization": "Bearer <token>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.transxact.io/v1/checkout-sessions?cursor=1717086400000.cs_3f9c2b1a&from=1717000000000&limit=10&status=succeeded&to=1717086400000")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```