{
  "name": "Повторы клиента участника: POST без ключа не повторяется, DELETE и GET — повторяются",
  "description": "Код для кассы (POST без Idempotency-Key) после обрыва не повторяется: transport с mayHaveBeenProcessed. endSession (DELETE) безопасен для повтора: после обрыва он повторяется, и 401 (первая попытка уже закрыла сеанс) — успех. Следующий вызов берёт сеанс у поставщика один раз, и повтор после 503 идёт с тем же сеансом.",
  "client": {
    "api": "member",
    "credential": {
      "memberSession": "lms_test_d0f3364baf26.4OuDuCo1m7vWf_OongPoB6orwvXEHwM1vFYHST6ieao",
      "sessionProvider": ["lms_test_44fcc049028e.YX6uB4Uy9bSplk5J3N4vxOonenmkJ6GYMB-zwIwDSfs"]
    },
    "origin": "https://lk.example.com:8443",
    "baseUrl": "https://api.example.com"
  },
  "calls": [
    {
      "operation": "issuePresentationCode",
      "args": {},
      "expect": {"error": {"class": "transport", "mayHaveBeenProcessed": true, "idempotencyKey": null}}
    },
    {"operation": "endSession", "args": {}, "expect": {"result": null}},
    {
      "operation": "getProfile",
      "args": {},
      "expect": {
        "result": {
          "id": "01929c1e-0030-7030-8030-000000000030",
          "status": "frozen",
          "masked_phone": null,
          "first_name": null,
          "registered_at": "2026-09-01T10:00:00Z",
          "referral_code": null,
          "balance": {
            "point_type_id": "01929c1e-0031-7031-8031-000000000031",
            "precision": 2,
            "available": 0,
            "pending": 1500,
            "held": 0,
            "spendable": 0,
            "next_expiration": null
          },
          "tier": null,
          "stamps": []
        }
      }
    }
  ],
  "exchanges": [
    {
      "request": {
        "method": "POST",
        "url": "https://api.example.com/api/member/v1/me/presentation-codes",
        "headers": {
          "authorization": "Bearer lms_test_d0f3364baf26.4OuDuCo1m7vWf_OongPoB6orwvXEHwM1vFYHST6ieao",
          "accept": "application/json",
          "content-type": null,
          "idempotency-key": null,
          "loyal-merchant": null,
          "origin": "https://lk.example.com:8443"
        }
      },
      "failure": "after_send"
    },
    {
      "request": {
        "method": "DELETE",
        "url": "https://api.example.com/api/member/v1/session",
        "headers": {
          "authorization": "Bearer lms_test_d0f3364baf26.4OuDuCo1m7vWf_OongPoB6orwvXEHwM1vFYHST6ieao",
          "accept": "application/json",
          "content-type": null,
          "idempotency-key": null,
          "loyal-merchant": null,
          "origin": "https://lk.example.com:8443"
        }
      },
      "failure": "after_send"
    },
    {
      "request": {
        "method": "DELETE",
        "url": "https://api.example.com/api/member/v1/session",
        "headers": {
          "authorization": "Bearer lms_test_d0f3364baf26.4OuDuCo1m7vWf_OongPoB6orwvXEHwM1vFYHST6ieao",
          "accept": "application/json",
          "content-type": null,
          "idempotency-key": null,
          "loyal-merchant": null,
          "origin": "https://lk.example.com:8443"
        }
      },
      "response": {
        "status": 401,
        "headers": {"Content-Type": "application/problem+json", "X-Request-Id": "01929c20-0301-7000-8000-000000000301"},
        "json": {
          "type": "urn:loyal:problem:unauthenticated",
          "title": "A valid API key is required.",
          "status": 401,
          "code": "unauthenticated",
          "request_id": "01929c20-0301-7000-8000-000000000301"
        }
      }
    },
    {
      "request": {
        "method": "GET",
        "url": "https://api.example.com/api/member/v1/me",
        "headers": {
          "authorization": "Bearer lms_test_44fcc049028e.YX6uB4Uy9bSplk5J3N4vxOonenmkJ6GYMB-zwIwDSfs",
          "accept": "application/json",
          "content-type": null,
          "idempotency-key": null,
          "loyal-merchant": null,
          "origin": "https://lk.example.com:8443"
        }
      },
      "response": {
        "status": 503,
        "headers": {"Content-Type": "text/html"},
        "text": "<html><body>503 Service Temporarily Unavailable</body></html>"
      }
    },
    {
      "request": {
        "method": "GET",
        "url": "https://api.example.com/api/member/v1/me",
        "headers": {
          "authorization": "Bearer lms_test_44fcc049028e.YX6uB4Uy9bSplk5J3N4vxOonenmkJ6GYMB-zwIwDSfs",
          "accept": "application/json",
          "content-type": null,
          "idempotency-key": null,
          "loyal-merchant": null,
          "origin": "https://lk.example.com:8443"
        }
      },
      "response": {
        "status": 200,
        "headers": {"Content-Type": "application/json", "X-Request-Id": "01929c20-0302-7000-8000-000000000302"},
        "json": {
          "id": "01929c1e-0030-7030-8030-000000000030",
          "status": "frozen",
          "masked_phone": null,
          "first_name": null,
          "registered_at": "2026-09-01T10:00:00Z",
          "referral_code": null,
          "balance": {
            "point_type_id": "01929c1e-0031-7031-8031-000000000031",
            "precision": 2,
            "available": 0,
            "pending": 1500,
            "held": 0,
            "spendable": 0,
            "next_expiration": null
          },
          "tier": null,
          "stamps": []
        }
      }
    }
  ],
  "sleeps": [500, 500]
}
