Generate Voucher Codes
POSThttps://api.uber.com/v1/organizations/{organization_id}/voucher-programs/{voucher_program_id}/codes/generate
¶ Use Case
The Generate Codes endpoint allows you to generate additional codes for a multi-code voucher program.
¶ Authorization
The Generate Redemption Codes endpoint requires an access_token using the client credentials
grant to organizations.voucher_programs
scope or using authorization_code
to organizations.voucher_programs.delegated
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. |
voucher_program_id |
string | No | The voucher_program_id returned back in the create voucher program call which identifies the voucher program created. |
¶ Request Parameters
Name | Type | Optional | Description |
---|---|---|---|
number_of_codes |
int | No | Number of codes to be generated |
¶ Example Request
curl -d '{"number_of_codes":"<number_of_codes>"}' \
-H 'Authorization: Bearer <TOKEN>' \
-H 'Accept-Language: en_US' \
-H 'Content-Type: application/json' \
'https://api.uber.com/v1/organizations/<organization_id>/voucher-programs/<voucher_program_id>/codes/generate'
¶ Example Response
Status-Code: 200 OK
¶ Error Responses
HTTP Status | Code | Description |
---|---|---|
400 | invalid_request |
This request is invalid |
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 |
404 | resource_not_found |
Voucher program is not found |
500 | internal_server_error |
We have experienced a problem |