Clone voucher

Order API v1
PUT*base*/voucher/*id*/clone
Authentication:API key

This will clone a voucher with updated provided information

Parameters

name

string
optional
Name of the voucher.

code

string
optional
Code of the voucher. Will be generated a random one if not passed.

stopDate

string
required
Stop date of the voucher in Y-m-d format.

conversionHtml

string
optional
Conversion html of the voucher

Request example

1
2
3
4
5
6
7
PUT <base>/voucher/3/clone HTTP/1.1

{
   "name": "Welcome 10%",
   "code": "new-welcome-10",
   "stopDate": "2022-07-09"
}

Response

200 Content-type: application/json

status

string
required
ok if success, else no.

voucher

int
optional
Id of a new voucher

code

string
optional
Code of a new voucher

Response example

1
2
3
4
5
{
    "status": "ok",
    "voucher": 4,
    "code": "new-welcome-10"
}

Errors example

Required fields are not passed

1
2
3
4
5
6
7
{
    "status": "no",
    "voucher": "4",
    "msg": {
        "stopDate": "required"
    }
}

Voucher not found

1
2
3
4
5
6
7
{
    "status": "no",
    "voucher": "3",
    "msg": {
        "voucher": "Voucher not found"
    }
}

Auto vouchers not supported

1
2
3
4
5
6
7
{
    "status": "no",
    "voucher": "3",
    "msg": {
        "voucher": "Auto vouchers not supported"
    }
}

Voucher does not belong to this store

1
2
3
4
5
6
7
{
    "status": "no",
    "voucher": "3",
    "msg": {
        "voucher": "Voucher does not belong to this store"
    }
}