Skip to main content
Cresora Commerce
Getting Started

First API Call

Make a test API call to verify your credentials and environment setup.

Before processing a payment, verify your setup with a simple authenticated request.

Verify authentication

Send a request to the Payments API. A 401 invalid_api_key means your key is wrong; a 422 card_declined means your key works but something in the payload failed — that's progress.

curl -X POST https://sandbox-api.cresoracommerce.com/api/v1/transactions/sale \
  -H "Authorization: Bearer csk_test_YOUR_KEY_HERE" \
  -H "Content-Type: application/json" \
  -d '{
    "amount": "1.00",
    "currency": "USD",
    "payment_method": "card",
    "merchant_id": "mrch_YOUR_MERCHANT_ID"
  }'

Expected responses

HTTP statusCodeMeaning
200 OKPayment processed (even without a real card, the sandbox accepts test flows)
401invalid_api_keyKey is invalid or expired — re-copy from Portal
400validation_errorPayload failed schema validation — check required fields
422merchant_not_foundmerchant_id is wrong or not under your partner account

Idempotency

Always include an Idempotency-Key header in production calls. The sandbox accepts requests without it, but production requires it for all non-idempotent operations. Use a UUID per request:

-H "Idempotency-Key: idem_$(uuidgen)"

Next

Proceed to First payment → to run a complete payment flow with test card data.