グラフ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

返金額の指定に使う通貨の3文字のISO通貨コード。これは、元の購入額で表示されていたものと同じでなければなりません。これは必須です。

string

amount

返金額。これは必須です。これは親Paymentオブジェクトのrefundable_amountフィールドの値以下でなければなりません。

string

reason

この注文の返金理由。

enum{MALICIOUS_FRAUD, FRIENDLY_FRAUD, CUSTOMER_SERVICE}

応答

成功した場合は、次のようになります。

{
  "success": true
}

成功しなかった場合は、関連するエラーメッセージが返されます。

削除

このエッジを使って削除することはできません。