Creates a reference number and registers payment information (description, timestamp) with the integrator.
The combination of the paymentIntegratorAccountId from the request and the referenceNumber from the response form a unique key that identifies the transaction for subsequent operations on this transaction.
The amount field is defined in micro currency units (micros), which means that $2 would be represented with the digit 2 followed by six digits 0, resulting in 2000000.
If the endpoint encounters an error while processing the request, the response body from this endpoint should be of type ErrorResponse.
REQUIRED: This is the payment integrator account identifier that identifies contractual constraints around this transaction.
transactionDescription
string
REQUIRED: This is the description of the transaction that can be put on the customer's statement. Localized to the userLocale found in the requestHeader. This format can be changed without notice and must never be parsed.
REQUIRED: Information about the user making the request.
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.
Response object for the generate reference number method.
JSON representation
{"responseHeader": {object (ResponseHeader)},// Union field result can be only one of the following:"referenceNumber": string,"displayableReferenceNumber": {object (DisplayableReferenceNumber)}// End of list of possible types for union field result.}
All rights reserved. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-07-29 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-07-29 UTC."],[[["\u003cp\u003eGenerates a reference number and registers payment information like description, timestamp, and amount with the integrator.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003epaymentIntegratorAccountId\u003c/code\u003e and \u003ccode\u003ereferenceNumber\u003c/code\u003e uniquely identify the transaction for later use.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eamount\u003c/code\u003e is expressed in micro currency units (micros), for example, $2 is represented as 2000000.\u003c/p\u003e\n"],["\u003cp\u003eThe response can include a displayable reference number in various formats like printable string or barcode.\u003c/p\u003e\n"],["\u003cp\u003eError responses are of type \u003ccode\u003eErrorResponse\u003c/code\u003e with relevant HTTP status codes.\u003c/p\u003e\n"]]],["This documentation details how to generate a unique reference number for a payment transaction. A `POST` request to the specified endpoint includes details like `paymentIntegratorAccountId`, transaction description, currency, amount in micros, and user information. The response contains a header and a `displayableReferenceNumber`, which can be a printable string, barcode contents, or both. The reference number, combined with the account ID, forms a unique transaction identifier. The process also supports handling errors via an `ErrorResponse`.\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- [GenerateReferenceNumberResponse](#GenerateReferenceNumberResponse)\n - [JSON representation](#GenerateReferenceNumberResponse.SCHEMA_REPRESENTATION)\n\nCreates a reference number and registers payment information (description, timestamp) with the integrator.\n\nThe combination of the `paymentIntegratorAccountId` from the request and the `referenceNumber` from the response form a unique key that identifies the transaction for subsequent operations on this transaction.\n\nThe `amount` field is defined in *micro currency units* (micros), which means that $2 would be represented with the digit `2` followed by six digits `0`, resulting in `2000000`.\n\nIf the endpoint encounters an error while processing the request, the response body from this endpoint should be of type [`ErrorResponse`](/pay/refundable-one-time-payment-code-v1/payment-integrator-refundable-one-time-payment-code-api/ErrorResponse).\n\nAn example request looks like: \n\n\n {\n \"requestHeader\": {\n \"protocolVersion\": {\n \"major\": 1,\n \"minor\": 0,\n \"revision\": 0\n },\n \"requestId\": \"bWVyY2hhbnQgdHJhbnNhY3Rpb24gaWQ\",\n \"requestTimestamp\": \"1502220196077\"\n },\n \"paymentIntegratorAccountId\": \"InvisiCashUSA_USD\",\n \"transactionDescription\": \"Google - Music\",\n \"userInfo\": {\n \"noUserInfo\": {}\n },\n \"currencyCode\": \"USD\",\n \"amount\": \"2000000\"\n }\n\nAn example response looks like: \n\n\n {\n \"responseHeader\": {\n \"responseTimestamp\": \"1502220197000\"\n },\n \"displayableReferenceNumber\": {\n \"barcodeWithPrintableString\": {\n \"printableString\": \"1122334455\",\n \"barcodeContents\": \"aW50ZWdyYXRvciB0cmFuc2FjdGlvbiBpZA\"\n }\n }\n }\n\nHTTP request\n\n`POST https://www.integratorhost.example.com/integrator-base-path/refundable-one-time-payment-code-v1/generateReferenceNumber`\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, \"transactionDescription\": string, \"currencyCode\": string, \"amount\": string, \"userInfo\": { object (/pay/refundable-one-time-payment-code-v1/payment-integrator-refundable-one-time-payment-code-api/UserInfo) } } ``` |\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| `transactionDescription` | `string` **REQUIRED** : This is the description of the transaction that can be put on the customer's statement. Localized to the userLocale found in the `requestHeader`. This format can be changed without notice and must never be parsed. |\n| `currencyCode` | `string` **REQUIRED**: ISO 4217 3-letter currency code. |\n| `amount` | `string (`[Int64Value](https://developers.google.com/discovery/v1/type-format)` format)` **REQUIRED** : The amount of the purchase, in [micros](/pay/refundable-one-time-payment-code-v1/reference/glossary#micros \"What are micros?\") of the currency unit. |\n| `userInfo` | `object (`[UserInfo](/pay/refundable-one-time-payment-code-v1/payment-integrator-refundable-one-time-payment-code-api/UserInfo)`)` **REQUIRED**: Information about the user making the request. |\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 (`[GenerateReferenceNumberResponse](/pay/refundable-one-time-payment-code-v1/payment-integrator-refundable-one-time-payment-code-api/generateReferenceNumber#GenerateReferenceNumberResponse)`)` |\n| HTTP 4XX / 5XX Status | `object (`[ErrorResponse](/pay/refundable-one-time-payment-code-v1/payment-integrator-refundable-one-time-payment-code-api/ErrorResponse)`)` |\n\nGenerateReferenceNumberResponse Response object for the generate 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) }, // Union field `result` can be only one of the following: \"referenceNumber\": string, \"displayableReferenceNumber\": { object (/pay/refundable-one-time-payment-code-v1/payment-integrator-refundable-one-time-payment-code-api/DisplayableReferenceNumber) } // End of list of possible types for union field `result`. } ``` |\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| Union field `result`. Reference number created by the integrator. `result` can be only one of the following: ||\n| `referenceNumber` **(deprecated)** | `string` | Instead of this field, all new integrations should use displayableReferenceNumber. **DEPRECATED**: Reference number created by the integrator. |\n| `displayableReferenceNumber` | `object (`[DisplayableReferenceNumber](/pay/refundable-one-time-payment-code-v1/payment-integrator-refundable-one-time-payment-code-api/DisplayableReferenceNumber)`)` Reference number created by the integrator. |"]]