Join us for an upcoming Shopify Partner webinar on February 27, 2024. Discover the latest Checkout Extensibility features, and deep dive on improvements to Shopify Functions and Web Pixels. Register now for either the 10am EST or 2pm EST sessions.

Order API: Issue Paid by customer: $0.00

VinhLe
Tourist
4 0 0

Hi,

Please help me to review issue paid by customer: $0.00 as summarized below:

- Created private app on store Shopify

- Follow by API create order on Shopify ,

- Call API to create order

curl -X POST 'https://{app_key}:{password}@{store}.myshopify.com/admin/api/2020-07/orders.json' \
-H 'Content-Type: application/json' \
-d '{
  "order": {
    "line_items": [
      {
        "variant_id": 123,
        "quantity": 1
      }
    ],
    "customer": {
      "email":"customer_email"
    },
    "financial_status": "paid"
  }
}'

- Created order. Login to store and view order detail. But I see Paid by customer: $0.00

Screen Shot 2020-07-22 at 11.19.10.png

I don't know this reason.

Please help me to review it.

Thanks for your advice!

VinhLe

Replies 2 (2)

VinhLe
Tourist
4 0 0

Hi,

I research and find reason for Paid by customer: $0.00. Create order must add transaction value. Example

 

curl -X POST 'https://{app_key}:{password}@{store}.myshopify.com/admin/api/2020-07/orders.json' \
-H 'Content-Type: application/json' \
-d '{
  "order": {
    "line_items": [
      {
        "variant_id": 123,
        "quantity": 1
      }
    ],
    "customer": {
      "email":"customer_email"
    },
    "financial_status": "paid",
    "transactions": [
      {
          "kind": "capture",
          "status": "success",
          "currency": "USD",
          "gateway": "manual",
        "amount": 13.00
      }
    ]
  }
}'

 

transactions -> amount for total_price  of order.

If we don't total_price for order to add in transactions.

We can created order without transactions. After order created. Call api to add transaction to order by API:

Example:

 

"transactions": {
          "kind": "capture",
          "status": "success",
          "currency": "USD",
          "gateway": "manual",
        "amount": 13.00,
        "source": "external"
      }

 

Required: "source": "external" to fixed issue: transaction invalid. You can find issue on url

 

Thanks!

Antonio84
Shopify Partner
45 1 2

It doesn't work for me.

Are missing something else?