Server-to-Server (s2s) Calls

Commerce Grid calls the Buyer endpoint using a s2s call in the following cases:

  • The initial call from the Publisher side was done using a s2s call

  • Commerce Grid is calling the Buyer burl

  • Commerce Grid is calling the Buyer nurl in some cases

An easy way to determine whether the call from Commerce Grid is s2s is to check the user agent. For s2s calls it is always "CGRID/1.0". One advantage of s2s impression calls is increased control of the call delivery, and thus minimizing any discrepancies between partners’ reporting and/or invoicing.

Expected s2s Behaviour

  • Commerce Grid expects HTTP 200, 204, or 302 responses to s2s calls, if you have recorded a valid impression.

  • If Commerce Grid receives a response code > 399, i.e. HTTP 4xx, or 5xx, it denotes the impression as not properly recorded on the Buyer side, and will lead to discrepancies between Commerce Grid and the Buyer.

  • If the response code is >= 400, or there was a timeout, Commerce Grid makes 1 retry to check if a valid impression was recorded on the Buyer side.

s2s Headers

When sending s2s impression calls, Commerce Grid uses the following headers.

  • User-Agent: Indicates that the impression call is relayed by BidSwitch, this is always CGRID/1.0.

  • X-User-Agent: Specifies the application type, operating system, software vendor or software version of the original request.

  • X-Forwarded-For: Identifies the originating IP address.

  • X-CGRID-ServerUpstream: A value of 1 indicates that the original impression call to BidSwitch was from a server.

# Example of s2s headers from burl imp request
X-Forwarded-For: 77.16.215.3, 18.196.6.164
X-CGRID-ServerUpstream: 1
User-Agent: CGRID/1.0
X-User-Agent: Mozilla/5.0 (iPhone; CPU iPhone OS 11_2_1 like Mac OS X) AppleWebKit/604.4.7 (KHTML, like Gecko) Mobile/15C153 [FBAN/FBIOS;FBAV/179.0.0.50.82;FBBV/116150041;FBDV/iPhone8,1;FBMD/iPhone;FBSN/iOS;FBSV/11.2.1;FBSS/2;FBCR/Telenor;FBID/phone;FBLC/nb_NO;FBOP/5;FBRV/0]

Use the following table to compare the s2s vs u2s headers Commerce Grid applies in each circumstance.

CGrid to DSP

s2s nurl

s2s burl

u2s

s2s

User-Agent: CGRID/1.0

X-CGRID-ServerUpstream: 1

User-Agent: CGRID/1.0

X-CGRID-ServerUpstream: 1

X-User-Agent: (applied from user in most cases)

X-Forwarded-For:

n/a; s2s forwarded as s2s only

u2s

User-Agent: CGRID/1.0

X-Forwarded-For:

X-User-Agent: (applied from user)

User-Agent: CGRID/1.0

X-Forwarded-For:

X-User-Agent: (applied from user)

X-Forwarded-For:

X-User-Agent: See u2s note