# Order payment

Using API you can make a new order or extend the old one.

You can get the link to pay with your card or crypto wallet or make automatic payment using API balance which can be replanished in personal account.

API balance replenishment: <https://proxy-solutions.net/lk/api> . To pay through API balance `balance`is to be passed  in `merchant` field.

## Pay for order

> Top up order balance. It is possible (but not required) to specify the desired period or payment amount.  By default, the invoice is issued for the full cost of the order.  \
> If a valid promo code is provided, the invoice will be issued with the discount applied.\
> Authentication for this call is optional, but payment from balance is only possible for an authenticated user.  <br>

```json
{"openapi":"3.0.3","info":{"title":"Client API","version":"4.1.0"},"servers":[{"url":"https://v4.dev.proxy-solutions.net/api"}],"security":[{"api-key":[]}],"components":{"securitySchemes":{},"parameters":{"order_id":{"name":"order_id","in":"path","required":true,"schema":{"type":"integer"}}}},"paths":{"/user/orders/{order_id}/charge":{"post":{"summary":"Pay for order","tags":["Orders","Payment"],"description":"Top up order balance. It is possible (but not required) to specify the desired period or payment amount.  By default, the invoice is issued for the full cost of the order.  \nIf a valid promo code is provided, the invoice will be issued with the discount applied.\nAuthentication for this call is optional, but payment from balance is only possible for an authenticated user.  \n","parameters":[{"$ref":"#/components/parameters/order_id"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["merchant","currency"],"properties":{"merchant":{"type":"string","description":"Merchant code"},"period":{"type":"integer","description":"Period in days the client wants to pay for. If specified, the amount will be calculated automatically.\n"},"currency":{"type":"string","description":"Currency code in which the client will receive the invoice"},"amount":{"type":"number","description":"Amount without discount in USD If payment amount is specified, the \"period\" field is ignored\n"},"promocode":{"type":"string","description":"Promo code"}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"payment":{"type":"object","properties":{"discount":{"type":"number","description":"Promo code discount percentage"},"merchant":{"type":"string","description":"Merchant code"},"payer_currency":{"type":"string","description":"Payment currency code"},"payer_amount":{"type":"number","description":"Amount to pay, including all discounts and in the specified \"payer_currency\" Note that the client may have personal discounts and this amount may be less  than calculated in /services/{service_id}/price\n"},"url":{"type":"string","description":"URL"}}}}}}}},"401":{"description":"Unauthorized"},"404":{"description":"Order not found"},"422":{"description":"Validation error","content":{"application/json":{"schema":{"type":"array","items":{"type":"string"}}}}}}}}}}
```

### Available payment methods reception&#x20;

## List of merchants

> List of active merchants

```json
{"openapi":"3.0.3","info":{"title":"Client API","version":"4.1.0"},"servers":[{"url":"https://v4.dev.proxy-solutions.net/api"}],"security":[],"paths":{"/merchants":{"get":{"summary":"List of merchants","tags":["Payment"],"description":"List of active merchants","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"merchants":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string","description":"Merchant code"},"name":{"type":"string","description":"Human-readable name"},"currencies":{"type":"array","description":"List of allowed currencies","items":{"type":"string"}}}}}}}}}}}}}}}
```

### Order cost calculations

## Calculate order cost

> Calculate the cost of an order with given parameters and the amount to pay. If a valid promo code is provided, the corresponding discount will be applied.<br>

```json
{"openapi":"3.0.3","info":{"title":"Client API","version":"4.1.0"},"servers":[{"url":"https://v4.dev.proxy-solutions.net/api"}],"security":[],"paths":{"/services/{service_id}/price":{"post":{"summary":"Calculate order cost","tags":["Services","Payment"],"description":"Calculate the cost of an order with given parameters and the amount to pay. If a valid promo code is provided, the corresponding discount will be applied.\n","parameters":[{"$ref":"#/components/parameters/service_id"},{"$ref":"#/components/parameters/lang"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"uid":{"type":"integer","description":"User ID for whom the order is created"},"location_id":{"description":"Location (if applicable)","type":"integer"},"quantity":{"description":"Number of addresses/channels","type":"integer","default":1},"period":{"type":"integer","description":"Period in days","default":30},"multiport":{"type":"boolean","description":"Allow client to change equipment (mobile only)","default":true},"server_config_id":{"type":"string","description":"Selected configuration code (see /services/{id}/locations/configs)\n"},"server_options":{"type":"object","description":"Additional server parameters (hosting only)\n","properties":{"os":{"type":"string","description":"OS image code to install on the server"},"ram":{"type":"string","description":"Additional RAM"},"drive":{"type":"string","description":"Additional disk space"},"additional_ip":{"type":"integer","description":"Number of additional IPv4 addresses"},"backup":{"type":"string","description":"Backup plan code"}}},"promocode":{"type":"string","description":"Promo code"},"merchant":{"type":"string","description":"Merchant code"},"currency":{"type":"string","description":"Currency code"}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"lang":{"type":"string"},"discount":{"type":"number","description":"Promo code discount percentage"},"amount":{"type":"number","description":"Order cost in USD"},"converted_amount":{"type":"number","description":"Cost in the specified \"payer_currency\""},"merchant":{"type":"string","description":"Merchant code"},"payer_amount":{"type":"number","description":"Amount to pay in the specified currency, including promo code discount\n"},"payer_currency":{"type":"string","description":"Currency code"}}}}}},"404":{"description":"Service not found"},"422":{"description":"Validation error","content":{"application/json":{"schema":{"type":"array","items":{"type":"string"}}}}}}}}},"components":{"parameters":{"service_id":{"name":"service_id","in":"path","required":true,"schema":{"type":"integer"}},"lang":{"name":"lang","description":"Language code","in":"query","required":false,"schema":{"type":"string","enum":["EN","RU","UA"],"default":"EN"}}}}}
```

### Order extension

You can always extend your order making payment for the needed extending period through  [#user-orders-order\_id-charge](#user-orders-order_id-charge "mention") .

If the orders validity period has already expired you can also change proxies quantity in it through [order-changes](https://proxy-solutions.gitbook.io/api-en/documention/orders/order-changes "mention").
