Shopify - Mark Order As Paid
@sergio
code:
data:privatelast updated:4 years ago
today
Build integrations remarkably fast!
You're viewing a public workflow template.
Sign up to customize, add steps, modify code and more.
Join 1,000,000+ developers using the Pipedream platform
steps.
trigger
HTTP API
Deploy to generate unique URL
This workflow runs on Pipedream's servers and is triggered by HTTP / Webhook requests.
steps.
shopify_mark_order_as_paid
Marks an order as paid
auth
(auths.shopify)
params
Order id

The ID for the order that the transaction is associated with.

 
string ·params.order_id
Kind

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

string ·params.kind
Optional
code
async (params, auths) => {
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
}
19
//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
    }
  }
})