The ID for the order that the transaction is associated with.
The transaction's type. For changing an order's status to paid, supported values are:
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.
More details at: https://help.shopify.com/en/api/reference/orders/transaction#create-2020-01
async
(params, auths) => {
}
//See the API docs here: https://help.shopify.com/en/api/reference/orders/transaction#create-2020-01
return await require("@pipedreamhq/platform").axios(this, {
method: "post",
url: `https://${auths.shopify.shop_id}.myshopify.com/admin/api/2020-01/orders/${params.order_id}/transactions.json`,
headers: {
"X-Shopify-Access-Token": `${auths.shopify.oauth_access_token}`,
"Content-Type": `application/json`,
},
data: {
transaction: {
kind: params.kind || "capture", //This action on its own supports the "capture" to mark the order paid.
//The "sale" value could be used when creating order and payment is one step, which implies having Payment gateway API access.
authorization: params.authorization
}
}
})