Payment partially refunded
Sent when a refund is issued for part of a payment: the refunds issued so far, this one included, are below the amount charged. data.refund carries the refund that triggered the event.
See How webhooks work for the envelope, delivery semantics and retries.
Payload
The data object for this event.
authCodestring · nullableAuthorization code returned by the payment gateway when available.
basePricenumberrequiredReference amount used to compute discounts/coupons (typically excluding taxes and before discounts/coupons).
couponobject · nullableCoupon details.
discountintegerrequiredApplied discount percentage (0-100). Note: fixed discount amounts are not represented separately in this event payload.
exactBasePricenumberrequiredNet amount excluding taxes (derived from `price`) with extended precision (up to 6 decimals). This may differ from `basePrice` when discounts/coupons apply.
idstringrequiredPayment/transaction id.
idCouponstring · nullableCoupon id.
idMemberstringrequiredMember id.
linesarray of objectPayment line items. Notes: for combo transactions, multiple lines may be sent; for non-combo payments TraininGym usually sends a single line representing the transaction concept/product.
memberobjectMember details.
paymentDatestring · date-time · nullablePayment date (UTC).
paymentMethodobject · nullablePayment method details.
pricenumberrequiredFinal amount charged to the customer (after discounts/coupons). If taxes are applicable and included, this is the gross amount.
refundobject · nullableRefund that triggered the event. Present only in `payment.refunded` and `payment.partially_refunded`; omitted otherwise. `id` is still the id of the original payment, so the refund can be matched with its `payment.succeeded`. In refund events `status` may not yet reflect the refund: rely on `eventType`.
statusintegerrequiredStatus (numeric enum).
statusNamestringrequiredStatus name (text). This is the enum name for `status`.
transactionDatestring · date-timerequiredTransaction date (UTC).
typeintegerrequiredProduct/fee type (numeric enum).
typeNamestringrequiredProduct/fee type name (text). This is the enum name for `type`.
unitPricenumberrequiredUnit price reference for the transaction (when applicable).
unitsinteger · nullableUnits/quantity. When the source amount is 0, TraininGym sends 1 to avoid division by zero in per-unit calculations.
Example payload
{
"center": {
"id": 1234,
"name": "Portales",
"publicToken": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
},
"data": {
"authCode": "123456",
"basePrice": 100,
"discount": 0,
"exactBasePrice": 85,
"id": "aB3dE9",
"idCoupon": null,
"idMember": "ZpQ1x7",
"lines": [
{
"idProduct": "Pq1Lm2",
"name": "Monthly fee",
"price": 102.85
}
],
"member": {
"address": "Main Street 1",
"billingInfo": null,
"countryCode": "ES",
"cp": "28001",
"documentNumber": "12345678A",
"email": "john.doe@example.com",
"lastName": "Doe",
"name": "John"
},
"paymentDate": "2025-01-01T12:00:00Z",
"paymentMethod": {
"brand": "visa",
"last4": "4242",
"name": "Card",
"type": 2,
"typeName": "card"
},
"price": 102.85,
"refund": {
"amount": 40,
"date": "2025-01-15T09:00:00Z",
"idRefund": "Rf7Kd2",
"lines": [
{
"amount": 1,
"idProduct": "Pq1Lm2",
"name": "Monthly fee"
}
]
},
"status": 5,
"statusName": "partialRefund",
"transactionDate": "2025-01-01T12:00:00Z",
"type": 1,
"typeName": "fee",
"unitPrice": 1,
"units": 1
},
"dateCreated": "2025-01-15T09:00:00Z",
"eventType": "payment.partially_refunded",
"idEvent": "7d2e4c1a-5b3f-4e8a-9c6d-1f0a2b3c4d5e",
"version": "1"
}
Responses
- 200
- 202
- 204
- 400
- 401
- 403
- 500
Accepted / processed.
Accepted / queued for processing.
Accepted / processed.
Bad Request (will trigger retries).
Unauthorized (will trigger retries).
Forbidden (will trigger retries).
Server error (will trigger retries).