Fluent Commerce Logo
Docs
Sign In

Transaction Order API

Essential knowledge

Author:

Fluent Commerce

Changed on:

3 July 2024

Overview

An API Order transaction defines the payment or refund details associated with an Order.

Key points

  • Order Transaction Properties
  • What you can do with Order Transaction
  • Response on Failures

Order Transaction Properties

Below are the properties available in the Order Transaction object which can be updated and retrieved through the APIs in this document.

1. orderId

Type: String

Description:

1{ "orderId" : "1965797" }

Language: json

Name: orderId

Description:

[Warning: empty required content area]

The unique identifier assigned by Fluent Commerce.

2. transactionId

Type: String

Description:

1{ "transactionId" : "56473" }

Language: json

Name: transactionId

Description:

[Warning: empty required content area]

The unique transaction identifier assigned by Fluent Commerce.

3. transactionRef

Type: String

Description:

1{ "transactionRef" : "1442900790" }

Language: java

Name: transactionRef

Description:

[Warning: empty required content area]

The unique transaction reference provided by the Retailer to the payment gateway.

For refunds, it contains the transaction Id provided by the gateway to Fluent Commerce when a refund is processed.

4. transactionType

Type: String

Description:

1{ "transactionType" : "PAYMENT" }

Language: java

Name: transactionType

Description:

[Warning: empty required content area]

The type of transaction. Possible values are:

  • PAYMENT - Order payment has been successfully processed via payment gateway.
  • REFUND - Refund has been successfully processed via payment gateway integration.
  • MANUAL REFUND - Transaction has been processed externally to the Fluent Retail system with the reference details saved in Admin Console.
5. amount

Type: Double

Description:

1{ "amount" : "59.90" }

Language: json

Name: amount

Description:

[Warning: empty required content area]

For transactionType = PAYMENT - The total transaction amount.

For transactionType = REFUND - The requested refund amount for a return.

6. currency

Type: String

Description:

1{ "currency" : "AUD" }

Language: json

Name: currency

Description:

[Warning: empty required content area]

The transaction currency. Possible values include 'AUD', 'NZD'.

7. transactionCode

Type: String

Description:

1{ "transactionCode" : "080920151234" }

Language: java

Name: transactionCode

Description:

[Warning: empty required content area]

The unique transaction ID or request ID provided by the payment gateway.

8. paymentProvider

Type: String

Description:

1{ "paymentProvider" : "PAYPAL" }

Language: java

Name: paymentProvider

Description:

[Warning: empty required content area]

The name of the payment gateway.

Possible values are:

  • CYBERSOURCE
  • GIVEX
  • PAYPAL
  • BRAINTREE
  • AFTERPAY
9. paymentMethod

Type: String

Description:

1{ "paymentMethod" : "GIFTVOUCHER" }

Language: json

Name: paymentMethod

Description:

[Warning: empty required content area]

The way in which payment was made.

Possible values are:

  • CREDITCARD
  • PAYPAL'
  • GIFTVOUCHER
  • CASH
  • AFTERPAY
10. cardType

Type: String

Description:

1{ "cardType" : "VISA" }

Language: json

Name: cardType

Description:

[Warning: empty required content area]

The card type used for the payment (if applicable)

Possible values are:

  • MASTERCARD
  • VISA
  • AMEX
  • DINERS
  • DISCOVER
  • UNIONPAY
  • JCB
  • MAESTRO
  • INTERAC
11. status

Type: String

Description:

1{ "status" : "APPROVED" }

Language: java

Name: status

Description:

[Warning: empty required content area]

The transaction status.

Default value is APPROVED for all transactions not initiated by Fluent Retail System i.e. A payment transaction passed in by the retailer along with the order details will be in APPROVED state.

For a Refund initiated by Fluent Retail it can be:

  • APPROVED - The Refund has been approved by the payment provider. A manual refund recorded in the system will be in approved state.
  • PROCESSING - The refund is in progress with the payment provider.
  • DECLINED - The refund has failed to process successfully.
12. createdOn

Type: DateTime

Description:

1{ "createdOn" : "2016-05-06T23:41:12.242Z" }

Language: java

Name: createdOn

Description:

[Warning: empty required content area]

Date/time when the transaction was created.

13. updateOn

Type: DateTime

Description:

1{ "updatedOn" : "2016-06-23T07:58:58.000+0000" }

Language: java

Name: updateOn

Description:

[Warning: empty required content area]

Date/time when the transaction was last updated.


What you can do with Order Transaction

Create an Order Transaction

Create a transaction in the Fluent Retail system.

POST: 

`/api/v4/order/{orderId}/transaction`

Request Object

1orderTransactionRequest {
2
3amount (double, compulsory),
4cardType (string, optional) = 'MASTERCARD', 'VISA', 'AMEX', 'DINERS',
5currency (string, compulsory) = 'AUD', 'NZD',
6paymentMethod (string, compulsory) = 'CREDITCARD', 'PAYPAL', 'GIFTVOUCHER', 'CASH', 'AFTERPAY',
7paymentProvider (string, compulsory) = 'CYBERSOURCE', 'GIVEX', 'PAYPAL', 'BRAINTREE', 'AFTERPAY',
8transactionCode (string, compulsory),
9transactionRef (string, compulsory),
10transactionType (string, compulsory) = 'PAYMENT', 'REFUND', 'MANUAL REFUND',
11updatedOn (string, optional)
12}

Language: java

Name: Request Object

Description:

[Warning: empty required content area]

Example request

1orderTransactionRequest {
2
3amount (double, compulsory),
4cardType (string, optional) = 'MASTERCARD', 'VISA', 'AMEX', 'DINERS',
5currency (string, compulsory) = 'AUD', 'NZD',
6paymentMethod (string, compulsory) = 'CREDITCARD', 'PAYPAL', 'GIFTVOUCHER', 'CASH', 'AFTERPAY',
7paymentProvider (string, compulsory) = 'CYBERSOURCE', 'GIVEX', 'PAYPAL', 'BRAINTREE', 'AFTERPAY',
8transactionCode (string, compulsory),
9transactionRef (string, compulsory),
10transactionType (string, compulsory) = 'PAYMENT', 'REFUND', 'MANUAL REFUND',
11updatedOn (string, optional)

Language: java

Name: Example Request

Description:

[Warning: empty required content area]

Response Object

1SuccessMessageResponse {
2
3id (object, optional),
4message (string, optional),
5status (string, optional)
6}

Language: java

Name: Response object

Description:

[Warning: empty required content area]

Example response

1{
2 "id":"185330"
3}

Language: java

Name: Example response

Description:

[Warning: empty required content area]
View Transaction Details

Retrieve details for a single Transaction associated with an Order

GET: 

`/api/v4/order/{orderId}/transaction/{transactionId}`

Response Object

1orderTransactionResponse {
2amount (double),
3cardType (string) = 'MASTERCARD', 'VISA', 'AMEX', 'DINERS',
4createdOn (string),
5currency (string) = 'AUD', 'NZD',
6orderId (string),
7paymentMethod (string) = 'CREDITCARD', 'PAYPAL', 'GIFTVOUCHER', 'CASH', 'AFTERPAY',
8paymentProvider (string) = 'CYBERSOURCE', 'GIVEX', 'PAYPAL', 'BRAINTREE', 'AFTERPAY',
9transactionCode (string),
10transactionId (string),
11transactionRef (string),
12transactionType (string) = 'PAYMENT', 'REFUND', 'MANUAL REFUND',
13}

Language: java

Name: Response Object

Description:

[Warning: empty required content area]
Example response
1{
2  "amount": 0,
3  "cardType": "VISA",
4  "createdOn": "2016-11-29T21:11:30.851Z",
5  "currency": "AUD",
6  "orderId": "16567",
7  "paymentMethod": "CREDITCARD",
8  "paymentProvider": "BRAINTREE",
9  "transactionCode": "080920151234",
10  "transactionId": "185330",
11  "transactionRef": "1442900790",
12  "transactionType": "PAYMENT"
13}

Language: text

Name: Example response

Description:

[Warning: empty required content area]
View all Order Transactions

Retrieve all transactions associated with an Order.

GET: 

`/api/v4/order/{orderId}/transaction`

Request Object
1orderTransactionRequest {
2
3    start (integer, optional),
4    
5    count (integer, optional)
6}

Language: java

Name: Request object

Description:

[Warning: empty required content area]
Example request
1{
2 "start":"1",
3 "count":"10"
4}

Language: text

Name: Example request

Description:

[Warning: empty required content area]

Response Object

1orderTransactionResponse {
2
3    start (integer),
4    count (integer),
5    total (integer),
6    retailerId (string),
7    orderId (string),
8    transactions (array[orderTransactions]) [
9    {
10        transactionId (string),
11        transactionRef (string),
12        transactionType (string) = 'PAYMENT', 'REFUND', 'MANUAL REFUND',
13        amount (double),
14        createdOn (DateTime)
15        status (string) = 'APPROVED', 'PROCESSING', 'DECLINED',
16        paymentProvider (string) = 'CYBERSOURCE', 'GIVEX', 'PAYPAL', 'BRAINTREE', 'AFTERPAY',
17        cardType (string) = 'MASTERCARD', 'VISA', 'AMEX', 'DINERS',
18        paymentMethod (string) = 'CREDITCARD', 'PAYPAL', 'GIFTVOUCHER', 'CASH', 'AFTERPAY'
19    }
20    ]
21}

Language: java

Name: Response object

Description:

[Warning: empty required content area]

Example response

1{
2  "count": 0,
3  "orderId": 0,
4  "results": [
5    {
6      "amount": 0,
7      "cardType": "VISA",
8      "createdOn": "2016-11-29T21:11:30.836Z",
9      "currency": "AUD",
10      "orderId": 0,
11      "paymentMethod": "CREDITCARD",
12      "paymentProvider": "BRAINTREE",
13      "transactionCode": "string",
14      "transactionId": 0,
15      "transactionRef": "string",
16      "transactionType": "PAYMENT"
17    }
18  ],
19  "start": 0,
20  "total": 0
21}

Language: java

Name: Example response

Description:

[Warning: empty required content area]


Response on Failures

NAME

TYPE

DESCRIPTION

error

Array

Array of errors

message

String

Additional information on the code Unauthorized | Bad Request | Forbidden | Not Found | Status 500 Error

code

String

Status Code for the above messages 401 | 400 | 403 | 404 | 500

Fluent Commerce

Fluent Commerce