Order API: Issue Paid by customer: $0.00

Highlighted
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

0 Likes
Highlighted
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!

0 Likes