Create Individual Voucher Program
POSThttps://api.uber.com/v1/organizations/{organization_id}/individual_voucher_program/create
¶ Use Case
The Create Individual Voucher Program endpoint allows you to create a template based individual voucher program. This endpoint will be deprecated soon, please make use of Create Voucher Program From Template endpoint instead.
¶ Authorization
The Create Individual Voucher Program endpoint requires an access_token using the client credentials
grant to organizations.voucher_programs
scope.
If an application follows third party authentication, this endpoint requires organizations.voucher_programs.aggregator
scope with the grant type as client credentials.
¶ Path Parameters
Name | Type | Optional | Description |
---|---|---|---|
organization_id |
string | No | Identifier for the organization the developer is part of and the entity that owns this voucher program. Should be known to developer when their organization was onboarded to Uber For Business. |
¶ Request Parameters
Name | Type | Optional | Description |
---|---|---|---|
template_uuid | string | No | Template uuid persisted after creating the template |
program_uuid | string | No | The program uuid persisted for this template |
owner_uuid | string | No | Organization uuid as Uber recognizes it |
owner_type | string | No | Type of campaign owner “ORGANIZATION”/ “USER” |
email_address | string | Yes | Customer email address(Either email or mobile number is required) |
mobile_number | string | Yes | Customer mobile phone number (Either email or mobile number is required) |
name | string | No | Name of the voucher, that user would see on their app. (This is required to be the name of the template) |
description | string | Yes | Internal description of the voucher program (not shown to riders). |
memo | string | Yes | A field used for data attribution on the voucher program and its resulting trips. |
starts_at | int | No | Time when voucher program starts. Should be given as milliseconds since Unix Epoch. Cannot be more than 1 year into the future. |
ends_at | int | No | Time when voucher program ends. Should be given as milliseconds since Unix Epoch. Cannot be more than 1 year into the future and has to be after starts_at. |
display_name | string | No | User’s display name (In desired format) |
display_timezone | string | Yes | User’s display timezone (eg: America/Los_Angeles) |
¶ Response Fields
Name | Type | Description |
---|---|---|
campaign_uuid |
string | Campaign uuid for the created voucher program. The caller needs to store this value. |
owner_uuid |
string | Organization that owns the campaign |
owner_type |
string | Organization/Personal |
creator_uuid |
string | User uuid of the creator |
template_uuid |
string | The template this campaign is based on |
name |
string | Name of the program template |
starts_at |
string | Start time of campaign in displayTimezone in the request |
ends_at |
string | End time of campaign in displayTimezone in the request |
¶ Example Request
curl -X POST 'https://api.uber.com/v1/organizations/<organization_id>/individual_voucher_program/create' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer <TOKEN> \
-d '{
"mobile_number": "+<country code><mobile number>",
"email_address": "foo@bar.com",
"program_uuid": "<specific program uuid>",
"template_uuid": "<template_uuid>",
"name": "<Template name (exact match)>",
"display_name": "<first_name><last name> (or desired convention)",
"memo": "Some memo",
"starts_at": 1610371813000,
"ends_at": 1642195956000,
"display_timezone": "America/Los_Angeles",
"description": "Some Description",
"owner_uuid": "<organization_ uuid>",
"owner_type": "ORGANIZATION"
}
'
¶ Example Response
If the individual voucher was created:
Status-Code: 200 OK
{
"campaign_uuid":"fdf2befb-e8c7-49b6-a7e6-f3eb7f546779",
"template_uuid":"66e129f6-7020-4ac5-9166-b71d68fb82af",
"owner_uuid":"a283a599-989f-4e5f-860d-d2d3af36b692",
"creator_uuid":"48f151ee-8b59-43b8-9e40-31e12f56a18f",
"owner_type":"ORGANIZATION",
"name":"Voucher Template",
"memo":"Some memo",
"starts_at":1610371813000,
"ends_at":1642195956000
}
¶ Error Responses
HTTP Status | Code | Description |
---|---|---|
400 | invalid_request |
This request is invalid |
402 | campaign_template_inactive |
The template used in the request is inactive |
403 | user_not_allowed |
User is not authorized for api access |
403 | unauthorized |
Requester not allowed to perform requested action. When the third party app (3P) is not authorized by the U4B organization |
500 | internal_server_error |
We have experienced a problem |