transaction

Description

A transaction is a historical record of a cart that has been purchased by a customer. To create a transaction, you post to a cart. The only aspects of a transaction which can be modified are hide_transaction and data_is_fed.

The receipt_url link relationship leads to the full HTML receipt.

Sandbox Example

You can interact with this resource and run actions against the sandbox API via our HAL Brower.

Actions

GET
View a transaction
PATCH
Update a transaction (send only the properties you want to modify)
PUT
Replace a transaction (send the entire representation)
HEAD
Get just the header response
OPTIONS
Get a response explaining which HTTP methods are supported

Properties

Property Description Type Constraints
id The order number. Integer Read only
is_test True if this transaction was a test transaction and not run against a live payment gateway. Boolean Read only
hide_transaction Set this to true to hide it in the FoxyCart admin. Boolean True or false, 1 or 0.
data_is_fed If the webhook for this transaction has been successfully sent, this will be true. You can also modify this to meet your needs. Boolean True or false, 1 or 0.
transaction_date The date of this transaction shown in the timezone of the store. The format used is ISO 8601 (or 'c' format string for PHP developers). Date Read only
locale_code The locale code of this transaction. This will be a copy of the store's local_code at the time of the transaction. String Read only
customer_first_name The customer's given name at the time of the transaction. String Read only
customer_last_name The customer's surname at the time of the transaction. String Read only
customer_tax_id If the customer provided a tax_id during checkout, it will be included here. String Read only
customer_email The customer's email address at the time of the transaction. Email Read only
customer_ip The customer's ip address at the time of the transaction. String Read only
ip_country The country of the customer's ip address. String Read only
total_item_price Total amount of the items in this transaction. Decimal Read only
total_tax Total amount of the taxes for this transaction. Decimal Read only
total_shipping Total amount of the shipping costs for this transaction. Decimal Read only
total_future_shipping If this transaction has any shippable subscription items which will process in the future, this will be the total amount of shipping costs for those items. Decimal Read only
total_order Total amount of this transaction including all items, taxes, shipping costs and discounts. Decimal Read only
status Used for transactions processed with a hosted payment gateway which can change the status of the transaction after it is originally posted. If the status is empty, a normal payment gateway was used and the transaction should be considered completed. String Read only. approved, authorized, declined, pending, rejected
date_created The date this resource was created. Date Read only
date_modified The date this resource was last modified. Date Read only

Example Representation

{
    "_links": {
        "curies": [
            {
                "name": "fx",
                "href": "https://api.foxycart.com/rels/{rel}",
                "templated": true
            }
        ],
        "self": {
            "href": "https://api.foxycart.com/transactions/3820290",
            "title": "This Transaction"
        },
        "fx:attributes": {
            "href": "https://api.foxycart.com/transactions/3820290/attributes",
            "title": "Attributes for this Transaction"
        },
        "fx:store": {
            "href": "https://api.foxycart.com/stores/66",
            "title": "This Store"
        },
        "fx:receipt": {
            "href": "https://example.foxycart.com/receipt?id=6fb65c90acd74fecbe1a18834d2a1a2c",
            "title": "This Receipt",
            "type": "text/html"
        },
        "fx:customer": {
            "href": "https://api.foxycart.com/customers/115",
            "title": "This Customer"
        },
        "fx:items": {
            "href": "https://api.foxycart.com/transactions/3820290/items",
            "title": "The Items for this Transaction"
        },
        "fx:payments": {
            "href": "https://api.foxycart.com/transactions/3820290/payments",
            "title": "The Payments for this Transaction"
        },
        "fx:applied_taxes": {
            "href": "https://api.foxycart.com/transactions/3820290/applied_taxes",
            "title": "The Applied Taxes for this Transaction"
        },
        "fx:custom_fields": {
            "href": "https://api.foxycart.com/transactions/3820290/transaction_custom_fields",
            "title": "The Custom Fields for this Transaction"
        },
        "fx:discounts": {
            "href": "https://api.foxycart.com/transactions/3820290/discounts",
            "title": "The Discounts for this Transaction"
        },
        "fx:shipments": {
            "href": "https://api.foxycart.com/transactions/3820290/shipments",
            "title": "The Shipments for this Transaction"
        },
        "fx:billing_addresses": {
            "href": "https://api.foxycart.com/transactions/3820290/billing_addresses",
            "title": "The Billing Addresses for this Transaction"
        },
        "fx:process_webhook": {
            "href": "https://api.foxycart.com/transactions/3820290/process_webhook",
            "title": "POST here to resend the webhook notification for this transaction"
        },
        "fx:send_emails": {
            "href": "https://api.foxycart.com/transactions/3820290/send_emails",
            "title": "POST here to resend emails for this transaction"
        }
    },
    "id": 3820290,
    "is_test": true,
    "hide_transaction": false,
    "data_is_fed": true,
    "transaction_date": "2013-06-06T17:26:07-05:00",
    "locale_code": "en_US",
    "customer_first_name": "Test",
    "customer_last_name": "User",
    "customer_tax_id": "",
    "customer_email": "testing@example.com",
    "customer_ip": "10.1.248.210",
    "ip_country": "",
    "total_item_price": 10,
    "total_tax": 1.9,
    "total_shipping": 0,
    "total_future_shipping": 0,
    "total_order": 11.9,
    "date_created": null,
    "date_modified": "2013-06-06T15:26:07-0700"
}
<?xml version="1.0" encoding="UTF-8"?>
<resource href="https://api.foxycart.com/transactions/3820290" rel="https://api.foxycart.com/rels/transaction">
  <link rel="self" href="https://api.foxycart.com/transactions/3820290" title="This Transaction"/>
  <link rel="https://api.foxycart.com/rels/attributes" href="https://api.foxycart.com/transactions/3820290/attributes" title="Attributes for this Transaction"/>
  <link rel="https://api.foxycart.com/rels/store" href="https://api.foxycart.com/stores/66" title="This Store"/>
  <link rel="https://api.foxycart.com/rels/receipt" href="https://example.foxycart.com/receipt?id=6fb65c90acd74fecbe1a18834d2a1a2c" title="This Receipt" type="text/html"/>
  <link rel="https://api.foxycart.com/rels/customer" href="https://api.foxycart.com/customers/115" title="This Customer"/>
  <link rel="https://api.foxycart.com/rels/items" href="https://api.foxycart.com/transactions/3820290/items" title="The Items for this Transaction"/>
  <link rel="https://api.foxycart.com/rels/payments" href="https://api.foxycart.com/transactions/3820290/payments" title="The Payments for this Transaction"/>
  <link rel="https://api.foxycart.com/rels/applied_taxes" href="https://api.foxycart.com/transactions/3820290/applied_taxes" title="The Applied Taxes for this Transaction"/>
  <link rel="https://api.foxycart.com/rels/custom_fields" href="https://api.foxycart.com/transactions/3820290/transaction_custom_fields" title="The Custom Fields for this Transaction"/>
  <link rel="https://api.foxycart.com/rels/discounts" href="https://api.foxycart.com/transactions/3820290/discounts" title="The Discounts for this Transaction"/>
  <link rel="https://api.foxycart.com/rels/shipments" href="https://api.foxycart.com/transactions/3820290/shipments" title="The Shipments for this Transaction"/>
  <link rel="https://api.foxycart.com/rels/billing_addresses" href="https://api.foxycart.com/transactions/3820290/billing_addresses" title="The Billing Addresses for this Transaction"/>
  <link rel="https://api.foxycart.com/rels/process_webhook" href="https://api.foxycart.com/transactions/3820290/process_webhook" title="POST here to resend the webhook notification for this transaction"/>
  <link rel="https://api.foxycart.com/rels/send_emails" href="https://api.foxycart.com/transactions/3820290/send_emails" title="POST here to resend emails for this transaction"/>
  <id>3820290</id>
  <is_test>true</is_test>
  <hide_transaction>false</hide_transaction>
  <data_is_fed>true</data_is_fed>
  <transaction_date>2013-06-06T17:26:07-05:00</transaction_date>
  <locale_code>en_US</locale_code>
  <customer_first_name>Test</customer_first_name>
  <customer_last_name>User</customer_last_name>
  <customer_tax_id></customer_tax_id>
  <customer_email>testing@example.com</customer_email>
  <customer_ip>10.1.248.210</customer_ip>
  <ip_country></ip_country>
  <total_item_price>10</total_item_price>
  <total_tax>1.9</total_tax>
  <total_shipping>0</total_shipping>
  <total_future_shipping>0</total_future_shipping>
  <total_order>11.9</total_order>
  <date_created></date_created>
  <date_modified>2013-06-06T15:26:07-0700</date_modified>
</resource>
{
    "class": [
        "transaction"
    ],
    "properties": {
        "id": 3820290,
        "is_test": true,
        "hide_transaction": false,
        "data_is_fed": true,
        "transaction_date": "2013-06-06T17:26:07-05:00",
        "locale_code": "en_US",
        "customer_first_name": "Test",
        "customer_last_name": "User",
        "customer_tax_id": "",
        "customer_email": "testing@example.com",
        "customer_ip": "10.1.248.210",
        "ip_country": "",
        "total_item_price": 10,
        "total_tax": 1.9,
        "total_shipping": 0,
        "total_future_shipping": 0,
        "total_order": 11.9,
        "date_created": null,
        "date_modified": "2013-06-06T15:26:07-0700"
    },
    "links": [
        {
            "rel": [
                "self"
            ],
            "href": "https://api.foxycart.com/transactions/3820290"
        },
        {
            "rel": [
                "https://api.foxycart.com/rels/attributes"
            ],
            "href": "https://api.foxycart.com/transactions/3820290/attributes"
        },
        {
            "rel": [
                "https://api.foxycart.com/rels/store"
            ],
            "href": "https://api.foxycart.com/stores/66"
        },
        {
            "rel": [
                "https://api.foxycart.com/rels/receipt"
            ],
            "href": "https://example.foxycart.com/receipt?id=6fb65c90acd74fecbe1a18834d2a1a2c"
        },
        {
            "rel": [
                "https://api.foxycart.com/rels/customer"
            ],
            "href": "https://api.foxycart.com/customers/115"
        },
        {
            "rel": [
                "https://api.foxycart.com/rels/items"
            ],
            "href": "https://api.foxycart.com/transactions/3820290/items"
        },
        {
            "rel": [
                "https://api.foxycart.com/rels/payments"
            ],
            "href": "https://api.foxycart.com/transactions/3820290/payments"
        },
        {
            "rel": [
                "https://api.foxycart.com/rels/applied_taxes"
            ],
            "href": "https://api.foxycart.com/transactions/3820290/applied_taxes"
        },
        {
            "rel": [
                "https://api.foxycart.com/rels/custom_fields"
            ],
            "href": "https://api.foxycart.com/transactions/3820290/transaction_custom_fields"
        },
        {
            "rel": [
                "https://api.foxycart.com/rels/discounts"
            ],
            "href": "https://api.foxycart.com/transactions/3820290/discounts"
        },
        {
            "rel": [
                "https://api.foxycart.com/rels/shipments"
            ],
            "href": "https://api.foxycart.com/transactions/3820290/shipments"
        },
        {
            "rel": [
                "https://api.foxycart.com/rels/billing_addresses"
            ],
            "href": "https://api.foxycart.com/transactions/3820290/billing_addresses"
        },
        {
            "rel": [
                "https://api.foxycart.com/rels/process_webhook"
            ],
            "href": "https://api.foxycart.com/transactions/3820290/process_webhook"
        },
        {
            "rel": [
                "https://api.foxycart.com/rels/send_emails"
            ],
            "href": "https://api.foxycart.com/transactions/3820290/send_emails"
        }
    ]
}

Conditional Link Relationsips

If this transaction has a subscription associated with it, it will include a subscription and a sub_token_url link relationship.

Zoomable Resources

The following related resources can be embedded within this resource by including a ?zoom=<child_resource> parameter. You can also filter by child resources by ?child_resource:property=<property_value>

customer
payments
items
applied_taxes
custom_fields
discounts
shipments
billing_addresses