# Payment Sent whenever a user completes a payment. Includes payment details. Endpoint: POST payment Version: 1.0 ## Request fields (application/json): - `notification_type` (string, required) Notification type. - `settings` (object) Custom project settings (object). - `settings.project_id` (integer) Project ID. You can find this parameter in your [Publisher Account](https://publisher.xsolla.com/) next to the name of the project. - `settings.merchant_id` (integer) Merchant ID. - `user` (object) User details (object). - `user.ip` (string) User IP. - `user.phone` (string) User phone. - `user.email` (string) User email. - `user.id` (string, required) User ID. - `user.name` (string) Username. - `user.country` (string) User’s country. Two-letter uppercase [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country code. - `user.zip` (string) User’s ZIP or postal code. - `purchase` (object) Purchase details (object). - `purchase.checkout` (object) Checkout details (object). - `purchase.checkout.currency` (string) Currency. Three-letter currency code per [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). - `purchase.checkout.amount` (number) Purchase amount. - `purchase.subscription` (object) Subscription details (object). - `purchase.subscription.plan_id` (string) Plan ID (external if the plan was created via API). - `purchase.subscription.subscription_id` (integer) Subscription ID in Xsolla database. - `purchase.subscription.product_id` (string) Product ID (if sent in the access token). - `purchase.subscription.tags` (array) Plan tags. - `purchase.subscription.date_create` (string) Subscription creation date. Date and time per [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601). - `purchase.subscription.date_next_charge` (string) Next billing date. Date and time per [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601). - `purchase.subscription.amount` (number) Price in real currency. - `purchase.gift` (object) Gift details (object). - `purchase.gift.giver_id` (string) Giver ID. - `purchase.gift.receiver_id` (string) Gift recipient ID. - `purchase.gift.receiver_email` (string) Gift recipient email. - `purchase.gift.message` (string) Message from the giver. - `purchase.gift.hide_giver_from_receiver` (string) Whether to hide the giver identity from the recipient. - `purchase.total` (object, required) Total price of purchase (object). - `purchase.total.amount` (number) Total payment amount. - `purchase.promotions` (array) Promotions applied to this transaction. - `purchase.promotions.technical_name` (string) Technical name of the promotion. - `purchase.promotions.id` (integer) Promotion ID. - `purchase.coupon` (object) Coupon details (object; if a coupon was used when creating the subscription). - `purchase.coupon.coupon_code` (string) Coupon code. - `purchase.coupon.campaign_code` (string) Campaign code. - `purchase.order` (object) Object that contains information about an order. This information is not passed in the webhook by default. To enable this function, contact your Account Manager or email to am@xsolla.com. - `purchase.order.id` (integer) Order ID. - `purchase.order.lineitems` (object) Object that contains information about an item. - `purchase.order.lineitems.sku` (string) Item SKU. - `purchase.order.lineitems.quantity` (integer) Item quantity. - `purchase.order.lineitems.price` (object) Object that contains information about an item price. - `purchase.order.lineitems.price.currency` (string) Currency of the item price. - `purchase.order.lineitems.price.amount` (number) Total price of the item in the selected currency. - `purchase.virtual_currency` (object) Virtual currency to purchase (object). - `purchase.virtual_currency.name` (string) Virtual currency name. - `purchase.virtual_currency.sku` (string) Virtual currency package SKU (if set for the virtual currency package). - `purchase.virtual_currency.quantity` (number) Quantity. - `purchase.virtual_items` (object) Virtual items in purchase (object). - `purchase.virtual_items.items` (array) - `purchase.virtual_items.items.sku` (string) Item ID. - `purchase.virtual_items.items.amount` (number) Item quantity. - `purchase.pin_codes` (object) Game keys (array). - `purchase.pin_codes.digital_content` (string) Game SKU set in Publisher Account. - `purchase.pin_codes.drm` (string) DRM platform used to distribute the game. Make sure that you have configured the required DRM platforms in your Publisher Account. Enum: "steam", "playstation", "xbox", "uplay", "origin", "drmfree", "gog", "epicgames", "nintendo_eshop", "discord_game_store", "oculus" - `purchase.pin_codes.amount` (number) Price. - `purchase.pin_codes.upgrade` (object) Object with upgrade data. - `purchase.pin_codes.upgrade.digital_content_from` (object) Object with data on the package, from which the user upgraded. - `purchase.pin_codes.upgrade.digital_content_from.DRM` (string) Game DRM platform. - `purchase.pin_codes.upgrade.digital_content_to` (object) Object with data on the package, to which the user upgraded. - `transaction` (object, required) Transaction details (object). - `transaction.id` (integer) Transaction ID. - `transaction.external_id` (string) Transaction external ID. - `transaction.payment_date` (string) Date of payment. - `transaction.payment_method` (integer) Payment method ID. - `transaction.payment_method_name` (string) Payment method name. - `transaction.payment_method_order_id` (string) Payment ID in the payment system. - `transaction.dry_run` (integer) Test transaction. The parameter has the 1 value if it is a test transaction, or is not sent if the transaction is real. - `transaction.agreement` (integer) Agreement ID. - `payment_details` (object, required) Payment details (object). - `payment_details.payment` (object) Amount paid by the user (object). - `payment_details.payment.amount` (number) Amount. - `payment_details.payment_method_sum` (object) Amount debited from the payment system. - `payment_details.xsolla_balance_sum` (object) Amount debited from Xsolla balance. - `payment_details.payout` (object) Payout details (object). - `payment_details.vat` (object) VAT details (object; EU only). - `payment_details.vat.percent` (number) VAT rate. - `payment_details.payout_currency_rate` (string) Exchange rate between payment and payout currencies. - `payment_details.xsolla_fee` (object) Xsolla fee (object). - `payment_details.payment_method_fee` (object) Payment system fee. - `payment_details.sales_tax` (object) Sales tax (object; USA and Canada only). - `payment_details.sales_tax.percent` (number) Sales tax rate. - `payment_details.direct_wht` (object) Direct withholding tax. - `payment_details.direct_wht.percent` (number) Direct withholding tax rate. - `payment_details.repatriation_commission` (object) Object with data on repatriation costs, imposed on Xsolla by third parties. - `custom_parameters` (object) Your custom parameters. ## Response 400 fields (application/json): - `error` (object) - `error.code` (string) - `error.message` (string) ## Response 204 fields ## Response 500 fields