Create Order
This endpoint is used to issue gift vouchers for the e-surprise platform.
POST https://api.e-guma.ch/v1/esurprise/voucher_orders.json?apikey={api-key}
Parameters
api-key
|
POST Data
order_lines
| List of order lines, see order line object below for details |
delivery | Provide one of those values pdf|codes |
language | Language as a two-letter code (ISO 639-1). The pdf with the vouchers will be generated in the provided language. e-guma supports German, French, Italian, English, Spanish and Portuguese. However it is up to each client, which languages are used. |
Order line object
product_id
| Id of the voucher template |
unit_price_in_cents | Unit price For value vouchers: For package vouchers (e.g. Brunch for 2): |
quantity | Quantity |
Return
order_id | Order Id |
order_number | Order number |
pdf_url | Url of the pdf which contains the vouchers. For pdf For codes |
vouchers | List of the vouchers. Each voucher has the following properties:
|
Example (delivery set to codes)
POST https://api.e-guma.ch/v1/esurprise/voucher_orders.json?apikey=510e32c594d84816a4af9df1
{
"order_lines": [
{
"product_id": "c333c464-8676-4489-ae97-360236d7c999",
"unit_price_in_cents": 1000,
"quantity": 1
},
{
"product_id": "c333c464-8676-4489-ae97-360236d7c999",
"unit_price_in_cents": 5000,
"quantity": 1
}
],
"language": "de",
"delivery": "codes"
}
{
"order_id": "50b6d149-49c4-4d2d-a96d-59d251de1edb",
"order_number": "G10015",
"pdf_url": "",
"vouchers": [
{
"code": "LSFR5D2C5A65",
"code_formatted": "LSFR-5D2C-5A65",
"product_id": "c333c464-8676-4489-ae97-360236d7c999",
"amount_in_cents": 1000,
"expiry_date": "2019-12-31T00:00:00.0000000"
},
{
"code": "CR7MFKRVH665",
"code_formatted": "CR7M-FKRV-H665",
"product_id": "c333c464-8676-4489-ae97-360236d7c999",
"amount_in_cents": 5000,
"expiry_date": "2019-12-31T00:00:00.0000000"
}
]
}
Updated 19 days ago