Skip to content

Latest commit

 

History

History
125 lines (80 loc) · 2.32 KB

File metadata and controls

125 lines (80 loc) · 2.32 KB

Refunds

A list of all methods in the Refunds service. Click on the method name to view detailed information about that method.

Methods Description
list_refunds
create_refund
get_refund_handler

list_refunds

  • HTTP Method: GET
  • Endpoint: /refunds

Parameters

Name Type Required Description
$createdAtGte string Get events after this created time
$createdAtLte string Get events created before this time
$pageSize int Page size default is 10 max is 100
$pageNumber int Page number default is 0
$status Models\RefundStatus Filter by status

Return Type

Models\GetRefundsListResponse

Example Usage Code Snippet

<?php

use Dodopayments\Client;

$sdk = new Client(accessToken: 'YOUR_TOKEN');

$status = Models\RefundStatus::Succeeded;

$response = $sdk->refunds->listRefunds(
  createdAtGte: "created_at_gte",
  createdAtLte: "created_at_lte",
  pageSize: 8,
  pageNumber: 7,
  status: $status
);

print_r($response);

create_refund

  • HTTP Method: POST
  • Endpoint: /refunds

Parameters

Name Type Required Description
input Models\CreateRefundRequest

Return Type

Models\RefundResponse

Example Usage Code Snippet

<?php

use Dodopayments\Client;
use Dodopayments\Models\CreateRefundRequest;

$sdk = new Client(accessToken: 'YOUR_TOKEN');


$input = new Models\CreateRefundRequest(
  amount: 1,
  paymentId: "payment_id",
  reason: "reason"
);

$response = $sdk->refunds->createRefund(
  input: $input
);

print_r($response);

get_refund_handler

  • HTTP Method: GET
  • Endpoint: /refunds/{refund_id}

Parameters

Name Type Required Description
$refundId string Refund Id

Return Type

Models\RefundResponse

Example Usage Code Snippet

<?php

use Dodopayments\Client;

$sdk = new Client(accessToken: 'YOUR_TOKEN');

$response = $sdk->refunds->getRefundHandler(
  refundId: "refund_id"
);

print_r($response);