OrderCompensationUpdatedv0.0.1
OrderCompensationUpdated
This event is triggered when an order compensation has been updated, this will include when the operation is e.g. started, restarted, completed, or failed.
If only the final outcome events are desired, we recommend listening for OrderCompensated, or OrderCompensatedFailed.
OrderCompensationUpdated Schema (json)
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "OrderCompensationChanged",
"required": ["detail-type", "resources", "detail", "id", "source", "time", "region", "version", "account"],
"type": "object",
"properties": {
"account": {
"type": "string"
},
"detail": {
"$ref": "#/definitions/Detail"
},
"detail-type": {
"type": "string"
},
"id": {
"type": "string"
},
"region": {
"type": "string"
},
"resources": {
"items": {
"type": "string"
},
"type": "array"
},
"source": {
"type": "string"
},
"time": {
"format": "date-time",
"type": "string"
},
"version": {
"type": "string"
}
},
"definitions": {
"Detail": {
"properties": {
"data": {
"$ref": "#/definitions/Data"
},
"metadata": {
"$ref": "#/definitions/Metadata"
}
},
"required": ["metadata", "data"],
"type": "object"
},
"Metadata": {
"type": "object",
"required": ["awsRequestId"],
"properties": {
"awsRequestId": {
"type": "string"
},
"isTruncated": {
"type": "boolean"
}
}
},
"Data": {
"$ref": "#/definitions/OrderCompensation"
},
"OrderCompensation": {
"type": "object",
"required": [
"id",
"orderId",
"orderReference",
"orderLines",
"shippingFees",
"giftCards",
"totals",
"created",
"updated",
"restarts",
"revision"
],
"properties": {
"id": {
"type": "string",
"description": "The compensation id"
},
"orderId": {
"type": "string",
"description": "The order id"
},
"orderReference": {
"type": "string",
"description": "The order short reference"
},
"paymentProvider": {
"$ref": "#/definitions/ProviderStatus"
},
"shippingProvider": {
"$ref": "#/definitions/ProviderStatus"
},
"giftCardProvider": {
"$ref": "#/definitions/ProviderStatus"
},
"giftCardProductProvider": {
"$ref": "#/definitions/ProviderStatus"
},
"voucherProvider": {
"$ref": "#/definitions/ProviderStatus"
},
"promotionProvider": {
"$ref": "#/definitions/ProviderStatus"
},
"bonusProvider": {
"$ref": "#/definitions/ProviderStatus"
},
"payment": {
"$ref": "#/definitions/Payment"
},
"totals": {
"$ref": "#/definitions/CompensationTotals"
},
"orderLines": {
"type": "array",
"items": {
"$ref": "#/definitions/OrderLine"
}
},
"shippingFees": {
"type": "array",
"items": {
"$ref": "#/definitions/ShippingFee"
}
},
"giftCards": {
"type": "array",
"items": {
"$ref": "#/definitions/GiftCard"
}
},
"bonus": {
"$ref": "#/definitions/Bonus"
},
"fee": {
"$ref": "#/definitions/Fee"
},
"reason": {
"$ref": "#/definitions/Reason"
},
"created": {
"type": "string",
"format": "date-time",
"description": "Created date for the order compensation"
},
"updated": {
"type": "string",
"format": "date-time",
"description": "Updated date for the order compensation"
},
"started": {
"type": "string",
"format": "date-time",
"description": "Started date for the order compensation"
},
"completed": {
"type": "string",
"format": "date-time",
"description": "Completed date for the order compensation"
},
"failed": {
"type": "string",
"format": "date-time",
"description": "Failed date for the order compensation"
},
"restarted": {
"type": "string",
"format": "date-time",
"description": "Restarted date for the order compensation"
},
"restarts": {
"description": "The number of restarts",
"type": "integer"
},
"revision": {
"description": "The revision number of the order compensation",
"type": "integer"
}
}
},
"ProviderStatus": {
"type": "object",
"required": ["providerId", "providerName"],
"properties": {
"providerId": {
"type": "string",
"description": "The id for the provider"
},
"providerName": {
"type": "string",
"description": "The name of the provider"
},
"status": {
"$ref": "#/definitions/ProviderStatusLog"
}
}
},
"ProviderStatusLog": {
"type": "object",
"required": ["current"],
"properties": {
"current": {
"type": "string",
"description": "The latest status for the provider"
},
"history": {
"type": "array",
"items": {
"$ref": "#/definitions/ProviderStatusLogEntry"
}
}
}
},
"ProviderStatusLogEntry": {
"type": "object",
"required": ["status", "timestamp", "type"],
"properties": {
"message": {
"type": "string",
"description": "Optional message for the status"
},
"errorMessage": {
"type": "string",
"description": "Optional error message from the provider"
},
"status": {
"type": "string",
"description": "The actual status"
},
"timestamp": {
"type": "string",
"format": "date-time",
"description": "Timestamp for the status"
},
"type": {
"type": "string",
"description": "Status type"
}
}
},
"Payment": {
"type": "object",
"required": ["reference"],
"properties": {
"reference": {
"type": "string",
"description": "Reference for the payment"
},
"amount": {
"type": "integer",
"format": "int64",
"description": "Amount compensated"
},
"currencyCode": {
"$ref": "#/definitions/CurrencyCode"
}
}
},
"OrderLine": {
"type": "object",
"required": [
"orderLineId",
"quantity",
"taxPercentage",
"taxPercentageDecimals",
"currencyCode",
"totalAmount",
"totalDiscountAmount",
"totalTaxAmount"
],
"properties": {
"orderLineId": {
"type": "string",
"description": "The id for the order line"
},
"quantity": {
"type": "integer",
"description": "Quantity for the order line"
},
"currencyCode": {
"$ref": "#/definitions/CurrencyCode"
},
"taxPercentage": {
"type": "integer",
"description": "Tax percentage for the order line"
},
"taxPercentageDecimals": {
"type": "integer",
"description": "Number of decimals in tax percentage, eg. taxPercentage=2500 and taxPercentageDecimals=2 -> 25 % tax"
},
"totalAmount": {
"type": "integer",
"description": "Total amount for the order line"
},
"totalDiscountAmount": {
"type": "integer",
"description": "Total discount amount of the order line"
},
"totalTaxAmount": {
"type": "integer",
"description": "Total tax amount for the order line"
},
"reason": {
"$ref": "#/definitions/Reason"
}
}
},
"ShippingFee": {
"type": "object",
"required": [
"shippingFeeId",
"currencyCode",
"taxPercentage",
"taxPercentageDecimals",
"totalAmount",
"totalDiscountAmount",
"totalTaxAmount"
],
"properties": {
"shippingFeeId": {
"type": "string",
"description": "The id for the shipping fee"
},
"currencyCode": {
"$ref": "#/definitions/CurrencyCode"
},
"taxPercentage": {
"type": "integer",
"description": "Tax percentage for the shipping fee"
},
"taxPercentageDecimals": {
"type": "integer",
"description": "Number of decimals in tax percentage, eg. taxPercentage=2500 and taxPercentageDecimals=2 -> 25 % tax"
},
"totalAmount": {
"type": "integer",
"description": "Total amount for the shipping fee"
},
"totalDiscountAmount": {
"type": "integer",
"description": "Total discount amount for the shipping fee"
},
"totalTaxAmount": {
"type": "integer",
"description": "Total tax amount for the shipping fee"
}
}
},
"GiftCard": {
"type": "object",
"required": ["giftCardId", "amount", "currencyCode", "status"],
"properties": {
"giftCardId": {
"type": "string",
"description": "The id for the gift card"
},
"amount": {
"type": "number",
"format": "int64",
"description": "The amount for the gift card"
},
"currencyCode": {
"$ref": "#/definitions/CurrencyCode"
},
"status": {
"type": "string",
"description": "The status of the gift card",
"enum": ["RESERVED", "RESERVATION_FAILED", "REDEEMED", "REDEEM_FAILED"]
},
"transactionId": {
"type": "string",
"description": "The id for the gift card transaction"
}
}
},
"Bonus": {
"type": "object",
"required": ["amount", "currencyCode", "reservationId"],
"properties": {
"reservationId": {
"type": "string",
"description": "The id for the bonus reservation"
},
"amount": {
"type": "integer",
"description": "Bonus amount"
},
"currencyCode": {
"$ref": "#/definitions/CurrencyCode"
},
"transactionId": {
"type": "string",
"description": "The id of the bonus transaction"
}
}
},
"Fee": {
"type": "object",
"description": "Optional refund fee for the compensation.",
"required": ["name", "amount", "currencyCode", "taxAmount", "taxPercentage", "taxPercentageDecimals"],
"properties": {
"name": {
"type": "string",
"description": "A descriptive name for the refund fee."
},
"amount": {
"type": "integer",
"description": "Refund fee amount in minor units"
},
"currencyCode": {
"$ref": "#/definitions/CurrencyCode"
},
"taxAmount": {
"type": "integer",
"description": "Refund fee tax amount in minor units"
},
"taxPercentage": {
"type": "integer",
"description": "Tax percentage, eg. taxPercentage=2500 and taxPercentageDecimals=2 -> 25.00 % tax"
},
"taxPercentageDecimals": {
"type": "integer",
"description": "Number of decimals in tax percentage, eg. taxPercentage=2500 and taxPercentageDecimals=2 -> 25.00 % tax"
}
}
},
"Reason": {
"type": "object",
"properties": {
"code": {
"type": "string",
"description": "Optional code for the reason, useful for BI tracking"
},
"cause": {
"type": "string",
"description": "Optional human readable cause for the reason"
}
}
},
"CompensationTotals": {
"type": "object",
"required": ["giftCardTotal", "bonusTotal", "paymentTotal", "grandTotal"],
"properties": {
"giftCardTotal": {
"type": "integer",
"description": "The total compensated amount gift card provider."
},
"bonusTotal": {
"type": "integer",
"description": "The total compensated amount for the bonus provider."
},
"paymentTotal": {
"type": "integer",
"description": "The total compensated amount for the payment provider."
},
"grandTotal": {
"type": "integer",
"description": "The grand total for the compensation: (`giftCardTotal` + `bonusTotal` + `paymentTotal`)."
}
}
},
"CurrencyCode": {
"title": "CurrencyCode",
"maxLength": 3,
"minLength": 3,
"pattern": "^[A-Z]{3}$",
"type": "string",
"description": "ISO 4217 currency code"
}
}
}
Last updated on 2026/3/3