***

title: createPaymentPrompt
slug: /reference/typescript/agents/function-result/create-payment-prompt
description: Build a payment prompt object for use with pay().
max-toc-depth: 3
---------------------

For a complete index of all SignalWire documentation pages, fetch https://signalwire.com/docs/llms.txt

[pay]: /docs/server-sdks/reference/typescript/agents/function-result/pay

[create-payment-action]: /docs/server-sdks/reference/typescript/agents/function-result/create-payment-action

[ref-functionresult]: /docs/server-sdks/reference/typescript/agents/function-result

Static helper that builds a payment prompt object for use with the `prompts`
parameter of [`pay()`][pay].
Payment prompts customize the TTS messages played during different stages of
payment collection.

## **Parameters**

<ParamField path="forSituation" type="string" required={true} toc={true}>
  The payment stage this prompt applies to (e.g., `"payment-card-number"`,
  `"expiration-date"`, `"security-code"`, `"postal-code"`).
</ParamField>

<ParamField path="actions" type={"PaymentAction[]"} required={true} toc={true}>
  List of prompt actions. Use [`createPaymentAction()`][create-payment-action]
  to build each entry.
</ParamField>

<ParamField path="cardType" type="string | undefined" default="undefined" toc={true}>
  Space-separated card types this prompt applies to (e.g., `"visa mastercard"`).
</ParamField>

<ParamField path="errorType" type="string | undefined" default="undefined" toc={true}>
  Space-separated error types this prompt handles.
</ParamField>

## **Returns**

`PaymentPrompt` — A prompt object to pass in the `prompts` list of [`pay()`][pay].

## **Example**

```typescript {3}
import { FunctionResult } from '@signalwire/sdk';

const prompt = FunctionResult.createPaymentPrompt(
  'payment-card-number',
  [{ type: 'say', phrase: 'Please enter your card number.' }],
);
```