REQUIRED: This is the payment integrator account identifier that identifies contractual constraints around this transaction.
referenceNumber
string
REQUIRED: The reference number that should be cancelled.
Response body
This method supports multiple return types. For additional information about what 4XX or 5XX HTTP status code to return with an ErrorResponse, consult the ErrorResponse object and HTTP status codes documentation.
Reference number has already been paid. Google should expect a call to referenceNumberPaidNotification for this reference number soon.
REFERENCE_NUMBER_PENDING_TRANSACTION
DEPRECATED Indicates the reference number has been entered into a kiosk but has not been paid yet, reference number is pending transaction completion
All rights reserved. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-02-28 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-02-28 UTC."],[[["\u003cp\u003eThe \u003ccode\u003ecancelReferenceNumber\u003c/code\u003e API invalidates a previously generated reference number, preventing future payments.\u003c/p\u003e\n"],["\u003cp\u003eThe request body requires the \u003ccode\u003epaymentIntegratorAccountId\u003c/code\u003e and the \u003ccode\u003ereferenceNumber\u003c/code\u003e to be cancelled.\u003c/p\u003e\n"],["\u003cp\u003eA successful response will return a \u003ccode\u003eSUCCESS\u003c/code\u003e result code, while other codes indicate specific error conditions.\u003c/p\u003e\n"],["\u003cp\u003eReference numbers already paid or pending transactions will result in specific response codes or error messages.\u003c/p\u003e\n"]]],["To cancel a previously generated reference number, send a `POST` request to the specified URL, including a request body. The request body must contain `requestHeader`, `paymentIntegratorAccountId`, and the `referenceNumber` to be canceled. A successful cancellation returns a `200` HTTP status with a response body containing a `responseHeader` and a `result` field set to `SUCCESS`. Alternative result codes indicate a payment or pending transaction, with an `ErrorResponse` object for pending transactions.\n"],null,["# Method: cancelReferenceNumber\n\n- [HTTP request](#body.HTTP_TEMPLATE)\n- [Request body](#body.request_body)\n - [JSON representation](#body.request_body.SCHEMA_REPRESENTATION)\n- [Response body](#body.response_body)\n- [CancelReferenceNumberResponse](#CancelReferenceNumberResponse)\n - [JSON representation](#CancelReferenceNumberResponse.SCHEMA_REPRESENTATION)\n- [CancelReferenceNumberResultCode](#CancelReferenceNumberResultCode)\n\nCancels a reference number by invalidating it in the integrators system and preventing future payments.\n\nOnly a reference number that was previously created by calling [generateReferenceNumber](/pay/one-time-payment-code-v1/payment-integrator-one-time-payment-code-api/generateReferenceNumber) is subject to cancellation.\n\nAn example requests looks like: \n\n\n {\n \"requestHeader\": {\n \"protocolVersion\": {\n \"major\": 1,\n \"minor\": 0,\n \"revision\": 0\n },\n \"requestId\": \"bWVyY2hhbnQgdHJhbnNhY3Rpb24gaWQ\",\n \"requestTimestamp\": \"1502223797000\"\n },\n \"paymentIntegratorAccountId\": \"InvisiCashUSA_USD\",\n \"referenceNumber\": \"aW50ZWdyYXRvciB0cmFuc2FjdGlvbiBpZA\"\n }\n\nAn example response looks like: \n\n\n {\n \"responseHeader\": {\n \"responseTimestamp\": \"1502223798000\"\n },\n \"result\": \"SUCCESS\"\n }\n\n### HTTP request\n\n`POST https://www.integratorhost.example.com/integrator-base-path/one-time-payment-code-v1/cancelReferenceNumber`\n\n### Request body\n\nThe request body contains data with the following structure:\n\n| JSON representation |\n|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ``` { \"requestHeader\": { object (/pay/one-time-payment-code-v1/payment-integrator-one-time-payment-code-api/RequestHeader) }, \"paymentIntegratorAccountId\": string, \"referenceNumber\": string } ``` |\n\n| Fields ||\n|------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `requestHeader` | `object (`[RequestHeader](/pay/one-time-payment-code-v1/payment-integrator-one-time-payment-code-api/RequestHeader)`)` **REQUIRED**: Common header for all requests. |\n| `paymentIntegratorAccountId` | `string` **REQUIRED**: This is the payment integrator account identifier that identifies contractual constraints around this transaction. |\n| `referenceNumber` | `string` **REQUIRED**: The reference number that should be cancelled. |\n\n### Response body\n\nThis method supports multiple return types. For additional information about what 4XX or 5XX HTTP status code to return with an `ErrorResponse`, consult the `ErrorResponse` object and [HTTP status codes documentation](/pay/one-time-payment-code-v1/guides/connectivity/protocol-standards#http_status_codes).\n\n| Possible response messages ||\n|-----------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| HTTP 200 Status | `object (`[CancelReferenceNumberResponse](/pay/one-time-payment-code-v1/payment-integrator-one-time-payment-code-api/cancelReferenceNumber#CancelReferenceNumberResponse)`)` |\n| HTTP 4XX / 5XX Status | `object (`[ErrorResponse](/pay/one-time-payment-code-v1/payment-integrator-one-time-payment-code-api/ErrorResponse)`)` |\n\nCancelReferenceNumberResponse\n-----------------------------\n\nResponse object for the cancel reference number method.\n\n| JSON representation |\n|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ``` { \"responseHeader\": { object (/pay/one-time-payment-code-v1/payment-integrator-one-time-payment-code-api/ResponseHeader) }, \"result\": enum (/pay/one-time-payment-code-v1/payment-integrator-one-time-payment-code-api/cancelReferenceNumber#CancelReferenceNumberResultCode) } ``` |\n\n| Fields ||\n|------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `responseHeader` | `object (`[ResponseHeader](/pay/one-time-payment-code-v1/payment-integrator-one-time-payment-code-api/ResponseHeader)`)` **REQUIRED**: Common header for all responses. |\n| `result` | `enum (`[CancelReferenceNumberResultCode](/pay/one-time-payment-code-v1/payment-integrator-one-time-payment-code-api/cancelReferenceNumber#CancelReferenceNumberResultCode)`)` **REQUIRED**: The result of this call |\n\nCancelReferenceNumberResultCode\n-------------------------------\n\nResult codes for cancel reference number\n\n| Enums ||\n|----------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `UNKNOWN_RESULT` | Do not ever set this default value! |\n| `SUCCESS` | Reference number successfully cancelled. |\n| `REFERENCE_NUMBER_ALREADY_PAID` | Reference number has already been paid. Google should expect a call to `referenceNumberPaidNotification` for this reference number soon. |\n| `REFERENCE_NUMBER_PENDING_TRANSACTION` | **DEPRECATED** Indicates the reference number has been entered into a kiosk but has not been paid yet, reference number is pending transaction completion | Instead return an [`ErrorResponse`](/pay/one-time-payment-code-v1/payment-integrator-one-time-payment-code-api/ErrorResponse) object with HTTP Status 423 and errorResponseCode `USER_ACTION_IN_PROGRESS` |"]]