Three lines

Uber

Developers

Cancel Voucher Codes

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

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 Cancel Voucher Codes endpoint allows you to cancel codes for a voucher program.

Authorization

The Cancel Voucher 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> No List of Code uuids to be canceled
Response Fields
Name Type Optional Description

cancelCodeFailures

(

code_uuid,

reason,

)

list

String

String

No

If there is an error, a list will be returned explaining which codes failed to be cancelled and why.

code_uuid: Code UUID

reason: Why the code failed to be cancelled

Example Request
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/cancel

{
     codes: ["1f913a96-f52c-42a0-aa0b-a2ba53b2d631", "1f913a96-f52c-42a0-aa0b-a2ba53b2d632"]
}
Example Response

If there were no errors (individual failures may still be reported): Status-Code: 200 OK

Error Responses

Note that claimed/redeemed codes cannot be canceled

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 Voucher code is not found
500 internal_server_error We have experienced a problem
400 INVALID_REQUEST_EXCEPTION Cancel Voucher Codes is only valid for campaigns having MULTI_CODE_SINGLE_REDEEM code scheme

Uber

Developers
© 2023 Uber Technologies Inc.