---
title: "Retrieve a hosted-checkout session"
description: "The session's outcome and the options it was minted with."
canonical_url: "https://twominutebilling.com/help/developers/api-reference/subscriptions/retrieve-a-hosted-checkout-session"
---
# Retrieve a hosted-checkout session

> The session's outcome and the options it was minted with.

<api-operation method="GET" path="/v1/businesses/{biz}/checkout_sessions/{id}">
<template v-slot:docs="">

`status` is open, completing or completed, or revoked / expired when either applies. `resulting_subscription` is set once it completes. `customer_prefill` / `billing_address_prefill` appear when the session was minted with prefill. The token is never returned: it is not stored.

## Path parameters

<table>
<thead>
  <tr>
    <th>
      Parameter
    </th>
    
    <th>
      Type
    </th>
    
    <th>
      Required
    </th>
    
    <th>
      Description
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        biz
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      <strong>
        yes
      </strong>
    </td>
    
    <td>
      Business id (biz_…)
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        id
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      <strong>
        yes
      </strong>
    </td>
    
    <td>
      cosess_… checkout session public id
    </td>
  </tr>
</tbody>
</table>

## Response

<table>
<thead>
  <tr>
    <th>
      Field
    </th>
    
    <th>
      Type
    </th>
    
    <th>
      Description
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        object
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      The object type; always <code>
        checkout_session
      </code>
      
      . One of <code>
        checkout_session
      </code>
      
      .
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        id
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      The checkout session id.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        mode
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      What the session does. One of <code>
        create
      </code>
      
      , <code>
        change
      </code>
      
      , <code>
        purchase
      </code>
      
      .
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        status
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      The session state. One of <code>
        open
      </code>
      
      , <code>
        completing
      </code>
      
      , <code>
        completed
      </code>
      
      , <code>
        revoked
      </code>
      
      , <code>
        expired
      </code>
      
      .
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        subscription
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      The subscription that the session changes.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        resulting_subscription
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      The subscription that the session created or changed.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        resulting_invoice
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      The invoice that a <code>
        purchase
      </code>
      
       session raised.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        customer
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      The customer that the session created or used.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        items
      </code>
    </td>
    
    <td>
      <code>
        array of object
      </code>
    </td>
    
    <td>
      The items in the session.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        coupons
      </code>
    </td>
    
    <td>
      <code>
        array of string
      </code>
    </td>
    
    <td>
      The coupon codes applied.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        replace_items_list
      </code>
    </td>
    
    <td>
      <code>
        boolean
      </code>
    </td>
    
    <td>
      True if the items list replaces the subscription's items.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        replace_coupon_list
      </code>
    </td>
    
    <td>
      <code>
        boolean
      </code>
    </td>
    
    <td>
      True if the coupons replace the subscription's coupons.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        reset_term
      </code>
    </td>
    
    <td>
      <code>
        boolean
      </code>
    </td>
    
    <td>
      True if the change starts a new term.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        reactivate
      </code>
    </td>
    
    <td>
      <code>
        boolean
      </code>
    </td>
    
    <td>
      True if the session reactivates a cancelled subscription.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        reactivate_from
      </code>
    </td>
    
    <td>
      <code>
        string · ISO-8601
      </code>
    </td>
    
    <td>
      When reactivation starts.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        redirect_url
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      Where checkout sends the buyer after payment.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        cancel_url
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      Where checkout sends the buyer who leaves.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        pass_thru_content
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      Text that comes back to you unchanged when the session finishes.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        metadata
      </code>
    </td>
    
    <td>
      <code>
        object
      </code>
    </td>
    
    <td>
      Your key-value data.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        customer_prefill
      </code>
    </td>
    
    <td>
      <code>
        object
      </code>
    </td>
    
    <td>
      The customer fields that the session pre-fills.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        billing_address_prefill
      </code>
    </td>
    
    <td>
      <code>
        object
      </code>
    </td>
    
    <td>
      The billing address fields that the session pre-fills.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        created_at
      </code>
    </td>
    
    <td>
      <code>
        string · ISO-8601
      </code>
    </td>
    
    <td>
      When the session was created.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        expires_at
      </code>
    </td>
    
    <td>
      <code>
        string · ISO-8601
      </code>
    </td>
    
    <td>
      When the session stops working.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        completed_at
      </code>
    </td>
    
    <td>
      <code>
        string · ISO-8601
      </code>
    </td>
    
    <td>
      When the buyer finished checkout.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        revoked_at
      </code>
    </td>
    
    <td>
      <code>
        string · ISO-8601
      </code>
    </td>
    
    <td>
      When the session was revoked.
    </td>
  </tr>
</tbody>
</table>

## Status codes

<table>
<thead>
  <tr>
    <th>
      Status
    </th>
    
    <th>
      Meaning
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        200
      </code>
    </td>
    
    <td>
      Checkout session
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        404
      </code>
    </td>
    
    <td>
      No such checkout session
    </td>
  </tr>
</tbody>
</table>
</template>

<template v-slot:request="">

```bash [Request]
curl "$TMBILLING_URL/v1/businesses/biz_XXXXXXXXXXXX01/checkout_sessions/cosess_XXXXXXXXXXXX01" \
  -H "Authorization: Bearer $TMBILLING_API_KEY"
```

</template>

<template v-slot:response="">
<code-group>

```json [200 OK]
{
  "object": "checkout_session",
  "id": "cosess_XXXXXXXXXXXX01",
  "mode": "create",
  "status": "open",
  "subscription": "sub_XXXXXXXXXXXX01",
  "resulting_subscription": "sub_XXXXXXXXXXXX01",
  "resulting_invoice": "inv_XXXXXXXXXXXX01",
  "customer": "cus_XXXXXXXXXXXX01",
  "items": [
    {
      "price": "pro-monthly-usd",
      "quantity": 1
    }
  ],
  "coupons": [
    "welcome-10"
  ],
  "replace_items_list": false,
  "replace_coupon_list": false,
  "reset_term": false,
  "reactivate": false,
  "reactivate_from": "2026-03-14T09:30:00Z",
  "redirect_url": "https://app.example.com/welcome",
  "cancel_url": "https://app.example.com/pricing",
  "pass_thru_content": "ref=spring-campaign",
  "metadata": {
    "crm_id": "acct-1001"
  },
  "customer_prefill": {
    "email": "buyer@example.com",
    "tax_registration_number": "EU123456789"
  },
  "billing_address_prefill": {},
  "created_at": "2026-03-14T09:30:00Z",
  "expires_at": "2026-04-14T09:30:00Z",
  "completed_at": "2026-03-14T09:30:00Z",
  "revoked_at": "2026-03-14T09:30:00Z"
}
```

```json [404 Not Found]
{
  "error": {
    "type": "invalid_request_error",
    "message": "No such checkout session"
  }
}
```

</code-group>
</template>
</api-operation>


## Sitemap

See the full [sitemap](https://twominutebilling.com/sitemap.md) for all pages.
