Create a Transaction.
Transactions can only be created (in this way) for Orders with "accepted" status.
POST ~/transactions
Headers
Field | Type | Description |
---|---|---|
doshii-location-id | String |
The hashed ID of the location you're targeting. See Hashed Location IDs |
Parameters
Field | Type | Description |
---|---|---|
orderId | String |
The orderId you're creating a transaction for |
amount | Number |
Transaction amount in cents |
prepaidoptional | Boolean |
If the Transaction has already been performed. Doshii will respond on behalf of the Partner when the POS requests payment and will notify when complete or rejected. |
referenceoptional | String |
Your internal reference number |
invoiceoptional | String |
Your invoice number |
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 | Number |
Tip amount in cents |
linkedTrxId | String |
The ID of the original transaction this new transaction is related to. Typically used to support refunds of previous transactions. |
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. |
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 documentary field for misc. information |
||||||||||||
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 |
||||||||||||
prepaid | Boolean |
If the Transaction has already been performed. Doshii will respond on behalf of the Partner when the POS requests payment and will notify when complete or rejected. |
||||||||||||
version | String |
An obfuscated representation of the version |
||||||||||||
status | String |
The current payment status. See Status and the Order State Machine for more information.
|
||||||||||||
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 |
||||||||||||
linkedTrxId | String |
The linked transaction id if this transaction is a refund |
||||||||||||
createdByApp | String |
ID identifying the App that originally created this transaction. |
||||||||||||
processedByApp | String |
ID identifying the App that is processing the transaction. |
Examples
Request: Begin a payment Transaction for an Order
{
"orderId":"182",
"amount": "2250"
"reference": "987654321",
"invoice": "123456789",
"method":"visa",
"tip": "120"
}
Response
{
"id":"125",
"orderId":"182",
"reference":"987654321",
"invoice":"123456789",
"method":"visa",
"amount":"2250",
"tip":"120",
"acceptLess":false,
"partnerInitiated":true,
"prepaid":true,
"version":"nfw8w3DBK",
"status":"complete",
"createdByApp": "123",
"processedByApp": "123",
"updatedAt": "2016-08-18T04:58:38.485Z",
"createdAt": "2016-08-18T04:58:38.485Z",
"uri": "https://sandbox.doshii.co/partner/v3/transactions/125"
}
Comments
0 comments
Please sign in to leave a comment.