Skip to main content

Operation Definitions

Endpoints

The Process Payment, Cancel Payment, and Refund Payment endpoints are asynchronous, and only return a status message. For full results of the operation, send the reference_id value as a query parameter in a GET request to the Transaction Status endpoint.

The Payment Router API base path is https://xpr.xenial.com/.

POST /api/process-payment

Summary

The Process Payment operation submits a wallet identifier obtained at the point of sale (POS) that is used to pay for the transaction. For example, Paypal and Citcon provide in-app QR codes to identify the wallet. The QR codes are scanned at the POS, and the associated data is sent in the body of the Process Payment request. A successful Process Payment request sets the transaction-status property to payment-pending.

The Process Payment operation is asynchronous. The operation returns a status_code and message. If successful, the transaction status is set to payment-pending.

For the final results of the request, use the Transaction Status operation.

Request Parameters

In

Field Name

Type

Required

Description

header

CONTENT-TYPE

string

Yes

application/json

header

AUTHORIZATION

string

Yes

The previously created integrator token

header

X-COMPANY-ID

string

Yes

The unique company identifier provided by us

header

X-SITE-IDs

string

Yes

The site identifier for the location performing the transaction

body

body

ProcessPaymentRequestBody

Yes

The transaction information including the reference_id

Responses

Code

Description

200

Success

Message: Ok

400

Error

Message: Bad Request

401

Error

Message: Token Authentication Error

403

Error

Message: Token Authentication Error

406

Error

Message: Not Acceptable

00

Success

01

Pending

C0

Cancelled

E0

Error

POST /api/cancel-payment

Summary

The Cancel Payment operation cancels a payment transaction if the funds were not yet withdrawn from the payment account.

The Cancel Payment operation is asynchronous. The operation returns a status_code and message. If successful, the transaction status is initially set to cancel-pending and then cancelled when complete.

For the final results of the request, use the Transaction Status operation.

Request Parameters

In

Field Name

Type

Required

Description

header

CONTENT-TYPE

string

Yes

application/json

header

AUTHORIZATION

string

Yes

The previously created integrator token

header

X-COMPANY-ID

string

Yes

The unique company identifier provided by us

header

X-SITE-IDs

string

Yes

The site identifier for the location performing the transaction

body

body

CancelPaymentRequestBody

Yes

Includes the reference_id and an optional reason field

Responses

Code

Description

202

Success

Message: Ok

400

Error

Message: Bad Request

401

Error

Message: Token Authentication Error

403

Error

Message: Token Authentication Error

406

Error

Message: Not Acceptable

00

Success

01

Pending

C0

Cancelled

E0

Error

POST /api/refund-payment

Summary

The Refund Payment operation cancels a transaction and returns funds to the payment account.

The Refund Payment operation is asynchronous. The operation returns a status_code and message. If successful, the transaction status is initially set to refund-pending and then refunded when complete.

For the final results of the request, use the Transaction Status operation.

Request Parameters

In

Field Name

Type

Required

Description

header

CONTENT-TYPE

string

Yes

application/json

header

AUTHORIZATION

string

Yes

The previously created integrator token

header

X-COMPANY-ID

string

Yes

The unique company identifier provided by us

header

X-SITE-IDs

string

Yes

The site identifier for the location performing the transaction

body

body

RefundPaymentRequestBody

Yes

Includes the reference_id, payment_reference_id, order_amount, and refund_amount

Responses

Code

Description

202

Success

Message: Ok

400

Error

Message: Bad Request

401

Error

Message: Token Authentication Error

403

Error

Message: Token Authentication Error

406

Error

Message: Not Acceptable

00

Success

01

Pending

C0

Cancelled

E0

Error

GET /api/transaction-status

Summary

The Transaction Status operation returns the current status of a transaction identified by the reference_id specified in the query string of the request URL.

Request Parameters

In

Field Name

Type

Required

Description

header

CONTENT-TYPE

string

Yes

application/json

header

AUTHORIZATION

string

Yes

The previously created integrator token

header

X-COMPANY-ID

string

Yes

The unique company identifier provided by us

header

X-SITE-IDs

string

Yes

The site identifier for the location performing the transaction

query

reference_id

string

Yes

The unique, integrator-defined transaction identifier used to identify a specific transaction in requests to Payment Router API

Responses

Code

Description

Schema

200

Transaction information and a status message.

Possible statuses:

  • callback-received

  • payment-pending

  • paid

  • payment-failed

  • cancel-pending

  • cancelled

  • cancel-failed

  • refund-pending

  • refunded

  • refund-failed

TransactionStatusResponseBody

Data Models

ProcessPaymentRequestBody

Field Name

Type

Required

Description

reference_id

string

Yes

The unique identifier (UID) provided by the integrator

Returned in the transaction_data.reference_id field of the GET /transaction-status response.

amount

number

No

The amount requested for payment

order_amount

number

No

The amount of the order paid. This is useful for partial payments.

order_id

string

No

The UID for the order

tip_amount

number

No

order_number

string

No

The order number

account_data

string

Yes

The QR code data obtained from the scanned QR code displayed on the mobile device of the guest

account_data_type

string

No

The account data type such as QR code

entry_method

string

No

The order entry method such as Scan

pos_local_time

string

No

The local time for the point of sale (POS)

pos_local_date

string

No

The local date for the POS

email

string

No

The customer's email address

status

string

No

The transaction status such as payment-pending

terminal_id

string

No

The UID for the terminal

timeout

string

No

CancelPaymentRequestBody

Field Name

Type

Required

Description

reference_id

string

Yes

The unique identifier (UID) provided by the integrator

Returned in the transaction_data.reference_id field of the GET /transaction-status response.

reason

string

No

The reason for the cancelation

RefundPaymentRequestBody

Field Name

Type

Required

Description

payment_reference_id

string

Yes

A POS-generated identifier for the previous Process Payment transaction

reference_id

string

Yes

The unique identifier (UID) provided by the integrator

Returned in the transaction_data.reference_id field of the GET /transaction-status response.

refund_amount

number

Yes

The amount to refund to the guest

order_amount

number

Yes

The full amount of the original order

transaction_id

string

No

The partner-generated identifier for the previous payment transaction.

To obtain the transaction_id value (transaction_data.id), send a GET request to the Transaction Status endpoint with the reference_id of the Process Payment request (payment_reference_id) in the query parameters

reason

string

No

The reason for the cancelation

TransactionStatusResponseBody

Field Name

Type

Description

merchant_data

merchant_data Object

The merchant name and identifiers

server_date_time

string

The local data and time for the server

transaction_data

transaction_data Object

The transaction identifiers and amounts

merchant_data Object

Field Name

Type

Description

name

string

The name from the Portal subscription

xenial_id

string

The identifier (ID) from the Portal subscription

id

string

The identifier from the digital wallet service

transaction_data Object

Field Name

Type

Description

id

string

The transaction identifier generated by our system

reference_id

string

The unique identifier (UID) provided by the integrator

amount

number

The amount requested for payment

tip_amount

number

order_number

string

The order number

business_date

string

The business date of the transaction

store_number

string

The store number where the transaction was requested

account_data

string

The QR code data obtained from the scanned QR code displayed on the mobile device of the guest

account_data_type

string

The account data type such as QR code

entry_method

string

The order entry method such as Scan

pos_local_time

string

The local time for the point of sale (POS)

pos_local_date

string

The local date for the POS

email

string

The customer's email address

terminal_id

string

The UID for the terminal

status

string

The transaction status such as payment-pending

cancellation_status

string

Present only if applicable

error_description

string

The error message

code

string

The applicable response code

Sample Code

Process Payment Request

{
 "reference_id": "", // provided by integrator
 "amount": 1.23, // amount requested for payment
 "order_amount": 1.23, // amount of order paid,
 // useful for partial payments
 "order_id": "123456789",
 "tip_amount": 1,
 "order_number": "900001",
 "account_data": "QR Data",
 "account_data_type": "QR Code",
 "entry_method": "Scan",
 "pos_local_time": "local-time",
 "pos_local_date": "local-date",
 "email": "thing@stuff.com",
 "status": "payment-pending",
 "terminal_id": "123",
 "timeout": 30
}

Cancel Payment Request

{
 "reference_id": ""
 "reason": ""
} 

Refund Payment Request

{ "reference_id": "" "reason": "" } 

Transaction Status Response

Success Response Example

{
 "merchant_data": {
 //name from portal subscription
 "name": "name",
 //id from portal subscription
 "xenial_id": "id",
 //id from the digital wallet service
 "id": "provider_merchant_id",
 },
 "server_date_time": "",
 "transaction_data": {
 //'transaction_id' generated by our system
 "id": "transaction_id",
 //integrator-generated unique identifier
 //for the transaction set in the
 //Process Payment request
 "reference_id": "integrator-generated uid",
 "amount": 1.23,
 "tip_amount": 1.23,
 "order_number": "",
 "business_date": "",
 "store_number": "",
 "account_data": "",
 "account_data_type": "",
 "entry_method": "",
 "pos_local_time": "",
 "pos_local_date": "",
 "email": "",
 "terminal_id": "",
 //see status list above
 "status": "payment status",
 //present only if a cancel is triggered
 "cancellation_status": "cancelled",
 //present only if applicable
 "error_description": "Error Message",
 //see code list above
 "code": "code"
 }
}

No Status Response Example

{
 "merchant_data": {
 //name from portal subscription
 "name": "name",
 //id from portal subscription
 "xenial_id": "id",
 //id from the digital wallet service
 "id": "provider_merchant_id"
 },
 "server_date_time": "",
 "transaction_data": {
 "status": "undefined"
 "reference_id": "same value from the request"
 }
}