See the Transaction data model for a list of properties and available filters.

GET http://api.cratejoy.com/v1/transactions/
GET http://api.cratejoy.com/v1/transactions/{trans_id}

List transactions

GET http://api.cratejoy.com/v1/transactions/
$.ajax({     
  url: 'https://api.cratejoy.com/v1/transactions/',
  method: 'GET'
});
{
  "count": 22, 
  "next": "?page=1", 
  "prev": null, 
  "results": [
    {
      "created_at": "2015-09-15T20:00:24Z", 
      "id": 75572233, 
      "is_test": true, 
      "order": {...}, // Order resource
      "result": "captured", 
      "total": 1200, 
      "url": "/v1/transactions/75572233/"
    } ]
}

Get a transaction

GET http://api.cratejoy.com/v1/transactions/{trans_id}
$.ajax({     
  url: 'https://api.cratejoy.com/v1/transactions/75572233/',
  method: 'GET'
});

How transactions relate to orders

Transactions have a one-to-many relationship to orders. A transaction represents an attempted payment, a successful payment, an attempted refund, or a successful refund that can all map to a single order ID.

Example #1: Standard Order
Subscriber pays for order ID #001 and payment goes through successfully.
Result: 1 transaction for order ID 001, enum result is captured, integer result is 2.

Example #2: Multiple payment attempts
Subscriber pays for order ID #002 but payment fails. Subscriber tries a different card that succeeds.
Result: 2 transactions for order ID 002:

  • One transaction has enum result captured, integer result 2
  • One transaction has enum result failed, integer result 3

Example #3: Standard order, with a partial refund
Subscriber pays for order ID #003. Later, seller partially refunds the order.
Result: 2 transactions for order ID 003:

  • One transaction has enum result captured, integer result 2
  • One transaction has enum result refunded, integer result 4, with total as the refunded amount.