# Pay with card

The endpoint {{redstone-api}}/v1/payment/pay/:payment\_reference is a POST request that initiates a card payment. The request body should be in raw format and include the following parameters:

<mark style="color:green;">POST</mark> /v1/payment/pay/:payment\_reference

#### Params

| Name               | Type   | Description                                                        |
| ------------------ | ------ | ------------------------------------------------------------------ |
| payment\_reference | String | The payment reference that was generated when initializing payment |

#### Headers

| Name       | Type   | Description               |
| ---------- | ------ | ------------------------- |
| secret-key | string | Your Redstone  secret key |
| public-key | String | Your Redstone  public key |

#### Request body

* account\_number (string): The customer's account number.
* customer\_first\_name (string): The first name of the customer.
* customer\_last\_name  (string): The last name of the customer.
* method (string): The payment method, in this case "card".
* phone\_number (string): The phone number of the customer.
* email (string): The email address of the customer.
* token(string): The context token generated from the payment context.
* frquency(string): The frequency of the payment, e.g., "monthly".
* customer\_address(string): The address of the customer.
* customer\_country(string): The country of the customer.
* customer\_city (string): The customer's city.
* customer\_state(string): The state of the customer.
* customer\_zip(string): The ZIP code of the customer.

#### Request

For example, you can make a post request to the endpoint above and pass in the **raw json data** below to make payment with card

```
{
    "account_number": "260******", 
    "customer_first_name": "Efemena",
    "customer_last_name": "Elvis",
    "method": "card",
    "phone_number": "260********",
    "email": "elvis@test.com",
    "token": "",
    "frquency": "monthly", //monthly,quartely,bi-annual, annually
    "customer_address": "test address",
    "customer_country": "ZM",
    "customer_city": "Lusaka",
    "customer_state": "Lusaka",
    "customer_zip": "10101"
}
```

#### Response

```
{
    "status": "success",
    "code": 200,
    "message": "success",
    "data": "payment sent for processing"
}
```


---

# 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://developer.redstonepgs.com/api-documentation/payments/pay-with-card.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.
