{"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":"authorize-and-capture-separately","__idx":0},"children":["Authorize and capture separately"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"prerequisites","__idx":1},"children":["Prerequisites"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["A valid API key — see ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/docs/how-tos/setup/obtain-credentials"},"children":["Obtain API credentials"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["A processor integration configured for card payments (TSYS)"]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"step-1-authorize-the-payment","__idx":2},"children":["Step 1: Authorize the payment"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Send ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["POST /v1/transactions"]}," with ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["type: auth"]},". This places a hold on the person's card without capturing funds."]},{"$$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: YOUR-API-KEY\" \\\n  -d '{\n    \"type\": \"auth\",\n    \"amount\": 25000,\n    \"tip\": 1000,\n    \"payment_method\": {\n      \"type\": \"card\",\n      \"pan\": \"5500000000005678\",\n      \"expiry_month\": \"07\",\n      \"expiry_year\": \"2029\",\n      \"cardholder_name\": \"Nyota Uhura\",\n      \"cvv\": \"789\",\n      \"address_line1\": \"42 Subspace Ln\",\n      \"zip\": \"30301\"\n    },\n    \"recurring\": false,\n    \"purchase_description\": \"Starfleet uniform\"\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":"import requests\n\nresp = requests.post(\n    \"https://api.dev.paradisegateway.net/v1/transactions\",\n    headers={\"Content-Type\": \"application/json\", \"APIKEY\": \"YOUR-API-KEY\"},\n    json={\n        \"type\": \"auth\",\n        \"amount\": 25000,\n        \"tip\": 1000,\n        \"payment_method\": {\n            \"type\": \"card\",\n            \"pan\": \"5500000000005678\",\n            \"expiry_month\": \"07\",\n            \"expiry_year\": \"2029\",\n            \"cardholder_name\": \"Nyota Uhura\",\n            \"cvv\": \"789\",\n            \"address_line1\": \"42 Subspace Ln\",\n            \"zip\": \"30301\",\n        },\n        \"recurring\": False,\n        \"purchase_description\": \"Starfleet uniform\",\n    },\n)\ndata = resp.json()\ntransaction_id = data[\"id\"]\nprint(f\"Authorization ID: {transaction_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 resp = await fetch(\n  \"https://api.dev.paradisegateway.net/v1/transactions\",\n  {\n    method: \"POST\",\n    headers: {\n      \"Content-Type\": \"application/json\",\n      \"APIKEY\": \"YOUR-API-KEY\",\n    },\n    body: JSON.stringify({\n      type: \"auth\",\n      amount: 25000,\n      tip: 1000,\n      payment_method: {\n        type: \"card\",\n        pan: \"5500000000005678\",\n        expiry_month: \"07\",\n        expiry_year: \"2029\",\n        cardholder_name: \"Nyota Uhura\",\n        cvv: \"789\",\n        address_line1: \"42 Subspace Ln\",\n        zip: \"30301\",\n      },\n      recurring: false,\n      purchase_description: \"Starfleet uniform\",\n    }),\n  }\n);\nconst data = await resp.json();\nconsole.log(\"Authorization ID:\", data.id);\n","lang":"javascript"},"children":[]}]},{"$$mdtype":"Tag","name":"TabItemFragment","attributes":{"label":"C#","disable":false},"children":[{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"csharp","header":{"controls":{"copy":{}}},"source":"using var client = new HttpClient();\nclient.DefaultRequestHeaders.Add(\"APIKEY\", \"YOUR-API-KEY\");\n\nvar payload = new\n{\n    type = \"auth\", amount = 25000, tip = 1000,\n    payment_method = new\n    {\n        type = \"card\", pan = \"5500000000005678\",\n        expiry_month = \"07\", expiry_year = \"2029\",\n        cardholder_name = \"Nyota Uhura\", cvv = \"789\",\n        address_line1 = \"42 Subspace Ln\", zip = \"30301\"\n    },\n    recurring = false, purchase_description = \"Starfleet uniform\"\n};\nvar resp = await client.PostAsJsonAsync(\n    \"https://api.dev.paradisegateway.net/v1/transactions\", payload);\nConsole.WriteLine(await resp.Content.ReadAsStringAsync());\n","lang":"csharp"},"children":[]}]},{"$$mdtype":"Tag","name":"TabItemFragment","attributes":{"label":"Java","disable":false},"children":[{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"java","header":{"controls":{"copy":{}}},"source":"HttpClient client = HttpClient.newHttpClient();\nString body = \"\"\"\n    {\n      \"type\": \"auth\", \"amount\": 25000, \"tip\": 1000,\n      \"payment_method\": {\n        \"type\": \"card\", \"pan\": \"5500000000005678\",\n        \"expiry_month\": \"07\", \"expiry_year\": \"2029\",\n        \"cardholder_name\": \"Nyota Uhura\", \"cvv\": \"789\",\n        \"address_line1\": \"42 Subspace Ln\", \"zip\": \"30301\"\n      },\n      \"recurring\": false, \"purchase_description\": \"Starfleet uniform\"\n    }\n    \"\"\";\nHttpRequest request = HttpRequest.newBuilder()\n    .uri(URI.create(\"https://api.dev.paradisegateway.net/v1/transactions\"))\n    .header(\"Content-Type\", \"application/json\")\n    .header(\"APIKEY\", \"YOUR-API-KEY\")\n    .POST(HttpRequest.BodyPublishers.ofString(body))\n    .build();\nHttpResponse<String> resp = client.send(request,\n    HttpResponse.BodyHandlers.ofString());\nSystem.out.println(resp.body());\n","lang":"java"},"children":[]}]},{"$$mdtype":"Tag","name":"TabItemFragment","attributes":{"label":"Go","disable":false},"children":[{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"go","header":{"controls":{"copy":{}}},"source":"payload := strings.NewReader(`{\n  \"type\": \"auth\", \"amount\": 25000, \"tip\": 1000,\n  \"payment_method\": {\n    \"type\": \"card\", \"pan\": \"5500000000005678\",\n    \"expiry_month\": \"07\", \"expiry_year\": \"2029\",\n    \"cardholder_name\": \"Nyota Uhura\", \"cvv\": \"789\",\n    \"address_line1\": \"42 Subspace Ln\", \"zip\": \"30301\"\n  },\n  \"recurring\": false, \"purchase_description\": \"Starfleet uniform\"\n}`)\nreq, _ := http.NewRequest(\"POST\",\n    \"https://api.dev.paradisegateway.net/v1/transactions\", payload)\nreq.Header.Set(\"Content-Type\", \"application/json\")\nreq.Header.Set(\"APIKEY\", \"YOUR-API-KEY\")\nresp, _ := http.DefaultClient.Do(req)\ndefer resp.Body.Close()\nbody, _ := io.ReadAll(resp.Body)\nfmt.Println(string(body))\n","lang":"go"},"children":[]}]},{"$$mdtype":"Tag","name":"TabItemFragment","attributes":{"label":"PHP","disable":false},"children":[{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"php","header":{"controls":{"copy":{}}},"source":"$ch = curl_init(\"https://api.dev.paradisegateway.net/v1/transactions\");\ncurl_setopt_array($ch, [\n    CURLOPT_RETURNTRANSFER => true, CURLOPT_POST => true,\n    CURLOPT_HTTPHEADER => [\"Content-Type: application/json\", \"APIKEY: YOUR-API-KEY\"],\n    CURLOPT_POSTFIELDS => json_encode([\n        \"type\" => \"auth\", \"amount\" => 25000, \"tip\" => 1000,\n        \"payment_method\" => [\n            \"type\" => \"card\", \"pan\" => \"5500000000005678\",\n            \"expiry_month\" => \"07\", \"expiry_year\" => \"2029\",\n            \"cardholder_name\" => \"Nyota Uhura\", \"cvv\" => \"789\",\n            \"address_line1\" => \"42 Subspace Ln\", \"zip\" => \"30301\",\n        ],\n        \"recurring\" => false, \"purchase_description\" => \"Starfleet uniform\",\n    ]),\n]);\necho curl_exec($ch); curl_close($ch);\n","lang":"php"},"children":[]}]},{"$$mdtype":"Tag","name":"TabItemFragment","attributes":{"label":"Ruby","disable":false},"children":[{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"ruby","header":{"controls":{"copy":{}}},"source":"require \"net/http\"; require \"json\"\nuri = URI(\"https://api.dev.paradisegateway.net/v1/transactions\")\nreq = Net::HTTP::Post.new(uri, {\n  \"Content-Type\" => \"application/json\", \"APIKEY\" => \"YOUR-API-KEY\",\n})\nreq.body = {\n  type: \"auth\", amount: 25000, tip: 1000,\n  payment_method: { type: \"card\", pan: \"5500000000005678\",\n    expiry_month: \"07\", expiry_year: \"2029\",\n    cardholder_name: \"Nyota Uhura\", cvv: \"789\",\n    address_line1: \"42 Subspace Ln\", zip: \"30301\" },\n  recurring: false, purchase_description: \"Starfleet uniform\",\n}.to_json\nresp = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) { |http| http.request(req) }\nputs resp.body\n","lang":"ruby"},"children":[]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Save the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["id"]}," from the response — you need it for the capture step."]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"json","header":{"controls":{"copy":{}}},"source":"{\n  \"id\": \"TRANSACTION-02KNUHURA8YWP4LT9G3X5V7Z0\",\n  \"type\": \"auth\",\n  \"transaction_state\": \"authorized\",\n  \"response_status\": \"Approved\",\n  \"response_code\": \"00\",\n  \"amount\": 25000\n}\n","lang":"json"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"step-2-capture-the-payment","__idx":3},"children":["Step 2: Capture the payment"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["When ready (for example, the order ships), send ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["POST /v1/transactions/{id}/capture"]},"."]},{"$$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/TRANSACTION-02KNUHURA8YWP4LT9G3X5V7Z0/capture \\\n  -H \"Content-Type: application/json\" \\\n  -H \"APIKEY: YOUR-API-KEY\" \\\n  -d '{\n    \"type\": \"capture\",\n    \"amount\": 30000,\n    \"tip\": 5000\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    f\"https://api.dev.paradisegateway.net/v1/transactions/{transaction_id}/capture\",\n    headers={\"Content-Type\": \"application/json\", \"APIKEY\": \"YOUR-API-KEY\"},\n    json={\"type\": \"capture\", \"amount\": 30000, \"tip\": 5000},\n)\nprint(resp.json())\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 captureResp = await fetch(\n  `https://api.dev.paradisegateway.net/v1/transactions/${transactionId}/capture`,\n  {\n    method: \"POST\",\n    headers: {\n      \"Content-Type\": \"application/json\",\n      \"APIKEY\": \"YOUR-API-KEY\",\n    },\n    body: JSON.stringify({\n      type: \"capture\",\n      amount: 30000,\n      tip: 5000,\n    }),\n  }\n);\nconsole.log(await captureResp.json());\n","lang":"javascript"},"children":[]}]},{"$$mdtype":"Tag","name":"TabItemFragment","attributes":{"label":"C#","disable":false},"children":[{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"csharp","header":{"controls":{"copy":{}}},"source":"var capturePayload = new { type = \"capture\", amount = 30000, tip = 5000 };\nvar captureResp = await client.PostAsJsonAsync(\n    $\"https://api.dev.paradisegateway.net/v1/transactions/{transactionId}/capture\",\n    capturePayload);\nConsole.WriteLine(await captureResp.Content.ReadAsStringAsync());\n","lang":"csharp"},"children":[]}]},{"$$mdtype":"Tag","name":"TabItemFragment","attributes":{"label":"Java","disable":false},"children":[{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"java","header":{"controls":{"copy":{}}},"source":"String captureBody = \"\"\"\n    {\"type\": \"capture\", \"amount\": 30000, \"tip\": 5000}\n    \"\"\";\nHttpRequest captureReq = HttpRequest.newBuilder()\n    .uri(URI.create(\n        \"https://api.dev.paradisegateway.net/v1/transactions/\"\n        + transactionId + \"/capture\"))\n    .header(\"Content-Type\", \"application/json\")\n    .header(\"APIKEY\", \"YOUR-API-KEY\")\n    .POST(HttpRequest.BodyPublishers.ofString(captureBody))\n    .build();\nHttpResponse<String> captureResp = client.send(captureReq,\n    HttpResponse.BodyHandlers.ofString());\nSystem.out.println(captureResp.body());\n","lang":"java"},"children":[]}]},{"$$mdtype":"Tag","name":"TabItemFragment","attributes":{"label":"Go","disable":false},"children":[{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"go","header":{"controls":{"copy":{}}},"source":"capturePayload := strings.NewReader(\n    `{\"type\": \"capture\", \"amount\": 30000, \"tip\": 5000}`)\ncaptureReq, _ := http.NewRequest(\"POST\",\n    \"https://api.dev.paradisegateway.net/v1/transactions/\"+transactionID+\"/capture\",\n    capturePayload)\ncaptureReq.Header.Set(\"Content-Type\", \"application/json\")\ncaptureReq.Header.Set(\"APIKEY\", \"YOUR-API-KEY\")\ncaptureResp, _ := http.DefaultClient.Do(captureReq)\ndefer captureResp.Body.Close()\ncaptureBody, _ := io.ReadAll(captureResp.Body)\nfmt.Println(string(captureBody))\n","lang":"go"},"children":[]}]},{"$$mdtype":"Tag","name":"TabItemFragment","attributes":{"label":"PHP","disable":false},"children":[{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"php","header":{"controls":{"copy":{}}},"source":"$ch = curl_init(\n    \"https://api.dev.paradisegateway.net/v1/transactions/$transactionId/capture\");\ncurl_setopt_array($ch, [\n    CURLOPT_RETURNTRANSFER => true, CURLOPT_POST => true,\n    CURLOPT_HTTPHEADER => [\"Content-Type: application/json\", \"APIKEY: YOUR-API-KEY\"],\n    CURLOPT_POSTFIELDS => json_encode([\n        \"type\" => \"capture\", \"amount\" => 30000, \"tip\" => 5000,\n    ]),\n]);\necho curl_exec($ch); curl_close($ch);\n","lang":"php"},"children":[]}]},{"$$mdtype":"Tag","name":"TabItemFragment","attributes":{"label":"Ruby","disable":false},"children":[{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"ruby","header":{"controls":{"copy":{}}},"source":"uri = URI(\n  \"https://api.dev.paradisegateway.net/v1/transactions/#{transaction_id}/capture\")\nreq = Net::HTTP::Post.new(uri, {\n  \"Content-Type\" => \"application/json\", \"APIKEY\" => \"YOUR-API-KEY\",\n})\nreq.body = { type: \"capture\", amount: 30000, tip: 5000 }.to_json\nresp = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) { |http| http.request(req) }\nputs resp.body\n","lang":"ruby"},"children":[]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The capture response confirms the transaction is ready for settlement."]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"json","header":{"controls":{"copy":{}}},"source":"{\n  \"id\": \"TRANSACTION-02KNUHURA8YWP4LT9G3X5V7Z0\",\n  \"type\": \"capture\",\n  \"transaction_state\": \"completed\",\n  \"response_status\": \"Approved\",\n  \"response_code\": \"00\",\n  \"amount\": 30000,\n  \"tip\": 5000\n}\n","lang":"json"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"canceling-an-uncaptured-authorization","__idx":4},"children":["Canceling an uncaptured authorization"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["If you decide not to fulfill the order, cancel the authorization to release the hold immediately."]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"shell","header":{"controls":{"copy":{}}},"source":"curl -X POST \\\n  https://api.dev.paradisegateway.net/v1/transactions/TRANSACTION-02KNUHURA8YWP4LT9G3X5V7Z0/cancel \\\n  -H \"Content-Type: application/json\" \\\n  -H \"APIKEY: YOUR-API-KEY\" \\\n  -d '{\"type\": \"cancel\", \"amount\": 25000}'\n","lang":"shell"},"children":[]},{"$$mdtype":"Tag","name":"Admonition","attributes":{"type":"info","name":"Authorization expiry"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Uncaptured authorizations expire after 7–30 days (varies by issuing bank). Always cancel explicitly to release funds sooner."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"next-steps","__idx":5},"children":["Next steps"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/docs/how-tos/process-payments/handle-partial-capture"},"children":["Handle partial captures"]}," — capture less than the authorized amount"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/docs/how-tos/process-payments/add-tip"},"children":["Add a tip or surcharge"]}," — update the amount between auth and capture"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/docs/concepts/transactions/sale-vs-auth"},"children":["About sale vs. authorization"]}]}]}]},"headings":[{"value":"Authorize and capture separately","id":"authorize-and-capture-separately","depth":1},{"value":"Prerequisites","id":"prerequisites","depth":2},{"value":"Step 1: Authorize the payment","id":"step-1-authorize-the-payment","depth":2},{"value":"Step 2: Capture the payment","id":"step-2-capture-the-payment","depth":2},{"value":"Canceling an uncaptured authorization","id":"canceling-an-uncaptured-authorization","depth":2},{"value":"Next steps","id":"next-steps","depth":2}],"frontmatter":{"title":"Authorize and capture separately","shortTitle":"Auth + capture","intro":"Place a hold on a card with an authorization, then capture when you are ready to fulfill. This two-step flow is ideal for e-commerce, pre-orders, and reservations.","type":"how-to","seo":{"title":""}},"lastModified":"2026-06-05T02:46:44.000Z","pagePropGetterError":{"message":"","name":""}},"slug":"/docs/how-tos/process-payments/authorize-capture-separately","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}