Pricing Service

The pricing service is responsible for managing the price of a film or TV season. Prices can vary by region and currency.

Summary: Request the geo block rules for the specified item
Authentication: X-Auth Admin
                      GET /services/pricing/v2/geo_block/[platform_type]/[slug]
                    

Description

Use this API to get the geo block rules for the specified item in the specified platform type. If the rule is allow, then only the countries listed are unblocked. If the rule is block then the countries that are listed will be geo blocked. This API is only accessible to users who have the admin role.

Response Parameters

Parameter Type Description
rule string The type of rule applied to this item, either allow or block.
geo_region string ISO 3166-1 two-letter country code.

Examples

Request the Geo Block Rules for TVOD for Film 92

curl -i 'https://store.shift72.com/services/pricing/v2/geo_block/tvod/film/92' \
 -H 'x-auth-token: 1a1f4363bac4df5ba34758945fae8d0d'

Response: Success

HttpStatus: 200
{  
  "rules":[  
    {  
      "rule":"allow",
      "geo_region":"us"
    },
    {  
      "rule":"allow",
      "geo_region":"ca"
    }
  ]
}

Response: Unauthorized

HttpStatus: 401
Summary: Update the geo block rules for the specified item
Authentication: X-Auth Admin
                      PUT /services/pricing/v2/geo_block/[platform_type]/[slug]
                    

Description

Use this API to update the geo block rules for the specified item for the specified platform type. If the rule is allow, then only the countries listed are unblocked. If the rule is block then the countries that are listed will be geo blocked. After you have made changes you must use the Rebuild API to update the prices returned from the Prices API. This API is only accessible to users who have the admin role.

Request Parameters

The same as the Geo Block data.

Response Parameters

Returns Geo Block.

Examples

Update the Geo Block Rules for TVOD for Film 92

curl -i 'https://store.shift72.com/services/pricing/v2/geo_block/tvod/film/92' \
  -X PUT \
  -H 'x-auth-token: 1a1f4363bac4df5ba34758945fae8d0d' \
  -H 'content-type: application/json;charset=UTF-8' \
  --data-binary '{  
    "geo_block_rules":{  
      "rules":[  
        {  
          "rule":"allow",
          "geo_region":"us"
        },
        {  
          "rule":"allow",
          "geo_region":"ca"
        }
      ]
    }
  }'

Response: Success

HttpStatus: 200
{  
  "rules":[  
    {  
      "rule":"allow",
      "geo_region":"us"
    },
    {  
      "rule":"allow",
      "geo_region":"ca"
    }
  ]
}

Response: Unauthorized

HttpStatus: 401
Summary: Get the plans a specific item belongs to
Authentication: X-Auth Admin
                      GET /services/pricing/v1/item_plans/[slug]
                    

Description

Use this API to get the plans that a specific item belongs to. This API is only accessible to users who have the admin role.

Response Parameters

Returns an array of Plans.

Examples

Request the Plans TV Show 35, Season 2 Belongs To

curl -i 'https://store.shift72.com/services/pricing/v1/item_plans/tv/35/season/2/' \
  -H 'x-auth-token: 606777c95daa2681707d7e47bb23ce26'

Response: Success

HttpStatus: 200
[  
   {  
      "id":1,
      "name":"Free",
      "status":"active",
      "created_at":"2015-07-27T22:09:18.982Z",
      "updated_at":"2015-07-27T22:09:18.982Z"
   }
]

Response: Unauthorized

HttpStatus: 401
Summary: Update the plans a specific item belongs to
Authentication: X-Auth Admin
                      PUT /services/pricing/v1/item_plans/[slug]
                    

Description

Use this API to update the plans that a specific item belongs to. This API is only accessible to users who have the admin role.

Request Parameters

Parameter Type Description
plans[plan_id] number The Plan ID that the item belongs to.

Response Parameters

Returns an array of Plans.

Examples

Request the Plans TV Show 35, Season 2 Belongs To

curl -i 'https://store.shift72.com/services/pricing/v1/item_plans//tv/35/season/2/' \
  -X PUT \
  -H 'x-auth-token: 606777c95daa2681707d7e47bb23ce26' \
  -H 'content-type: application/json;charset=UTF-8' \
  --data-binary '{  
   "plans":[  
      {  
         "plan_id":1
      }
   ]
  }'

Response: Success

HttpStatus: 200
[  
   {  
      "id":1,
      "name":"Free",
      "status":"active",
      "created_at":"2015-07-27T22:09:18.982Z",
      "updated_at":"2015-07-27T22:09:18.982Z"
   }
]

Response: Unauthorized

HttpStatus: 401
Summary: Get the details of a specific plan
Authentication: X-Auth Admin
                      GET /services/pricing/v1/plans/[plan_id]
                    

Description

Use this API to get the details of a specific subscription plan. This API is only accessible to users who have the admin role.

Response Parameters

Parameter Type Description
id number The unique ID of the plan.
name string The name of the plan.
status string active means the plan is currently live.
created_at string The ISO 8601 time and date the plan was created.
updated_at string The ISO 8601 time and date the plan was last updated.

Examples

Request the Details of Plan 1

curl -i 'https://store.shift72.com/services/pricing/v1/plans/1' \
  -H 'x-auth-token: 606777c95daa2681707d7e47bb23ce26'

Response: Success

HttpStatus: 200
{  
   "id":1,
   "name":"Free",
   "status":"active",
   "created_at":"2015-07-27T22:09:18.982Z",
   "updated_at":"2015-07-27T22:09:18.982Z"
}

Response: Error - Plan Doesn’t Exist

HttpStatus: 404
{  
  "error":"The resource does not exist."
}

Response: Unauthorized

HttpStatus: 401
Summary: Create a plan
Authentication: X-Auth Admin
                      POST /services/pricing/v1/plans
                    

Description

Use this API to create a new subscription plan. This API is only accessible to users who have the admin role.

Request Parameters

The same as the Plan API data.

Response Parameters

Returns a Plan.

Examples

Update Plan 1

curl -i 'https://store.shift72.com/services/pricing/v1/plans/' \
  -X POST \
  -H 'x-auth-token: 606777c95daa2681707d7e47bb23ce26' \
  -H 'content-type: application/json;charset=UTF-8' \
  --data-binary '{  
    "name":"Silver"
  }'

Response: Success

HttpStatus: 200
[  
   {  
      "id":5,
      "name":"Silver",
      "status":"active",
      "created_at":"2015-07-29T02:59:00.157Z",
      "updated_at":"2015-07-29T02:59:00.157Z"
   }
]

Response: Unauthorized

HttpStatus: 401
Summary: Update a plan
Authentication: X-Auth Admin
                      PUT /services/pricing/v1/plans/[plan_id]
                    

Description

Use this API to update a specific subscription plan. This API is only accessible to users who have the admin role.

Request Parameters

The same as the Plan API data.

Response Parameters

Returns a Plan.

Examples

Update Plan 1

curl -i 'https://store.shift72.com/services/pricing/v1/plans/1' \
  -X PUT \
  -H 'x-auth-token: 606777c95daa2681707d7e47bb23ce26' \
  -H 'content-type: application/json;charset=UTF-8' \
  --data-binary '{  
    "name":"Gold"
  }'

Response: Success

HttpStatus: 200
[  
   {  
      "id":1,
      "name":"Gold",
      "status":"active",
      "created_at":"2015-07-27T22:09:18.982Z",
      "updated_at":"2015-07-29T02:48:22.690Z"
   }
]

Response: Error - Plan Doesn’t Exist

HttpStatus: 404
{  
  "error":"No item found for provided id"
}

Response: Unauthorized

HttpStatus: 401
Summary: List all of the subscription plans
Authentication: X-Auth Admin
                      GET /services/pricing/v1/plans
                    

Description

Use this API to get the subscription plans. This API is only accessible to users who have the admin role.

Response Parameters

Returns an array of Plans.

Examples

Request the Plans

curl -i 'https://store.shift72.com/services/pricing/v1/plans' \
  -H 'x-auth-token: 606777c95daa2681707d7e47bb23ce26'

Response: Success

HttpStatus: 200
[  
   {  
      "id":1,
      "name":"Free",
      "status":"active",
      "created_at":"2015-07-27T22:09:18.982Z",
      "updated_at":"2015-07-27T22:09:18.982Z"
   }
]

Response: Unauthorized

HttpStatus: 401
Summary: Request the region prices for the specified item
Authentication: X-Auth Admin
                      GET /services/pricing/v1/pricing_region_prices/?item=[slug]
                    

Description

Use this API to get the price of the specified item for each of the defined Pricing Regions. This API is only accessible to users who have the admin role.

Response Parameters

Parameter Type Description
item string The slug of the film, TV show and season, plan, credit, or bundle.
id number The unique id of the pricing region price.
pricing_region_id number The id of the Pricing Region that this price applies to.
hd_rent_price string The rent price.
sd_rent_price string Deprecated. This is no longer used.
hd_buy_price string The buy price.
sd_buy_price string Deprecated. This is no longer used.

Examples

Request the Pricing Region Prices

curl -i 'https://store.shift72.com/services/pricing/v1/pricing_region_prices/?item=/film/92' \
  -H 'x-auth-token: 1a1f4363bac4df5ba34758945fae8d0d'

Response: Success

HttpStatus: 200
{  
  "item":"/film/92",
  "prices":[  
    {  
      "id":3397,
      "pricing_region_id":36,
      "hd_rent_price":"2.99",
      "sd_rent_price":null,
      "hd_buy_price":"4.99",
      "sd_buy_price":null
    },
    {  
      "id":3398,
      "pricing_region_id":40,
      "hd_rent_price":"2.99",
      "sd_rent_price":null,
      "hd_buy_price":"4.99",
      "sd_buy_price":null
    },
    {  
      "id":3399,
      "pricing_region_id":37,
      "hd_rent_price":"2.99",
      "sd_rent_price":null,
      "hd_buy_price":"4.99",
      "sd_buy_price":null
    },
    {  
      "id":3400,
      "pricing_region_id":35,
      "hd_rent_price":"3.49",
      "sd_rent_price":null,
      "hd_buy_price":"5.99",
      "sd_buy_price":null
    },
    {  
      "id":3401,
      "pricing_region_id":38,
      "hd_rent_price":"2.49",
      "sd_rent_price":null,
      "hd_buy_price":"3.99",
      "sd_buy_price":null
    },
    {  
      "id":3402,
      "pricing_region_id":2,
      "hd_rent_price":"3.99",
      "sd_rent_price":null,
      "hd_buy_price":"6.49",
      "sd_buy_price":null
    },
    {  
      "id":3403,
      "pricing_region_id":39,
      "hd_rent_price":"1.99",
      "sd_rent_price":null,
      "hd_buy_price":"3.49",
      "sd_buy_price":null
    }
  ]
}

Response: Unauthorized

HttpStatus: 401
Summary: Update the region prices for the specified item
Authentication: X-Auth Admin
                      PUT /services/pricing/v1/pricing_region_prices/
                    

Description

Use this API to set the price of the specified item for each of the defined Pricing Regions. After you have made changes you must use the Rebuild API to update the prices returned from the Prices API. This API is only accessible to users who have the admin role.

Request Parameters

The same as the Pricing Region Prices data.

Response Parameters

Returns Pricing Region Prices.

Examples

Update the Pricing Region Prices for Film 92

curl -i 'https://store.shift72.com/services/pricing/v1/pricing_region_prices/' \
  -X PUT \
  -H 'x-auth-token: 1a1f4363bac4df5ba34758945fae8d0d' \
  -H 'content-type: application/json;charset=UTF-8' \
  --data-binary $'{  
    "item":"/film/92",
    "pricing_regions":[  
      {  
        "id":36,
        "hd_buy_price":"4.99",
        "hd_rent_price":"2.99"
      },
      {  
        "id":40,
        "hd_buy_price":"4.99",
        "hd_rent_price":"2.99"
      },
      {  
        "id":37,
        "hd_buy_price":"4.99",
        "hd_rent_price":"2.99"
      },
      {  
        "id":35,
        "hd_buy_price":"5.99",
        "hd_rent_price":"3.49"
      },
      {  
        "id":38,
        "hd_buy_price":"3.99",
        "hd_rent_price":"2.49"
      },
      {  
        "id":2,
        "hd_buy_price":"6.49",
        "hd_rent_price":"3.99"
      },
      {  
        "id":39,
        "hd_buy_price":"3.49",
        "hd_rent_price":"1.99"
      }
    ]
  }'

Response: Success

HttpStatus: 200
{  
  "item":"/film/92",
  "prices":[  
    {  
      "id":6024,
      "pricing_region_id":36,
      "hd_rent_price":"2.99",
      "sd_rent_price":null,
      "hd_buy_price":"4.99",
      "sd_buy_price":null
    },
    {  
      "id":6025,
      "pricing_region_id":40,
      "hd_rent_price":"2.99",
      "sd_rent_price":null,
      "hd_buy_price":"4.99",
      "sd_buy_price":null
    },
    {  
      "id":6026,
      "pricing_region_id":37,
      "hd_rent_price":"2.99",
      "sd_rent_price":null,
      "hd_buy_price":"4.99",
      "sd_buy_price":null
    },
    {  
      "id":6027,
      "pricing_region_id":35,
      "hd_rent_price":"3.49",
      "sd_rent_price":null,
      "hd_buy_price":"5.99",
      "sd_buy_price":null
    },
    {  
      "id":6028,
      "pricing_region_id":38,
      "hd_rent_price":"2.49",
      "sd_rent_price":null,
      "hd_buy_price":"3.99",
      "sd_buy_price":null
    },
    {  
      "id":6029,
      "pricing_region_id":2,
      "hd_rent_price":"3.99",
      "sd_rent_price":null,
      "hd_buy_price":"6.49",
      "sd_buy_price":null
    },
    {  
      "id":6030,
      "pricing_region_id":39,
      "hd_rent_price":"1.99",
      "sd_rent_price":null,
      "hd_buy_price":"3.49",
      "sd_buy_price":null
    }
  ]
}

Response: Invalid Price

HttpStatus: 422
{  
  "36":[  
    {  
      "hd_buy_price":"Must be less than 1000000"
    }
  ]
}

Response: Unauthorized

HttpStatus: 401
Summary: Request the pricing regions for the site
Authentication: X-Auth Admin
                      GET /services/pricing/v1/pricing_regions
                    

Description

Use this API to get the pricing regions for the site and the countries that belong to each pricing region. This API is only accessible to users who have the admin role.

Response Parameters

Parameter Type Description
id number The unique id of the pricing region.
name string The name of the pricing region.
currency string ISO 4217 currency code.
currency_symbol string The symbol of the currency.
country_codes string An array of ISO 3166-1 two-letter country codes that belong to the pricing region and the full name of the country.

Examples

Request the Pricing Regions

curl -i 'https://store.shift72.com/services/pricing/v1/pricing_regions' \
  -H 'x-auth-token: 1a1f4363bac4df5ba34758945fae8d0d'

Response: Success

HttpStatus: 200
[  
  {  
    "id":2,
    "name":"New Zealand",
    "currency":"NZD",
    "currency_symbol":"$",
    "country_codes":[  
      {  
        "nz":"New Zealand"
      },
      {  
        "ck":"Cook Islands"
      },
      {  
        "fj":"Fiji"
      },
      {  
        "ki":"Kiribati"
      },
      {  
        "nu":"Niue"
      },
      {  
        "tk":"Tokelau"
      },
      {  
        "to":"Tonga"
      },
      {  
        "tv":"Tuvalu"
      },
      {  
        "ws":"Samoa"
      }
    ]
  },
  {  
    "id":35,
    "name":"Australia",
    "currency":"AUD",
    "currency_symbol":"$",
    "country_codes":[  
      {  
        "au":"Australia"
      },
      {  
        "cc":"Cocos (Keeling) Islands"
      },
      {  
        "hm":"Heard Island and McDonald Islands"
      },
      {  
        "nc":"New Caledonia"
      },
      {  
        "nf":"Norfolk Island"
      },
      {  
        "nr":"Nauru"
      },
      {  
        "pf":"French Polynesia"
      },
      {  
        "pg":"Papua New Guinea"
      },
      {  
        "sb":"Solomon Islands"
      },
      {  
        "vu":"Vanuatu"
      },
      {  
        "wf":"Wallis and Futuna"
      }
    ]
  }
]

Response: Unauthorized

HttpStatus: 401
Summary: Request price data for multiple films and TV seasons
Authentication: None
                  GET /services/pricing/v2/prices/show_multiple?items=[slug],[slug]&location=[country]
                

Description

Use this API to get the price of the specified items and the plan that the item belongs to. By default, this will use the default country prices determined by the client. You should overwrite this by specifying the location in the query string request parameters. If the client is setup for transactional purchase, TVOD, then prices will be returned. If the client is setup for subscription, AVOD/SVOD, then plans will be returned. The client can be setup for both TVOD and SVOD, therefore both prices and plans will be returned.

Query String Request Parameters

Parameter Description
items The slug of the items to request the price for. Can be a film, TV shows and season, plan, credit or bundle.
location Optional. Get prices for the specified ISO 3166-1 two-letter country code. If not present then prices for the default country will be returned.

Prices Response Parameters

Parameter Type Description
item string The slug of the film, TV show and season, plan, credit, or bundle.
currency string ISO 4217 currency code.
rent[hd] string The rent price.
rent[hd_string] string The rent price formatted to include the currency symbol.
rent[sd] string Deprecated. This is no longer used.
rent[sd_string] string Deprecated. This is no longer used.
buy[hd] string The buy price.
buy[hd_string] string The buy price formatted to include the currency symbol.
buy[sd] string Deprecated. This is no longer used.
buy[sd_string] string Deprecated. This is no longer used.

Plans Response Parameters

Parameter Type Description
item string The slug of the film or TV show and season.
plans string The slug of the Plan ID that the item belongs to.

Examples

Request New Zealand Prices for Film 71 and TV Show 1 Season 1

curl -i 'https://store.shift72.com/services/pricing/v2/prices/show_multiple?items=/film/71,/tv/1/season/1&location=nz'

Response: Success

HttpStatus: 200
{  
  "prices":[  
    {  
      "item":"/film/71",
      "currency":"NZD",
      "rent":{  
        "hd":"6.49",
        "hd_string":"$6.49",
        "sd":null,
        "sd_string":null
      },
      "buy":{  
        "hd":"12.99",
        "hd_string":"$12.99",
        "sd":null,
        "sd_string":null
      }
    },
    {  
      "item":"/tv/1/season/1",
      "currency":"NZD",
      "rent":{  
        "hd":null,
        "hd_string":null,
        "sd":null,
        "sd_string":null
      },
      "buy":{  
        "hd":"34.99",
        "hd_string":"$34.99",
        "sd":null,
        "sd_string":null
      }
    }
  ],
   "plans":[  
      {  
         "item":"/tv/1/season/1",
         "plans":[  
            "/plan/1"
         ]
      }
   ]
}
Summary: Rebuild the prices for the specified item
Authentication: X-Auth Admin
                  POST /services/pricing/v1/prices/rebuild
                

Description

Use this API to rebuild the prices for the specified item. This is required after updating either Geo Block (Update) or Pricing Region Prices (Update). This API is only accessible to users who have the admin role.

Request Parameters

Parameter Type Description
item string The slug of the film, TV show and season, plan, credit, or bundle.

Response Parameters

Parameter Type Description
item string The slug of the film or TV show and season.
success bool Deprecated. This is no longer used.

Examples

Rebuild the Prices for Film 92

curl -i 'https://store.shift72.com/services/pricing/v1/prices/rebuild' \
  -X POST \
  -H 'x-auth-token: 1a1f4363bac4df5ba34758945fae8d0d' \
  -H 'content-type: application/json;charset=UTF-8' \
  --data-binary '{"item":"/film/92"}'

Response: Success

HttpStatus: 200
{  
  "item":"/film/92",
  "success":true
}

Response: Unauthorized

HttpStatus: 401