> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.schoolset.io/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.schoolset.io/_mcp/server.

# Charge a credit card immediately

POST https://ssuccessv2.com/app/api/v2/payment/create/onetime/charge-now/credit-card
Content-Type: multipart/form-data

Charges a SchoolSet contract immediately through the selected merchant account using the credit-card fields sent as multipart form data.

Reference: https://docs.schoolset.io/api-reference/school-set-api/payments/create-v-2-credit-card-charge-now-one-time-payment

## Authentication

- `Authorization` header (bearer token, required) — The signed-in SchoolSet user token sent by the frontend.

## Request

### Body (multipart/form-data)

This endpoint expects a multipart form.

- `merchant_account_id` (integer, required)
- `contract_id` (integer, required)
- `payment_amount` (double, required)
- `credit_card_number` (string, required)
- `credit_card_exp_date` (string, required)
- `credit_card_cvc` (string, required)
- `customer_billing_name` (string, required)
- `customer_address_1` (string, optional)
- `customer_address_2` (string, optional)
- `customer_city` (string, optional)
- `customer_state` (string, optional)
- `customer_zip` (string, optional)
- `customer_country` (string, optional)
- `customer_phone` (string, optional)
- `customer_email` (string, optional)
- `fees_priority` (list of integer, optional)
- `note` (string, optional)

## Response

### 200

Credit-card payment accepted

- `status` (string, optional)
- `message` (string, optional)
- `data` (map from string to any, optional)

## Errors

### 400 Bad Request Error

Card or merchant service rules rejected the charge

- `status` (string, required)
- `message` (string, required)
- `data` (any, optional, nullable)

### 401 Unauthorized Error

Authentication is required

- `status` (string, required)
- `message` (string, required)
- `data` (any, optional, nullable)

### 403 Forbidden Error

SchoolSet create-payments permission was denied

- `status` (string, required)
- `message` (string, required)
- `data` (any, optional, nullable)

### 404 Not Found Error

Contract or merchant account was not found

- `status` (string, required)
- `message` (string, required)
- `data` (any, optional, nullable)

### 422 Unprocessable Entity Error

Credit-card payment validation failed

- `message` (string, required)
- `errors` (map from string to list of string, required)

## Examples

**Request**

```json
{
  "merchant_account_id": 9,
  "contract_id": 1204,
  "payment_amount": 425.5,
  "credit_card_number": "4111111111111111",
  "credit_card_exp_date": "2028-12",
  "credit_card_cvc": "123",
  "customer_billing_name": "Jordan Lee"
}
```

**Response**

```json
{
  "status": "success",
  "message": "Payment accepted",
  "data": {}
}
```

**SDK Code**

```python
import requests

url = "https://ssuccessv2.com/app/api/v2/payment/create/onetime/charge-now/credit-card"

payload = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"merchant_account_id\"\r\n\r\n9\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"contract_id\"\r\n\r\n1204\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"payment_amount\"\r\n\r\n425.5\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"credit_card_number\"\r\n\r\n4111111111111111\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"credit_card_exp_date\"\r\n\r\n2028-12\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"credit_card_cvc\"\r\n\r\n123\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"customer_billing_name\"\r\n\r\nJordan Lee\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"customer_address_1\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"customer_address_2\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"customer_city\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"customer_state\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"customer_zip\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"customer_country\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"customer_phone\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"customer_email\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"fees_priority\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"note\"\r\n\r\n\r\n-----011000010111000001101001--\r\n"
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "multipart/form-data; boundary=---011000010111000001101001"
}

response = requests.post(url, data=payload, headers=headers)

print(response.json())
```

```javascript
const url = 'https://ssuccessv2.com/app/api/v2/payment/create/onetime/charge-now/credit-card';
const form = new FormData();
form.append('merchant_account_id', '9');
form.append('contract_id', '1204');
form.append('payment_amount', '425.5');
form.append('credit_card_number', '4111111111111111');
form.append('credit_card_exp_date', '2028-12');
form.append('credit_card_cvc', '123');
form.append('customer_billing_name', 'Jordan Lee');
form.append('customer_address_1', '');
form.append('customer_address_2', '');
form.append('customer_city', '');
form.append('customer_state', '');
form.append('customer_zip', '');
form.append('customer_country', '');
form.append('customer_phone', '');
form.append('customer_email', '');
form.append('fees_priority', '');
form.append('note', '');

const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};

options.body = form;

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://ssuccessv2.com/app/api/v2/payment/create/onetime/charge-now/credit-card"

	payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"merchant_account_id\"\r\n\r\n9\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"contract_id\"\r\n\r\n1204\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"payment_amount\"\r\n\r\n425.5\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"credit_card_number\"\r\n\r\n4111111111111111\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"credit_card_exp_date\"\r\n\r\n2028-12\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"credit_card_cvc\"\r\n\r\n123\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"customer_billing_name\"\r\n\r\nJordan Lee\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"customer_address_1\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"customer_address_2\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"customer_city\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"customer_state\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"customer_zip\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"customer_country\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"customer_phone\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"customer_email\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"fees_priority\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"note\"\r\n\r\n\r\n-----011000010111000001101001--\r\n")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Authorization", "Bearer <token>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://ssuccessv2.com/app/api/v2/payment/create/onetime/charge-now/credit-card")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request.body = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"merchant_account_id\"\r\n\r\n9\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"contract_id\"\r\n\r\n1204\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"payment_amount\"\r\n\r\n425.5\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"credit_card_number\"\r\n\r\n4111111111111111\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"credit_card_exp_date\"\r\n\r\n2028-12\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"credit_card_cvc\"\r\n\r\n123\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"customer_billing_name\"\r\n\r\nJordan Lee\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"customer_address_1\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"customer_address_2\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"customer_city\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"customer_state\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"customer_zip\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"customer_country\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"customer_phone\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"customer_email\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"fees_priority\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"note\"\r\n\r\n\r\n-----011000010111000001101001--\r\n"

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://ssuccessv2.com/app/api/v2/payment/create/onetime/charge-now/credit-card")
  .header("Authorization", "Bearer <token>")
  .body("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"merchant_account_id\"\r\n\r\n9\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"contract_id\"\r\n\r\n1204\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"payment_amount\"\r\n\r\n425.5\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"credit_card_number\"\r\n\r\n4111111111111111\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"credit_card_exp_date\"\r\n\r\n2028-12\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"credit_card_cvc\"\r\n\r\n123\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"customer_billing_name\"\r\n\r\nJordan Lee\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"customer_address_1\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"customer_address_2\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"customer_city\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"customer_state\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"customer_zip\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"customer_country\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"customer_phone\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"customer_email\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"fees_priority\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"note\"\r\n\r\n\r\n-----011000010111000001101001--\r\n")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://ssuccessv2.com/app/api/v2/payment/create/onetime/charge-now/credit-card', [
  'multipart' => [
    [
        'name' => 'merchant_account_id',
        'contents' => '9'
    ],
    [
        'name' => 'contract_id',
        'contents' => '1204'
    ],
    [
        'name' => 'payment_amount',
        'contents' => '425.5'
    ],
    [
        'name' => 'credit_card_number',
        'contents' => '4111111111111111'
    ],
    [
        'name' => 'credit_card_exp_date',
        'contents' => '2028-12'
    ],
    [
        'name' => 'credit_card_cvc',
        'contents' => '123'
    ],
    [
        'name' => 'customer_billing_name',
        'contents' => 'Jordan Lee'
    ]
  ]
  'headers' => [
    'Authorization' => 'Bearer <token>',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://ssuccessv2.com/app/api/v2/payment/create/onetime/charge-now/credit-card");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddParameter("undefined", "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"merchant_account_id\"\r\n\r\n9\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"contract_id\"\r\n\r\n1204\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"payment_amount\"\r\n\r\n425.5\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"credit_card_number\"\r\n\r\n4111111111111111\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"credit_card_exp_date\"\r\n\r\n2028-12\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"credit_card_cvc\"\r\n\r\n123\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"customer_billing_name\"\r\n\r\nJordan Lee\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"customer_address_1\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"customer_address_2\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"customer_city\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"customer_state\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"customer_zip\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"customer_country\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"customer_phone\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"customer_email\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"fees_priority\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"note\"\r\n\r\n\r\n-----011000010111000001101001--\r\n", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = ["Authorization": "Bearer <token>"]
let parameters = [
  [
    "name": "merchant_account_id",
    "value": "9"
  ],
  [
    "name": "contract_id",
    "value": "1204"
  ],
  [
    "name": "payment_amount",
    "value": "425.5"
  ],
  [
    "name": "credit_card_number",
    "value": "4111111111111111"
  ],
  [
    "name": "credit_card_exp_date",
    "value": "2028-12"
  ],
  [
    "name": "credit_card_cvc",
    "value": "123"
  ],
  [
    "name": "customer_billing_name",
    "value": "Jordan Lee"
  ],
  [
    "name": "customer_address_1",
    "value": 
  ],
  [
    "name": "customer_address_2",
    "value": 
  ],
  [
    "name": "customer_city",
    "value": 
  ],
  [
    "name": "customer_state",
    "value": 
  ],
  [
    "name": "customer_zip",
    "value": 
  ],
  [
    "name": "customer_country",
    "value": 
  ],
  [
    "name": "customer_phone",
    "value": 
  ],
  [
    "name": "customer_email",
    "value": 
  ],
  [
    "name": "fees_priority",
    "value": 
  ],
  [
    "name": "note",
    "value": 
  ]
]

let boundary = "---011000010111000001101001"

var body = ""
var error: NSError? = nil
for param in parameters {
  let paramName = param["name"]!
  body += "--\(boundary)\r\n"
  body += "Content-Disposition:form-data; name=\"\(paramName)\""
  if let filename = param["fileName"] {
    let contentType = param["content-type"]!
    let fileContent = String(contentsOfFile: filename, encoding: String.Encoding.utf8)
    if (error != nil) {
      print(error as Any)
    }
    body += "; filename=\"\(filename)\"\r\n"
    body += "Content-Type: \(contentType)\r\n\r\n"
    body += fileContent
  } else if let paramValue = param["value"] {
    body += "\r\n\r\n\(paramValue)"
  }
}

let request = NSMutableURLRequest(url: NSURL(string: "https://ssuccessv2.com/app/api/v2/payment/create/onetime/charge-now/credit-card")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```