---
updatedAt: 2025-05-20T21:54:16.000Z
agentTools:
  projectIndex: https://shop-and-pay.readme.io/llms.txt
---

# Capture a Transaction

# OpenAPI definition

```json
{
  "openapi": "3.1.0",
  "info": {
    "title": "api-settings",
    "version": "1.0"
  },
  "servers": [
    {
      "url": "https://api.shop-and-pay.com/v1.0"
    }
  ],
  "security": [
    {}
  ],
  "paths": {
    "/Transaction/{id}/capture": {
      "post": {
        "summary": "Capture a Transaction",
        "description": "",
        "operationId": "capture-a-transaction",
        "parameters": [
          {
            "name": "instance",
            "in": "query",
            "description": "Your Shop & Pay instance name",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "id",
            "in": "path",
            "description": "ID of the transacton to charge.",
            "schema": {
              "type": "integer",
              "format": "int32"
            },
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "200",
            "content": {
              "application/json": {
                "examples": {
                  "Result": {
                    "value": "{  \n    \"status\":\"success\",\n    \"data\":[  \n        {  \n            \"id\":2,\n            \"uuid\":\"81d545ca\",\n            \"time\":\"2017-10-16 12:29:12\",\n            \"status\":\"confirmed\",\n            \"lang\":\"de\",\n            \"psp\":\"Shopandpay_Payments\"\n        }\n    ]\n}"
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string",
                      "example": "success"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "integer",
                            "example": 2,
                            "default": 0
                          },
                          "uuid": {
                            "type": "string",
                            "example": "81d545ca"
                          },
                          "time": {
                            "type": "string",
                            "example": "2017-10-16 12:29:12"
                          },
                          "status": {
                            "type": "string",
                            "example": "confirmed"
                          },
                          "lang": {
                            "type": "string",
                            "example": "de"
                          },
                          "psp": {
                            "type": "string",
                            "example": "Shopandpay_Payments"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "deprecated": false,
        "x-readme": {
          "code-samples": [
            {
              "language": "curl",
              "code": "apiSignature=`echo -n \"\" | openssl dgst -sha256 -hmac \"INSTANCE_API_SECRET\" -binary | openssl enc -base64`\ncurl --request POST \"https://api.shop-and-pay.com/v1.0/Transaction/2/capture/?instance=INSTANCE_NAME\" \\\n    --data-urlencode \"ApiSignature=$apiSignature\""
            },
            {
              "language": "php",
              "code": "<?php\n\n// $instanceName is a part of the url where you access your shopandpay installation.\n// https://{$instanceName}.shop-and-pay.com\n$instanceName = 'YOUR_INSTANCE_NAME';\n\n// $secret is the shopandpay secret for the communication between the applications\n// if you think someone got your secret, just regenerate it in the shopandpay administration\n$secret = 'YOUR_SECRET';\n\n$shopandpay = new \\Shopandpay\\Shopandpay($instanceName, $secret);\n\n$transaction = new \\Shopandpay\\Models\\Request\\Transaction();\n$transaction->setId(2);\n\ntry {\n    $response = $shopandpay->capture($transaction);\n    var_dump($response);\n} catch (\\Shopandpay\\ShopandpayException $e) {\n    print $e->getMessage();\n}\n"
            }
          ],
          "samples-languages": [
            "curl",
            "php"
          ]
        }
      }
    }
  },
  "x-readme": {
    "headers": [],
    "explorer-enabled": false,
    "proxy-enabled": true
  },
  "x-readme-fauxas": true
}
```