Bulk Distribution of Voucher Redemption Codes
POSThttps://api.uber.com/v1/organizations/{organization_id}/voucher-programs/{voucher_program_id}/codes/distribute
¶ Use Case
The Bulk Distribution of Voucher Redemption Codes endpoint allows you to distribute voucher codes for a specific voucher program.
¶ Authorization
The Bulk Distribution of Voucher 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 above which identifies the voucher program created. |
¶ Request Parameters
Name | Type | Optional | Description |
---|---|---|---|
codes |
list <string> | Yes | List of code uuids to distribute (send to all if empty) |
¶ Example Request
An example of distributing all the codes for a voucher program
curl -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/distribute
An example of distributing specific codes for a voucher program
curl -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/distribute
{
codes: [‘1f913a96-f52c-42a0-aa0b-a2ba53b2d631’, ‘1f913a96-f52c-42a0-aa0b-a2ba53b2d632’]
}
¶ Response
This API is asynchronous, so a 200 status code will be returned if the request was successfully queued. Details regarding if the codes were successfully distributed or not will be available via webhook. We may have partial success when distributing the codes
¶ Error Responses
HTTP Status | Code | Description |
---|---|---|
400 | invalid_request |
This request is invalid |
403 | user_not_allowed |
User is not authorized for api access |
404 | resource_not_found |
Program is not found |
500 | internal_server_error |
We have experienced a problem |