Our Partner & Developer boards on the community are moving to a brand new home: the .dev community forums! While you can still access past discussions here, for all your future app and storefront building questions, head over to the new forums.

Order API: Issue Paid by customer: $0.00

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
50 1 3

It doesn't work for me.

Are missing something else?