Order completion events are triggered when a new order has completed processing. The webhook payload depends on whether the order was processed successfully or not.
Read through our webhook guide for webhook implementation details.
Payload examples
These are examples of the order completion webhook payloads. Please also refer to the OpenAPI specification.
Successful Order
{
"id": "O-01HK7VK8C3WM1MQ916GEXJGQ6P",
"status": "COMPLETED",
"created_at": "2024-01-04T14:19:07.882052+00:00",
"completed_at": "2024-01-04T14:19:17.882052+00:00",
"description": "This is an example order",
"payment_method": {
"type": "CARD",
"card_payment_fee": "0.03"
},
"currency": "USD",
"total_price": "19.03",
"total_discount": "1.0",
"execution_mode": "async"
}
Failed order
{
"id": "O-01HK7VK8C3WM1MQ916GEXJGQ6P",
"status": "FAILED"
}
OpenAPI specification
openapi: 3.1.0
info:
title: webhooks
description: |-
The webhooks Runa sends to notify you of events.
version: 1.0.0
externalDocs:
description: Runa webhook guide
url: https://developer.runa.io/docs/webhooks
webhooks:
order-completion:
post:
requestBody:
description: Information about a newly completed order
content:
application/json:
schema:
type: object
oneOf:
- $ref: "#/components/schemas/SuccessfulOrder"
- $ref: "#/components/schemas/FailedOrder"
responses:
"200":
description: Return a 200 status to indicate that the data was received successfully
components:
schemas:
FailedOrder:
type: object
properties:
id:
type: string
examples: ["O-01HK7VK8C3WM1MQ916GEXJGQ6P"]
status:
type: string
enum: ["FAILED"]
required:
- id
- status
SuccessfulOrder:
type: object
properties:
id:
type: string
examples: ["O-01HK7VK8C3WM1MQ916GEXJGQ6P"]
created_at:
type: string
examples: ["2024-01-03T14:25:02.661306+00:00"]
completed_at:
type: string
examples: ["2024-01-03T14:25:06.653Z"]
description:
type: string
examples: ["This is an example order"]
currency:
type: string
examples: ["USD", "GBP"]
payment_method:
$ref: "#/components/schemas/PaymentMethod"
status:
type: string
enum: ["COMPLETED"]
total_price:
type: string
examples: ["10.00"]
total_discount:
type: string
examples: ["0.40"]
execution_mode:
type: string
enum: ["sync", "async"]
required:
- id
- created_at
- completed_at
- currency
- status
- total_price
- total_discount
PaymentMethod:
type: object
properties:
type:
type: string
enum: ["CARD", "ACCOUNT_BALANCE"]
card_payment_fee:
type: string
examples: ["0.03"]
required:
- type