# Cancel Barcode

Use this endpoint to cancel a single barcode in an order. Note that if you cancel the last remaining valid barcode, the entire order will also receive a canceled status.

# OpenAPI definition

```json
{
  "openapi": "3.1.0",
  "info": {
    "title": "General Admission Partner API",
    "version": "1.0"
  },
  "servers": [
    {
      "url": "https://api.ticketing.cm.com/partnerapi/v1.0"
    }
  ],
  "components": {
    "securitySchemes": {
      "sec0": {
        "type": "oauth2",
        "flows": {
          "clientCredentials": {
            "tokenUrl": "https://example.com/oauth2/token",
            "scopes": {}
          }
        }
      }
    }
  },
  "security": [
    {
      "sec0": []
    }
  ],
  "paths": {
    "/events/{event_uuid}/orders/{order_id}/barcodes/{barcode_id}/cancel": {
      "post": {
        "summary": "Cancel Barcode",
        "description": "Use this endpoint to cancel a single barcode in an order. Note that if you cancel the last remaining valid barcode, the entire order will also receive a canceled status.",
        "operationId": "cancel-barcode",
        "parameters": [
          {
            "name": "event_uuid",
            "in": "path",
            "description": "Your event uuid. Example: 00000000-0000-0000-0000-000000000000",
            "schema": {
              "type": "string"
            },
            "required": true
          },
          {
            "name": "order_id",
            "in": "path",
            "description": "The id of the order. Example: ZR36353102",
            "schema": {
              "type": "string"
            },
            "required": true
          },
          {
            "name": "barcode_id",
            "in": "path",
            "description": "The barcode you wish to cancel. Example: N7CUFEZ5BW",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "responses": {
          "201": {
            "description": "201",
            "content": {
              "application/json": {
                "examples": {
                  "Result": {
                    "value": "{\n\t\"success\": {\n\t\t\"message\": \"Successfully canceled barcode: N7CUFEZ5BW.\"\n\t}\n}"
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "object",
                      "properties": {
                        "message": {
                          "type": "string",
                          "example": "Successfully canceled barcode: N7CUFEZ5BW."
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "400",
            "content": {
              "application/json": {
                "examples": {
                  "Result": {
                    "value": "{\n\t\"error\": {\n\t\t\"message\": \"Can not cancel barcode: barcode already canceled.\",\n\t\t\"error_code\": 400284,\n\t\t\"error_details\": {\n\t\t\t\"barcode_id\": \"N7CUFEZ5BW\"\n\t\t}\n\t}\n}"
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "message": {
                          "type": "string",
                          "example": "Can not cancel barcode: barcode already canceled."
                        },
                        "error_code": {
                          "type": "integer",
                          "example": 400284,
                          "default": 0
                        },
                        "error_details": {
                          "type": "object",
                          "properties": {
                            "barcode_id": {
                              "type": "string",
                              "example": "N7CUFEZ5BW"
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "deprecated": false
      }
    }
  },
  "x-readme": {
    "headers": [
      {
        "key": "X-TF-PREFERREDLANGUAGEID",
        "value": "Language ID"
      }
    ],
    "explorer-enabled": true,
    "proxy-enabled": true
  },
  "x-readme-fauxas": true,
  "_id": "63aafdb047058c0010db405f:63ad5f04d4b41400163ed019"
}
```