Skip to content
Merged
2 changes: 2 additions & 0 deletions gator-sidebar.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,9 @@ const sidebar = {
type: 'category',
label: 'x402',
collapsed: true,
key: 'x402-guides',
items: [
'guides/x402/seller',
{
type: 'category',
label: 'Buyer',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ const sessionAccount = privateKeyToAccount('0x...')

### 3. Get payment requirements

Call the protected API route once without a payment header.
Call the protected API route once without the `PAYMENT-SIGNATURE` header.

The server returns `402` with the payment terms (`PAYMENT-REQUIRED`) in the response, which you use
to build the payment payload.
Expand Down Expand Up @@ -222,7 +222,7 @@ For ERC-7710 (Smart Contract Delegation), x402 requires the payload fields `dele
`permissionContext`, and `delegator`. The facilitator uses `permissionContext` to simulate
during verification and then settle the payment.

Encode the full x402 payment payload as base64, then send it in the `payment-signature` header.
Encode the full x402 payment payload as base64, then send it in the `PAYMENT-SIGNATURE` header.

<Tabs>
<TabItem value="example.ts">
Expand Down Expand Up @@ -267,13 +267,13 @@ export type PaymentPayload = {

### 7. Make the paid request

Send the base64-encoded x402 payment payload in the `payment-signature` header.
Send the base64-encoded x402 payment payload in the `PAYMENT-SIGNATURE` header.
If verification succeeds, the server returns the protected data.

```ts
const apiResponse = await fetch('https://api.example.com/paid-endpoint', {
headers: {
'payment-signature': encodedPayment,
'PAYMENT-SIGNATURE': encodedPayment,
},
})

Expand Down
8 changes: 4 additions & 4 deletions smart-accounts-kit/guides/x402/buyer/delegations.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ export const buyerAccount = privateKeyToAccount('0x<BUYER_PRIVATE_KEY>')

### 2. Get payment requirements

Call the protected API route once without a payment header.
Call the protected API route once without the `PAYMENT-SIGNATURE` header.

The server returns `402` with the payment terms (`PAYMENT-REQUIRED`) in the response, which you use
to build the payment payload.
Expand Down Expand Up @@ -194,7 +194,7 @@ For ERC-7710 (Smart Contract Delegation), x402 requires the payload fields `dele
The facilitator uses `permissionContext` to simulate during verification and then settle the payment.

Use `encodeDelegations` to encode the delegation chain.
Then base64 encode the full x402 payment payload before sending it in the `payment-signature` header.
Then base64 encode the full x402 payment payload before sending it in the `PAYMENT-SIGNATURE` header.

<Tabs>
<TabItem value="example.ts">
Expand Down Expand Up @@ -238,13 +238,13 @@ export type PaymentPayload = {

### 5. Make the paid request

Send the encoded x402 payment payload in the `payment-signature` header.
Send the encoded x402 payment payload in the `PAYMENT-SIGNATURE` header.
If verification succeeds, the server returns the protected data.

```ts
const apiResponse = await fetch('https://api.example.com/paid-endpoint', {
headers: {
'payment-signature': encodedPayment,
'PAYMENT-SIGNATURE': encodedPayment,
},
})

Expand Down
8 changes: 4 additions & 4 deletions smart-accounts-kit/guides/x402/buyer/recurring-payments.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ const grantedPermissions = await walletClient.requestExecutionPermissions([

### 4. Get payment requirements

Call the x402-protected endpoint without a payment header to request payment terms
Call the x402-protected endpoint without the `PAYMENT-SIGNATURE` header to request payment terms
after your agent has been granted permission.

The server returns `402` with the payment terms (`PAYMENT-REQUIRED`) in the response, which agent can use to
Expand Down Expand Up @@ -225,7 +225,7 @@ For ERC-7710 (Smart Contract Delegation), x402 requires the payload fields `dele
`permissionContext`, and `delegator`. The facilitator uses `permissionContext` to simulate
during verification and then settle the payment.

Encode the full x402 payment payload as base64, then send it in the `payment-signature` header.
Encode the full x402 payment payload as base64, then send it in the `PAYMENT-SIGNATURE` header.

```ts
import { PaymentPayload } from './types'
Expand All @@ -247,12 +247,12 @@ const encodedPayment = Buffer.from(JSON.stringify(paymentPayload)).toString('bas

### 7. Make the paid request

Send the base64-encoded x402 payment payload in the `payment-signature` header.
Send the base64-encoded x402 payment payload in the `PAYMENT-SIGNATURE` header.

```ts
const apiResponse = await fetch('https://api.example.com/paid-endpoint', {
headers: {
'payment-signature': encodedPayment,
'PAYMENT-SIGNATURE': encodedPayment,
},
})

Expand Down
Loading
Loading