Difference between revisions of "Web Hook"
From Spiffy Stores Knowledge Base
m (Created page with ''''Web Hooks''' are a way to tell Spiffy stores to call a script on one of your own web servers and react to the event in any way you want.') |
m |
||
Line 1: | Line 1: | ||
'''Web Hooks''' are a way to tell Spiffy stores to call a script on one of your own web servers and react to the event in any way you want. | '''Web Hooks''' are a way to tell Spiffy stores to call a script on one of your own web servers and react to the event in any way you want. | ||
+ | |||
+ | == Example Web Hook Post == | ||
+ | |||
+ | Here is an example of the format of the data that a Web Hook posts to your application. | ||
+ | |||
+ | <pre> | ||
+ | POST /your-web-hook-path HTTP/1.1 | ||
+ | Accept: */* | ||
+ | Content-Type: application/xml | ||
+ | Content-Length: 2665 | ||
+ | X_spiffy_stores_id: 00000000-0000-0000-0000-000000000000 | ||
+ | |||
+ | <?xml version="1.0" encoding="UTF-8"?> | ||
+ | <order> | ||
+ | <buyer-accepts-marketing type="boolean">false</buyer-accepts-marketing> | ||
+ | <cart-token nil="true"/> | ||
+ | <closed-at type="datetime" nil="true"></closed-at> | ||
+ | <created-at type="datetime">2010-06-18T00:00:00+10:00</created-at> | ||
+ | <currency>AUD</currency> | ||
+ | <email>spiffy@mystore.spiffystores.com</email> | ||
+ | <financial-status>paid</financial-status> | ||
+ | <fulfillment-status>unshipped</fulfillment-status> | ||
+ | <gateway>Testing Gateway</gateway> | ||
+ | <id type="integer">0</id> | ||
+ | <ip>127.0.0.1</ip> | ||
+ | <note></note> | ||
+ | <number type="integer">99999</number> | ||
+ | <shipping-method>Australia Post</shipping-method> | ||
+ | <shop-id type="integer">0</shop-id> | ||
+ | <subtotal-price type="decimal">81.82</subtotal-price> | ||
+ | <taxes-included type="boolean">true</taxes-included> | ||
+ | <total-discounts type="decimal">10.0</total-discounts> | ||
+ | <total-line-items-price type="decimal">91.82</total-line-items-price> | ||
+ | <total-price type="decimal">100.0</total-price> | ||
+ | <total-shipping type="decimal">50.0</total-shipping> | ||
+ | <total-tax type="decimal">12.72</total-tax> | ||
+ | <total-weight type="float">0.2</total-weight> | ||
+ | <name>#99999</name> | ||
+ | <billing-address> | ||
+ | <address1>1 Bill St</address1> | ||
+ | <address2></address2> | ||
+ | <city>Billingsworth</city> | ||
+ | <company></company> | ||
+ | <country>Australia</country> | ||
+ | <first-name>Spiffy</first-name> | ||
+ | <id type="integer"></id> | ||
+ | <last-name>Customer</last-name> | ||
+ | <phone></phone> | ||
+ | <province>New South Wales</province> | ||
+ | <title>Mr</title> | ||
+ | <zip>3333</zip> | ||
+ | <name>Spiffy Customer</name> | ||
+ | </billing-address> | ||
+ | <shipping-address> | ||
+ | <address1>1 Ship St</address1> | ||
+ | <address2></address2> | ||
+ | <city>Shipping Town</city> | ||
+ | <company></company> | ||
+ | <country>Australia</country> | ||
+ | <first-name>Spiffy</first-name> | ||
+ | <id type="integer"></id> | ||
+ | <last-name>Customer</last-name> | ||
+ | <phone></phone> | ||
+ | <province>New South Wales</province> | ||
+ | <title>Mr</title> | ||
+ | <zip>2222</zip> | ||
+ | <name>Spiffy Customer</name> | ||
+ | </shipping-address> | ||
+ | <line-items type="array"> | ||
+ | <line-item> | ||
+ | <fulfillment-service>manual</fulfillment-service> | ||
+ | <weight type="float">0.1</weight> | ||
+ | <id type="integer"></id> | ||
+ | <price type="decimal">25.0</price> | ||
+ | <quantity type="integer">2</quantity> | ||
+ | <sku>ITEM001</sku> | ||
+ | <name>A very wonderful item</name> | ||
+ | </line-item> | ||
+ | <line-item> | ||
+ | <fulfillment-service>manual</fulfillment-service> | ||
+ | <weight type="float">0.1</weight> | ||
+ | <id type="integer"></id> | ||
+ | <price type="decimal">25.0</price> | ||
+ | <quantity type="integer">2</quantity> | ||
+ | <sku>ITEM002</sku> | ||
+ | <name>A Barrel of Monkeys</name> | ||
+ | </line-item> | ||
+ | </line-items> | ||
+ | </order> | ||
+ | </pre> |
Revision as of 13:16, 18 June 2010
Web Hooks are a way to tell Spiffy stores to call a script on one of your own web servers and react to the event in any way you want.
Example Web Hook Post
Here is an example of the format of the data that a Web Hook posts to your application.
POST /your-web-hook-path HTTP/1.1 Accept: */* Content-Type: application/xml Content-Length: 2665 X_spiffy_stores_id: 00000000-0000-0000-0000-000000000000 <?xml version="1.0" encoding="UTF-8"?> <order> <buyer-accepts-marketing type="boolean">false</buyer-accepts-marketing> <cart-token nil="true"/> <closed-at type="datetime" nil="true"></closed-at> <created-at type="datetime">2010-06-18T00:00:00+10:00</created-at> <currency>AUD</currency> <email>spiffy@mystore.spiffystores.com</email> <financial-status>paid</financial-status> <fulfillment-status>unshipped</fulfillment-status> <gateway>Testing Gateway</gateway> <id type="integer">0</id> <ip>127.0.0.1</ip> <note></note> <number type="integer">99999</number> <shipping-method>Australia Post</shipping-method> <shop-id type="integer">0</shop-id> <subtotal-price type="decimal">81.82</subtotal-price> <taxes-included type="boolean">true</taxes-included> <total-discounts type="decimal">10.0</total-discounts> <total-line-items-price type="decimal">91.82</total-line-items-price> <total-price type="decimal">100.0</total-price> <total-shipping type="decimal">50.0</total-shipping> <total-tax type="decimal">12.72</total-tax> <total-weight type="float">0.2</total-weight> <name>#99999</name> <billing-address> <address1>1 Bill St</address1> <address2></address2> <city>Billingsworth</city> <company></company> <country>Australia</country> <first-name>Spiffy</first-name> <id type="integer"></id> <last-name>Customer</last-name> <phone></phone> <province>New South Wales</province> <title>Mr</title> <zip>3333</zip> <name>Spiffy Customer</name> </billing-address> <shipping-address> <address1>1 Ship St</address1> <address2></address2> <city>Shipping Town</city> <company></company> <country>Australia</country> <first-name>Spiffy</first-name> <id type="integer"></id> <last-name>Customer</last-name> <phone></phone> <province>New South Wales</province> <title>Mr</title> <zip>2222</zip> <name>Spiffy Customer</name> </shipping-address> <line-items type="array"> <line-item> <fulfillment-service>manual</fulfillment-service> <weight type="float">0.1</weight> <id type="integer"></id> <price type="decimal">25.0</price> <quantity type="integer">2</quantity> <sku>ITEM001</sku> <name>A very wonderful item</name> </line-item> <line-item> <fulfillment-service>manual</fulfillment-service> <weight type="float">0.1</weight> <id type="integer"></id> <price type="decimal">25.0</price> <quantity type="integer">2</quantity> <sku>ITEM002</sku> <name>A Barrel of Monkeys</name> </line-item> </line-items> </order>