> For the complete documentation index, see [llms.txt](https://docs.vesicash.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.vesicash.com/api-documentation/payments/pay-with-card.md).

# Pay with card

This endpoint allows you to initiate a payment with the provided details.

The endpoint /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 Vesicash secret key |
| public-key | string | Your Vesicash public key |

#### Request body

* currency (string): The currency for the payment.
* country (string): The country for the payment.
* narration (string): Description or reason for the payment.
* method (string): The payment method, in this case "card".
* token(string): The context token generated from the payment context.
* amount (number): The amount of the payment.
* customer\_first\_name (string): The first name of the customer.
* customer\_last\_name (string): The last name of the customer.
* account\_number (string): The customer's account number.
* card\_number(string): Card number (PAN)
* card\_expiry\_date(sting): Card expiry in MMYY format
* card\_cvv(string): Card CVV code
* java\_enabled(Boolean): Indicates if Java is enabled in browser
* language(string): Browser language
* screen\_height(integer): Screen height in pixels

  *

#### Request

For example, you can make a post request to the endpoint above and pass in the raw json data below to create a one-off transaction.

```
//card
{
    "phone_number": "2335********",
    "email": "customer@example.com",
    "customer_first_name": "Jane",
    "customer_last_name": "Doe",
    "card_number": "5399*********",
    "card_expiry_date": "0629",
    "card_cvv": "***",
    "java_enabled": false,
    "language": "en-GB",
    "screen_height": 1080, //This should be generated Programmatically
    "screen_width": 1920,    //This should be generated Programmatically
    "color_depth": 24,    //This should be generated Programmatically
    "time_zone": -60,    //This should be generated Programmatically
    "ip_address":"", //This will be generated from the Get client IP Address endpoint
    "browser_user_agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/142.0.0.0 Safari/537.36" //This should be generated Programmatically
}
```

#### Response

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