Capture Order - citiesocial/citiesocial-api-doc GitHub Wiki

Capture Order

  • URL

    /orders/{{ order-id }}/capture/

  • Method:

    POST

  • URL Params

    None

  • Data Params

{
    "reference_key": "1234567890123"(string, 授權代碼)
}
  • Success Response:

    • Code: 200 OK
      Content: As sample success response below.
  • Error Response:

    • Code: 400 BAD REQUEST
      Content:

      Invalid json format
      {"errors": "Invalid json format."}

      Transaction has already been captured.
      {"errors": "transaction has already been captured."}

      Order has already been cancelled.
      {'errors': 'Cannot capture order that is already cancelled.'}

    • Code: 401 UNAUTHORIZED
      Content: {"message": "Unauthorized access"}

    • Code: 404 NOT FOUND
      Content: None

    • Code: 405 METHOD NOT ALLOWED
      Content: "POST is required."

  • Sample Successful Response:

{
    "order": {
        "total_price": 30,
        "name": "#1207",
        "items": [
            {
                "shipment": null,
                "estimated_shipping_date": null,
                "name": "Active 水煙筒 - 原木",
                "is_refunded": false,
                "variant_id": 1793693507
            },
            {
                "shipment": null,
                "estimated_shipping_date": null,
                "name": "Active 水煙筒 - 原木",
                "is_refunded": false,
                "variant_id": 1793693507
            },
            {
                "shipment": null,
                "estimated_shipping_date": null,
                "name": "Active 水煙筒 - 橘 - 橘灰",
                "is_refunded": false,
                "variant_id": 1793680195
            }
        ],
        "financial_status": "paid",
        "id": "5764308878",
        "shipping_address": {
            "city": "台北市",
            "first_name": "小明",
            "last_name": "王",
            "zip": "100",
            "title": "先生",
            "address1": "中正區",
            "address2": "八德路一段",
            "phone": "0912345678"
        },
        "is_cancelled": false,
        "email": "[email protected]"
    }
}