Skip to main content

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.

payment.partially_refunded

See How webhooks work for the envelope, delivery semantics and retries.

Payload​

The data object for this event.

authCodestring · nullable

Authorization code returned by the payment gateway when available.

basePricenumberrequired

Reference amount used to compute discounts/coupons (typically excluding taxes and before discounts/coupons).

couponobject · nullable

Coupon details.

discountintegerrequired

Applied discount percentage (0-100). Note: fixed discount amounts are not represented separately in this event payload.

exactBasePricenumberrequired

Net amount excluding taxes (derived from `price`) with extended precision (up to 6 decimals). This may differ from `basePrice` when discounts/coupons apply.

idstringrequired

Payment/transaction id.

idCouponstring · nullable

Coupon id.

idMemberstringrequired

Member id.

linesarray of object

Payment 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.

memberobject

Member details.

paymentDatestring · date-time · nullable

Payment date (UTC).

paymentMethodobject · nullable

Payment method details.

pricenumberrequired

Final amount charged to the customer (after discounts/coupons). If taxes are applicable and included, this is the gross amount.

refundobject · nullable

Refund 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`.

statusintegerrequired

Status (numeric enum).

statusNamestringrequired

Status name (text). This is the enum name for `status`.

transactionDatestring · date-timerequired

Transaction date (UTC).

typeintegerrequired

Product/fee type (numeric enum).

typeNamestringrequired

Product/fee type name (text). This is the enum name for `type`.

unitPricenumberrequired

Unit price reference for the transaction (when applicable).

unitsinteger · nullable

Units/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​

Accepted / processed.