Kepla API

Transactions

Transactions are where you track anything financial in Kepla. They're the financial interactions your records have with your organisation, and drive a series of powerful financial reports. Transactions will always be associated with a record. You can add line items, metadata, shipping/tax information and campaign codes to each transaction. You can list, create, update and delete transactions through the API.

Transactions Overview

{
  "accountId": "04fe9a97-a579-43c5-bb1a-58ed29bf0a6a",
String (Uuid)

Read only. Set by your API key.

  "campaign": "may fundraiser",
String

A campaign to group the transaction around. This could be the top-level promotions event that drove the transaction.

  "createdAt": null,
String (Date-time)

Read only.

  "currency": "AUD",
String

ISO 3-letter currency code

  "date": null,
String (Date-time)

Date the transaction occurred, defaults to the current date.

  "fees": 2,
Integer

Optional. Any processing fees incurred with the transaction.

  "fundId": "foo",
String

An ID of the fund to add the transaction to. These can be registered using the taxonomies API.

  "id": "04fe9a97-a579-43c5-bb1a-58ed29bf0a6a",
String (Uuid)

Read only, generated after the transaction has been created.

  items: [
Array

An optional array of items in the transaction (like products bought)

    {
    { ... }
Object

Items

      "category": "Home",
String

Optional

      "name": "Sleek Soft Shoes",
String
      "price": 519,
Integer

Optional

      "sku": "foo",
String

Optional

      "quantity": 1
Integer

Quantity of the item

    }
  ]
  "recordId": "2ac919ee-c895-465d-a656-42b1530c0e09",
String

The record the transaction is attached to

  "revenue": 500,
Integer

Net revenue from the transaction (minus fees, tax and shipping)

  "shipping": 54,
Integer

Optional. Shipping costs to record on the transaction.

  "source": "facebook",
String

The source this transaction came from as part of the campaign. IE. cpc or facebook

  "status": "succeeded",
String

Can be succeeded, failed or refunded.

  "tax": 50,
Integer

Optional. Tax associated with the transaction

  "transactionId": "foo",
String

Optional. A reference ID to record on the transaction (usually generated by the system that is processing the charge).

  "updatedAt": null,
String (Date-time)

Read-only

  meta: [
Array

Arbitrary key/value pairs to store on the transaction.

    {
    { ... }
Object

Meta

      "key": "mykey",
String
      "value": "API Value"
String
    }
  ]
}

List Transactions

Open in API Explorer
GET /transactions

Returns a list of all transactions that meet the specified criteria.

Example Request

Format:
curl --request GET \
  --url 'https://api.kepla.com/v1/transactions?limit=42&offset=42&orderBy=foo&order=foo&recordId=04fe9a97-a579-43c5-bb1a-58ed29bf0a6a&fundId=foo&campaign=foo&source=foo&status=foo&from=&expand=record%252Ctype' \
  --header 'accept: application/json' \
  --header 'authorization: Bearer YOUR API KEY HERE'
require 'uri'
require 'net/http'

url = URI("https://api.kepla.com/v1/transactions?limit=42&offset=42&orderBy=foo&order=foo&recordId=04fe9a97-a579-43c5-bb1a-58ed29bf0a6a&fundId=foo&campaign=foo&source=foo&status=foo&from=&expand=record%252Ctype")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE

request = Net::HTTP::Get.new(url)
request["accept"] = 'application/json'
request["authorization"] = 'Bearer YOUR API KEY HERE'

response = http.request(request)
puts response.read_body
var http = require("https");

var options = {
  "method": "GET",
  "hostname": "api.kepla.com",
  "port": null,
  "path": "/v1/transactions?limit=42&offset=42&orderBy=foo&order=foo&recordId=04fe9a97-a579-43c5-bb1a-58ed29bf0a6a&fundId=foo&campaign=foo&source=foo&status=foo&from=&expand=record%252Ctype",
  "headers": {
    "accept": "application/json",
    "authorization": "Bearer YOUR API KEY HERE"
  }
};

var req = http.request(options, function (res) {
  var chunks = [];

  res.on("data", function (chunk) {
    chunks.push(chunk);
  });

  res.on("end", function () {
    var body = Buffer.concat(chunks);
    console.log(body.toString());
  });
});

req.end();
import http.client

conn = http.client.HTTPSConnection("api.kepla.com")

headers = {
    'accept': "application/json",
    'authorization': "Bearer YOUR API KEY HERE"
    }

conn.request("GET", "/v1/transactions?limit=42&offset=42&orderBy=foo&order=foo&recordId=04fe9a97-a579-43c5-bb1a-58ed29bf0a6a&fundId=foo&campaign=foo&source=foo&status=foo&from=&expand=record%252Ctype", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://api.kepla.com/v1/transactions?limit=42&offset=42&orderBy=foo&order=foo&recordId=04fe9a97-a579-43c5-bb1a-58ed29bf0a6a&fundId=foo&campaign=foo&source=foo&status=foo&from=&expand=record%252Ctype",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",
  CURLOPT_HTTPHEADER => array(
    "accept: application/json",
    "authorization: Bearer YOUR API KEY HERE"
  ),
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
package main

import (
	"fmt"
	"net/http"
	"io/ioutil"
)

func main() {

	url := "https://api.kepla.com/v1/transactions?limit=42&offset=42&orderBy=foo&order=foo&recordId=04fe9a97-a579-43c5-bb1a-58ed29bf0a6a&fundId=foo&campaign=foo&source=foo&status=foo&from=&expand=record%252Ctype"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("accept", "application/json")
	req.Header.Add("authorization", "Bearer YOUR API KEY HERE")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := ioutil.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}

Query Parameters

Name Type Required Description Example
limit Integer Optional

Number of transactions to return

42
offset Integer Optional

Number of transactions to skip from the start of the collection (for pagination)

42
orderBy String Optional

Field to order transactions by

foo
order String Optional

Direction to order transactions in. Either asc or desc

foo
recordId String (uuid) Optional

Retrieve transactions associated with this record ID

04fe9a97-a579-43c5-bb1a-58ed29bf0a6a
fundId String Optional

The fund ID to filter transactions by

foo
campaign String Optional

The campaign to filter transactions by. This must be an exact match.

foo
source String Optional

The source to filter transactions by. This must be an exact match.

foo
status String Optional

The status to filter transactions by. Should be succeeded, failed or refunded.

foo
from String (date-time) Optional

Retrieve transactions from this date (inclusive)

expand String Optional

Accepts a comma-separated string of objects to expand out. Accepted values are currenty "record".

record%2Ctype

Path Parameters

Name Type Required Description Example
to String (date-time) Required

Retrieve transactions up until this date (inclusive)

Responses

200 Success Transactions Envelope
{
  "total": 100,
Integer
  transactions: [
Array
    {
    { ... }
Object

Default

      "accountId": "04fe9a97-a579-43c5-bb1a-58ed29bf0a6a",
String (Uuid)

Read only. Set by your API key.

      "campaign": "may fundraiser",
String

A campaign to group the transaction around. This could be the top-level promotions event that drove the transaction.

      "createdAt": null,
String (Date-time)

Read only.

      "currency": "AUD",
String

ISO 3-letter currency code

      "date": null,
String (Date-time)

Date the transaction occurred, defaults to the current date.

      "fees": 2,
Integer

Optional. Any processing fees incurred with the transaction.

      "fundId": "foo",
String

An ID of the fund to add the transaction to. These can be registered using the taxonomies API.

      "id": "04fe9a97-a579-43c5-bb1a-58ed29bf0a6a",
String (Uuid)

Read only, generated after the transaction has been created.

      items: [
Array

An optional array of items in the transaction (like products bought)

        {
        { ... }
Object

Items

          "category": "Home",
String

Optional

          "name": "Sleek Soft Shoes",
String
          "price": 519,
Integer

Optional

          "sku": "foo",
String

Optional

          "quantity": 1
Integer

Quantity of the item

        }
      ]
      "recordId": "2ac919ee-c895-465d-a656-42b1530c0e09",
String

The record the transaction is attached to

      "revenue": 500,
Integer

Net revenue from the transaction (minus fees, tax and shipping)

      "shipping": 54,
Integer

Optional. Shipping costs to record on the transaction.

      "source": "facebook",
String

The source this transaction came from as part of the campaign. IE. cpc or facebook

      "status": "succeeded",
String

Can be succeeded, failed or refunded.

      "tax": 50,
Integer

Optional. Tax associated with the transaction

      "transactionId": "foo",
String

Optional. A reference ID to record on the transaction (usually generated by the system that is processing the charge).

      "updatedAt": null,
String (Date-time)

Read-only

      meta: [
Array

Arbitrary key/value pairs to store on the transaction.

        {
        { ... }
Object

Meta

          "key": "mykey",
String
          "value": "API Value"
String
        }
      ]
    }
  ]
  "options": {
  "options": { ... }
Object
    "limit": 50,
Integer
    "offset": 0
Integer
  }
}

Retrieve a Transaction

Open in API Explorer
GET /transactions/:transaction

Retrieves the specified transaction object

Example Request

Format:
curl --request GET \
  --url https://api.kepla.com/v1/transactions/:transaction \
  --header 'accept: application/json' \
  --header 'authorization: Bearer YOUR API KEY HERE'
require 'uri'
require 'net/http'

url = URI("https://api.kepla.com/v1/transactions/:transaction")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE

request = Net::HTTP::Get.new(url)
request["accept"] = 'application/json'
request["authorization"] = 'Bearer YOUR API KEY HERE'

response = http.request(request)
puts response.read_body
var http = require("https");

var options = {
  "method": "GET",
  "hostname": "api.kepla.com",
  "port": null,
  "path": "/v1/transactions/:transaction",
  "headers": {
    "accept": "application/json",
    "authorization": "Bearer YOUR API KEY HERE"
  }
};

var req = http.request(options, function (res) {
  var chunks = [];

  res.on("data", function (chunk) {
    chunks.push(chunk);
  });

  res.on("end", function () {
    var body = Buffer.concat(chunks);
    console.log(body.toString());
  });
});

req.end();
import http.client

conn = http.client.HTTPSConnection("api.kepla.com")

headers = {
    'accept': "application/json",
    'authorization': "Bearer YOUR API KEY HERE"
    }

conn.request("GET", "/v1/transactions/:transaction", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://api.kepla.com/v1/transactions/:transaction",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",
  CURLOPT_HTTPHEADER => array(
    "accept: application/json",
    "authorization: Bearer YOUR API KEY HERE"
  ),
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
package main

import (
	"fmt"
	"net/http"
	"io/ioutil"
)

func main() {

	url := "https://api.kepla.com/v1/transactions/:transaction"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("accept", "application/json")
	req.Header.Add("authorization", "Bearer YOUR API KEY HERE")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := ioutil.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}

Path Parameters

Name Type Required Description Example
transaction String (uuid) Required

The transaction ID to delete (this should be the id field not transactionId)

04fe9a97-a579-43c5-bb1a-58ed29bf0a6a

Responses

200 Success Transactions Default
{
  "accountId": "04fe9a97-a579-43c5-bb1a-58ed29bf0a6a",
String (Uuid)

Read only. Set by your API key.

  "campaign": "may fundraiser",
String

A campaign to group the transaction around. This could be the top-level promotions event that drove the transaction.

  "createdAt": null,
String (Date-time)

Read only.

  "currency": "AUD",
String

ISO 3-letter currency code

  "date": null,
String (Date-time)

Date the transaction occurred, defaults to the current date.

  "fees": 2,
Integer

Optional. Any processing fees incurred with the transaction.

  "fundId": "foo",
String

An ID of the fund to add the transaction to. These can be registered using the taxonomies API.

  "id": "04fe9a97-a579-43c5-bb1a-58ed29bf0a6a",
String (Uuid)

Read only, generated after the transaction has been created.

  items: [
Array

An optional array of items in the transaction (like products bought)

    {
    { ... }
Object

Items

      "category": "Home",
String

Optional

      "name": "Sleek Soft Shoes",
String
      "price": 519,
Integer

Optional

      "sku": "foo",
String

Optional

      "quantity": 1
Integer

Quantity of the item

    }
  ]
  "recordId": "2ac919ee-c895-465d-a656-42b1530c0e09",
String

The record the transaction is attached to

  "revenue": 500,
Integer

Net revenue from the transaction (minus fees, tax and shipping)

  "shipping": 54,
Integer

Optional. Shipping costs to record on the transaction.

  "source": "facebook",
String

The source this transaction came from as part of the campaign. IE. cpc or facebook

  "status": "succeeded",
String

Can be succeeded, failed or refunded.

  "tax": 50,
Integer

Optional. Tax associated with the transaction

  "transactionId": "foo",
String

Optional. A reference ID to record on the transaction (usually generated by the system that is processing the charge).

  "updatedAt": null,
String (Date-time)

Read-only

  meta: [
Array

Arbitrary key/value pairs to store on the transaction.

    {
    { ... }
Object

Meta

      "key": "mykey",
String
      "value": "API Value"
String
    }
  ]
}

Export Transactions

Open in API Explorer
GET /transaction-exports

Returns a URL to a CSV file containing all transactions that meet the criteria. The endpoint is synchronous, though can take a little while to return. You can download the CSV for bulk processing.

Example Request

Format:
curl --request GET \
  --url 'https://api.kepla.com/v1/transaction-exports?orderBy=foo&order=foo&recordId=04fe9a97-a579-43c5-bb1a-58ed29bf0a6a&fundId=04fe9a97-a579-43c5-bb1a-58ed29bf0a6a&campaign=foo&source=foo&status=foo&from=&to=' \
  --header 'accept: application/json' \
  --header 'authorization: Bearer YOUR API KEY HERE'
require 'uri'
require 'net/http'

url = URI("https://api.kepla.com/v1/transaction-exports?orderBy=foo&order=foo&recordId=04fe9a97-a579-43c5-bb1a-58ed29bf0a6a&fundId=04fe9a97-a579-43c5-bb1a-58ed29bf0a6a&campaign=foo&source=foo&status=foo&from=&to=")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE

request = Net::HTTP::Get.new(url)
request["accept"] = 'application/json'
request["authorization"] = 'Bearer YOUR API KEY HERE'

response = http.request(request)
puts response.read_body
var http = require("https");

var options = {
  "method": "GET",
  "hostname": "api.kepla.com",
  "port": null,
  "path": "/v1/transaction-exports?orderBy=foo&order=foo&recordId=04fe9a97-a579-43c5-bb1a-58ed29bf0a6a&fundId=04fe9a97-a579-43c5-bb1a-58ed29bf0a6a&campaign=foo&source=foo&status=foo&from=&to=",
  "headers": {
    "accept": "application/json",
    "authorization": "Bearer YOUR API KEY HERE"
  }
};

var req = http.request(options, function (res) {
  var chunks = [];

  res.on("data", function (chunk) {
    chunks.push(chunk);
  });

  res.on("end", function () {
    var body = Buffer.concat(chunks);
    console.log(body.toString());
  });
});

req.end();
import http.client

conn = http.client.HTTPSConnection("api.kepla.com")

headers = {
    'accept': "application/json",
    'authorization': "Bearer YOUR API KEY HERE"
    }

conn.request("GET", "/v1/transaction-exports?orderBy=foo&order=foo&recordId=04fe9a97-a579-43c5-bb1a-58ed29bf0a6a&fundId=04fe9a97-a579-43c5-bb1a-58ed29bf0a6a&campaign=foo&source=foo&status=foo&from=&to=", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://api.kepla.com/v1/transaction-exports?orderBy=foo&order=foo&recordId=04fe9a97-a579-43c5-bb1a-58ed29bf0a6a&fundId=04fe9a97-a579-43c5-bb1a-58ed29bf0a6a&campaign=foo&source=foo&status=foo&from=&to=",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",
  CURLOPT_HTTPHEADER => array(
    "accept: application/json",
    "authorization: Bearer YOUR API KEY HERE"
  ),
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
package main

import (
	"fmt"
	"net/http"
	"io/ioutil"
)

func main() {

	url := "https://api.kepla.com/v1/transaction-exports?orderBy=foo&order=foo&recordId=04fe9a97-a579-43c5-bb1a-58ed29bf0a6a&fundId=04fe9a97-a579-43c5-bb1a-58ed29bf0a6a&campaign=foo&source=foo&status=foo&from=&to="

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("accept", "application/json")
	req.Header.Add("authorization", "Bearer YOUR API KEY HERE")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := ioutil.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}

Query Parameters

Name Type Required Description Example
orderBy String Optional

The field to order the export by

foo
order String Optional

The direction to order in. Either asc or desc.

foo
recordId String (uuid) Optional

Filter transactions by this record ID

04fe9a97-a579-43c5-bb1a-58ed29bf0a6a
fundId String (uuid) Optional

Filter transactions by this fund ID

04fe9a97-a579-43c5-bb1a-58ed29bf0a6a
campaign String Optional

Filter transactions by this campaign. It must be an exact match.

foo
source String Optional

Filter transactions by this source. It must be an exact match.

foo
status String Optional

Filter transactions by this status. It must be succeeded, failed or refunded.

foo
from String (date-time) Optional

Export transactions from this date (inclusive)

to String (date-time) Optional

Export transactions up until this date (inclusive)

Create a Transaction

Open in API Explorer
POST /transactions

Creates a transaction using the supplied parameters

Example Request

Format:
curl --request POST \
  --url https://api.kepla.com/v1/transactions \
  --header 'accept: application/json' \
  --header 'authorization: Bearer YOUR API KEY HERE' \
  --header 'content-type: application/x-www-form-urlencoded'
require 'uri'
require 'net/http'

url = URI("https://api.kepla.com/v1/transactions")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE

request = Net::HTTP::Post.new(url)
request["accept"] = 'application/json'
request["authorization"] = 'Bearer YOUR API KEY HERE'
request["content-type"] = 'application/x-www-form-urlencoded'

response = http.request(request)
puts response.read_body
var http = require("https");

var options = {
  "method": "POST",
  "hostname": "api.kepla.com",
  "port": null,
  "path": "/v1/transactions",
  "headers": {
    "accept": "application/json",
    "authorization": "Bearer YOUR API KEY HERE",
    "content-type": "application/x-www-form-urlencoded"
  }
};

var req = http.request(options, function (res) {
  var chunks = [];

  res.on("data", function (chunk) {
    chunks.push(chunk);
  });

  res.on("end", function () {
    var body = Buffer.concat(chunks);
    console.log(body.toString());
  });
});

req.end();
import http.client

conn = http.client.HTTPSConnection("api.kepla.com")

payload = ""

headers = {
    'accept': "application/json",
    'authorization': "Bearer YOUR API KEY HERE",
    'content-type': "application/x-www-form-urlencoded"
    }

conn.request("POST", "/v1/transactions", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://api.kepla.com/v1/transactions",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS => "",
  CURLOPT_HTTPHEADER => array(
    "accept: application/json",
    "authorization: Bearer YOUR API KEY HERE",
    "content-type: application/x-www-form-urlencoded"
  ),
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
package main

import (
	"fmt"
	"net/http"
	"io/ioutil"
)

func main() {

	url := "https://api.kepla.com/v1/transactions"

	req, _ := http.NewRequest("POST", url, nil)

	req.Header.Add("accept", "application/json")
	req.Header.Add("authorization", "Bearer YOUR API KEY HERE")
	req.Header.Add("content-type", "application/x-www-form-urlencoded")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := ioutil.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}

Request Body

Name Type Required Description Example
payload Object Required {}

Responses

201 Success Transactions Default
{
  "accountId": "04fe9a97-a579-43c5-bb1a-58ed29bf0a6a",
String (Uuid)

Read only. Set by your API key.

  "campaign": "may fundraiser",
String

A campaign to group the transaction around. This could be the top-level promotions event that drove the transaction.

  "createdAt": null,
String (Date-time)

Read only.

  "currency": "AUD",
String

ISO 3-letter currency code

  "date": null,
String (Date-time)

Date the transaction occurred, defaults to the current date.

  "fees": 2,
Integer

Optional. Any processing fees incurred with the transaction.

  "fundId": "foo",
String

An ID of the fund to add the transaction to. These can be registered using the taxonomies API.

  "id": "04fe9a97-a579-43c5-bb1a-58ed29bf0a6a",
String (Uuid)

Read only, generated after the transaction has been created.

  items: [
Array

An optional array of items in the transaction (like products bought)

    {
    { ... }
Object

Items

      "category": "Home",
String

Optional

      "name": "Sleek Soft Shoes",
String
      "price": 519,
Integer

Optional

      "sku": "foo",
String

Optional

      "quantity": 1
Integer

Quantity of the item

    }
  ]
  "recordId": "2ac919ee-c895-465d-a656-42b1530c0e09",
String

The record the transaction is attached to

  "revenue": 500,
Integer

Net revenue from the transaction (minus fees, tax and shipping)

  "shipping": 54,
Integer

Optional. Shipping costs to record on the transaction.

  "source": "facebook",
String

The source this transaction came from as part of the campaign. IE. cpc or facebook

  "status": "succeeded",
String

Can be succeeded, failed or refunded.

  "tax": 50,
Integer

Optional. Tax associated with the transaction

  "transactionId": "foo",
String

Optional. A reference ID to record on the transaction (usually generated by the system that is processing the charge).

  "updatedAt": null,
String (Date-time)

Read-only

  meta: [
Array

Arbitrary key/value pairs to store on the transaction.

    {
    { ... }
Object

Meta

      "key": "mykey",
String
      "value": "API Value"
String
    }
  ]
}

Update a Transaction

Open in API Explorer
PUT /transactions/:transaction

Updates the specified transaction with the supplied data. Partial updates to the items or meta object are not currently supported, to update items or meta you should resupply the object.

Example Request

Format:
curl --request PUT \
  --url https://api.kepla.com/v1/transactions/:transaction \
  --header 'accept: application/json' \
  --header 'authorization: Bearer YOUR API KEY HERE' \
  --header 'content-type: application/x-www-form-urlencoded'
require 'uri'
require 'net/http'

url = URI("https://api.kepla.com/v1/transactions/:transaction")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE

request = Net::HTTP::Put.new(url)
request["accept"] = 'application/json'
request["authorization"] = 'Bearer YOUR API KEY HERE'
request["content-type"] = 'application/x-www-form-urlencoded'

response = http.request(request)
puts response.read_body
var http = require("https");

var options = {
  "method": "PUT",
  "hostname": "api.kepla.com",
  "port": null,
  "path": "/v1/transactions/:transaction",
  "headers": {
    "accept": "application/json",
    "authorization": "Bearer YOUR API KEY HERE",
    "content-type": "application/x-www-form-urlencoded"
  }
};

var req = http.request(options, function (res) {
  var chunks = [];

  res.on("data", function (chunk) {
    chunks.push(chunk);
  });

  res.on("end", function () {
    var body = Buffer.concat(chunks);
    console.log(body.toString());
  });
});

req.end();
import http.client

conn = http.client.HTTPSConnection("api.kepla.com")

payload = ""

headers = {
    'accept': "application/json",
    'authorization': "Bearer YOUR API KEY HERE",
    'content-type': "application/x-www-form-urlencoded"
    }

conn.request("PUT", "/v1/transactions/:transaction", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://api.kepla.com/v1/transactions/:transaction",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "PUT",
  CURLOPT_POSTFIELDS => "",
  CURLOPT_HTTPHEADER => array(
    "accept: application/json",
    "authorization: Bearer YOUR API KEY HERE",
    "content-type: application/x-www-form-urlencoded"
  ),
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
package main

import (
	"fmt"
	"net/http"
	"io/ioutil"
)

func main() {

	url := "https://api.kepla.com/v1/transactions/:transaction"

	req, _ := http.NewRequest("PUT", url, nil)

	req.Header.Add("accept", "application/json")
	req.Header.Add("authorization", "Bearer YOUR API KEY HERE")
	req.Header.Add("content-type", "application/x-www-form-urlencoded")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := ioutil.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}

Path Parameters

Name Type Required Description Example
transaction String (uuid) Required

The transaction ID to update (this should be the id field not transactionId)

04fe9a97-a579-43c5-bb1a-58ed29bf0a6a

Request Body

Name Type Required Description Example
payload Object Required {}

Responses

200 Success Transactions Default
{
  "accountId": "04fe9a97-a579-43c5-bb1a-58ed29bf0a6a",
String (Uuid)

Read only. Set by your API key.

  "campaign": "may fundraiser",
String

A campaign to group the transaction around. This could be the top-level promotions event that drove the transaction.

  "createdAt": null,
String (Date-time)

Read only.

  "currency": "AUD",
String

ISO 3-letter currency code

  "date": null,
String (Date-time)

Date the transaction occurred, defaults to the current date.

  "fees": 2,
Integer

Optional. Any processing fees incurred with the transaction.

  "fundId": "foo",
String

An ID of the fund to add the transaction to. These can be registered using the taxonomies API.

  "id": "04fe9a97-a579-43c5-bb1a-58ed29bf0a6a",
String (Uuid)

Read only, generated after the transaction has been created.

  items: [
Array

An optional array of items in the transaction (like products bought)

    {
    { ... }
Object

Items

      "category": "Home",
String

Optional

      "name": "Sleek Soft Shoes",
String
      "price": 519,
Integer

Optional

      "sku": "foo",
String

Optional

      "quantity": 1
Integer

Quantity of the item

    }
  ]
  "recordId": "2ac919ee-c895-465d-a656-42b1530c0e09",
String

The record the transaction is attached to

  "revenue": 500,
Integer

Net revenue from the transaction (minus fees, tax and shipping)

  "shipping": 54,
Integer

Optional. Shipping costs to record on the transaction.

  "source": "facebook",
String

The source this transaction came from as part of the campaign. IE. cpc or facebook

  "status": "succeeded",
String

Can be succeeded, failed or refunded.

  "tax": 50,
Integer

Optional. Tax associated with the transaction

  "transactionId": "foo",
String

Optional. A reference ID to record on the transaction (usually generated by the system that is processing the charge).

  "updatedAt": null,
String (Date-time)

Read-only

  meta: [
Array

Arbitrary key/value pairs to store on the transaction.

    {
    { ... }
Object

Meta

      "key": "mykey",
String
      "value": "API Value"
String
    }
  ]
}

Delete a Transaction

Open in API Explorer
DELETE /transactions/:transaction

Deletes the specified transaction

Example Request

Format:
curl --request DELETE \
  --url https://api.kepla.com/v1/transactions/:transaction \
  --header 'accept: application/json' \
  --header 'authorization: Bearer YOUR API KEY HERE'
require 'uri'
require 'net/http'

url = URI("https://api.kepla.com/v1/transactions/:transaction")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE

request = Net::HTTP::Delete.new(url)
request["accept"] = 'application/json'
request["authorization"] = 'Bearer YOUR API KEY HERE'

response = http.request(request)
puts response.read_body
var http = require("https");

var options = {
  "method": "DELETE",
  "hostname": "api.kepla.com",
  "port": null,
  "path": "/v1/transactions/:transaction",
  "headers": {
    "accept": "application/json",
    "authorization": "Bearer YOUR API KEY HERE"
  }
};

var req = http.request(options, function (res) {
  var chunks = [];

  res.on("data", function (chunk) {
    chunks.push(chunk);
  });

  res.on("end", function () {
    var body = Buffer.concat(chunks);
    console.log(body.toString());
  });
});

req.end();
import http.client

conn = http.client.HTTPSConnection("api.kepla.com")

headers = {
    'accept': "application/json",
    'authorization': "Bearer YOUR API KEY HERE"
    }

conn.request("DELETE", "/v1/transactions/:transaction", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://api.kepla.com/v1/transactions/:transaction",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "DELETE",
  CURLOPT_HTTPHEADER => array(
    "accept: application/json",
    "authorization: Bearer YOUR API KEY HERE"
  ),
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
package main

import (
	"fmt"
	"net/http"
	"io/ioutil"
)

func main() {

	url := "https://api.kepla.com/v1/transactions/:transaction"

	req, _ := http.NewRequest("DELETE", url, nil)

	req.Header.Add("accept", "application/json")
	req.Header.Add("authorization", "Bearer YOUR API KEY HERE")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := ioutil.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}

Path Parameters

Name Type Required Description Example
transaction String (uuid) Required

The transaction ID to delete (this should be the id field not transactionId)

04fe9a97-a579-43c5-bb1a-58ed29bf0a6a

Responses

204 Success (Empty Response)