Skip to content
Last updated

Tutorial: Your first API call

What you will learn

  1. Retrieve an API key using Basic Auth
  2. Send a test card sale to the sandbox
  3. Read the transaction response

Prerequisites

  • A Paradise Gateway username and password (provided during registration)
  • curl or any HTTP client

Step 1: Retrieve your API key

Send a POST to /v1/auth/keys with Basic Auth (your email and password).

curl -X POST \
  https://api.dev.paradisegateway.net/v1/auth/keys \
  -u "john.doe@example.com:your-password"

Response

{
  "api_key": "KEY-abc123def456...",
  "encryption_keys": {
    "public_key": "...",
    "private_key": "..."
  },
  "correlation_id": "e9c1b2a3-f4d5-e6f7-g8h9-i0j1k2l3m4n5"
}
Store your keys securely

The api_key and encryption_keys are returned only once. Store them in a secrets manager or environment variable — never commit them to source control.

Save the api_key — you will use it in the next step.

Step 2: Send a test sale

Use the API key from Step 1 to process a $10.00 card sale in the sandbox.

curl -X POST \
  https://api.dev.paradisegateway.net/v1/transactions \
  -H "Content-Type: application/json" \
  -H "APIKEY: KEY-abc123def456..." \
  -d '{
    "type": "sale",
    "amount": 1000,
    "payment_method": {
      "type": "card",
      "card": {
        "pan": "4111111111111111",
        "expiry_month": "12",
        "expiry_year": "2027",
        "cvv": "123",
        "cardholder_name": "John Doe"
      }
    }
  }'

Response example

{
  "id": "TRANSACTION-01KEW32V6YNV11T33XGDR7TGWC",
  "object": "transaction",
  "type": "sale",
  "amount": 1000,
  "transaction_state": "completed",
  "response_status": "approved",
  "response_code": "00",
  "response_message": "The API request is approved.",
  "authorization_code": "123456",
  "payment_method": {
    "type": "card",
    "card": {
      "brand": "visa",
      "last_four": "1111",
      "funding": "credit"
    }
  },
  "correlation_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
}

Step 3: Understand the response

FieldWhat it tells you
response_statusapproved — the payment succeeded
response_code00 — the approval code
transaction_statecompleted — funds are captured (because it's a sale, not an auth)
idUse this to retrieve, capture, cancel, or refund the transaction later
correlation_idInclude in support requests for faster troubleshooting

What you built

image

Next steps