存入資金

POST
https://www.digicert.com/services/v2/finance/deposit

使用此端點存入資金到您的帳戶餘額中。

cURL
curl -X POST \
  https://www.digicert.com/services/v2/finance/deposit \
  -H 'Content-Type: application/json' \
  -H 'X-DC-DEVKEY: {{api_key}}' \
  -d '{
  "amount": 1000,
  "payment_method": "card",
  "profile_id": 67849,
  "credit_card": {
    "number": "4111111111111111",
    "cvv": 723,
    "expiration_month": 2,
    "expiration_year": 2022,
    "cardholder_name": "John Digismith"
  },
  "billing_address": {
    "address": "21 Jump St",
    "address2": "Ste. 227",
    "city": "New York",
    "state": "ny",
    "zip": 10177,
    "country": "US"
  }
}'
Python
import requests

url = "https://www.digicert.com/services/v2/finance/deposit"

payload = "{\n  \"amount\": 1000,\n  \"payment_method\": \"card\",\n  \"profile_id\": 67849,\n  \"credit_card\": {\n    \"number\": \"4111111111111111\",\n    \"cvv\": 723,\n    \"expiration_month\": 2,\n    \"expiration_year\": 2022,\n    \"cardholder_name\": \"John Digismith\"\n  },\n  \"billing_address\": {\n    \"address\": \"21 Jump St\",\n    \"address2\": \"Ste. 227\",\n    \"city\": \"New York\",\n    \"state\": \"ny\",\n    \"zip\": 10177,\n    \"country\": \"US\"\n  }\n}"
headers = {
    'X-DC-DEVKEY': "{{api_key}}",
    'Content-Type': "application/json"
    }

response = requests.request("POST", url, data=payload, headers=headers)

print(response.text)
Go
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io/ioutil"
)

func main() {

	url := "https://www.digicert.com/services/v2/finance/deposit"

	payload := strings.NewReader("{\n  \"amount\": 1000,\n  \"payment_method\": \"card\",\n  \"profile_id\": 67849,\n  \"credit_card\": {\n    \"number\": \"4111111111111111\",\n    \"cvv\": 723,\n    \"expiration_month\": 2,\n    \"expiration_year\": 2022,\n    \"cardholder_name\": \"John Digismith\"\n  },\n  \"billing_address\": {\n    \"address\": \"21 Jump St\",\n    \"address2\": \"Ste. 227\",\n    \"city\": \"New York\",\n    \"state\": \"ny\",\n    \"zip\": 10177,\n    \"country\": \"US\"\n  }\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("X-DC-DEVKEY", "{{api_key}}")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := ioutil.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
NodeJS
var request = require("request");

var options = { method: 'POST',
  url: 'https://www.digicert.com/services/v2/finance/deposit',
  headers: 
   { 'Content-Type': 'application/json',
     'X-DC-DEVKEY': '{{api_key}}' },
  body: 
   { amount: 1000,
     payment_method: 'card',
     profile_id: 67849,
     credit_card: 
      { number: '4111111111111111',
        cvv: 723,
        expiration_month: 2,
        expiration_year: 2022,
        cardholder_name: 'John Digismith' },
     billing_address: 
      { address: '21 Jump St',
        address2: 'Ste. 227',
        city: 'New York',
        state: 'ny',
        zip: 10177,
        country: 'US' } },
  json: true };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
204 No Content
// empty

要求參數

使用設定檔付款方法時,使用列出付款設定檔端點取得profile_id

名稱 必填/選填 類型 說明
amount 必填 float 以美金存入的金額。
payment_method 必填 string 要使用的付款方法。
允許的值:card,profile
profile_id 選填 int 用於存款的付款設定檔。
profile用於 payment_method 時必填。
credit_card 選填 object 信用卡詳細資料。
card用於 payment_method 時必填。
.. number 必填 string 信用卡號碼。
不要使用破折號或空格。僅限使用數字。
.. cvv 必填 int 卡碼驗證值 (CVV) 數字。
.. expiration_month 必填 int 信用卡的到期月份。
.. expiration_year 必填 int 信用卡的到期年份。
.. cardholder_name 必填 string 信用卡的名稱。
billing_address 選填 object 帳單地址詳細資料。
.. address 必填 string
.. address2 選填 string
.. city 必填 string
.. state 必填 string 帳單的州或省份。
對有些國家為選填。
.. zip 必填 int 郵遞區號。
對有些國家為選填。
.. country 必填 string