返金: Create

このリクエストでは、アプリトークン・シークレット・店舗ID・課金IDを指定することで、返金を作成することができます。

Request

POST https://api.gyro-n.money/stores/{storeId}/charges/{chargeId}/refunds

Parameters:

Parameters
amountnumber [必須]
返金金額。課金金額以下でなければなりません。
currencystring (ISO-4217) [必須]
ISO 4217の通貨コードで指定してください。
reasonstring
返金理由。fraud, duplicate, customer_requestのいずれかを指定下さい。
messagestring
返金の詳細理由を記載。
metadatajson
自由に設定できます。詳細は、メタデータを参照下さい。

Headers:

Content-Type: application/json
Authorization: Bearer {secret}.{jwt}

Body:

curl --request POST \
--url https://api.gyro-n.money/stores/f1054498-18f3-11e7-93ff-bb609c8f3ef7/charges/f96eeb3e-18f3-11e7-93ff-1fbf78b8196b/refunds \
--header 'Authorization: Bearer {secret}.{jwt}' \
--header 'content-type: application/json' \
--data '{
  "amount": 250,
  "currency": "USD",
  "reason": "customer_request",
  "message": "15 percent off",
  "metadata": {
      "coupon": "VIP007"
  }
}'

Response

Code: 201

Headers:

Content-Type: application/json

Body:

{
  "id": "72491cc0-1906-11e7-82f4-230e1180f31c",
  "charge_id": "f96eeb3e-18f3-11e7-93ff-1fbf78b8196b",
  "status": "pending",
  "amount": 250,
  "currency": "USD",
  "amount_formatted": 2.5,
  "reason": "customer_request",
  "message": "15 percent off",
  "error": null,
  "metadata": {
    "coupon": "VIP007"
  },
  "mode": "test",
  "created_on": "2018-07-13T02:55:00.07367Z"
}