I tried to get Shopify's purchase history

Admin私のストア

Added GraphQL and Flow apps to the store

Shopify's GraphQL is divided into Storeront and Admin. Software protection is implemented as a custom frontend with Shopify as the backend.

 

mutation {
   customerAccessTokenCreate(input: {email: "****", password: "*****"}) {
      customerAccessToken {
        accessToken
      }
   }
}

query {
   customer(customerAccessToken: "***") {
       orders(first: 250) {
           nodes {
              Financial Status
              customAttributes {
                 key
                 value
              }
              lineItems(first: 10) {
                 nodes {
                     variant {
                         product {
                            id
                            title
                         }
                      }
                  }
               }
           }
      }
}

 

I create an access token from an email address and password, but I don't know how to create an access token in the case of one-time token authentication.

Payment status of products from orders ( If payment has been made, PAID will be entered.

The Storefront API did not allow us to link the payment date and time from a GraphQL resolver, so we used the Flow applet.

Create a trigger when the payment status of an order changes to PAID, and set the date and time when the trigger occurs to the customAttributes field of Order.

 

Back to blog

Leave a comment

Please note, comments need to be approved before they are published.