Skip to main content

The REST Admin API is a legacy API as of October 1, 2024. Starting April 1, 2025, all new public apps must be built exclusively with the GraphQL Admin API. For details and migration steps, visit our migration guide.

Transaction

Requires ANY of the following access scopes: orders, marketplace_orders.

Transactions are created for every order that results in an exchange of money.

There are five types of transactions:

  • Authorization: An amount reserved against the cardholder's funding source. Money does not change hands until the authorization is captured.
  • Sale: An authorization and capture performed together in a single step.
  • Capture: A transfer of the money that was reserved during the authorization stage.
  • Void: A cancellation of a pending authorization or capture.
  • Refund: A partial or full return of captured funds to the cardholder. A refund can happen only after a capture is processed.

Refund transactions must be created by using the Refund resource.

Note

An order can have more than one authorization transaction associated with it. This might happen when an order is edited or when a post-purchase upsell is added to the order. To be notified when an order is edited subscribe to the OrderEdit webhook.

If your app captures payments, you should make a GET request to the /admin/api/{version}/orders/{order_id}/transactions.json endpoint to retrieve the authorization transactions associated with an order. Then, to complete the full order payment capture, you should use the authorization or parent_id properties in separate capture POST requests to the same endpoint for each authorization transaction.

Note

An order can have no more than 100 transactions associated with it.

Was this section helpful?

Anchor to

The Transaction resource

Anchor to

Properties


amount

The amount of money included in the transaction. If you don't provide a value for amount, then it defaults to the total cost of the order (even if a previous transaction has been made towards it).


amount_rounding
read-only

The rounding adjustment for cash payments, to be applied on the amount to get a rounded amount.


authorization

The authorization code associated with the transaction.


authorization_expires_at

The date and time (ISO 8601 format) when the Shopify Payments authorization expires.


created_at
read-only

The date and time (ISO 8601 format) when the transaction was created.


currency

The three-letter code (ISO 4217 format) for the currency used for the payment.


device_id
read-only

The ID for the device.


error_code
read-only

A standardized error code, independent of the payment provider. Valid values:

Show error_code properties
  • incorrect_number
  • invalid_number
  • invalid_expiry_date
  • invalid_cvc
  • expired_card
  • incorrect_cvc
  • incorrect_zip
  • incorrect_address
  • card_declined
  • processing_error
  • call_issuer
  • pick_up_card

extended_authorization_attributes

The attributes associated with a Shopify Payments extended authorization period. It has the following attributes:

Show extended_authorization_attributes properties
  • standard_authorization_expires_at: The date and time (ISO 8601 format) when the standard authorization period expires. After expiry, an extended authorization fee is applied upon capturing the payment.
  • extended_authorization_expires_at: The date and time (ISO 8601 format) when the extended authorization period expires. After expiry, the merchant can't capture the payment.
extended_authorization_attributes are available on the Retrieve a specific transaction for an order endpoint only if the following criteria applies:
  • The store is on a Shopify Plus plan.
  • The store uses Shopify Payments.
  • The transaction being retrieved is an extended authorization, which is determined by the capture_before date in the charge.
If the criteria isn't met, then an empty JSON is returned for extended_authorization_attributes. To learn more about extended authorization periods, refer to Payment authorization.

gateway

The name of the gateway the transaction was issued through. A list of gateways can be found on Shopify's payment gateways page.


id
read-only
->
id

The ID for the transaction.


kind

The transaction's type. Valid values:

Show kind properties
  • authorization: Money that the customer has agreed to pay. The authorization period can be between 7 and 30 days (depending on your payment service) while a store waits for a payment to be captured.
  • capture: A transfer of money that was reserved during the authorization of a shop.
  • sale: The authorization and capture of a payment performed in one single step.
  • void: The cancellation of a pending authorization or capture.
  • refund: The partial or full return of captured money to the customer.

Was this section helpful?
{}

The Transaction resource

{
"amount": "10.00",
"amount_rounding": "0.02",
"authorization": "ch_1AtJu6CktlpKSclI4zjeQb2t",
"authorization_expires_at": "2021-03-13T16:09:54-04:00",
"created_at": "2012-03-13T16:09:54-04:00",
"currency": "USD",
"device_id": 1,
"error_code": "invalid_cvc",
"extended_authorization_attributes": {
"standard_authorization_expires_at": "2020-10-08T00:00:00-04:00",
"extended_authorization_expires_at": "2020-10-30T00:00:00-04:00"
},
"gateway": "shopify_payments",
"id": 999225661,
"kind": "capture",
"location_id": {
"id": 49202758
},
"message": "Marked the Stripe payment as received",
"order_id": 450789469,
"payment_details": {
"credit_card_bin": "123456",
"avs_result_code": "Y",
"cvv_result_code": "M",
"credit_card_number": "•••• •••• •••• 4242",
"credit_card_company": "Visa",
"credit_card_name": "John Smith",
"credit_card_wallet": "shopify_pay",
"credit_card_expiration_month": 10,
"credit_card_expiration_year": 2028,
"buyer_action_info": {
"multibanco": {
"Entity": "12345",
"Reference": "999999999"
}
},
"payment_method_name": "multibanco"
},
"parent_id": 584698724408,
"payments_refund_attributes": {
"status": "success",
"acquirer_reference_number": "123456789012345678901234"
},
"processed_at": "2018-01-10T11:00:00-05:00",
"receipt": {},
"source_name": "web",
"status": "success",
"total_unsettled_set": {
"presentment_money": {
"amount": "171.8",
"currency": "USD"
},
"shop_money": {
"amount": "171.8",
"currency": "USD"
}
},
"test": true,
"user_id": 106045196,
"currency_exchange_adjustment": {
"id": 1,
"adjustment": "-0.01",
"original_amount": "-53.62",
"final_amount": "-53.63",
"currency": "CAD"
},
"manual_payment_gateway": false
}

Anchor to POST request, Creates a transaction for an order
post
Creates a transaction for an order

Caution

For multi-currency orders, the currency property is required when creating refund and capture transactions. The value should be the presentment currency from the order. For more information, refer to the Transaction resource.

Creates a transaction for an order.

Anchor to Parameters of Creates a transaction for an orderParameters


api_version
string
required

order_id
string
required

source

An optional origin of the transaction. Set to external to import a cash transaction for the associated order.


Was this section helpful?

Anchor to post-orders-order-id-transactions-examplesExamples

Capture a specified amount on an authorized order, and associate the capture with an authorization by including its ID

Path parameters
order_id=450789469
string
required
Request body
transaction
Transaction resource
Show transaction properties
transaction.currency:"USD"

The three-letter code (ISO 4217 format) for the currency used for the payment.

transaction.amount:"10.00"

The amount of money included in the transaction. If you don't provide a value for amount, then it defaults to the total cost of the order (even if a previous transaction has been made towards it).

transaction.kind:"capture"

The transaction's type. Valid values:

Show kind properties
  • authorization: Money that the customer has agreed to pay. The authorization period can be between 7 and 30 days (depending on your payment service) while a store waits for a payment to be captured.
  • capture: A transfer of money that was reserved during the authorization of a shop.
  • sale: The authorization and capture of a payment performed in one single step.
  • void: The cancellation of a pending authorization or capture.
  • refund: The partial or full return of captured money to the customer.
transaction.parent_id:389404469

The ID of an associated transaction.

Show parent_id properties
  • For capture transactions, the parent needs to be an authorization transaction.
  • For void transactions, the parent needs to be an authorization transaction.
  • For refund transactions, the parent needs to be a capture or sale transaction.

Capture the full amount for one authorization on an order, and associate the capture with an authorization by including its authorization code

Path parameters
order_id=450789469
string
required
Request body
transaction
Transaction resource
Show transaction properties
transaction.kind:"capture"

The transaction's type. Valid values:

Show kind properties
  • authorization: Money that the customer has agreed to pay. The authorization period can be between 7 and 30 days (depending on your payment service) while a store waits for a payment to be captured.
  • capture: A transfer of money that was reserved during the authorization of a shop.
  • sale: The authorization and capture of a payment performed in one single step.
  • void: The cancellation of a pending authorization or capture.
  • refund: The partial or full return of captured money to the customer.
transaction.authorization:"authorization-key"

The authorization code associated with the transaction.

Create a test transaction

Path parameters
order_id=450789469
string
required
Request body
transaction
Transaction resource
Show transaction properties
transaction.currency:"USD"

The three-letter code (ISO 4217 format) for the currency used for the payment.

transaction.amount:"10.00"

The amount of money included in the transaction. If you don't provide a value for amount, then it defaults to the total cost of the order (even if a previous transaction has been made towards it).

transaction.kind:"capture"

The transaction's type. Valid values:

Show kind properties
  • authorization: Money that the customer has agreed to pay. The authorization period can be between 7 and 30 days (depending on your payment service) while a store waits for a payment to be captured.
  • capture: A transfer of money that was reserved during the authorization of a shop.
  • sale: The authorization and capture of a payment performed in one single step.
  • void: The cancellation of a pending authorization or capture.
  • refund: The partial or full return of captured money to the customer.
transaction.parent_id:389404469

The ID of an associated transaction.

Show parent_id properties
  • For capture transactions, the parent needs to be an authorization transaction.
  • For void transactions, the parent needs to be an authorization transaction.
  • For refund transactions, the parent needs to be a capture or sale transaction.
transaction.test:true

Whether the transaction is a test transaction.

Void a transaction

Path parameters
order_id=450789469
string
required
Request body
transaction
Transaction resource
Show transaction properties
transaction.currency:"USD"

The three-letter code (ISO 4217 format) for the currency used for the payment.

transaction.amount:"10.00"

The amount of money included in the transaction. If you don't provide a value for amount, then it defaults to the total cost of the order (even if a previous transaction has been made towards it).

transaction.kind:"void"

The transaction's type. Valid values:

Show kind properties
  • authorization: Money that the customer has agreed to pay. The authorization period can be between 7 and 30 days (depending on your payment service) while a store waits for a payment to be captured.
  • capture: A transfer of money that was reserved during the authorization of a shop.
  • sale: The authorization and capture of a payment performed in one single step.
  • void: The cancellation of a pending authorization or capture.
  • refund: The partial or full return of captured money to the customer.
transaction.parent_id:389404469

The ID of an associated transaction.

Show parent_id properties
  • For capture transactions, the parent needs to be an authorization transaction.
  • For void transactions, the parent needs to be an authorization transaction.
  • For refund transactions, the parent needs to be a capture or sale transaction.
Was this section helpful?
post

/admin/api/2025-07/orders/450789469/transactions.json

curl -d '{"transaction":{"currency":"USD","amount":"10.00","kind":"capture","parent_id":389404469}}' \
-X POST "https://your-development-store.myshopify.com/admin/api/2025-07/orders/450789469/transactions.json" \
-H "X-Shopify-Access-Token: {access_token}" \
-H "Content-Type: application/json"

{}

Response

JSON
HTTP/1.1 201 Created
{
"transaction": {
"id": 1068278471,
"order_id": 450789469,
"kind": "capture",
"gateway": "bogus",
"status": "success",
"message": "Bogus Gateway: Forced success",
"created_at": "2025-07-01T14:27:25-04:00",
"test": true,
"authorization": null,
"location_id": null,
"user_id": null,
"parent_id": 389404469,
"processed_at": "2025-07-01T14:27:25-04:00",
"device_id": null,
"error_code": null,
"source_name": "755357713",
"payment_details": {
"credit_card_bin": null,
"avs_result_code": null,
"cvv_result_code": null,
"credit_card_number": "•••• •••• •••• 4242",
"credit_card_company": "Visa",
"buyer_action_info": null,
"credit_card_name": null,
"credit_card_wallet": null,
"credit_card_expiration_month": null,
"credit_card_expiration_year": null,
"payment_method_name": "visa"
},
"receipt": {},
"currency_exchange_adjustment": null,
"amount": "10.00",
"currency": "USD",
"payment_id": "c901414060.1",
"total_unsettled_set": {
"presentment_money": {
"amount": "588.94",
"currency": "USD"
},
"shop_money": {
"amount": "588.94",
"currency": "USD"
}
},
"manual_payment_gateway": false,
"amount_rounding": null,
"admin_graphql_api_id": "gid://shopify/OrderTransaction/1068278471"
}
}

Retrieves a list of transactions.

Transactions attached to multi-currency orders are in the presentment currency by default. To retrieve transactions in the shop currency, include the URL parameter in_shop_currency=true.


api_version
string
required

order_id
string
required

fields

Show only certain fields, specifed by a comma-separated list of fields names.


in_shop_currency
default false

Show amounts in the shop currency.


since_id

Retrieve only transactions after the specified ID.


Was this section helpful?

Retrieve an order's transactions

Path parameters
order_id=450789469
string
required

Retrieve an order's transactions after a specified ID

Path parameters
order_id=450789469
string
required
Query parameters
since_id=801038806

Retrieve only transactions after the specified ID.

Was this section helpful?
get

/admin/api/2025-07/orders/450789469/transactions.json

curl -X GET "https://your-development-store.myshopify.com/admin/api/2025-07/orders/450789469/transactions.json" \
-H "X-Shopify-Access-Token: {access_token}"

{}

Response

JSON
HTTP/1.1 200 OK
{
"transactions": [
{
"id": 179259969,
"order_id": 450789469,
"kind": "refund",
"gateway": "bogus",
"status": "success",
"message": null,
"created_at": "2005-08-05T12:59:12-04:00",
"test": false,
"authorization": "authorization-key",
"location_id": null,
"user_id": null,
"parent_id": 801038806,
"processed_at": "2005-08-05T12:59:12-04:00",
"device_id": null,
"error_code": null,
"source_name": "web",
"receipt": {},
"currency_exchange_adjustment": null,
"amount": "209.00",
"currency": "USD",
"payment_id": "#1001.3",
"total_unsettled_set": {
"presentment_money": {
"amount": "348.0",
"currency": "USD"
},
"shop_money": {
"amount": "348.0",
"currency": "USD"
}
},
"manual_payment_gateway": false,
"amount_rounding": null,
"admin_graphql_api_id": "gid://shopify/OrderTransaction/179259969"
},
{
"id": 389404469,
"order_id": 450789469,
"kind": "authorization",
"gateway": "bogus",
"status": "success",
"message": null,
"created_at": "2005-08-01T11:57:11-04:00",
"test": false,
"authorization": "authorization-key",
"location_id": null,
"user_id": null,
"parent_id": null,
"processed_at": "2005-08-01T11:57:11-04:00",
"device_id": null,
"error_code": null,
"source_name": "web",
"payment_details": {
"credit_card_bin": null,
"avs_result_code": null,
"cvv_result_code": null,
"credit_card_number": "•••• •••• •••• 4242",
"credit_card_company": "Visa",
"buyer_action_info": null,
"credit_card_name": null,
"credit_card_wallet": null,
"credit_card_expiration_month": null,
"credit_card_expiration_year": null,
"payment_method_name": "visa"
},
"receipt": {
"testcase": true,
"authorization": "123456"
},
"currency_exchange_adjustment": null,
"amount": "598.94",
"currency": "USD",
"payment_id": "#1001.1",
"total_unsettled_set": {
"presentment_money": {
"amount": "348.0",
"currency": "USD"
},
"shop_money": {
"amount": "348.0",
"currency": "USD"
}
},
"manual_payment_gateway": false,
"amount_rounding": null,
"admin_graphql_api_id": "gid://shopify/OrderTransaction/389404469"
},
{
"id": 801038806,
"order_id": 450789469,
"kind": "capture",
"gateway": "bogus",
"status": "success",
"message": null,
"created_at": "2005-08-05T10:22:51-04:00",
"test": false,
"authorization": "authorization-key",
"location_id": null,
"user_id": null,
"parent_id": 389404469,
"processed_at": "2005-08-05T10:22:51-04:00",
"device_id": null,
"error_code": null,
"source_name": "web",
"receipt": {},
"currency_exchange_adjustment": null,
"amount": "250.94",
"currency": "USD",
"payment_id": "#1001.2",
"total_unsettled_set": {
"presentment_money": {
"amount": "348.0",
"currency": "USD"
},
"shop_money": {
"amount": "348.0",
"currency": "USD"
}
},
"manual_payment_gateway": false,
"amount_rounding": null,
"admin_graphql_api_id": "gid://shopify/OrderTransaction/801038806"
}
]
}

Retrieves a specific transaction.

Transactions attached to multi-currency orders are in the presentment currency by default. To retrieve transactions in the shop currency, include the URL parameter in_shop_currency=true.

extended_authorization_attributes are available on this endpoint only to stores on the Shopify Plus plan that use Shopify Payments. To learn more about extended authorization periods, refer to Payment authorization.


api_version
string
required

order_id
string
required

transaction_id
string
required

fields

Show only certain fields, specified by a comma-separated list of field names.


in_shop_currency
default false

Show amounts in the shop currency.


Was this section helpful?

Retrieve a specific transaction for an order

Was this section helpful?
get

/admin/api/2025-07/orders/450789469/transactions/389404469.json

curl -X GET "https://your-development-store.myshopify.com/admin/api/2025-07/orders/450789469/transactions/389404469.json" \
-H "X-Shopify-Access-Token: {access_token}"

{}

Response

JSON
HTTP/1.1 200 OK
{
"transaction": {
"id": 389404469,
"order_id": 450789469,
"kind": "authorization",
"gateway": "bogus",
"status": "success",
"message": null,
"created_at": "2005-08-01T11:57:11-04:00",
"test": false,
"authorization": "authorization-key",
"location_id": null,
"user_id": null,
"parent_id": null,
"processed_at": "2005-08-01T11:57:11-04:00",
"device_id": null,
"error_code": null,
"source_name": "web",
"payment_details": {
"credit_card_bin": null,
"avs_result_code": null,
"cvv_result_code": null,
"credit_card_number": "•••• •••• •••• 4242",
"credit_card_company": "Visa",
"buyer_action_info": null,
"credit_card_name": null,
"credit_card_wallet": null,
"credit_card_expiration_month": null,
"credit_card_expiration_year": null,
"payment_method_name": "visa"
},
"receipt": {
"testcase": true,
"authorization": "123456"
},
"currency_exchange_adjustment": null,
"amount": "598.94",
"currency": "USD",
"authorization_expires_at": null,
"extended_authorization_attributes": {},
"payment_id": "#1001.1",
"total_unsettled_set": {
"presentment_money": {
"amount": "348.0",
"currency": "USD"
},
"shop_money": {
"amount": "348.0",
"currency": "USD"
}
},
"manual_payment_gateway": false,
"amount_rounding": null,
"admin_graphql_api_id": "gid://shopify/OrderTransaction/389404469"
}
}

Anchor to GET request, Retrieves a count of an order's transactions
get
Retrieves a count of an order's transactions

Retrieves a count of an order's transactions.


api_version
string
required

order_id
string
required

Was this section helpful?

Count an order's transactions

Path parameters
order_id=450789469
string
required
Was this section helpful?
get

/admin/api/2025-07/orders/450789469/transactions/count.json

curl -X GET "https://your-development-store.myshopify.com/admin/api/2025-07/orders/450789469/transactions/count.json" \
-H "X-Shopify-Access-Token: {access_token}"

{}

Response

JSON
HTTP/1.1 200 OK
{
"count": 3
}