Skip to content

Search is only available in production builds. Try building and previewing the site to test it out locally.

US Card Payments (PayIn)

This section documents the endpoints for accepting deposits via US-issued credit and debit cards. These endpoints support the full card flow: authorization, capture, void, and direct charge.


Overview

  • Supports: Visa, Mastercard, Amex (test numbers in sandbox)
  • Use cases: E-commerce, instant wallet top-up, card-not-present transactions
  • Authentication: Basic Auth (Business Key + Secret)
  • All endpoints: POST requests

Endpoints

1. Authorize Card

Method: POST URL: /api/v1/pay-in/us-cards/request-authorize

Authentication: Basic Auth

Request Body

FieldTypeRequiredDescription
external_identifierstringYesUnique reference for idempotency
descriptionstringNoDescription for the transaction
name_on_the_cardstringYesCardholder name
card_numberstringYesCard number (test: 4111111111111111)
card_codestringYesCVV/CVC code
expiration_datestringYesFormat: YYYY-MM
addressstringYesBilling address
state_namestringYesState
city_namestringYesCity
postal_codestringYesPostal code
amount_paidnumberYesAmount to authorize
fee_on_payerbooleanNoIf true, payer covers fees

Example Request

{
"external_identifier": "36215463256",
"description": "Test authorization",
"name_on_the_card": "John Doe",
"card_number": "4111111111111111",
"card_code": "999",
"expiration_date": "2026-12",
"address": "14 Main Street",
"state_name": "Texas",
"city_name": "Texas City",
"postal_code": "46226",
"amount_paid": 150,
"fee_on_payer": false
}

2. Capture Card Authorization

Method: POST URL: /api/v1/pay-in/us-cards/request-capture

Request Body

FieldTypeRequiredDescription
idstringYesAuthorization ID returned from authorize
external_identifierstringNoOptional reference
referencestringNoOptional reference

Example Request

{
"id": "4ce59270-802e-431e-9b69-b14ffd54389a"
}

3. Void Card Authorization

Method: POST URL: /api/v1/pay-in/us-cards/request-void

Request Body

FieldTypeRequiredDescription
idstringYesAuthorization ID to void
external_identifierstringNoOptional reference
referencestringNoOptional reference

Example Request

{
"id": "acee3819-f320-4465-97e4-ebcfe496497e"
}

4. Charge Credit Card (One-Step)

Method: POST URL: /api/v1/pay-in/us-cards/charge-credit-card

Request Body

FieldTypeRequiredDescription
external_identifierstringYesUnique reference for idempotency
name_on_the_cardstringYesCardholder name
card_numberstringYesCard number
card_codestringYesCVV/CVC code
expiration_datestringYesFormat: YYYY-MM
addressstringYesBilling address
state_namestringYesState
city_namestringYesCity
postal_codestringYesPostal code
amount_paidnumberYesAmount to charge

Example Request

{
"external_identifier": "65236986456",
"name_on_the_card": "John Doe",
"card_number": "4111111111111111",
"card_code": "999",
"expiration_date": "2026-12",
"address": "14 Main Street",
"state_name": "Texas",
"city_name": "Texas City",
"postal_code": "46226",
"amount_paid": 250
}

Response & Error Handling

  • Standard Cashela error model applies (see global error section)
  • All endpoints return JSON with transaction status, reference, and error codes if applicable

Notes

  • Use sandbox card numbers for testing
  • All card data must be PCI DSS compliant
  • Idempotency is enforced via external_identifier
  • Fees, settlement, and restrictions are described in the global sections

Example cURL (Authorize)

Terminal window
curl -X POST "https://api.cashela.com/api/v1/pay-in/us-cards/request-authorize" \
-H "Authorization: Basic BASE64_ENCODED_KEY_SECRET" \
-H "Content-Type: application/json" \
-d '{
"external_identifier": "36215463256",
"name_on_the_card": "John Doe",
"card_number": "4111111111111111",
"card_code": "999",
"expiration_date": "2026-12",
"address": "14 Main Street",
"state_name": "Texas",
"city_name": "Texas City",
"postal_code": "46226",
"amount_paid": 150
}'

See Also