Create a voucher V2
Creates a voucher for a marketplace user.
POST
/v2/marketplace/vouchersAuthorization
Marketplace-Authentication
Authorization<token>
The Noona Marketplace API uses an Authorization header with JWT Bearer tokens to authenticate marketplace users.
In: header
Query Parameters
select?array<string>
expand?array<string>
Request Body
application/json
company_id*string
Example
"7awdXwZoedakjad37a"voucher_template_id?string
amount?number
Format
doubleExample
3990message?string
Example
"You deserve to relax a bit!"name*string
Name of the customer purchasing the user
Example
"John Snow"email*string
If an email is provided, it receives news of the newly created voucher.
Example
"[email protected]"payment*||||
phone_country_code?string
Example
"354"phone_number?string
Example
"7134124"Response Body
application/json
application/json
application/json
application/json
curl -X POST "https://api.noona.is/v2/marketplace/vouchers" \ -H "Content-Type: application/json" \ -d '{ "company_id": "7awdXwZoedakjad37a", "name": "John Snow", "email": "[email protected]", "payment": { "method": "SavedCard", "card_id": "9d8aj2oi2audawo", "return_url": "string", "channel": "iOS" } }'{
"voucher": {
"id": "7awdXwZoedakjad37a",
"currency": "ISK",
"amount": 3990,
"voucher_template": "string",
"data": {
"type": "service",
"sessions_used": 0,
"sessions_total": 0,
"event_type_name": "Quicky Haircut",
"event_type_id": "d0a9w8da09w8dindwa",
"number_of_guests": 2,
"voucher_template": "7awdXwZoedakjad37a",
"voucher_template_amount": 0.1,
"voucher_template_value": 0.1
},
"color": "#0f0f0f",
"message": "You deserve to relax a bit!",
"is_gift": true,
"code": "A328DB",
"phone_country_code": "354",
"phone_number": "7134124",
"send_to_user": {
"phone_number": "8124132",
"phone_country_code": "354"
},
"email": "[email protected]",
"user": "string",
"company": "string",
"expiration": "2022-08-24T14:15:22Z",
"payment": {
"method": "SavedCard",
"card_id": "9d8aj2oi2audawo",
"cvc": "070",
"return_url": "string",
"browser_information": {
"language": "en-US",
"color_depth": 0,
"javascript_enabled": true,
"screen_width": 0.1,
"screen_height": 0.1,
"time_zone_offset": 0
},
"channel": "iOS",
"three_ds2_sdk_version": "string",
"PARes": "string",
"CRes": "string"
},
"payment_information": {
"payment_method": "ApplePay",
"pan": "1842********8123"
},
"fully_used": true,
"original_owner": true,
"bought_by": "7awdXwZoedakjad37a",
"created_at": "2019-08-24T14:15:22Z",
"updated_at": "2019-08-24T14:15:22Z"
},
"payment": {
"id": "7awdXwZoedakjad37a",
"company": "string",
"user": "string",
"event": {
"id": "string"
},
"currency": "ISK",
"amount": 10000,
"status": "refunded",
"provider": "teya",
"created_at": "2019-08-24T14:15:22Z",
"updated_at": "2019-08-24T14:15:22Z"
},
"action": {
"type": "redirect",
"url": "https://example.com"
}
}{
"type": "generic_error",
"message": "Time slot is not available."
}{
"type": "generic_error",
"message": "Time slot is not available."
}{
"type": "generic_error",
"message": "Time slot is not available."
}