order.approval.pending

Last modified October 10, 2017

A server webhook fired when approval is required before an order can be completed (for example, when purchase orders are enabled for your Store with the Require Approval method configured, and a buyer places an order using a purchase order).

About Webhook Expansion

When webhook expansion is enabled, order.approval.pending will include the full customer account object rather than just the account ID.

Contents of Event Payload

Name Type Description
order string internal order ID
id string internal order ID
reference string customer-visible order reference
buyerReference string optional purchase order number entered by the customer
completed Boolean "true" for a completed order; never true for order.approval.pending
changed integer date of the most recent update to the order record, in milliseconds
changedValue integer date of the most recent update to the order record, in milliseconds
(backward compatibility)
changedInSeconds integer date of the most recent update to the order record, in seconds
changedDisplay string date of the most recent update to the order record, formatted for display based on the
language in which the order was processed
language string two-character ISO code for the order language
live Boolean "false" for a test order
currency string three-character ISO code for the order currency
payoutCurrency string three-character ISO code for the currency in which your disbursement will be made
invoiceUrl string URL of the customer-facing invoice for this order
account string (expansion disabled)
object (expansion enabled)
FastSpring-generated customer account ID (expansion disabled)
details of the customer account (expansion enabled)
account.id string FastSpring-generated customer account ID
account.account string FastSpring-generated customer account ID
account.contact object customer's contact details
account.contact.first string customer's first name
account.contact.last string customer's last name
account.contact.email string customer's email address
account.contact.company string customer's company name
account.contact.phone string customer's telephone number
account.language string two-character ISO code for the language associated with the customer's account
account.country string two-character ISO code for the country associated with the customer's account
account.lookup object multiple-field object containing lookup IDs for the customer account (e.g. for use with the /accounts endpoint of the FastSpring API)
account.lookup.global string external customer account ID, generated by FastSpring
account.url string url for the Store's default account management page
total number order total in the transaction's currency
totalDisplay string order total, formatted for display in the transaction's currency
totalInPayoutCurrency number order total in the currency of your FastSpring disbursements
totalInPayoutCurrencyDisplay string order total, formatted for display in the currency of your FastSpring disbursements
tax number amount of tax
taxDisplay string amount of tax, formatted for display in the transaction's currency
taxInPayoutCurrency number amount of tax in the currency of your FastSpring disbursements
taxInPayoutCurrencyDisplay string amount of tax, formatted for display in the currency of your FastSpring disbursements
subtotal number order subtotal in the transaction's currency
subtotalDisplay string order subtotal, formatted for display in the transaction's currency
subtotalInPayoutCurrency number order subtotal in the currency of your FastSpring disbursements
subtotalInPayoutCurrencyDisplay string order subtotal, formatted for display in the currency of your FastSpring disbursements
discount number total discount applied to the order in the transaction's currency
discountDisplay string total discount applied to the order, formatted for display in the transaction's currency
discountInPayoutCurrency number total discount applied to the order, in the currency of your FastSpring disbursements
discountInPayoutCurrencyDisplay string total discount applied to the order, formatted for display in the currency of your FastSpring disbursements
discountWithTax number discount amount including tax
discountWithTaxDisplay string discount amount including tax, formatted for display in the transaction's currency
discountWithTaxInPayoutCurrency number discount amount including tax, in the currency of your FastSpring disbursements
discountWithTaxInPayoutCurrencyDisplay string discount amount including tax, formatted for display in the currency of your FastSpring disbursements
payment object normally contains details about the transaction's payment method, but blank here since the payment has not been completed yet
reason string reason approval is required for the order (e.g. purchaseOrder)
customer object details about the customer
customer.first string customer's first name
customer.last string customer's last name
customer.email string customer's email address
customer.company string customer's company name
customer.phone string customer's telephone number
address object details about the customer address associated with this order
address.city string name of the city in the address
address.regionCode string two-character ISO code for the state of the address (present for U.S. addresses only)
address.regionDisplay string state or region of the address, formatted for display
address.region string state or region of the address (backward compatibility)
address.postalCode string postal code of the address
address.country string country of the address
address.display string concatenated string of address information, formatted for display
notes array optional internal order notes entered via Dashboard
items array products included in the order, one object per product
items.product string product path / product ID
items.quantity integer quantity of the current product in this transaction
items.display string customer-facing Display name of the product
items.sku string optional internal SKU ID (e.g. your part number) for the current product
items.subtotal number subtotal for the current product, in the transaction's currency
items.subtotalDisplay string subtotal for the current product, formatted for display in the transaction's currency
items.subtotalInPayoutCurrency number subtotal for the current product, in the currency of your FastSpring disbursements
items.subtotalInPayoutCurrencyDisplay string subtotal for the current product, formatted for display in the currency of your FastSpring disbursements
items.attributes object multiple-field object containing optional product-level attributes for the current product
items.discount number amount of any discount applied to the current product
items.discountDisplay string amount of any discount applied to the current product, formatted for display in the transaction's currency
items.discountInPayoutCurrency number amount of any discount applied to the current product, in the currency of your FastSpring disbursements
items.discountInPayoutCurrencyDisplay string amount of any discount applied to the current product, formatted for display in the currency of your FastSpring disbursements
items.fulfillments object multiple-field object containing details of fulfillment actions associated with the current product (file, license, or instructions)


Examples

Example 1 - Webhook Expansion Disabled

order.approval.pending webhook example (webhook expansion disabled)
{  
   "order":"K_GkjhoURmyAnA6mNsy0sA",
   "id":"K_GkjhoURmyAnA6mNsy0sA",
   "reference":"FUR170210-3172-19133",
   "buyerReference":"867-5309.10",
   "completed":false,
   "changed":1486744631560,
   "changedValue":1486744631560,
   "changedInSeconds":1486744631,
   "changedDisplay":"2/10/17",
   "language":"en",
   "live":true,
   "currency":"USD",
   "payoutCurrency":"USD",
   "invoiceUrl":"https://furiousfalcon.onfastspring.com/account/order/FUR170210-3172-19133/invoice",
   "account":"uKj7izONRfanVwBL9eiG_A",
   "total":9.95,
   "totalDisplay":"$9.95",
   "totalInPayoutCurrency":9.95,
   "totalInPayoutCurrencyDisplay":"$9.95",
   "tax":0.0,
   "taxDisplay":"$0.00",
   "taxInPayoutCurrency":0.0,
   "taxInPayoutCurrencyDisplay":"$0.00",
   "subtotal":9.95,
   "subtotalDisplay":"$9.95",
   "subtotalInPayoutCurrency":9.95,
   "subtotalInPayoutCurrencyDisplay":"$9.95",
   "discount":0.0,
   "discountDisplay":"$0.00",
   "discountInPayoutCurrency":0.0,
   "discountInPayoutCurrencyDisplay":"$0.00",
   "discountWithTax":0.0,
   "discountWithTaxDisplay":"$0.00",
   "discountWithTaxInPayoutCurrency":0.0,
   "discountWithTaxInPayoutCurrencyDisplay":"$0.00",
   "payment":{ 
   },
   "reason":"purchaseOrder",
   "customer":{ 
      "first":"Leeroy",
      "last":"Jenkins",
      "email":"ne1@all.com",
      "company":null,
      "phone":null
   },
   "address":{  
      "postalCode":"93101",
      "country":"US",
      "display":"93101, US"
   },
   "notes":[  
   ],
   "items":[  
      {  
         "product":"falcon",
         "quantity":1,
         "display":"Furious Falcon",
         "sku":"falcon6abc123",
         "subtotal":9.95,
         "subtotalDisplay":"$9.95",
         "subtotalInPayoutCurrency":9.95,
         "subtotalInPayoutCurrencyDisplay":"$9.95",
         "attributes":{  
            "conditions":"{\"include\":{\"countries\":[\"US\"]}}"
         },
         "discount":0.0,
         "discountDisplay":"$0.00",
         "discountInPayoutCurrency":0.0,
         "discountInPayoutCurrencyDisplay":"$0.00",
         "fulfillments":{  
            "instructions":"<p>Thank you for purchasing <em>Falcon</em>. To register, please launch the trial version and select <strong>Help</strong> | <strong>Register Falcon</strong>. Then, copy and paste the license key above into the <strong>License Key</strong> field and click <strong>Submit</strong>.</p>"
         }
      }
   ]
}


Example 2 - Webhook Expansion Enabled

order.approval.pending webhook example (webhook expansion enabled)
{  
   "order":"H4ouuiD1Sl-Iqrpaj1vrRQ",
   "id":"H4ouuiD1Sl-Iqrpaj1vrRQ",
   "reference":"FUR170815-7465-95188",
   "buyerReference":"867-5309.16",
   "completed":false,
   "changed":1502823475748,
   "changedValue":1502823475748,
   "changedInSeconds":1502823475,
   "changedDisplay":"8/15/17",
   "language":"en",
   "live":true,
   "currency":"USD",
   "payoutCurrency":"USD",
   "invoiceUrl":"https://furiousfalcon.onfastspring.com/account/order/FUR170815-7465-95188/invoice",
   "account":{  
      "id":"N8FjcSWcQNeYCc-suM1O8g",
      "account":"N8FjcSWcQNeYCc-suM1O8g",
      "contact":{  
         "first":"Leeroy",
         "last":"Jenkins",
         "email":"ne1@all.com",
         "company":"Chicken Danger, Inc.",
         "phone":null
      },
      "language":"en",
      "country":"US",
      "lookup":{  
         "global":"TVWhu0iwQhKJyuhpT_2yMw"
      },
      "url":"https://furiousfalcon.onfastspring.com/account"
   },
   "total":9.95,
   "totalDisplay":"$9.95",
   "totalInPayoutCurrency":9.95,
   "totalInPayoutCurrencyDisplay":"$9.95",
   "tax":0.0,
   "taxDisplay":"$0.00",
   "taxInPayoutCurrency":0.0,
   "taxInPayoutCurrencyDisplay":"$0.00",
   "subtotal":9.95,
   "subtotalDisplay":"$9.95",
   "subtotalInPayoutCurrency":9.95,
   "subtotalInPayoutCurrencyDisplay":"$9.95",
   "discount":0.0,
   "discountDisplay":"$0.00",
   "discountInPayoutCurrency":0.0,
   "discountInPayoutCurrencyDisplay":"$0.00",
   "discountWithTax":0.0,
   "discountWithTaxDisplay":"$0.00",
   "discountWithTaxInPayoutCurrency":0.0,
   "discountWithTaxInPayoutCurrencyDisplay":"$0.00",
   "payment":{  

   },
   "reason":"purchaseOrder",
   "customer":{  
      "first":"Leeroy",
      "last":"Jenkins",
      "email":"ne1@all.com",
      "company":"Chicken Danger, Inc.",
      "phone":null
   },
   "address":{  
      "city":"Santa Barbara",
      "regionCode":"CA",
      "regionDisplay":"California",
      "region":"California",
      "postalCode":"93101",
      "country":"US",
      "display":"Santa Barbara, California, 93101, US"
   },
   "notes":[  

   ],
   "items":[  
      {  
         "product":"falcon",
         "quantity":1,
         "display":"Furious Falcon",
         "sku":"falcon6abc123",
         "subtotal":9.95,
         "subtotalDisplay":"$9.95",
         "subtotalInPayoutCurrency":9.95,
         "subtotalInPayoutCurrencyDisplay":"$9.95",
         "discount":0.0,
         "discountDisplay":"$0.00",
         "discountInPayoutCurrency":0.0,
         "discountInPayoutCurrencyDisplay":"$0.00",
         "fulfillments":{  
            "instructions":"<p>Thank you for purchasing <em>Falcon</em>. To register, please launch the trial version and select <strong>Help</strong> | <strong>Register Falcon</strong>. Then, copy and paste the license key above into the <strong>License Key</strong> field and click <strong>Submit</strong>.</p>"
         }
      }
   ]
}