***

title: create_payment_parameter
slug: /reference/python/agents/function-result/create-payment-parameter
description: Build a parameter entry for the pay() method.
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/python/agents/function-result/pay

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

Static helper that builds a parameter entry for the `parameters` list of
[`pay()`][pay].

## **Parameters**

<ParamField path="name" type="str" required={true} toc={true}>
  Parameter name.
</ParamField>

<ParamField path="value" type="str" required={true} toc={true}>
  Parameter value.
</ParamField>

## **Returns**

`dict[str, str]` — parameter dictionary for use in the `parameters` list of
[`pay()`][pay].

## **Example**

```python {22}
from signalwire import AgentBase
from signalwire import FunctionResult

agent = AgentBase(name="my-agent", route="/agent")
agent.set_prompt_text("You are a helpful assistant.")

@agent.tool(name="subscription_payment", description="Set up a subscription payment")
def subscription_payment(args, raw_data):
    prompt = FunctionResult.create_payment_prompt(
        for_situation="payment-card-number",
        actions=[
            FunctionResult.create_payment_action("Say", "Please enter your credit card number.")
        ]
    )
    return (
        FunctionResult("Let's set up your subscription.")
        .pay(
            payment_connector_url="https://api.example.com/subscribe",
            charge_amount="29.99",
            prompts=[prompt],
            parameters=[
                FunctionResult.create_payment_parameter("plan", "monthly")
            ]
        )
    )

agent.serve()
```