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

# Retrieve 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}/": {
      "get": {
        "summary": "Retrieve a Transaction",
        "description": "",
        "operationId": "retrieve-a-transaction",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "ID of transaction to retrieve.",
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 0
            },
            "required": true
          },
          {
            "name": "instance",
            "in": "query",
            "description": "Your Shop & Pay instance name.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "200",
            "content": {
              "application/json": {
                "examples": {
                  "Result": {
                    "value": "{ \n    \"status\":\"success\",\n    \"data\":[ \n        { \n            \"id\":1,\n            \"uuid\":\"f384000b\",\n            \"status\":\"authorized\",\n            \"time\":\"2020-01-20 15:56:02\",\n            \"lang\":\"de\",\n            \"pageUuid\":\"892dcf5c\",\n            \"payment\":{ \n                \"brand\":\"visa\"\n            },\n            \"psp\":\"Shopandpay_Payments\",\n            \"pspId\":26,\n            \"mode\":\"LIVE\",\n            \"referenceId\":\"ORDER#321\",\n            \"invoice\":{ \n                \"currencyAlpha3\":\"CHF\",\n                \"products\":[ \n                    { \n                        \"quantity\":1,\n                        \"name\":\"Hoodie\",\n                        \"amount\":5900\n                    },\n                    { \n                        \"quantity\":2,\n                        \"name\":\"T-Shirt\",\n                        \"amount\":2850\n                    }\n                ],\n                \"discount\":{ \n                    \"code\":\"SUPERSALE\",\n                    \"percentage\":33,\n                    \"amount\":3828\n                },\n                \"shippingAmount\":150000,\n                \"totalAmount\":9272,\n                \"customFields\":{ \n                    \"20\":{ \n                        \"name\":\"Additional Information\",\n                        \"value\":\"Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.\"\n                    }\n                }\n            },\n            \"contact\":{ \n                \"id\":16,\n                \"uuid\":\"9c9c0282\",\n                \"company\":\"FeelGood\",\n                \"title\":\"mister\",\n                \"firstname\":\"Hans\",\n                \"lastname\":\"Schmid\",\n                \"street\":\"Dorstrasse 11\",\n                \"zip\":\"1234\",\n                \"place\":\"Habern\",\n                \"country\":\"Schweiz\",\n                \"countryISO\":\"CH\",\n                \"date_of_birth\":\"10.03.1989\",\n                \"email\":\"info@example.com\",\n                \"phone\":\"+413312345678\",\n                \"delivery_company\":\"NewFashion\",\n                \"delivery_title\":\"miss\",\n                \"delivery_firstname\":\"Fabienne\",\n                \"delivery_lastname\":\"Muster\",\n                \"delivery_street\":\"Seestrasse 39\",\n                \"delivery_zip\":\"4321\",\n                \"delivery_place\":\"Nechters\",\n                \"delivery_country\":\"Schweiz\"\n                \"delivery_countryISO\":\"CH\",\n            }\n        }\n    ]\n}"
                  }
                }
              }
            }
          }
        },
        "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 GET \"https://api.shop-and-pay.com/v1.0/Transaction/1/?instance=INSTANCE_NAME\" --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(1);\n\ntry {\n    $response = $shopandpay->getOne($transaction);\n    var_dump($response);\n} catch (\\Shopandpay\\ShopandpayException $e) {\n    print $e->getMessage();\n}"
            },
            {
              "language": "python",
              "code": "import urllib.request\nimport hmac\nimport hashlib\nimport base64\nimport json\n\npost_data = {}\n\ndata = urllib.parse.urlencode(post_data).encode('UTF-8')\n\ndig = hmac.new(b'INSTANCE_API_SECRET', msg=data, digestmod=hashlib.sha256).digest()\npost_data['ApiSignature'] = base64.b64encode(dig).decode()\npost_data['instance'] = 'INSTANCE_NAME'\n\ndata = urllib.parse.urlencode(post_data, quote_via=urllib.parse.quote).encode('UTF-8')\n\nresult = urllib.request.urlopen('https://api.shop-and-pay.com/v1.0/Transaction/1/?' + data)\ncontent = result.read().decode('UTF-8')\nresponse = json.loads(content)\ntransaction = response['data'][0]\nprint(transaction)"
            }
          ],
          "samples-languages": [
            "curl",
            "php",
            "python"
          ]
        }
      }
    }
  },
  "x-readme": {
    "headers": [],
    "explorer-enabled": false,
    "proxy-enabled": true
  },
  "x-readme-fauxas": true
}
```