transaction
Collection: transactions
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.
If you create custom attributes for a transaction, they will automatically be included in the response as embedded resources without having to zoom in on them.
Notes
For some stores and gateways, you may see additional link relationships which allow you to modify a transaction in the following ways:
- capture: For Auth Only transactions, you can capture them on the gateway by POSTing to the
capturelink relationship href with an empty body. - void: To reverse a recent captured transaction (usually within the same day it was completed but before batched by the gateway), POST an empty body to the
voidlink relationship href. This will not work for auth only transactions. - refund: To reverse a captured transaction completed in the past, POST an empty body to the
refundlink relationship href. This will not work for auth only transactions. - transaction_logs: When modifications are made to a transaction, logs will be available for all changes to the transaction. These can be obtained via GET to the
transaction_logslink relationship href. You can also zoom into details by adding?zoom=transaction_log_details.
Required Scopes
store_full_access transactions_read transactions_write transactions_resend Actions
Properties (28)
id Number · Read-only The order number.
display_id String or Number · Read-only If custom transaction IDs, prefixes, or suffixes have been configured, this value will contain the custom ID (which may be a string). Otherwise it will be identical to the id value (an integer).
is_test Boolean · Read-only True if this transaction was a test transaction and not run against a live payment gateway.
hide_transaction Boolean Set this to true to archive the transaction in the FoxyCart admin.
data_is_fed Boolean If the webhook for this transaction has been successfully sent, this will be true. You can also modify this to meet your needs.
transaction_date String · Read-only 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).
locale_code String · Read-only The locale code of this transaction. This will be a copy of the store's local_code at the time of the transaction.
customer_first_name String · Read-only The customer's given name at the time of the transaction.
customer_last_name String · Read-only The customer's surname at the time of the transaction.
customer_tax_id String · Read-only If the customer provided a tax_id during checkout, it will be included here.
customer_email String · Read-only The customer's email address at the time of the transaction.
customer_ip String · Read-only The customer's ip address at the time of the transaction.
ip_country String · Read-only The country of the customer's ip address.
user_agent String · Read-only The user agent string of the browser the customer used at checkout.
total_item_price Number · Read-only Total amount of the items in this transaction.
total_tax Number · Read-only Total amount of the taxes for this transaction.
total_shipping Number · Read-only Total amount of the shipping costs for this transaction.
total_future_shipping Number · Read-only 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.
total_order Number · Read-only Total amount of this transaction including all items, taxes, shipping costs and discounts.
status String · Read-only 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.
""capturingcapturedapprovedauthorizedpendingcompletedproblempending_fraud_reviewrejecteddeclinedrefundingrefundedvoidedverified type String · Read-only The type of transaction that has occurred.
transaction""updateinfosubscription_modificationsubscription_renewalsubscription_cancellation source String · Read-only The source of the transaction. Indicates whether it was customer-initiated (CIT) or merchant-initiated (MIT).
cit_ecommercemit_uoemit_apimit_recurringmit_recurring_reattempt_automatedmit_recurring_reattempt_manualcit_recurring_cancellationmit_recurring_cancellation currency_code String · Read-only The 3 character ISO code for the currency.
currency_symbol String · Read-only The currency symbol, such as $, £, €, etc.
folder_id Number (nullable) ID of the folder this transaction is assigned to. When not assigned, this will be null.
folder_uri String The URI of the folder this transaction is assigned to. When not assigned, this will be an empty string.
date_created String (nullable) · Read-only The date this resource was created.
date_modified String (nullable) · Read-only The date this resource was last modified.
Link Relations (38)
self This Transaction fx:receipt GET This Receipt Only present when a receipt URL is available for the transaction.
fx:applied_gift_card_codes The Applied Gift Card Codes for this Transaction fx:folder GET Transaction Folder Only present when the transaction is assigned to a folder.
Only present when the transaction is from an existing subscription.
fx:process_webhook POST POST here to resend the webhook notification for this transaction Only present when the store has a legacy data feed (webhook v1) configured.
fx:send_emails POST here to resend emails for this transaction Only present on stores and gateways that support transaction editing.
Only present on stores and gateways that support transaction editing.
fx:void POST POST here to void this transaction. Only present on supported gateways when the transaction has not already been voided, refunded, or verified, and is not auth-only.
fx:refund POST POST here to refund this transaction. Only present on supported gateways when the transaction has not already been refunded, voided, authorized, or verified.
fx:capture POST POST here to capture this transaction. Only present for Auth Only transactions on supported gateways where the transaction status is 'authorized' or 'verified'.
fx:sub_token_url GET A URL with the sub token for the customer to manage the subscription. Content type is text/html. Only present when the transaction is from an existing subscription and a sub_token_url is available.
Only present when the transaction creates one or more new subscriptions, and only returned when you zoom on subscriptions.
Only present when the transaction has an associated template set.
fx:send_taxes POST POST here to refeed automatic tax services for this transaction. Only present on stores and gateways that support transaction editing.
fx:update_status_from_gateway POST POST here to update the transaction status from the payment gateway. Only present when the transaction status is 'pending_fraud_review'.
Zoomable Resources
Embed related resources using ?zoom=<resource>.
Filter with ?resource:property=value.
fx:transaction on applied_tax·fx:transaction on billing_address·fx:transaction on coupon_code_transaction·fx:transaction on coupon_detail·fx:transaction on custom_field·fx:transaction on discount·fx:transaction on discount_detail·fx:transaction on downloadable_purchase·fx:transaction on error_entry·fx:transaction on gift_card_code_log_detail·fx:transaction on item·fx:transaction on item_option·fx:transaction on item_taxes·fx:transaction on payment·fx:transaction on shipment·fx:transaction on subscription_event·fx:transaction on transaction_journal_entry·fx:transaction on transaction_log Example Representation
{
"_links": {
"curies": [
{
"name": "fx",
"href": "https://api.foxycart.com/rels/{rel}",
"templated": true
}
],
"self": {
"href": "https://api.foxycart.com/transactions/123",
"title": "This Transaction"
},
"fx:store": {
"href": "https://api.foxycart.com/stores/456",
"title": "This Store"
},
"fx:receipt": {
"href": "https://mystore.foxycart.com/receipt?id=c2e419c3d3ef4713d8d792c6abb90df35b5c67a39ce144736338380d06319a9a",
"title": "This Receipt"
},
"fx:customer": {
"href": "https://api.foxycart.com/customers/789",
"title": "This Customer"
},
"fx:attributes": {
"href": "https://api.foxycart.com/transactions/123/attributes",
"title": "Attributes for this Transaction"
},
"fx:items": {
"href": "https://api.foxycart.com/transactions/123/items",
"title": "The Items for this Transaction"
},
"fx:payments": {
"href": "https://api.foxycart.com/transactions/123/payments",
"title": "The Payments for this Transaction"
},
"fx:applied_taxes": {
"href": "https://api.foxycart.com/transactions/123/applied_taxes",
"title": "The Applied Taxes for this Transaction"
},
"fx:applied_gift_card_codes": {
"href": "https://api.foxycart.com/transactions/123/gift_card_code_logs",
"title": "The Applied Gift Card Codes for this Transaction"
},
"fx:custom_fields": {
"href": "https://api.foxycart.com/transactions/123/transaction_custom_fields",
"title": "The Custom Fields for this Transaction"
},
"fx:discounts": {
"href": "https://api.foxycart.com/transactions/123/discounts",
"title": "The Discounts for this Transaction"
},
"fx:shipments": {
"href": "https://api.foxycart.com/transactions/123/shipments",
"title": "The Shipments for this Transaction"
},
"fx:billing_addresses": {
"href": "https://api.foxycart.com/transactions/123/billing_addresses",
"title": "The Billing Addresses for this Transaction"
},
"fx:folder": {
"href": "https://api.foxycart.com/store_transaction_folders/222",
"title": "Transaction Folder"
},
"fx:subscription": {
"href": "https://api.foxycart.com/subscriptions/321",
"title": "This Subscription"
},
"fx:native_integrations": {
"href": "https://api.foxycart.com/transactions/123/native_integrations",
"title": "POST here to resend transaction to the Webhooks."
},
"fx:process_webhook": {
"href": "https://api.foxycart.com/transactions/123/process_webhook",
"title": "POST here to resend the webhook notification for this transaction"
},
"fx:send_webhooks": {
"href": "https://api.foxycart.com/transactions/123/send_webhooks",
"title": "Refeed webhooks v2 for this Transaction"
},
"fx:send_emails": {
"href": "https://api.foxycart.com/transactions/123/send_emails",
"title": "POST here to resend emails for this transaction"
},
"fx:transaction_logs": {
"href": "https://api.foxycart.com/transactions/123/transaction_logs",
"title": "Transaction Logs"
},
"fx:transaction_journal_entries": {
"href": "https://api.foxycart.com/transactions/123/journal_entries",
"title": "Transaction Journal Entries"
},
"fx:void": {
"href": "https://api.foxycart.com/transactions/123/void",
"title": "POST here to void this transaction."
},
"fx:refund": {
"href": "https://api.foxycart.com/transactions/123/refund",
"title": "POST here to refund this transaction."
},
"fx:capture": {
"href": "https://api.foxycart.com/transactions/123/capture",
"title": "POST here to capture 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",
"currency_code": "USD",
"currency_symbol": "$"
}