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

# Pay by Credit Card

API for direct payment by credit card number without using payment page.

{% hint style="warning" %}
Sending credit card information using API requires your server to be PCI compliant, if you don't have PCI certification - please see our documentation of [Credit Card iFrame ](/sensepay/transaction-api/sdk-and-iframes/credit-card-iframe.md)
{% endhint %}

### API Interface

## Pay by credit card

<mark style="color:green;">`POST`</mark> `https://api.sensepass.com/api/transactions/pay`

**Authentication Request Body fields**

[See here our Authentication page](/sensepay/transaction-api/authentication.md)

{% hint style="info" %}
This API only support merchant API authentication - [See Authenticating page for examples](/sensepay/transaction-api/authentication.md#merchant-api-key-authentication)
{% endhint %}

#### Request Body

<table><thead><tr><th>Name</th><th width="107">Type</th><th>Description</th></tr></thead><tbody><tr><td>methodType</td><td>string</td><td>Transaction Type:<br>1. 'payment' = Regular Payment<br>2. 'tokenize' = Tokenization<br>3. 'authorize' = Authorization<br>4. 'credit' = Credit transaction (Refund transaction without a reference to original payment transaction)</td></tr><tr><td>amount<mark style="color:red;">*</mark></td><td>number</td><td><p>The required amount for this transaction (Cents). </p><p>If products are a part of the transaction - they are all summed up &#x26; calculated via the following formula: </p><p>(amount + vat - discount) * quantity e.g. (10 + 1.7 - 1) * 2.</p></td></tr><tr><td>creditCardDetails.cardNumber<mark style="color:red;">*</mark></td><td>string</td><td>Credit card number</td></tr><tr><td>currency<mark style="color:red;">*</mark></td><td>string</td><td>[ USD, CAD, ILS, EUR, RUB ]</td></tr><tr><td>creditCardDetails.securityCode<mark style="color:red;">*</mark></td><td>string</td><td>Credit card CVV</td></tr><tr><td>reason</td><td>string</td><td>The reason for this payment - This field will be presented to the consumer</td></tr><tr><td>creditCardDetails.socialID</td><td>String</td><td>Israel Only - Social ID of the credit card owner</td></tr><tr><td>creditCardDetails.cardExpiration<mark style="color:red;">*</mark></td><td>string</td><td>Credit card expiration MM/YY</td></tr><tr><td>installments</td><td>number</td><td>Israel Only - Installments</td></tr><tr><td>metadata</td><td>array</td><td><a data-mention href="/sensepay/transaction-api/models/metadata-model.md">Metadata Model</a></td></tr></tbody></table>

{% tabs %}
{% tab title="200: OK OK" %}
**See Transactions entity schema:** [Transaction Model](/sensepay/transaction-api/models/transaction-model.md#transaction-entity)

```javascript
{
  "success": true,
  "message": null,
  "code": null,
  "error": null,
  "approvalID": null,
  "requestID": null,
  "transactionNumber": "cf04ea0faf73988c1f545add1ec2bd9fcd87c7a292566536e8395b1b",
  "transactionPaymentID": null,
  "transactionStatus": "TransactionApproved",
  "confirmation":
    {
      "paymentType": "Regular",
      "confirmationNumber": "063-d9j09YsY1",
      "fullConfirmationCode": "063-d9j09YsY1",
      "dateApproval": "2019-12-19T09:47:59.105Z",
      "installments": 1,
      "paymentMethodName": "Credit Card",
      "approvedBy": "Cardknox",
      "providerId": "uGfNuwEGiP18SUnTUEo1/atTdesDnhDhZ/8i7G9NAEg=",
      "requestID": "a4dbf66e-d3f1-4a29-baf7-2591424a9a0c",
      "authNumber": "123213dsf13111",
      "referenceNumber": "1778298289",
      "acquirer": "Visa",
      "voucher": "yyyAbnlmlfm1323",
      "lastFourDigits": "8858",
      "cardExpiration": "0127",
      "sensePassReferenceId": "34e209ea8b24cc831cf"
    },
    "cardMask": "",
    "token": "060a4330-abd7-4845-b8e9-809f454a2d6c"
}
```

{% endtab %}

{% tab title="400: Bad Request Invalid Input" %}

```javascript
{
    // Response
}
```

{% endtab %}

{% tab title="500: Internal Server Error Internal Error" %}

```javascript
{
    // Response
}
```

{% endtab %}
{% endtabs %}

### Examples

Basic request example to pay using credit card

```json
{
  "deviceId": "93sa20e3b9c05d0670f00924a5384185aa4e5fe913b71014",
  "amount": 500,
  "currency": "USD",
  "reason": "Invoice of December 2023",
  "creditCardDetails": {
    "cardNumber": "375510190366075",
    "cardExpiration": "12/34",
    "securityCode": "0123"
  }
}
```

Response

```json
{
  "success": true,
  "message": null,
  "code": null,
  "error": null,
  "approvalID": null,
  "requestID": null,
  "transactionNumber": "cf04ea0faf73988c1f545add1ec2bd9fcd87c7a292566536e8395b1b",
  "transactionPaymentID": null,
  "transactionStatus": "TransactionApproved",
  "confirmation": {
      "paymentType": "Regular",
      "confirmationNumber": "063-d9j09YsY1",
      "fullConfirmationCode": "063-d9j09YsY1",
      "dateApproval": "2019-12-19T09:47:59.105Z",
      "installments": 1,
      "paymentMethodName": "Credit Card",
      "approvedBy": "Cardknox",
      "providerId": "uGfNuwEGiP18SUnTUEo1/atTdesDnhDhZ/8i7G9NAEg=",
      "requestID": "a4dbf66e-d3f1-4a29-baf7-2591424a9a0c",
      "authNumber": "123213dsf13111",
      "referenceNumber": "1778298289",
      "acquirer": "Visa",
      "voucher": "yyyAbnlmlfm1323",
      "lastFourDigits": "8858",
      "cardExpiration": "0127",
      "sensePassReferenceId": "34e209ea8b24cc831cf"
   },
   "cardMask": "",
   "token": "060a4330-abd7-4845-b8e9-809f454a2d6c"
}
```

### Transaction Status Flow

[See our transaction status flow here](/sensepay/transaction-api/flow-charts/transaction-status-flow.md)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.sensepass.com/sensepay/transaction-api/payment-flows/pay-by-credit-card.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
