---
name: x402-payments
description: Pay PeptidesDirect with USDC on Base via the x402 protocol: buy the machine-readable catalogue feed or settle a pending order.
---

## Overview

PeptidesDirect accepts on-chain payment for select machine-readable endpoints using the
x402 protocol (v2): an agent makes a normal HTTP request and gets back `402 Payment Required`
whose challenge sits base64-encoded in the `PAYMENT-REQUIRED` response header (x402 v2 carries
the challenge in that header, not in the response body). The agent signs a payment and retries
the same request with the base64-encoded payment payload in a `PAYMENT-SIGNATURE` request
header. On success the response carries a `PAYMENT-RESPONSE` header, the base64-encoded
settlement receipt.

- **Network:** `eip155:8453` (Base mainnet)
- **Asset:** USDC, contract `0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913`
- **Scheme:** `exact`
- **payTo:** `0x5e4413F7EC69B67c07A60c4F1f75391370F79b13`

`PAYMENT-SIGNATURE` is the x402 v2 header name and the one every endpoint here understands.
The catalogue-feed routes additionally accept the older v1 name `X-PAYMENT` as an alias, the
order-payment endpoint does not, so always send `PAYMENT-SIGNATURE`.

The facilitator settles the USDC transfer directly to that wallet; PeptidesDirect does not
hold x402 payments in a separate custodial balance before settlement.

## Endpoints

All endpoints below live at `https://peptidesdirect.io/api/v1/...`, a same-domain proxy in
front of the API's `https://api.peptidesdirect.io/x402/...` routes, so an agent never has to
leave the brand domain to pay.

### GET https://peptidesdirect.io/api/v1

Alias: `GET https://peptidesdirect.io/api/v1/catalog/feed`.

Buys the full machine-readable catalogue feed (JSON: every active product, its variants,
EUR prices, live stock and lab reports, plus current shipping rates). Price: **0.01 USD**,
paid in USDC. An unpaid request answers `402` with the challenge in the `PAYMENT-REQUIRED`
header and an empty JSON body (`{}`).

### GET https://peptidesdirect.io/api/v1/orders/{trackingToken}/pay

Pays a pending order at its exact EUR total, converted to USD at the ECB reference rate at
quote time. The quote is valid for **15 minutes**; request the endpoint again after that to
get a fresh quote if payment was not completed in time. An unpaid request answers `402` with
the challenge in the `PAYMENT-REQUIRED` header and a JSON body naming the order number, the
EUR total and the USD/USDC quote.

`{trackingToken}` is the token from the order confirmation page or confirmation email:
`https://peptidesdirect.io/{locale}/track/{token}`.

Order payments may be disabled while this integration is being verified; while disabled, the
endpoint answers `503 Service Unavailable` instead of issuing a `402` challenge.

### GET https://peptidesdirect.io/api/v1/status

Health/status check for the x402 integration: reports whether x402 and order payments are
enabled, the network, the facilitator, the feed price in USD and a shortened preview of the
payTo address. No payment required.

## How to pay

- **Client libraries:** `@x402/fetch`'s `wrapFetchWithPayment` (2.23.0 or newer) drives the
  402-challenge/retry loop automatically once given a signer; `x402HTTPClient` from
  `@x402/core/http` is the lower-level equivalent.
- **Coinbase Agentic Wallets** and other x402-aware wallet SDKs work the same way.
- **A human** needs an x402-capable wallet or client too: the `PAYMENT-SIGNATURE` payload is a
  signed EIP-3009 transfer authorization that the facilitator settles, not a receipt of a
  normal transfer. Never send a plain USDC transfer to `payTo`: it cannot be matched to a
  request, the resource stays locked, and the transfer is irreversible.

### Example 402 challenge

The `PAYMENT-REQUIRED` header is base64-encoded JSON. Decoded, a feed challenge has this
shape (`amount` and the `extra` block are produced by the x402 SDK, so always read the values
from the live response rather than from this document):

```json
{
  "x402Version": 2,
  "error": "Payment required",
  "resource": {
    "url": "https://peptidesdirect.io/api/v1",
    "description": "PeptidesDirect full catalogue feed: every product with variants, EUR prices, live stock and lab reports (JSON)",
    "mimeType": "application/json"
  },
  "accepts": [
    {
      "scheme": "exact",
      "network": "eip155:8453",
      "amount": "10000",
      "asset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
      "payTo": "0x5e4413F7EC69B67c07A60c4F1f75391370F79b13",
      "maxTimeoutSeconds": 300,
      "extra": { "name": "USD Coin", "version": "2" }
    }
  ]
}
```

`amount` is in USDC base units (6 decimals): `10000` = 0.01 USDC.

## Refunds

x402 payments are irreversible on-chain USDC transfers; there is no automated refund path.
If a refund is warranted, PeptidesDirect sends a manual USDC transfer back to the paying
address after the payer contacts support@peptidesdirect.io.

## Research-use notice

Products purchasable through this catalogue are sold strictly for in-vitro laboratory
research use, not for human or animal consumption, exactly as on the human-facing storefront
(see the `product-search` skill).
