Schain and Pchain in SpringServe

SpringServe offers support for both the supply chain object and payment chain string. These can be passed into the supply tag url via "schain=" and "payid=" parameters which allows SpringServe to pass the information in Programmatic Connect requests as well as to header bidders that accept it. 

Passing schain to SpringServe

Passing the supply chain object into the ad call requires a specific format outlined in the "SupplyChain for Non-OpenRTB Requests" section of the supply chain object spec:

Format of serialization
The serialization is composed of two items; the SupplyChainObject properties and the SupplyChainNode array. These two items are separated by a bang (“!”) character.

{SupplyChainObject}!{SupplyChainNode array}

SupplyChainObject properties
There are two properties in a SupplyChain object; version and complete. These two values must be included at the beginning of the serialized value and must be separated by a comma (“,”).

ver,complete

Array of SupplyChainNode properties
Following the SupplyChainObject properties, every node in the SupplyChain must be included. Properties of a SupplyChainNode object must be separated by a comma (“,”) and if there is more than one node, each must be separated by a bang (“!”) character.

The order of properties is as follows:

asi,sid,hp,rid,name,domain,ext

The contents of the ext property are exchange specific, no attempt is made in this document to specify the method of serialization of values for this object.

Optional SupplyChainNode property values can be omitted and trailing separators can be optionally excluded.

Example: exampleexchange.com,12345,1,,,

or

exampleexchange.com,12345,1

If the values in any of the properties require URL encoding (See RFC 3986 or Wikipedia post) or contain a comma or bang character, they should be URL encoded. The comma that is used to separate properties should not be encoded.

Example: exampleexchange.com,123%2CB,1,,,

This represents an sid of “123,B” on exampleexchange.com, which handles payments.


So for example, this supply chain object:

{ 
   "ver":"1.0",
   "nodes":[ 
      { 
         "asi":"exchange1.com",
         "domain":"publisher.com",
         "name":"publisher",
         "hp":1,
         "rid":"bid-request-1",
         "sid":"1234"
      },
      { 
         "asi":"exchange2.com",
         "hp":1,
         "sid":"abcd"
      },
      { 
         "asi":"example.com",
         "hp":1,
         "sid":"091381"
      },
      { 
         "asi":"lastexchange.com",
         "hp":1,
         "sid":"22"
      }
   ],
   "complete":1
}

would be passed into the supply tag url like:

schain=1.0,1!exchange1.com,1234,1,bid-request-1,publisher,publisher.com!exchange2.com,abcd,1,,,!example.com,091381,1,,,!lastexchange.com,22,1,,,


These nodes will then be passed to any header bidders that accept them, and also appended to the full supply chain sent in SpringServe Programmatic Connect requests.

You can also use the "{{SCHAIN}}" passthrough macro to include what was passed in the supply tag url on demand tag endpoints.

Passing pchain to SpringServe

Sending the payment chain in the supply tag url is much simpler than the format required for supply chain. All that is required is to make sure the string is properly encoded, and then sent through the "payid="  param. 

For example the following pchain:

1514as71fv7:1891h-jo1ov9987:acc22


would look like this in the supply tag url:

&payid=1514as71fv7%3A1891h-jo1ov9987%3Aacc22

Similar to schain, the pchain passed in the supply tag url will be sent to any header bidders that accept it, and also appended to the full payment chain sent in SpringServe Programmatic Connect requests.

You can also use the "{{PAY_ID}}" passthrough macro to include what was passed in the supply tag url on demand tag endpoints.