Capture Payment Webhook

Capture Payment Webhook

ShipHero will call this URL to check if a payment was captured succesfully before the order is shipped.

This event is triggered every time the user presses the Print Label button, as such, it may be called multiple times for the same order if there are partial shipments or reship operations, consider this behavior when building your integrations.

The payload is sent during the pre-processing of the request to print a label, and does not account of the result of said print, carrier issues when generating labels may occur after after a sucessful response for the webhook.

  • If success is returned in your response, the process will continue and attempt to generate a shipment.
  • If a failure (HTTP code not 200 or body code not 200) is returned in your response, the fulfillment process will be stopped, and the order will be put in Payment Hold.

Please, reach out to support to have this webhook configured in your account

Webhook Body:

{
    "webhook_type": "Capture Payment",
    "order_number": "Order#11135",
    "partner_order_number": 13581351383157124131,
    "partner_order_id": "Order#11135_",
    "account_id": 4040,
    "shop_name": "My Test Shop",
    "order_id": 611111,
    "allocation_reference": 111111533,
    "line_items": [
        {
            "id": "a07UJ00001vZDUMMY2",
            "sku": "TEST-2",
            "shiphero_id": 164099358631,
            "quantity": 1
        },
        {
            "id": "a07UJ00001vZZDUMMY2",
            "sku": "TEST-2",
            "shiphero_id": 164099358631,
            "quantity": 2
        },
        {
            "id": "a07UJ00001vZZDUMMY",
            "sku": "TEST-1",
            "shiphero_id": 9640393589,
            "quantity": 10
        }
    ]
}

The only valid response for success:

{
  "code": "200",
  "Message": "Success"
}

Any other response will be considered as a failed validation and halt the process as previously mentioned. For example:

{
  "code": "500",
  "Status": "Failure"
}

Relevant fields in the body:

  • allocation_reference: Represents the allocation generated at the moment of picking/shipping this order. Indicates to which order allocation this shipping is associated.
  • line_items: Each object represents the content of one of the packages to be sent in the print label operation. Matches the packages outline to be received in the Shipment Update webhook once the operation is complete.
  • line_items.id: Unique HMAC hash that represents the line item in this order.