# Core Write Methods

#### createCryptoCheckout

Creates a new crypto checkout session. The SDK handles authentication and request signing internally. The returned object contains the session ID, payment address, and status needed to render a pay screen in your UI.

```
const checkout = await paymentClient.createCryptoCheckout({
  participantCode: "merchant-1",
  amountToPay: 100,
  currencyToPay: "USDT",
  clientReference: "order-1",
  paymentPurpose: {
    subject: "Order #1",
    description: "Premium subscription",
  },
  buyerInfo: {
    fullLegalName: "Alice Example",
  },
  expiry: Math.floor(Date.now() / 1000) + 15 * 60,
});
```

| Parameter         | Type     | Description                                                                     |
| ----------------- | -------- | ------------------------------------------------------------------------------- |
| `participantCode` | `string` | Merchant or participant identifier issued during onboarding.                    |
| `amountToPay`     | `number` | Settlement amount in the specified currency.                                    |
| `currencyToPay`   | `string` | Currency code for the checkout (e.g. `"USDT"`, `"USDC"`).                       |
| `clientReference` | `string` | Your own idempotent reference for the order. Used to fetch the checkout later.  |
| `paymentPurpose`  | `object` | Contains `subject` and `description` fields displayed to the buyer.             |
| `buyerInfo`       | `object` | Contains `fullLegalName` of the payer.                                          |
| `expiry`          | `number` | Unix timestamp (seconds) after which the checkout session is no longer payable. |


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://city-protocol.gitbook.io/docs/software-development-kit/payment/core-write-methods.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
