Create Order
This endpoint can be useful when you want to issue gift vouchers in your e-commerce shop. Please read this documentation for more information.
POST https://api.e-guma.ch/v1/voucher_orders.json?apikey={api-key}
Parameters
api-key |
POST Data
customer | Customer, see customer object below for details. |
order_lines | List of order lines, see order line object below for details |
delivery | Provide one of those values pdf|codes|mailing |
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. |
payment_id | Optionally, you can pass a payment id. If this value is empty then a default payment will be used. |
Customer object
email | Email address |
title | Provide one of those two values Mr|Mrs |
first_name | First name |
last_name | Last name |
company | Company name |
street | Street |
zip | Zip code |
city | City |
country | Country as two-letter code (ISO 3166-1 alpha-2) |
phone | Phone number |
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 |
message | Personal message for the receiver of the voucher. The message will be printed on the voucher. |
Return
order_id | Order Id |
order_number | Order number |
pdf_url | Url of the pdf which contains the vouchers. For pdf For mailing (printing) For mailing (using depot vouchers) For codes |
vouchers | If delivery is set to codes, then a list of vouchers will be returned. Each voucher has the following properties:
|
manage_order_url | Url to open the ordered vouchers in e-guma Backoffice. |
Example (delivery set to codes)
POST https://api.e-guma.ch/v1/voucher_orders.json?apikey=510e32c594d84816a4af9df1
{
"customer": {
"email": "[email protected]",
"title": "Mr",
"first_name": "John",
"last_name": "Doe",
"street": "Walchestrasse 15",
"zip": "8006",
"city": "Zürich",
"country": "CH",
"phone": "+41 44 500 54 00"
},
"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": "",
"manage_order_url": "http://www.e-guma.ch/Backend/Voucher/Voucher.aspx?search=param&tnr=GI1015&___mId=2",
"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 over 1 year ago