Skip to content

Payment

Bakhtarian edited this page May 14, 2026 · 2 revisions

Payment

A payment is a charge processed through Whop — a transaction recording money collected from a customer for a product, plan, or invoice. This resource is one of the few in the SDK that returns typed DTOs rather than plain arrays for several of its methods.

SDK access

$client->payments // Matchable\Whop\Resource\PaymentResource

Endpoints

create(array $data): array

HTTP POST payments
Does Creates a new payment.
Parameters $data — payment attributes (e.g. amount, currency, customer, payment method).
Returns array

get(string $id): Payment

HTTP GET payments/{id}
Does Retrieves a single payment by ID.
Parameters $id — the payment ID.
Returns Matchable\Whop\Dto\Payment\Payment — a typed DTO. If a required field is missing from the response, a MissingArgumentsException is thrown.

list(array $query = []): array

HTTP GET payments
Does Lists payments.
Parameters $query — optional filters / pagination.
Returns array

refund(string $id, ?int $amount = null): RefundResponse

HTTP POST payments/{id}/refund
Does Refunds a payment, fully or partially.
Parameters $id — the payment ID; $amount — optional partial refund amount (sent as partial_amount); omit for a full refund.
Returns Matchable\Whop\Dto\Payment\RefundResponse — a typed DTO. A missing required field raises a MissingArgumentsException.

void(string $id): VoidResponse

HTTP POST payments/{id}/void
Does Voids a payment before it settles.
Parameters $id — the payment ID.
Returns Matchable\Whop\Dto\Payment\VoidResponse — a typed DTO. A missing required field raises a MissingArgumentsException.

getFees(string $id): array

HTTP GET payments/{id}/fees
Does Retrieves the fee breakdown for a payment.
Parameters $id — the payment ID.
Returns array

retry(string $id): array

HTTP POST payments/{id}/retry
Does Retries a failed payment.
Parameters $id — the payment ID.
Returns array

Note: get, refund, and void return typed DTOs (Payment, RefundResponse, VoidResponse) — not arrays. The remaining methods (create, list, getFees, retry) return plain arrays.

Example

$payment = $client->payments->get('pay_...');

// Partial refund of 500 (minor units).
$refund = $client->payments->refund('pay_...', 500);

$fees = $client->payments->getFees('pay_...');

Reference

Official Whop documentation: https://docs.whop.com

Clone this wiki locally