Three lines

Uber

Developers

Get Voucher Codes

GEThttps://api.uber.com/v1/organizations/{organization_id}/voucher-programs/{voucher_program_id}/codes

Privileged and Confidential This endpoint design has been confidentially shared with you. It is still under development and is subject to change without notice. Please do not share this document or API endpoint details with anyone who is not authorized to have access. For more information read about scopes.

Use Case

The Get Codes endpoint allows you to get voucher program codes.

Authorization

The Get 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.
include_usage bool Yes Flag used to request that usage details be included.
Response Fields
Name Type Description
total_number_of_codes int The number of codes associated with this voucher program.

codes

(

code_id,

code_text,

redemption_link,

max_num_redemptions,

usage_count,

usage_amount,

currency_code

canceled_at

)

List

 

String

String

String

int

int

float

String

int

 

List of code structs containing the codes and corresponding redemption links generated for this voucher program.

 

Code_id: Unique identifier of the code

Code_text: Text of the code

Redemption_link: Link that a user can use to redeem the code for a offer

Max_num_redemptions: Number of times this code can be redeemed

Usage_count: Total number of trips taken using voucher code

Usage_amount: Total amount spent using voucher code

Currency_code: Currency code of total spend amount

Canceled_at: Will be set if code was canceled. Given as milliseconds since Unix Epoch

 

Example Request
curl -H 'Authorization: Bearer <TOKEN>' \
     -H 'Accept-Language: en_US' \
     -H 'Content-Type: application/json' \
     -X GET
     'https://api.uber.com/v1/organizations<:organization_id>/voucher-programs/<voucher_program_id>/codes?include_usage=true'
Example Response

Status-Code: 200 OK

{
  "codes": [
    {
      "code_id": "1d6b34d1-1f06-4cb6-a97a-8bbfdcff119c",
      "code_text": "asdbHd2",
      "redemption_link": "redeem.uber.com/asdbHd2",
      "max_num_redemptions": 3,
      "usage_count": 20,
      "usage_amount": "200",
      "currency_code": "USD"
    },
    {
      "code_id": "b05416c0-01cd-52fa-a04e-24f9aaaddc43",
      "code_text": "asdbHd5",
      "redemption_link": "redeem.uber.com/asdbHd5",
      "max_num_redemptions": 3,
      "usage_count": 4,
      "usage_amount": "40",
      "currency_code": "USD"
    }
  ]
}
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
409 code_generation_in_progress The codes are not ready yet. Please try again later
500 internal_server_error We have experienced a problem

Uber

Developers
© 2023 Uber Technologies Inc.