{"templateId":"markdown","sharedDataIds":{"sidebar":"sidebar-docs/sidebars.yaml"},"props":{"metadata":{"markdoc":{"tagList":["tabs","tab","admonition"]},"type":"markdown"},"seo":{"title":"Reefpay Docs","description":"Reefpay is the groundbreaking payment gateway that lets you integrate with the future of payments.","llmstxt":{"hide":false,"sections":[{"title":"Table of contents","includeFiles":["**/*"],"excludeFiles":[]}],"excludeFiles":[]}},"dynamicMarkdocComponents":[],"compilationErrors":[],"ast":{"$$mdtype":"Tag","name":"article","attributes":{},"children":[{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"tutorial-your-first-api-call","__idx":0},"children":["Tutorial: Your first API call"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"what-you-will-learn","__idx":1},"children":["What you will learn"]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Retrieve an API key using Basic Auth"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Send a test card sale to the sandbox"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Read the transaction response"]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"prerequisites","__idx":2},"children":["Prerequisites"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["A Paradise Gateway username and password (provided during registration)"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["curl"]}," or any HTTP client"]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"step-1-retrieve-your-api-key","__idx":3},"children":["Step 1: Retrieve your API key"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Send a ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["POST"]}," to ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["/v1/auth/keys"]}," with Basic Auth (your email and password)."]},{"$$mdtype":"Tag","name":"Tabs","attributes":{"size":"medium"},"children":[{"$$mdtype":"Tag","name":"TabItemFragment","attributes":{"label":"curl","disable":false},"children":[{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"shell","header":{"controls":{"copy":{}}},"source":"curl -X POST \\\n  https://api.dev.paradisegateway.net/v1/auth/keys \\\n  -u \"john.doe@example.com:your-password\"\n","lang":"shell"},"children":[]}]},{"$$mdtype":"Tag","name":"TabItemFragment","attributes":{"label":"Python","disable":false},"children":[{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"python","header":{"controls":{"copy":{}}},"source":"import requests\n\nresp = requests.post(\n    \"https://api.dev.paradisegateway.net/v1/auth/keys\",\n    auth=(\"john.doe@example.com\", \"your-password\"),\n)\ndata = resp.json()\napi_key = data[\"api_key\"]\nprint(\"API Key:\", api_key)\n","lang":"python"},"children":[]}]},{"$$mdtype":"Tag","name":"TabItemFragment","attributes":{"label":"JavaScript","disable":false},"children":[{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"javascript","header":{"controls":{"copy":{}}},"source":"const credentials = btoa(\"john.doe@example.com:your-password\");\nconst resp = await fetch(\n  \"https://api.dev.paradisegateway.net/v1/auth/keys\",\n  {\n    method: \"POST\",\n    headers: { Authorization: `Basic ${credentials}` },\n  }\n);\nconst data = await resp.json();\nconsole.log(\"API Key:\", data.api_key);\n","lang":"javascript"},"children":[]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"response","__idx":4},"children":["Response"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"json","header":{"controls":{"copy":{}}},"source":"{\n  \"api_key\": \"KEY-abc123def456...\",\n  \"encryption_keys\": {\n    \"public_key\": \"...\",\n    \"private_key\": \"...\"\n  },\n  \"correlation_id\": \"e9c1b2a3-f4d5-e6f7-g8h9-i0j1k2l3m4n5\"\n}\n","lang":"json"},"children":[]},{"$$mdtype":"Tag","name":"Admonition","attributes":{"type":"warning","name":"Store your keys securely"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["api_key"]}," and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["encryption_keys"]}," are returned only once. Store them in a secrets manager or environment variable — never commit them to source control."]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Save the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["api_key"]}," — you will use it in the next step."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"step-2-send-a-test-sale","__idx":5},"children":["Step 2: Send a test sale"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Use the API key from Step 1 to process a $10.00 card sale in the sandbox."]},{"$$mdtype":"Tag","name":"Tabs","attributes":{"size":"medium"},"children":[{"$$mdtype":"Tag","name":"TabItemFragment","attributes":{"label":"curl","disable":false},"children":[{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"shell","header":{"controls":{"copy":{}}},"source":"curl -X POST \\\n  https://api.dev.paradisegateway.net/v1/transactions \\\n  -H \"Content-Type: application/json\" \\\n  -H \"APIKEY: KEY-abc123def456...\" \\\n  -d '{\n    \"type\": \"sale\",\n    \"amount\": 1000,\n    \"payment_method\": {\n      \"type\": \"card\",\n      \"card\": {\n        \"pan\": \"4111111111111111\",\n        \"expiry_month\": \"12\",\n        \"expiry_year\": \"2027\",\n        \"cvv\": \"123\",\n        \"cardholder_name\": \"John Doe\"\n      }\n    }\n  }'\n","lang":"shell"},"children":[]}]},{"$$mdtype":"Tag","name":"TabItemFragment","attributes":{"label":"Python","disable":false},"children":[{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"python","header":{"controls":{"copy":{}}},"source":"resp = requests.post(\n    \"https://api.dev.paradisegateway.net/v1/transactions\",\n    headers={\"Content-Type\": \"application/json\", \"APIKEY\": api_key},\n    json={\n        \"type\": \"sale\",\n        \"amount\": 1000,\n        \"payment_method\": {\n            \"type\": \"card\",\n            \"card\": {\n                \"pan\": \"4111111111111111\",\n                \"expiry_month\": \"12\",\n                \"expiry_year\": \"2027\",\n                \"cvv\": \"123\",\n                \"cardholder_name\": \"John Doe\",\n            },\n        },\n    },\n)\ntxn = resp.json()\nprint(f\"Status: {txn['response_status']}, ID: {txn['id']}\")\n","lang":"python"},"children":[]}]},{"$$mdtype":"Tag","name":"TabItemFragment","attributes":{"label":"JavaScript","disable":false},"children":[{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"javascript","header":{"controls":{"copy":{}}},"source":"const txnResp = await fetch(\n  \"https://api.dev.paradisegateway.net/v1/transactions\",\n  {\n    method: \"POST\",\n    headers: {\n      \"Content-Type\": \"application/json\",\n      \"APIKEY\": data.api_key,\n    },\n    body: JSON.stringify({\n      type: \"sale\",\n      amount: 1000,\n      payment_method: {\n        type: \"card\",\n        card: {\n          pan: \"4111111111111111\",\n          expiry_month: \"12\",\n          expiry_year: \"2027\",\n          cvv: \"123\",\n          cardholder_name: \"John Doe\",\n        },\n      },\n    }),\n  }\n);\nconst txn = await txnResp.json();\nconsole.log(`Status: ${txn.response_status}, ID: ${txn.id}`);\n","lang":"javascript"},"children":[]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"response-example","__idx":6},"children":["Response example"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"json","header":{"controls":{"copy":{}}},"source":"{\n  \"id\": \"TRANSACTION-01KEW32V6YNV11T33XGDR7TGWC\",\n  \"object\": \"transaction\",\n  \"type\": \"sale\",\n  \"amount\": 1000,\n  \"transaction_state\": \"completed\",\n  \"response_status\": \"approved\",\n  \"response_code\": \"00\",\n  \"response_message\": \"The API request is approved.\",\n  \"authorization_code\": \"123456\",\n  \"payment_method\": {\n    \"type\": \"card\",\n    \"card\": {\n      \"brand\": \"visa\",\n      \"last_four\": \"1111\",\n      \"funding\": \"credit\"\n    }\n  },\n  \"correlation_id\": \"a1b2c3d4-e5f6-7890-abcd-ef1234567890\"\n}\n","lang":"json"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"step-3-understand-the-response","__idx":7},"children":["Step 3: Understand the response"]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"align":"left","data-label":"Field"},"children":["Field"]},{"$$mdtype":"Tag","name":"th","attributes":{"align":"left","data-label":"What it tells you"},"children":["What it tells you"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["response_status"]}]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["approved"]}," — the payment succeeded"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["response_code"]}]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["00"]}," — the approval code"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["transaction_state"]}]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["completed"]}," — funds are captured (because it's a sale, not an auth)"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["id"]}]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":["Use this to retrieve, capture, cancel, or refund the transaction later"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["correlation_id"]}]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":["Include in support requests for faster troubleshooting"]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"what-you-built","__idx":8},"children":["What you built"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"img","attributes":{"src":"https://files.modern-mermaid.live/images/1776276612814-mermaid-diagram-1776276612989.png","alt":"image"},"children":[]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"next-steps","__idx":9},"children":["Next steps"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/docs/tutorials/build-checkout-page"},"children":["Build a checkout page"]}," — end-to-end tutorial"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/docs/how-tos/process-payments/authorize-capture-separately"},"children":["Authorize and capture separately"]}," — two-step flow"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/docs/get-started/sandbox-vs-production"},"children":["Sandbox vs production"]}," — test card numbers and environment differences"]}]}]},"headings":[{"value":"Tutorial: Your first API call","id":"tutorial-your-first-api-call","depth":1},{"value":"What you will learn","id":"what-you-will-learn","depth":2},{"value":"Prerequisites","id":"prerequisites","depth":2},{"value":"Step 1: Retrieve your API key","id":"step-1-retrieve-your-api-key","depth":2},{"value":"Response","id":"response","depth":3},{"value":"Step 2: Send a test sale","id":"step-2-send-a-test-sale","depth":2},{"value":"Response example","id":"response-example","depth":3},{"value":"Step 3: Understand the response","id":"step-3-understand-the-response","depth":2},{"value":"What you built","id":"what-you-built","depth":2},{"value":"Next steps","id":"next-steps","depth":2}],"frontmatter":{"title":"Tutorial: Your first API call","shortTitle":"First API call","intro":"Authenticate with Basic Auth, retrieve your API key, and send a test transaction — all in under five minutes.","type":"tutorial","seo":{"title":""}},"lastModified":"2026-06-05T02:46:44.000Z","pagePropGetterError":{"message":"","name":""}},"slug":"/docs/tutorials/first-api-call","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}