Difference between revisions of "API Transaction"
From Spiffy Stores Knowledge Base
m |
m |
||
Line 72: | Line 72: | ||
|- | |- | ||
|payment_details | |payment_details | ||
− | |<code>{ "payment_details" : { | + | |<code>{ "payment_details" : { |
− | "credit_card_bin" : "411111", | + | "avs_result_code" : null, |
− | "cvv_result_code" : null, | + | <br/> "credit_card_bin" : "411111", |
− | "credit_card_number" : "4111 11XX XXXX 1234", | + | <br/> "cvv_result_code" : null, |
− | "credit_card_company" : "Visa", | + | <br/> "credit_card_number" : "4111 11XX XXXX 1234", |
− | "credit_card_issuing_bank" : "Big Bank", | + | <br/> "credit_card_company" : "Visa", |
− | "minfraud_risk_score" : 0.15 }</code><br/> | + | <br/> "credit_card_issuing_bank" : "Big Bank", |
+ | <br/> "minfraud_risk_score" : 0.15 }</code><br/> | ||
Returns an object containing information about the credit card that was used for this transaction. | Returns an object containing information about the credit card that was used for this transaction. | ||
Revision as of 10:06, 13 October 2016
The Spiffy Stores API Transaction object represents a transaction that has been applied to an order.
There are five types of transactions that can be applied to an order.
- Sale: The amount of money transferred from the cardholder's account to pay the outstanding order.
- Authorization: This represents the amount which has been reserved against the cardholder's account. No money changes hands until an authorization is captured.
- Capture: This occurs only after an authorization has been approved, and records the actual transfer of funds from the cardholder's account.
- Void: This represents the cancellation of a pending authorization or capture.
- Refund: A full or partial return of captured funds to the cardholder can occur. A refund can only happen after a capture or sale is processed.
Contents
- 1 Transaction Properties
- 2 Endpoints
- 3 Further Reference
Transaction Properties
id | { "id" : 123456789 } A unique numeric identifier for the transaction. This ID is only used with the API interface. |
order_id | { "order_id" : 452983 } The internal ID of the associated order. |
sequence | { "sequence" : 1 } The sequence number of the transaction. |
amount | { "amount" : 54.53 } The value of the transaction. |
authorization | { "authorization" : "A235467-239934" } The authorization code associated with the transaction. |
transaction_id | { "transaction_id" : "823048203" } The transaction id that has been returned by the payment gateway. |
created_at | { "created_at" : "2015-10-24T18:26:31Z" } The date and time when the transaction was created. The timestamp is in ISO 8601 format. |
gateway | { "gateway" : "Big Bank" } The name of the payment gateway which processed the transaction. |
kind | { "kind" : "sale" } The kind of transaction. |
status | { "status" : "success" } The status of the transaction. |
description | { "description" : "Additional information about the transaction" } In some cases some additional information may be returned by the payment gateway. |
source_name | { "source_name" : "web" } The origin of the transaction. Currently, only web is returned. |
currency | { "currency" : "AUD" } The currency used for the transaction. |
payment_details | { "payment_details" : {
The following properties are supported:
|
Endpoints
GET /api/orders/ORDER_ID/transactions.json
Return a list of transacions belonging to a specific order. Use the optional parameters to return specific transactions.
GET /api/transactions.json
Return a list of transactions belonging to a store. Use the optional parameters to return specific transactions.
Optional Parameters
limit | Number of results returned. The default is 30, with a maximum of 50 in a single request. |
page | The number of the page to return. The number of results per page is set by the limit parameter. If more results are required, then submit the request again, increasing the page number each time.
|
ids | A comma-separated list of transaction ids. |
since_id | Limit the results to only include objects which have an id greater than the given value. |
created_at_min | Return only the transactions created after the given date and time. Use the format "2014-12-31 12:00". |
created_at_max | Return only the transactions created before the given date and time. Use the format "2014-12-31 12:00". |
order_id | Return all the transactions belonging to the specified order. |
fields | A comma-separated list of fields to return in the response. |
Example Request and Response
GET /api/transactions.json HTTP/1.1 200 OK { "transactions": [ { "id": 34169, "order_id": 768969, "sequence": 1, "amount": "123.50", "kind": "sale", "gateway": "bogus", "status": "success", "description": null, "created_at": "2015-08-05T12:59:12-04:00", "authorization": "123456789", "transaction_id": "A3w47983", "currency": "AUD", "source_name": "web" }, ... ] } Examples using filters GET /api/orders/234234/transactions.json?limit=10 GET /api/transactions.json?order_id=2322
GET /api/orders/ORDER_ID/transactions/count.json
Return a count of transactions belonging to an order.
GET /api/transactionss/count.json
Return a count of transactions belonging to a store.
Optional Parameters
since_id | Limit the results to only include objects which have an id greater than the given value. |
created_at_min | Return only the transactions created after the given date and time. Use the format "2014-12-31 12:00". |
created_at_max | Return only the transactions created before the given date and time. Use the format "2014-12-31 12:00". |
order_id | Return all the transactions belonging to the specified order. |
Example Request and Response
GET /api/orders/12345/transactions/count.json HTTP/1.1 200 OK { "count": 3 } Examples using filters GET /api/transactions/count.json?order_id=2322
GET /api/orders/ORDER_ID/transactions/TRANSACTION_ID.json
Return a single transaction belonging to an order.
GET /api/transactions/TRANSACTION_ID.json
Return a single transaction belonging to a store.
Optional Parameters
fields | A comma-separated list of fields to return in the response. |
Example Request and Response
GET /api/transactions/443169.json HTTP/1.1 200 OK { "transaction": { "id": 34169, "order_id": 768969, "sequence": 1, "amount": "123.50", "kind": "sale", ... } }