orderDeliver
Type: Mutation
Confirms that the goods were delivered to the buyer. This releases the payment that Sevi held since the buyer paid and credits your Sevi wallet. It is step 4 of the Integration flow.
Request
mutation OrderDeliver($orderId: String!, $amount: Float) {
orderDeliver(orderId: $orderId, amount: $amount) {
order {
id
referenceNumber
status
paymentStatus
amount
}
}
}
| Argument | Required | Description |
|---|---|---|
orderId | yes | The Sevi order.id returned by orderCreate (not the reference number). |
amount | no | Delivered amount, for a partial delivery. Must be greater than 0 and not more than the order amount. Omit it for a full delivery. |
When to call it
Call it after the order is paid — once you received the ORDER webhook with status: "AWAITING_SHIPMENT" and paymentStatus: "PAID" — and the goods are delivered.
The buyer can also confirm receipt in the Sevi mobile app. Whichever confirmation comes first completes the order:
- If the order is already
DELIVERED(e.g. the buyer confirmed first),orderDeliversimply returns the order — it is safe to call. - The
ORDERwebhook'sdeliveryConfirmedBytells you who confirmed:SELLER(you, via the API),BUYER(in the app),SEVI(Sevi support) orSYSTEM.
What happens
Delivery is processed in the background. The mutation response may still show AWAITING_SHIPMENT; within seconds you receive:
- the
ORDERwebhook withstatus: "DELIVERED",deliveredAtanddeliveryConfirmedBy; - the
TRANSACTIONwebhook for your wallet:TOP_UP,COMPLETED,hold.wasHeld: true,hold.releasedAtset.
If the buyer paid with Sevi credit, delivery is also the moment their repayment schedule starts.
Partial delivery
If you deliver less than ordered, pass the delivered value in amount. The order amount is reduced to that value, you are credited that amount, and the undelivered remainder goes back to the buyer (refunded to their Sevi wallet, or deducted from their credit).
Errors
The delivery is not queued when it is rejected — fix the cause and call again.
| Situation | Error message |
|---|---|
| Payment not completed yet | Order D123456 cannot be marked as delivered yet: the payment is not completed (payment status: PENDING). Confirm delivery only after the order is paid — wait for the ORDER webhook with status AWAITING_SHIPMENT (paymentStatus PAID), then retry. |
| Order abandoned before payment | Order D123456 cannot be marked as delivered: the order was archived before it was paid. Create a new order. |
| Order refunded / returned | Order D123456 cannot be marked as delivered: the order is already refunded. |
| Unknown order id | Order <id> not found. Pass the Sevi order id returned by orderCreate. |
| Order belongs to another seller | Unauthorized |
| Invalid partial amount | Delivery amount must be greater than zero / Delivery amount can only be reduced, not increased |
| Same order delivered twice within 3 seconds | ThrottlerException: Too Many Requests — retry after a few seconds. |