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\u003eThis API cancels a previously generated reference number, preventing future payments using it.\u003c/p\u003e\n"],["\u003cp\u003eThe request body requires the payment integrator account ID and the reference number to be cancelled.\u003c/p\u003e\n"],["\u003cp\u003eA successful cancellation results in a "SUCCESS" response, while other results indicate issues like the reference number being already paid or pending a transaction.\u003c/p\u003e\n"],["\u003cp\u003eIntegrators should expect a \u003ccode\u003ereferenceNumberPaidNotification\u003c/code\u003e call if the reference number was already paid before cancellation.\u003c/p\u003e\n"],["\u003cp\u003eError responses with specific HTTP status codes and error codes are provided for various failure scenarios.\u003c/p\u003e\n"]]],["This describes the process for canceling a previously generated reference number via the `cancelReferenceNumber` method. A `POST` request is sent to a specified URL, including a `requestHeader`, `paymentIntegratorAccountId`, and the `referenceNumber` to be canceled. The response will include a `responseHeader` and a `result` code. Possible results are `SUCCESS`, `REFERENCE_NUMBER_ALREADY_PAID`, or indicate an error with status codes 4XX or 5XX. Only generated numbers can be cancelled.\n"],null,["- [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/refundable-one-time-payment-code-v1/payment-integrator-refundable-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\nHTTP request\n\n`POST https://www.integratorhost.example.com/integrator-base-path/refundable-one-time-payment-code-v1/cancelReferenceNumber`\n\nRequest body\n\nThe request body contains data with the following structure:\n\n| JSON representation |\n|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ``` { \"requestHeader\": { object (/pay/refundable-one-time-payment-code-v1/payment-integrator-refundable-one-time-payment-code-api/RequestHeader) }, \"paymentIntegratorAccountId\": string, \"referenceNumber\": string } ``` |\n\n| Fields ||\n|------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `requestHeader` | `object (`[RequestHeader](/pay/refundable-one-time-payment-code-v1/payment-integrator-refundable-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\nResponse 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](/pay/refundable-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/refundable-one-time-payment-code-v1/payment-integrator-refundable-one-time-payment-code-api/cancelReferenceNumber#CancelReferenceNumberResponse)`)` |\n| HTTP 4XX / 5XX Status | `object (`[ErrorResponse](/pay/refundable-one-time-payment-code-v1/payment-integrator-refundable-one-time-payment-code-api/ErrorResponse)`)` |\n\nCancelReferenceNumberResponse Response object for the cancel reference number method.\n\n| JSON representation |\n|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ``` { \"responseHeader\": { object (/pay/refundable-one-time-payment-code-v1/payment-integrator-refundable-one-time-payment-code-api/ResponseHeader) }, \"result\": enum (/pay/refundable-one-time-payment-code-v1/payment-integrator-refundable-one-time-payment-code-api/cancelReferenceNumber#CancelReferenceNumberResultCode) } ``` |\n\n| Fields ||\n|------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `responseHeader` | `object (`[ResponseHeader](/pay/refundable-one-time-payment-code-v1/payment-integrator-refundable-one-time-payment-code-api/ResponseHeader)`)` **REQUIRED**: Common header for all responses. |\n| `result` | `enum (`[CancelReferenceNumberResultCode](/pay/refundable-one-time-payment-code-v1/payment-integrator-refundable-one-time-payment-code-api/cancelReferenceNumber#CancelReferenceNumberResultCode)`)` **REQUIRED**: The result of this call |\n\nCancelReferenceNumberResultCode Result 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/refundable-one-time-payment-code-v1/payment-integrator-refundable-one-time-payment-code-api/ErrorResponse) object with HTTP Status 423 and errorResponseCode `USER_ACTION_IN_PROGRESS` |"]]