API - Transactions

The Transactions resource contains several methods that return transaction specific information.

Method Name: listTransactions, listPreviousTransactions, listNextTransactions

Retrieve a list of the Transactions on your account. The list will contain 25 Transactions at a time with links to the next and previous pages.

The methods listPreviousTransactions and listNextTransactions are pagination methods.

  • Method: GET

  • Parameters:

    • Limit — Min Value: 0, Max Value: 25.
    • Offset — Min Value: 0
  • Request Headers: Accept, Authorization, Host

  • Request Message Body: None

  • Response Headers: Content-Length, Content-Type, Content-Location

  • Response Message Body: List of Transactions

  • Response Status: 200, 204, 400, 401, 403, 404

  • Media Types:

    • application/vnd.koleimports.ds.transaction+xml
    • application/vnd.koleimports.ds.transaction+json

Request Parameters:

GET /transactions
Host: example.com 
Authorization: Basic {id}:{api_key} 
Accept: application/vnd.koleimports.ds.transaction+xml

Example CURL Request:

curl -H "Accept: application/vnd.koleimports.ds.transaction+xml" "https://{id}:{api_key}@api.koleimports.com/transactions?limit=1&offset=0"

Example Response:

HTTP/1.1 200 OK 
Content-Type: application/vnd.koleimports.ds.transaction+xml
Content-Length: 1804
Content-Location: https://api.koleimports.com/transactions?limit=25&offset=0

<?xml version="1.0" encoding="utf-8"?>
<transactions>
    <transaction>
        <order_id></order_id>
        <amount></amount>
        <type></type>
        <method></method>
        <account></account>
        <status></status>
        <message></message>
        <created></created>
        <links>
            <link>
                <method></method>
                <media_type></media_type>
                <url></url>
            </link>
        </links>
    </transaction>
</transactions>

Response Body Field Definitions

The listTransactions, listPreviousTransactions and listNextTransactions methods are collection methods. See getTransaction for field definitions.

Method Name: getTransaction

Retrieve information about Transactions for an order, by the Transaction ID.

Note: Unlike most resources, multiple transactions can appear for a single order.

  • Method: GET

  • Parameters: None

  • Request Headers: Accept, Authorization, Host

  • Request Message Body: None

  • Response Headers: Content-Length, Content-Type, Content-Location

  • Response Message Body: Transaction Information

  • Response Status: 200, 400, 401, 403, 404

  • Media Types:

    • application/vnd.koleimports.ds.transaction+xml
    • application/vnd.koleimports.ds.transaction+json

Request Parameters:

GET /transactions/{order_id}
Host: example.com 
Authorization: Basic {id}:{api_key} 
Accept: application/vnd.koleimports.ds.transaction+xml

Example CURL Request:

curl -H "Accept: application/vnd.koleimports.ds.transaction+xml" "https://{id}:{api_key}@api.koleimports.com/transactions/{order_id}"

Example Response:

HTTP/1.1 200 OK 
Content-Type: application/vnd.koleimports.ds.transaction+xml
Content-Length: 1804
Content-Location: https://api.koleimports.com/transactions/{order_id}

<?xml version="1.0" encoding="utf-8"?>
<transaction>
    <order_id></order_id>
    <amount></amount>
    <type></type>
    <method></method>
    <account></account>
    <status></status>
    <message></message>
    <created></created>
    <links>
        <link>
            <method></method>
            <media_type></media_type>
            <url></url>
        </link>
    </links>
</transaction>

Response Body Field Definitions

Field Name Description Type Length
Field Name Description Type Length
shipment

Children:

  • order_id
  • amount
  • type
  • method
  • account
  • status
  • message
  • created
  • links
n/a n/a
order_id

A unique order number.

integer 10
amount

The amount of the transaction.

decimal 10
type

A constant that specifies the type of transaction.
Options: AUTH_CAPTURE, REFUND or VOID

String n/a
method

The transaction method. Currently only CC (Credit card) is supported.

String 10
account

The masked account number for this transaction (e.g. XXXX1234).

String 8
status

A constant that specifies the status of the transaction.
Options: APPROVED, DECLINED or VOID

String n/a
message

The short message describing the transaction.

String 250
created

The ISO 8601 Timestamp for when the transaction was submitted (0000-00-00T00:00:00).

String 19
links

Children:

  • link
n/a n/a
link

Children:

  • method
  • media_type
  • url
n/a n/a
method

The name of the API method.

String 100
media_type

The media type for the method. Use this in the Accept Header.

String 250
url

The URL used to access the resource.

String 250