> For the complete Lynkow documentation index in agent-friendly format, see [llms.txt](/llms.txt).

# Refresh a storefront payment

**Published**: 2026-11-30
**Category**: Commerce

## `POST /payments/:id/refresh`

**Refresh a storefront payment**

Refreshes one booking deposit or order payment from the payment provider's current
state, for example when the buyer returns from checkout. Returns the payment `status`,
with `bookingStatus` for a deposit or `orderStatus` for an order.

The caller must be the signed-in customer who owns the booking or order, or send the
payment capability issued with checkout in the `X-Lynkow-Payment-Capability` header.
A payment id alone is not enough. An unknown id or a missing or invalid capability
returns 403 `PAYMENT_CAPABILITY_REQUIRED`.

> **Note:** Available only on sites with e-commerce enabled.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `id` | path | string | Yes | Unique identifier |


### Responses

| Status | Description |
| --- | --- |
| `200` | Successful response |
| `401` | Missing or invalid storefront publishable key |
| `402` | The site subscription does not currently permit this operation |
| `403` | `STOREFRONT_KEY_ORIGIN_NOT_ALLOWED`: the storefront key origin is not allowed. `PAYMENT_CAPABILITY_REQUIRED`: no owning customer session or valid payment capability, or an unknown payment id |
| `404` | Not found |


### SDK

```typescript
import { createClient } from 'lynkow'

const lynkow = createClient({
  siteId: process.env.LYNKOW_SITE_ID!,
  publishableKey: process.env.LYNKOW_PK,
})

const order = await lynkow.checkout.placeOrder({ email, paymentMethod: 'card', acceptsTerms: true })
// Keep paymentId and captureToken privately for the hosted-checkout return page.
if (order.payment) {
  const result = await lynkow.checkout.refreshPayment(
    order.payment.paymentId,
    order.payment.captureToken,
  )
  if (result.status === 'captured') showConfirmation(order.id)
}
```

```typescript
import { createClient } from 'lynkow'

const lynkow = createClient({
  siteId: process.env.LYNKOW_SITE_ID!,
  publishableKey: process.env.LYNKOW_PK,
})

const result = await lynkow.reservations.book('chef-table', {
  startsAt: '2026-07-10T18:00:00.000Z',
  partySize: 2,
  guestName: 'Alice Martin',
  guestEmail: 'alice@example.com',
  acceptsTerms: true,
})
if (!result.deposit) return

const refreshed = await lynkow.reservations.refreshPayment(
  result.deposit.paymentId,
  result.deposit.captureToken,
)
if (refreshed.bookingStatus === 'confirmed') {
  showConfirmation()
}
```

---