- HTTP request
- Request body
- Response body
- GenerateReferenceNumberResult
- SuccessDetails
- DisplayableReferenceNumber
- BarcodeWithPrintableString
Creates a reference number and registers payment information (description, timestamp) with the integrator.
The combination of requestId
and paymentIntegratorAccountId
within the header is the idempotency key and uniquely identifies this transaction. All mutations on this transaction populate the requestId
value in their generateReferenceNumberRequestId
field or transactionId
field.
If the endpoint encounters an error while processing the request, the response body from this endpoint should be of type
.ErrorResponse
An example request looks like:
{
"requestHeader": {
"protocolVersion": {
"major": 2
},
"requestId": "cmVxdWVzdDE",
"requestTimestamp": {
"epochMillis": "1481899949606"
},
"paymentIntegratorAccountId": "InvisiCashUSA_USD"
},
"googlePaymentToken": {
"issuerId": {
"value": "invisicash"
},
"token": "ZXhhbXBsZSB1bmlxdWUgcGF5bWVudCB0b2tlbiB2YWx1ZQ"
},
"transactionDescription": "Google - Music",
"amount": {
"amountMicros": "728000000",
"currencyCode": "USD"
}
}
An example response looks like:
{
"responseHeader": {
"responseTimestamp": {
"epochMillis": "1481907920760"
}
},
"result": {
"success": {
"displayableReferenceNumber": {
"barcodeWithPrintableString": {
"printableString": "1122334455",
"barcodeContents": "aW50ZWdyYXRvciB0cmFuc2FjdGlvbiBpZA"
}
}
}
}
}
HTTP request
POST https://www.integratorhost.example.com/v2/payment-integrator-tokenized/generateReferenceNumber
Request body
The request body contains data with the following structure:
JSON representation |
---|
{ "requestHeader": { object ( |
Fields | |
---|---|
requestHeader |
REQUIRED: Common header for all requests. |
googlePaymentToken |
REQUIRED: This is the token that both companies will use to identify the account for purchases between each other. |
transactionDescription |
REQUIRED: This is the description of the transaction that can be put on the customer's statement. Localized to the user's preferred language. This format can be changed without notice and must never be parsed. |
amount |
REQUIRED: The amount of the purchase. |
Response body
If successful, the response body contains data with the following structure:
Response object for the generateReferenceNumber
method.
JSON representation |
---|
{ "responseHeader": { object ( |
Fields | |
---|---|
responseHeader |
REQUIRED: Common header for all responses. |
result |
REQUIRED: Result of this |
GenerateReferenceNumberResult
Result of this generateReferenceNumber
call.
JSON representation |
---|
{ // Union field |
Fields | |
---|---|
Union field result . Result of this generateReferenceNumber call. result can be only one of the following: |
|
success |
Reference number is generated. |
googlePaymentTokenInvalidatedByUser |
The account is active, but the GPT has been invalidated by the user on the integrator's side. Returning this value will cause the user's instrument to be closed with Google. The user will be forced to add a new instrument by going through the association flow again. |
accountClosed |
The user's account held with the integrator has been closed. Returning this value will cause the user's instrument to be closed with Google. The user will be forced to add a new instrument by going through the association flow again. |
SuccessDetails
Results are within this message.
JSON representation |
---|
{
"displayableReferenceNumber": {
object ( |
Fields | |
---|---|
displayableReferenceNumber |
REQUIRED: Reference number created by the integrator. |
DisplayableReferenceNumber
This message contains a reference number for a transaction.
JSON representation |
---|
{ // Union field |
Fields | |
---|---|
Union field display_form . Different display forms of the reference number. display_form can be only one of the following: |
|
printableString |
The string value of the reference number. Normally, this string should not contain any whitespace. When displaying this string on UI, Google may insert whitespace for better readability. There is no max length limitation. However, the user/cashier may need to type in this string. The shorter the better. Populate this field if we only need to show the reference number to the users. |
barcodeContents |
The contents to encode in a barcode. Google's UIs can represent the reference number in the Code 128 format or QR code format. Other barcode formats can be supported by request. Populate this field if we only need to show a barcode to the users. |
barcodeWithPrintableString |
Populate this field if we need to show both the reference number and a barcode to the users. |
BarcodeWithPrintableString
This message contains a printable string and a barcode contents for the reference number.
JSON representation |
---|
{ "printableString": string, "barcodeContents": string } |
Fields | |
---|---|
printableString |
REQUIRED The string value of the reference number. Normally, this string should not contain any whitespace. When displaying this string on UI, Google may insert whitespace for better readability. There is no max length limitation. However, the user/cashier may need to type in this string. The shorter the better. |
barcodeContents |
REQUIRED The contents to encode in a barcode. Google's UIs can represent the reference number in the Code 128 format or QR code format. Other barcode formats can be supported by request. |