圖形 API 版本

/{payment-id}/refunds

用於核發任何退款。

讀取

您無法讀取此關係連線。

發佈

您可以使用此關係連線開始處理退款:

POST /v19.0/{payment-id}/refunds HTTP/1.1
Host: graph.facebook.com

currency=EUR&amount=1.00
/* PHP SDK v5.0.0 */
/* make the API call */
try {
  // Returns a `Facebook\FacebookResponse` object
  $response = $fb->post(
    '/{payment-id}/refunds',
    array (
      'currency' => 'EUR',
      'amount' => '1.00',
    ),
    '{access-token}'
  );
} catch(Facebook\Exceptions\FacebookResponseException $e) {
  echo 'Graph returned an error: ' . $e->getMessage();
  exit;
} catch(Facebook\Exceptions\FacebookSDKException $e) {
  echo 'Facebook SDK returned an error: ' . $e->getMessage();
  exit;
}
$graphNode = $response->getGraphNode();
/* handle the result */
Bundle params = new Bundle();
params.putString("currency", "EUR");
params.putString("amount", "1.00");
/* make the API call */
new GraphRequest(
    AccessToken.getCurrentAccessToken(),
    "/{payment-id}/refunds",
    params,
    HttpMethod.POST,
    new GraphRequest.Callback() {
        public void onCompleted(GraphResponse response) {
            /* handle the result */
        }
    }
).executeAsync();
NSDictionary *params = @{
  @"currency": @"EUR",
  @"amount": @"1.00",
};
/* make the API call */
FBSDKGraphRequest *request = [[FBSDKGraphRequest alloc]
                               initWithGraphPath:@"/{payment-id}/refunds"
                                      parameters:params
                                      HTTPMethod:@"POST"];
[request startWithCompletionHandler:^(FBSDKGraphRequestConnection *connection,
                                      id result,
                                      NSError *error) {
    // Handle the result
}];

權限

  • 必須取得應用程式存取權杖,才能針對該應用程式核發任何退款。

欄位

名稱 說明 類型

currency

三個字母組成的 ISO 代碼,用來指定退款金額的幣別;必須與原始購買的計價幣別相同。此為必填欄位。

string

amount

退款金額。此為必填欄位。此值必須小於或等於上層付款物件中的 refundable_amount 欄位。

string

reason

您為此訂單辦理退款的原因。

enum{MALICIOUS_FRAUD, FRIENDLY_FRAUD, CUSTOMER_SERVICE}

回應

如果成功,回應如下:

{
  "success": true
}

否則會傳回相關錯誤訊息。

刪除

您無法使用此關係連線來刪除。