Refunds
in package
Refunds resource for managing order refunds.
Request arrays use the API's documented snake_case field names. Successful responses
are returned as immutable values from the corresponding singular resource namespace.
Table of Contents
Methods
- __construct() : mixed
- Creates the refunds resource client.
- cancel() : Refund
- Cancel a pending refund.
- create() : Refund
- Create a refund for paid order line items.
- lookup() : Refund
- Look up a refund by ID.
- page() : Page
- Page through refunds.
Methods
__construct()
Creates the refunds resource client.
public
__construct(HttpClient $http) : mixed
Parameters
- $http : HttpClient
-
Shared authenticated HTTP transport used by this resource client.
cancel()
Cancel a pending refund.
public
cancel(string $refundId[, string|null $idempotencyKey = null ][, string|null $reason = null ]) : Refund
Sends the documented request through the shared authenticated transport and hydrates the successful response into the declared return type.
Parameters
- $refundId : string
-
Unique identifier of the refund.
- $idempotencyKey : string|null = null
-
Optional idempotency key for safely retrying the same logical write.
- $reason : string|null = null
-
Optional explanation for canceling the refund.
Return values
Refund —The canceled refund.
create()
Create a refund for paid order line items.
public
create(array<string, mixed> $payload[, string|null $idempotencyKey = null ]) : Refund
Sends the documented request through the shared authenticated transport and hydrates the successful response into the declared return type.
Parameters
- $payload : array<string, mixed>
-
Request fields keyed by the documented
snake_caseAPI names. - $idempotencyKey : string|null = null
-
Optional idempotency key for safely retrying the same logical write.
Return values
Refund —The created refund.
lookup()
Look up a refund by ID.
public
lookup(string $refundId) : Refund
Sends the documented request through the shared authenticated transport and hydrates the successful response into the declared return type.
Parameters
- $refundId : string
-
Unique identifier of the refund.
Return values
Refund —The requested refund.
page()
Page through refunds.
public
page([array<string, mixed> $payload = [] ]) : Page
Sends the documented request through the shared authenticated transport and hydrates the successful response into the declared return type.
Parameters
- $payload : array<string, mixed> = []
-
Request fields keyed by the documented
snake_caseAPI names.
Return values
Page —A typed page of matching refunds.