Saltar al contenido principal

Payment succeeded

Sent when a payment has been completed successfully.

payment.succeeded

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

Payload

El objeto data de este evento.

authCodestring · nullable

Authorization code returned by the payment gateway when available.

basePricenumberobligatorio

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

couponobject · nullable

Coupon details.

discountintegerobligatorio

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

exactBasePricenumberobligatorio

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

idstringobligatorio

Payment/transaction id.

idCouponstring · nullable

Coupon id.

idMemberstringobligatorio

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.

pricenumberobligatorio

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

statusintegerobligatorio

Status (numeric enum).

statusNamestringobligatorio

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

transactionDatestring · date-timeobligatorio

Transaction date (UTC).

typeintegerobligatorio

Product/fee type (numeric enum).

typeNamestringobligatorio

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

unitPricenumberobligatorio

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,
"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

Accepted / processed.