POST
/
v1
/
payments
curl --location --request POST 'https://api.stateset.com/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
}'
{
  "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 with payments:write permissions.
Authorization: Bearer YOUR_API_KEY

Request Body

amount
integer
required
Payment amount in cents (e.g., 1000 for $10.00)
currency
string
required
ISO 4217 currency code (e.g., “USD”, “EUR”)
payment_method
object
required
Payment method details
order_id
string
Associated order ID
invoice_id
string
Associated invoice ID
customer_id
string
required
Customer ID making the payment
description
string
Payment description
statement_descriptor
string
Text to appear on customer’s statement (max 22 chars)
capture
boolean
Whether to immediately capture the payment (default: true)
billing_address
object
Billing address for verification
metadata
object
Additional custom fields

Response

Returns the created payment with processing status.
curl --location --request POST 'https://api.stateset.com/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
}'
{
  "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"
  }
}