Create a Transaction
POST ~/transactions
Headers
Field | Type | Description |
---|---|---|
Authorization | String |
Bearer authentication token prefixed with |
Content-Type | String |
Request content type, must be 'application/json' |
vendor | String |
The POS vendor name retrieved from Doshii dashboard |
doshii-terminal-id | String |
The hashed Id of a POS Terminal registered within Doshii via the Create POS Terminal endpoint |
Parameters
Field | Type | Description |
---|---|---|
amount | String |
An integer for the number of cents to be paid |
orderIdoptional | String |
pos reference identifying the order this relates to. It is possible to create a transaction without linking directly to the order during a POS-Initiated Payment (PIP) request. This link can be established in a subsequent update. |
referenceoptional | String |
A free-text field for entering external identifiers eg: bank deposit reference no. |
invoiceoptional | String |
External identifiers eg: Invoice number or bank deposit reference no. |
methodoptional | String |
An enumerated value describing how the payment was made. The supported types are: 'cash', 'visa', 'mastercard', 'amex', 'diners', 'giftcard', 'loyalty', 'crypto', 'credit', 'directdeposit', 'cheque', 'alipay', 'wechatpay', 'zip', 'moto' and 'other' |
tipoptional | String |
An optional integer for the number of cents transferred as a tip (additional to amount) |
acceptLessoptional | Boolean |
Whether the POS will accept less than the |
linkedTrxId | String |
The ID of the original transaction this new transaction is related to. Typically used to support refunds of previous transactions. |
statusoptional | String |
The current payment status. Default is "complete". See Status and the Transaction State Machine for more information. This property can only have the value of 'requested' if there is no orderId supplied. |
surcountsoptional | Object[] |
Array of Surcount objects. Typically used for payment surcharges (credit card fees, etc). See Surcounts: Surcharges & Discounts for more information on how these work. |
nameoptional | String |
Name of item. Required when |
typeoptional | String |
Whether this is an 'absolute' or 'percentage' Surcount. Required when |
amountoptional | String |
The amount to surcharge/discount (positive/negative integer). Required when |
valueoptional | String |
The value of the surcounts in cents. Accepts integer or string of integers. This value should be calculated if the Surcount is % based. Required when |
descriptionoptional | String |
Description of the surcount. |
posIdoptional | String |
Id of the item in the POS. Providing this will allow the POS to correctly print and report sales. |
requestedAppIdoptional | String |
ID identifying the App that the POS has explicitly requested to process this transaction. If not provided, any Payment App subscribed to the venue may process the transaction. |
requestDataoptional | Object |
An optional list of properties that support the payment request. This information is ephemeral and will only be dispatched to the payment provider via the event, it cannot be retrieved at a later date from the transaction. |
accountId | String |
Specifies the ID of the account to be used, this typically maps to the gift card number, voucher code, payId for NPP, etc |
issueDateoptional | String |
A |
expiryDateoptional | String |
A |
authorisationCodeoptional | String |
The code used to authorise the request. This could take the form of the secure pin code on the back of a gift card, or a passphrase required by venue staff. |
Response
Field | Type | Description | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
id | String |
Unique number identifying this resource |
||||||||||||||
orderId | String |
Unique number identifying the order this relates to |
||||||||||||||
reference | String |
A free-text field for entering external identifiers eg: bank deposit reference no. |
||||||||||||||
invoice | String |
External identifiers eg: Invoice number or bank deposit reference no. |
||||||||||||||
method | String |
Describes the payment method used, e.g. cash, giftcard, crypto, visa, etc |
||||||||||||||
amount | String |
An integer for the number of cents to be paid |
||||||||||||||
tip | String |
An optional integer for the number of cents transferred as a tip (additional to amount) |
||||||||||||||
acceptLess | Boolean |
Whether the POS will accept less than the |
||||||||||||||
partnerInitiated | Boolean |
Whether the Transaction was initiated by the Partner |
||||||||||||||
version | String |
An obfuscated representation of the version |
||||||||||||||
linkedTrxId | String |
The linked transaction id if this transaction is a refund |
||||||||||||||
surcounts | Object[] |
Array of Surcount objects. |
||||||||||||||
posId | String |
Id of the item in the POS. Providing this will allow the POS to correctly print and report sales. |
||||||||||||||
name | String |
Name of item. |
||||||||||||||
type | String |
Whether this is an 'absolute' or 'percentage' Surcount. |
||||||||||||||
description | String |
Description of item. |
||||||||||||||
amount | String |
The amount to surcharge/discount (positive/negative integer) |
||||||||||||||
value | String |
The value of the surcounts in cents. Accepts integer or string of integers. This value should be calculated if the Surcount is % based. |
||||||||||||||
updatedAt | String |
Date when the record is last updated |
||||||||||||||
createdAt | String |
Date when the record is created |
||||||||||||||
uri | String |
The object details url |
||||||||||||||
status | String |
The current payment status. See Status and the Transaction State Machine for more information.
|
||||||||||||||
createdByApp | String |
ID identifying the App that originally created this transaction. Will not return if not set. |
||||||||||||||
processedByApp | String |
ID identifying the App that is processing the transaction. Will not return if not set. |
||||||||||||||
posTerminalId | String |
A hashed ID of the POS terminal that is associated to this transaction. Will not return if not set. |
||||||||||||||
requestedAppId | String |
ID identifying the App that the POS has requested to process this transaction. Will not return if not set. |
Examples
Request: Complete a payment already made at the POS
{
"orderId": "122",
"amount": "2500",
"status": "complete",
"method": "cash",
"tip":"200",
}
Response
{
"id":"123",
"orderId":"122",
"status":"complete",
"method":"cash",
"invoice":null,
"amount":"2500",
"tip":"200",
"acceptLess":true,
"version":"eqf8HE3deq",
"partnerInitiated":false,
"posTerminalId": "bEK3ryO7",
"updatedAt": "2016-08-18T04:58:38.485Z",
"createdAt": "2016-08-18T04:58:38.485Z",
"uri": "https://sandbox.doshii.co/pos/v3/transactions/123"
}
Request: Request a Payment App to process the payment
{
"orderId": "122",
"amount": "2500",
"status": "requested",
"requestedAppId": "543",
"requestData": {
"accountId": "HwgD78834234Ds2d",
"expiryDate": "2018-09-12T00:00:00.000Z"
}
}
Response
{
"id": "124",
"orderId": "122",
"status": "pending",
"reference": null,
"invoice": null,
"amount": "2500",
"acceptLess": true,
"version": "eqf8HE3deq",
"partnerInitiated": false,
"processedByApp": "543",
"requestedAppId": "543",
"updatedAt": "2016-08-18T04:58:38.485Z",
"createdAt": "2016-08-18T04:58:38.485Z",
"uri": "https://sandbox.doshii.co/pos/v3/transactions/124"
}
Comments
0 comments
Please sign in to leave a comment.