p=t P ; q = t Q ;

GammaPQ[z_]:=Product[(1-p^(m+1)q^(n+1) / z) / (1-p^m q^n z)+O[t]^(order+1),{m,0,order},{n,0,order-m}]

GammaPQ1:=Product[(1-p^(m+1)q^(n+1)) / If[m==0&&n==0,1,(1-p^m q^n )]+O[t]^(order+1),{m,0,order},{n,0,order-m}]

GammaPQ[x_,xs___]:=GammaPQ[x]GammaPQ[xs]

trifund[a_,b_,c_]:=GammaPQ[t^(1/2) a b c ,t^(1/2) a b /c,t^(1/2) a c/b ,t^(1/2) b c /a,t^(1/2) a /b/c,t^(1/2) b/c/a,t^(1/2) c/a/b,t^(1/2) 1/a/b/c ]

vec[z_]:=1/GammaPQ[t]/GammaPQ1/GammaPQ[z^2,t z^2,1/z^2,t/z^2 ]

integrate[x_,z_]:=Residue[Normal[Expand[x]]/z,{z,0}]/2 + O[t]^(order+1)

SCI[a_,b_,c_,d_]:=integrate[ vec[z] trifund[a,b,z]trifund[z,c,d],z]

order=2

SCI[a,b,c,d]

X-(X/.{b->c,c->b})