/v1/charges
Run a one-time charge against a card. Supports idempotent retries via the Idempotency-Key header.
Headers
| Name | Type | Required | Description |
|---|---|---|---|
| Authorization | string | yes | Bearer <secret_api_key>. Use a sk_test_ or sk_live_ key from your dashboard. |
| Idempotency-Key | string | no | Unique key (UUID recommended). Replays return the original response. |
| Content-Type | string | yes | application/json |
Body parameters
| Name | Type | Required | Description |
|---|---|---|---|
| amount | integer | yes | Amount in cents. Min 50, max 10,000,000. |
| currency | string | no | "USD" (default and only value today). |
| source | object | yes | Card details: { number, exp_month, exp_year, cvc }. |
| billing_address | object | yes | US billing address: { line1, line2?, city, state, postal_code, country: "US" }. |
| description | string | no | Up to 500 chars, surfaced in the dashboard. |
| metadata | object | no | Arbitrary key/value pairs (strings, numbers, booleans). |
Example request
curl https://api.k-payments.com/v1/charges \
-H "Authorization: Bearer sk_test_..." \
-H "Content-Type: application/json" \
-H "Idempotency-Key: 8f4c2e1a-..." \
-d '{
"amount": 4999,
"currency": "USD",
"source": {
"number": "4242424242424242",
"exp_month": 12,
"exp_year": 2030,
"cvc": "123"
},
"billing_address": {
"line1": "1 Market St",
"city": "San Francisco",
"state": "CA",
"postal_code": "94105",
"country": "US"
},
"description": "Order #1024",
"metadata": { "order_id": "1024" }
}'