What is the API field for the amount paid using store credit?

We are implementing a store credit system where customers earn store credit based on the amount they pay for their orders. However, we are encountering difficulties in accurately calculating the store credit earned when store credit is used as a payment method. Specifically, we need to determine the correct amount of new store credit to award based on the actual amount paid by the customer, excluding any store credit used.

Current Challenge:

  • Payment Gateway Identification: We are able to identify if store credit was used for payment by checking the payment_gateway_names field for “shopify_store_credit”.
  • Total Discounts Field: The current_total_discounts field does not reflect the store credit usage, showing $0.00 even when store credit is used.
  • Accurate Calculation: We need to ensure that the store credit is awarded based on the adjusted amount paid by the customer after accounting for any store credit used, excluding shipping costs.

Example Orders:

  1. Order Paid with Store Credit:

    • current_subtotal_price: $14.95
    • current_total_price: $22.45 (includes $7.50 shipping)
    • payment_gateway_names: [“shopify_store_credit”]
    • current_total_discounts: $0.00
    • The challenge is identifying the actual amount paid by the customer and awarding the correct store credit.
  2. Order Paid with Cash:

    • current_subtotal_price: $29.95
    • current_total_price: $37.45 (includes $7.50 shipping)
    • payment_gateway_names: [“manual”]
    • current_total_discounts: $0.00
    • This calculation is straightforward, but we need to ensure consistency across all orders.

Request for Support:

  1. Field Clarification: Is there a specific field or method to accurately identify the amount paid by the customer after applying store credit?
  2. Best Practices: What is the recommended approach to calculate the store credit accurately in such scenarios?
  3. API Insights: Are there specific API fields or resources that can provide the necessary data to differentiate between store credit usage and actual payments?
1 Like

in simple terms…

Is there a way to see on the order data in the API how much store credit was used on a transaction?

ie

  1. customer spends $150, we award $15 of store credit
  2. customer spends $150, uses $15 of store credit and pays $135 remainder - we want to award $13.50 store credit for that transaction, not $15

I can’t find a way in the API to see how much of the order was paid for with store credit. Any idea?