Skip to main content

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
}
}
}
ArgumentRequiredDescription
orderIdyesThe Sevi order.id returned by orderCreate (not the reference number).
amountnoDelivered 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), orderDeliver simply returns the order — it is safe to call.
  • The ORDER webhook's deliveryConfirmedBy tells you who confirmed: SELLER (you, via the API), BUYER (in the app), SEVI (Sevi support) or SYSTEM.

What happens​

Delivery is processed in the background. The mutation response may still show AWAITING_SHIPMENT; within seconds you receive:

  1. the ORDER webhook with status: "DELIVERED", deliveredAt and deliveryConfirmedBy;
  2. the TRANSACTION webhook for your wallet: TOP_UP, COMPLETED, hold.wasHeld: true, hold.releasedAt set.

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.

SituationError message
Payment not completed yetOrder 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 paymentOrder D123456 cannot be marked as delivered: the order was archived before it was paid. Create a new order.
Order refunded / returnedOrder D123456 cannot be marked as delivered: the order is already refunded.
Unknown order idOrder <id> not found. Pass the Sevi order id returned by orderCreate.
Order belongs to another sellerUnauthorized
Invalid partial amountDelivery amount must be greater than zero / Delivery amount can only be reduced, not increased
Same order delivered twice within 3 secondsThrottlerException: Too Many Requests — retry after a few seconds.