• Notifications
  • Messages
  • Complaints
  • Offers
  • Chats
  • Logout
  • РУС ENG

API



A preliminary check of parameters

  xml json
The URL for sending a request: defined by the seller in additional parameter settings (if the url contains "format=json" then the data is transferred in json format)
Method: POST
Request format: { "product": { "id": 0, "cnt": 0.0, "lang": "ru-RU", }, "options": [ { "id": 0, "type": "text" "value": "text" }, { "id": 0, "type": "textarea" "value": "textarea" }, { "id": 0, "type": "select" "value": "0" }, { "id": 0, "type": "checkbox" "value": "0" }, { "id": 0, "type": "radio" "value": "0" }, ... ] } <request> <product> <id>0</id> <cnt>0.0</cnt> <lang>ru-RU</lang> </product> <options> <option id="0" type="text">text</option> <option id="0" type="textarea">textarea</option> <option id="0" type="select">0</option> <option id="0" type="checkbox">0</option> <option id="0" type="radio">0</option> ... </options> </request>
Response parameters:
Name Use Comment
product\id item id integer
product\cnt number of product units integer
product\lang the information display language ru-RU | en-US
options the list of parameters
options\option value of selected parameter
id attribute - id of parameter
attribute type - parameter type:
  • "text" - text field
  • "textarea" - multi-line text area
  • "select" - dropdown list
  • "checkbox" - flag (checkbox)
  • "radio" - radio buttons
For parameters of the types "select," "checkbox," or "radio"
the ID of the selected option is transmitted as a value.
Response format: { "error": "" } <response> <error></error> </response>
Response parameters:
Name Use Comment
error the error message to be shown to the buyer The presence of this tag in the response is mandatory! An empty tag indicates the absence of errors in the selected parameters.
Please form the error text taking into account the language of the response data (product\lang).



Determining the values of the parameters of the goods upon purchase

  xml json
The URL for sending a request: https://api.digiseller.ru/api/purchases/options
Method: POST
Request headers: Accept: "application/json"
Content-Type: "application/json"
Accept: "application/xml"
Content-Type: "application/xml"
Request format: { "product_id": 0, "options": [ { "id": 0, "value": { "id": 0 } }, { "id": 0, "value": { "text": "" } }, ... ], "unit_cnt": 0, "lang": "", "ip": "" } <digiseller.request> <product_id></product_id> <options> <option> <id></id> <value><id></id></value> </option> <option> <id></id> <value><text></text></value> </option> ... </options> <unit_cnt></unit_cnt> <lang></lang> <ip></ip> </digiseller.request>
Request parameters:
NameUseComment
product\iditem idinteger
optionsproduct parameters
options\optionparameter
options\option\idparameter ID
options\option\value\idID of the selected parameter valuefor parameters of types radio buttons, checkbox and drop-down list
options\option\value\textparameter text value
unit_cntquantity of the product with a non-fixed price
langthe information display languageru-RU (by default) or en-US
ipUser IP
Response format:
{ "retval": 0, "retdesc": "", "id_po": 0 } <digiseller.response> <retval></retval> <retdesc></retdesc> <id_po></id_po> </digiseller.response>
Response parameters:
NameUseComment
retvalresult code0 - request sent
retdescdecryption of the request execution code
id_pounique ID of the selected value setused when switching to a payment form



Work with the shopping cart

1. Adding of products to the cart

The URL for sending a request: //shop.digiseller.ru/xml/shop_cart_add.asp
Method: POST
Content-Type: application/x-www-form-urlencoded
Request format: product_id=1239468&product_cnt=2&typecurr=wmr&email=buyer_@email@mail.com&lang=ru-RU&cart_uid=6420808B4ACC46BEBB04749EC63FF062&id_po=22418804
Request parameters:
Name Use Comment
product_id item id integer
product_cnt number of product units integer > 0. the number of product units is increased by the value of product_cnt if a second request to add products with the same product_id is made
typecurr payment method WMR | WMZ | WME | WMX | PCR | QSP | PYU | RCC | MTS | TL2 | BLN | MGF | BNK | GRN
email customer's email optional, used for calculating discounts
lang language (of error messages) ru-RU | en-US
cart_uid cart UID (if any) or an empty string when the product is first added to the cart
id_po unique ID of the selected value set only for products with mandatory parameters, the value previously obtained by API method
JSON response format: { "cart_err": "0", "cart_cnt": "3", "cart_uid": "C1253F4ABD9C4EDEA79048AFA3E6FB60", "currency": "RUR", "cart_curr": ["USD", "RUR", "EUR", "UAH"], "products": [{ "id": "1847398", "item_id": "986716", "name": "Grand Theft Auto V ", "available": "1", "price": "289", "currency": "RUR", "cnt_item": "1", "cnt_lock": "0" }, { "id": "2272915", "item_id": "986719", "name": "Xbox Live Gold 14 дней (RUS/EU/USA) +48 часов в подарок", "available": "1", "price": "149", "currency": "RUR", "cnt_item": "2", "cnt_lock": "0" }] }
Response parameters:
Name Use Comment
cart_err result code 0 - request completed
1 – one of the request parameters is not specified
1 – the product is not C169
2 – the max number of products in the cart has been exceeded - 50
3 – too many carts have been recently opened from this IP address
4 – the specified cart wasn’t found
5 – the product cannot be paid for with the specified method (typecurr)
8 – the cart contains products from sellers accepting direct payments to their purses
100,101,102 – product payment is temporarily unavailable
103 – unknown error B168 "
cart_cnt total number of products in the cart integer
cart_uid Cart UID string
products the list of products in the cart
products\id id of the position in the cart (not to be confused with product id) integer
products\item_id item ID integer
products\name item name
products\available availability of goods for purchase 1 | 0
products\price price
products\currency
products\cnt_item number of items in the cart integer
products\cnt_lock 1, if it is impossible to buy more than 1 number of goods (the type of goods is universal or with a dynamic price) 1 | 0

2. Getting a list of in-cart products + updating product quantities in the cart

URL and request format: //shop.digiseller.ru/xml/shop_cart_lst.asp
Method: POST
Content-Type: application/x-www-form-urlencoded
Request parameters:
Name Use Comment
cart_uid Cart UID
cart_curr price currency. optional parameter USD | RUR | EUR | UAH | mBTC
item_id id of the position in the cart (not to be confused with product id) that needs to be changed (optional) if unspecified, the method is called exclusively for displaying the contents of the cart.
product_cnt product quantity (optional parameter) integer. if specified, the quantity of item_id is replaced (not increased by!) by the value of product_cnt
lang language (product name display)
JSON response format:
response sample
{ "cart_err": "0", "cart_cnt":"1", "amount":"4,67", "currency":"USD", "cart_curr":["USD", "RUR", "EUR", "UAH"], "products":[ { "id":"2192430", "item_id":"540078", "name":"Музыкант Том 1", "available":"1", "price":"1,87", "currency":"USD", "cnt_item":"1", "cnt_lock":"1" }, { "id":"1942216", "item_id":"540079", "name":"Болотный Кот", "available":"1", "price":"0,93", "currency":"USD", "cnt_item":"2", "cnt_lock":"1" }, { "id":"1970323", "item_id":"541147", "name":"ИС-3, Боевое крещение", "available":"1", "price":"1,87", "currency":"USD", "cnt_item":"1", "cnt_lock":"1" } ] }
Response parameters:
Name Use Comment
cart_err result code 0 - request completed
1 – one of the request parameters is not specified
1 – the product is not C169
2 – the max number of products in the cart has been exceeded - 50
3 – too many carts have been recently opened from this IP address
4 – the specified cart wasn’t found
5 – the product cannot be paid for with the specified method (typecurr)
8 – the cart contains products from sellers accepting direct payments to their purses
100,101,102 – product payment is temporarily unavailable
103 – unknown error B168 "
cart_cnt total number of products in the cart integer
cart_uid Cart UID string
products the list of products in the cart similar to parameter description above in 1. Adding product to the cart



Jump to payment

An example of sending the user through FORM POST: <form id="digiselller_form" action="https://oplata.info/asp2/pay.asp" method="post"> <input type="hidden" name="id_d" value="2038820" /> <input type="hidden" name="cart_uid" value="" /> <input type="hidden" name="typecurr" value="WMZ" /> <input type="hidden" name="email" value="test@test.com" /> <input type="hidden" name="lang" value="ru-RU" /> <input type="hidden" name="failpage" value="https://plati.market/itm/world-of-warcraft/2038820" /> <input type="hidden" name="agent" value="1" /> <input type="hidden" name="promocode" value="" /> <input type="hidden" name="unit_cnt" value="" /> <input type="hidden" name="id_po" value="" /> </form> <script type="text/javascript">$(document).ready(function(){$("#digiselller_form").submit();});</script>
Request parameters:
Name Use Comment
id_d item id integer — can be unspecified if cart_uid is specified.
cart_uid Cart UID can be unspecified if id_d is specified. UID is obtained from the “work” method work with the cart 1.
typecurr payment method WMR | WMZ | WME | WMX | PCR | QSP | PYU | RCC | MTS | TL2 | BLN | MGF | BNK | GRN
email customer's email optional parameter
lang язык интерфейса ru-RU | en-US (optional parameter)
failpage the address of the page that the user will be forwarded to if the payment is canceled http-ссылка (optional parameter)
unit_cnt the product count for products with a non-fixed price integer (optional parameter)
id_po unique ID of the selected value set only for products with mandatory parameters, the value previously obtained by API method
agent Partner ID integer (optional parameter)



Настройка индивидуальных способов оплаты

1. Инициализация платежа

The URL for sending a request: берется из настроек из поля "URL оплаты"
Method: POST
Content-Type: application/x-www-form-urlencoded
Request format: invoice_id=12345&amount=10.00&currency=USD&description=товар&lang=ru-RU&payment_id=8&return_url=https://www.digiseller.market/info/buy.asp?id_i=12345&uid=FB4902995B8EDC36D9DC66F743E9E9CF9607284928E3CD484A0AA
Request parameters:
Name Use Comment
invoice_id the invoice number in the Digiseller system integer
amount сумма платежа два знака после запятой, разделитель дробной части точка
currency валюта платежа USD | RUB | EUR
description название платежа
lang локаль ru-RU | en-US
email email адрес указанный покупателем
payment_id ID способа оплаты, выбранный покупателем
return_url адрес страницы возврата покупателя после оплаты

2. Обновление статуса платежа

URL and request format: https://digiseller.market/callback/api
Method: GET
Content-Type: application/x-www-form-urlencoded
Request format: invoice_id=12345&amount=10.00&currency=USD&status=paid&signature=FB4902995B8EDC36D9DC66F743E9E9CF9607284928E3CD484A0AA
Request parameters:
Name Use Comment
invoice_id the invoice number in the Digiseller system integer
amount сумма платежа два знака после запятой, разделитель дробной части точка
currency валюта платежа USD | RUB | EUR
status статус платежа paid | wait | canceled | refunded | error
signature подпись запроса см. формирование подписи
error текст ошибки транслируемый покупателю параметр не участвует в формировании подписи

3. Получение статуса платежа

URL and request format: берется из настроек из поля "URL статуса платежа"
Method: GET
Content-Type: application/x-www-form-urlencoded
Request format: invoice_id=12345&amount=10.00&currency=USD&seller_id=8531&signature=FB4902995B8EDC36D9DC66F743E9E9CF9607284928E3CD484A0AA
Request parameters:
Name Use Comment
invoice_id the invoice number in the Digiseller system integer
seller_id ваш идентификатор
amount сумма платежа два знака после запятой, разделитель дробной части точка
currency валюта платежа USD | RUB | EUR
signature подпись запроса см. формирование подписи
JSON response format: { "invoice_id": "12345", "amount":"10.00", "currency":"USD", "status":"paid", "signature":"FB4902995B8EDC36D9DC66F743E9E9CF9607284928E3CD484A0AA", "error":"" }
Response parameters:
Name Use Comment
invoice_id the invoice number in the Digiseller system integer
amount сумма платежа два знака после запятой, разделитель дробной части точка
currency валюта платежа USD | RUB | EUR
status статус платежа paid | wait | canceled | refunded | error
signature подпись запроса см. формирование подписи
error текст ошибки транслируемый покупателю параметр не участвует в формировании подписи
integrator название платежного интегратора, через которого был инициирован (осуществлен) платеж параметр не участвует в формировании подписи

4. Подпись

Для формирования криптографической подписи данных запроса/ответа необходимо сформировать из данных запроса/ответа строку следующим образом: для каждой пары (ключ, значение), в алфавитном порядке следования ключей, сначала записывается ключ, потом символ :(двоеточие), потом значение. Каждая пара ключ:значение завершается символом ;(точкой с запятой).

Параметры: 1. Хеш-функция — sha256
2. Секретный ключ — берется из настроек
Формирование подписи: 1. Сформировать строку из данных запроса
2. Сгенерировать HMAC для этой строки, согласно общепринятому алгоритму формирования HMAC RFC 2104 в языке PHP, например, реализуется функцией hash_hmac используя свой секретный ключ и указанную в наборе параметров хэш - функцию. Выходная строка должна быть в формате HEX.
Пример: Данные запроса: invoice_id=12345&amount=10.00&currency=USD&seller_id=8531
Полученная строка: amount:10.00;currency:USD;invoice_id:12345;seller_id:8531;

Данные ответа: {"invoice_id":"12345", "amount":"10.00", "currency":"USD", "status":"paid"}
Полученная строка: amount:10.00;currency:USD;invoice_id:12345;status:paid;