Payment succeeded
Sent when a payment has been completed successfully.
payment.succeededSee 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.
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,
"coupon": {
"amount": null,
"couponAmount": 5,
"name": "WELCOME5",
"percent": 5
},
"discount": 10,
"exactBasePrice": 85,
"id": "aB3dE9",
"idCoupon": "C0up0n5",
"idMember": "ZpQ1x7",
"lines": [
{
"idProduct": "Pq1Lm2",
"name": "Monthly fee",
"price": 102.85,
"tax": {
"amountTax": 17.85,
"description": "IVA (general)",
"exactAmountTax": 17.85,
"id": "Tx21ES",
"isIncludePVP": true,
"rate": 21
}
}
],
"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,
"status": 1,
"statusName": "approved",
"transactionDate": "2025-01-01T12:00:00Z",
"type": 1,
"typeName": "fee",
"unitPrice": 1,
"units": 3
},
"dateCreated": "2025-01-01T12:00:00Z",
"eventType": "payment.succeeded",
"idEvent": "b6c1a2e5-0c90-4e93-9dd0-2f2fdc0d8ef4"
}
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).