Create a Transaction
POST /orders/:pos-ref/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 |
Parameters
Field | Type | Description |
---|---|---|
:pos-ref | String |
The POS Reference of the Order to create a Transaction for |
amount | String |
An integer for the number of cents to be paid |
orderIdoptional | String |
posId identifying the order this relates to |
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', 'paypal' 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 |
statusoptional | String |
The current payment status. Default is "complete". See Status and the Transaction State Machine for more information. |
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 |
||||||||||||||
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 Order 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: Create a payment already made at the POS
{
"amount": "2500",
"tip": "500",
"status": "complete",
"method": "cash"
}
Response
{
"id":"123",
"orderId":"112",
"status":"complete",
"method":"cash",
"invoice":null,
"amount":"2500",
"tip":"500",
"acceptLess":true,
"version":"eqf8HE3deq",
"partnerInitiated":false,
"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.