curl --location --request POST 'https://api.stateset.com/api/v1/payments' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer YOUR_API_KEY' \
--data-raw '{
"amount": 15000,
"currency": "USD",
"payment_method": {
"type": "card",
"card": {
"token": "tok_1234567890abcdef"
}
},
"order_id": "order_123456",
"customer_id": "cust_abc123",
"description": "Payment for Order #123456",
"capture": true
}'
const payment = await stateset.payments.create({
amount: 15000,
currency: "USD",
payment_method: {
type: "card",
card: {
token: "tok_1234567890abcdef"
}
},
order_id: "order_123456",
customer_id: "cust_abc123",
description: "Payment for Order #123456",
capture: true
});
{
"id": "pay_0901f083-aa1c-43c5-af5c-0a9d2fc64e30",
"object": "payment",
"amount": 15000,
"currency": "USD",
"status": "succeeded",
"captured": true,
"created_at": "2024-01-19T15:30:00Z",
"payment_method": {
"type": "card",
"card": {
"last4": "4242",
"brand": "visa",
"exp_month": 12,
"exp_year": 2025,
"fingerprint": "Xt5EWLLDS7FJjR1c"
}
},
"order_id": "order_123456",
"customer_id": "cust_abc123",
"description": "Payment for Order #123456",
"receipt_url": "https://receipts.stateset.com/pay_0901f083-aa1c-43c5-af5c-0a9d2fc64e30",
"processor_response": {
"approved": true,
"authorization_code": "123456",
"avs_result": "Y",
"cvv_result": "M",
"network_transaction_id": "123456789"
}
}
Process a payment for an order or invoice
POST
/
api
/
v1
/
payments
curl --location --request POST 'https://api.stateset.com/api/v1/payments' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer YOUR_API_KEY' \
--data-raw '{
"amount": 15000,
"currency": "USD",
"payment_method": {
"type": "card",
"card": {
"token": "tok_1234567890abcdef"
}
},
"order_id": "order_123456",
"customer_id": "cust_abc123",
"description": "Payment for Order #123456",
"capture": true
}'
const payment = await stateset.payments.create({
amount: 15000,
currency: "USD",
payment_method: {
type: "card",
card: {
token: "tok_1234567890abcdef"
}
},
order_id: "order_123456",
customer_id: "cust_abc123",
description: "Payment for Order #123456",
capture: true
});
{
"id": "pay_0901f083-aa1c-43c5-af5c-0a9d2fc64e30",
"object": "payment",
"amount": 15000,
"currency": "USD",
"status": "succeeded",
"captured": true,
"created_at": "2024-01-19T15:30:00Z",
"payment_method": {
"type": "card",
"card": {
"last4": "4242",
"brand": "visa",
"exp_month": 12,
"exp_year": 2025,
"fingerprint": "Xt5EWLLDS7FJjR1c"
}
},
"order_id": "order_123456",
"customer_id": "cust_abc123",
"description": "Payment for Order #123456",
"receipt_url": "https://receipts.stateset.com/pay_0901f083-aa1c-43c5-af5c-0a9d2fc64e30",
"processor_response": {
"approved": true,
"authorization_code": "123456",
"avs_result": "Y",
"cvv_result": "M",
"network_transaction_id": "123456789"
}
}
This endpoint processes payments through various payment methods and gateways. It supports credit cards, ACH, wire transfers, and digital wallets.
Authentication
This endpoint requires a valid API key withpayments:write permissions.
Authorization: Bearer YOUR_API_KEY
Request Body
integer
required
Payment amount in cents (e.g., 1000 for $10.00)
string
required
ISO 4217 currency code (e.g., “USD”, “EUR”)
object
required
Payment method details
Show Payment method properties
Show Payment method properties
string
required
Payment type: “card”, “ach”, “wire”, “paypal”, “crypto”
object
string
Associated order ID
string
Associated invoice ID
string
required
Customer ID making the payment
string
Payment description
string
Text to appear on customer’s statement (max 22 chars)
boolean
Whether to immediately capture the payment (default: true)
object
object
Additional custom fields
Response
Returns the created payment with processing status.curl --location --request POST 'https://api.stateset.com/api/v1/payments' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer YOUR_API_KEY' \
--data-raw '{
"amount": 15000,
"currency": "USD",
"payment_method": {
"type": "card",
"card": {
"token": "tok_1234567890abcdef"
}
},
"order_id": "order_123456",
"customer_id": "cust_abc123",
"description": "Payment for Order #123456",
"capture": true
}'
const payment = await stateset.payments.create({
amount: 15000,
currency: "USD",
payment_method: {
type: "card",
card: {
token: "tok_1234567890abcdef"
}
},
order_id: "order_123456",
customer_id: "cust_abc123",
description: "Payment for Order #123456",
capture: true
});
{
"id": "pay_0901f083-aa1c-43c5-af5c-0a9d2fc64e30",
"object": "payment",
"amount": 15000,
"currency": "USD",
"status": "succeeded",
"captured": true,
"created_at": "2024-01-19T15:30:00Z",
"payment_method": {
"type": "card",
"card": {
"last4": "4242",
"brand": "visa",
"exp_month": 12,
"exp_year": 2025,
"fingerprint": "Xt5EWLLDS7FJjR1c"
}
},
"order_id": "order_123456",
"customer_id": "cust_abc123",
"description": "Payment for Order #123456",
"receipt_url": "https://receipts.stateset.com/pay_0901f083-aa1c-43c5-af5c-0a9d2fc64e30",
"processor_response": {
"approved": true,
"authorization_code": "123456",
"avs_result": "Y",
"cvv_result": "M",
"network_transaction_id": "123456789"
}
}
⌘I