- A valid API key — see Obtain API credentials
- A processor integration configured for card payments (TSYS)
Set type to sale and include the full card details in payment_method.
| Field | Required | Description |
|---|---|---|
type | Yes | sale |
amount | Yes | Amount in cents (for example, 1999 = 19.99 USD) |
tip | No | Tip amount in cents (minimum 50 if provided) |
payment_method.type | Yes | card |
payment_method.pan | Yes | Full card number |
payment_method.expiry.month | Yes | Two-digit expiry month |
payment_method.expiry.year | Yes | Four-digit expiry year |
payment_method.cardholder_name | Yes | Name on card |
payment_method.cvv | Recommended | 3- or 4-digit verification value |
payment_method.address_line1 | Recommended | Billing street address (for AVS) |
payment_method.zip | Recommended | Billing ZIP code (for AVS) |
recurring | No | true if this is a recurring charge |
purchase_description | No | Description of the purchase |
Loading...
A successful sale returns 200 with transaction_state: authorized.
{
"id": "TRANSACTION-01JMRSPCK7XVNP3KS8F2W4T6Y",
"object": "transaction",
"type": "card_sale",
"transaction_state": "authorized",
"response_status": "Approved",
"response_code": "00",
"response_message": "The API request is approved.",
"batch_id": "BATCH-01JMRSPCK7XVNP3KS8F2W4T6Y",
"amount": 15000,
"tip": 1000,
"avs_result_code": "y",
"cvv_result": "M",
"authorization_code": "847293",
"payment_method": {
"type": "card",
"payment_token": "PAYMENT_TOKEN-01JMRSPCK8WLXDPRMW3SNPVQEA",
"brand": "visa",
"last_four": "1234",
"bin": "411111",
"funding": "credit"
},
"correlation_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
}Save the id for any future operations (cancel, refund). Note the payment_token — you can reuse it for future transactions without collecting card details again.
Review the avs_result_code and cvv_result in the response before fulfilling the order.
| Field | Good values | Action on mismatch |
|---|---|---|
avs_result_code | y, x | Partial match: review. No match (n): consider declining. |
cvv_result | M (Visa), 2 (Mastercard) | No match: high risk — consider declining. |
For more information, see About fraud prevention.
- Process a payment with a stored token — reuse the
payment_tokenfrom this response - Add a tip or surcharge — update the amount after authorization
- About the transaction lifecycle