Method getCode
Deprecation notice: This method is deprecated and is not available to end users via the B2B API. Do not use it in new integrations.
This method allows you to obtain the digital code of the e-gift card without a wrapper as a PDF-file when it ready. To track status, you can use the getStatus method or callback. Method available only if delivery_type = code parameter has been passed on makeOrder request.
Please note that not every product is accepted "by code" in stores. For some products is required to print e-gift card on paper. The possibility of acceptance depends on parameter digital_acceptance, which is returned by the method getProducts.
Usualy e-gift card is ready less than 5 seconds after makeOrder. In some cases, it can take up to several hours (mostly due technical problems on the supplier side). If e-gift card is not ready error will be returned: 1203.
Parameters (data)
| param | description |
|---|---|
| queue_id | ID of makeOrder request |
Response
| param | description |
|---|---|
| code | Digital code. |
| pin | PIN-code (empty if product don't have PIN-code) |
| expire_date | expiration date (Moscow time in format 2017-12-31 23:59:59) or false if product dosn't have expiration date. |
| format | Barcode format. You must generate barcode for digital code in specified format for acceptance in store. Current list of posible formats : code128, ean13, code39, i25, qr (can be extended in future). |
Request example
cmd: getCode,
data:
{
"queue_id": 123456
}Response example (success)
{
"status": "ok",
"data": {
"code": "00342-574-249-447",
"pin": "0757",
"expire_date": "2017-12-31 23:59:59",
"format": "code128"
}
}Response example (success, no pin, no barcode, no expiration date)
{
"status": "ok",
"data": {
"code": "00342-574-249-447",
"pin": "",
"expire_date": false
}
}Response example (failure)
{
"status": "error",
"error": {
"code": 1202,
"text": "Order not paid"
}
}