New Order API

Glossary


cart — new cart. Each client has one shopping cart for each provider. For example, a client belongs to one provider, therefore it has one shopping cart and all items the client orders go into that cart.

lineitem.id — new cart item.

order — one or more items from the cart, for which a payment is created.

Adding an item to cart


The API of a new order is similar to the API of the old order, so the values of addons and parameters are passed in the same way, whereas additional and differing parameters are described in the table below.

For SSL and Domain product types, use functions like "{ITEMTYPE}.order.param". To add these services to the cart via API using quick order, use the old order API with parameters "clicked_button=quickbasket" and "force_use_new_cart=on".

Name

Description

Meaning

Example

func *

Order function

v2.{ITEMTYPE}.order.param

{ITEMTYPE} — internal product type name

func=v2.soft.order.param

func=v2.vds.order.param

func=v2.dedic.order.param

order_period *

Order period

Assumes one of the following values:

  • 1 — month

  • 3 — 3 months

  • 6 — 6 months

  • 12 — year

  • 24 — 2 years

  • 36 — 3 years

order_period=1

pricelist *

Tariff ID

Integer

pricelist=111

sok *

Confirm the operation

ok

sok=ok

clicked_button *

Operation subtype

order

clicked_button=order

autoprolong

Enable auto-renewal

Flag

Assumes one of the following values:

  • on

  • off

autoprolong=on

datacenter

ID of the data center where the service will be opened

Integer

datacenter=2

force_use_new_cart

Enable use of the new shopping cart

Flag

Assumes one of the following values:

  • on

  • off

force_use_new_cart=on

out

Response format

Assumes one of the following values:

  • xml

  • xjson

  • devel

  • text

out=xml

addon_{ADDON_PRICELIST_ID}

Addon value

The value depends on the setting of the addon in the tariff plan

Tariff addons are passed through the API via the addon_ parameter. For example, addon_5=10, where

  • 5 is the addon code,

  • 10 - value.

To find the addon code, enter ProductsTariff plan → Options → Id field

addon_12=126

skipbasket

Enable payment for the service from the personal account without placing it in the cart

Flag

Assumes one of the following values:

  • on

  • off

skipbasket=on

* — mandatory parameter

Пример запроса добавления позиции в корзину:

curl -X POST -k https://billing.sclad.us/billmgr \
	-d 'authinfo=admin_login:admin_password' \
	-d 'su=client_login' \
	-d 'out=xml' \
	-d 'sok=ok' \
	-d 'force_use_new_cart=on' \
	-d 'func=v2.{ITEMTYPE}.order.param' \
	-d 'datacenter={DATACENTER_ID}' \
	-d 'pricelist={PRICELIST_ID}' \
	-d 'addon_{ADDON_PRICELIST_ID}={ADDON_VALUE}' \
	-d 'order_period={PERIOD}' \
	-d 'clicked_button=order'

Copy Example with values

curl -X POST -k https://billing.sclad.us/billmgr \
	-d 'authinfo=admin_login:admin_password' \
	-d 'su=client_login' \
	-d 'out=xml' \
	-d 'sok=ok' \
	-d 'force_use_new_cart=on' \
	-d 'func=v2.vds.order.param' \
	-d 'datacenter=1' \
	-d 'pricelist=2' \
	-d 'addon_2=10' \
	-d 'order_period=1' \
	-d 'clicked_button=order'

Last updated