Create a payment

サンプル

  • クレジットカード
  • コンビニ
  • 銀行振込
  • PayEasy
  • WebMoney
  • ビットキャッシュ
  • nanaco
  • NET CASH
curl -X POST https://komoju.com/api/v1/payments \
  -u sk_123456: \
  -d "amount=100" \
  -d "currency=JPY" \
  -d "payment_details[email]=test@example.com" \
  -d "payment_details[prepaid_number]=1111111111111111" \
  -d "payment_details[type]=bit_cash" 
curl -X POST https://komoju.com/api/v1/payments \
  -u sk_123456: \
  -d "amount=1000" \
  -d "currency=JPY" \
  -d "external_order_num=123" \
  -d "metadata[foobar]=hoge" \
  -d "payment_details[email]=test@example.com" \
  -d "payment_details[expiry_days]=3" \
  -d "payment_details[phone]=090-1111-2222" \
  -d "payment_details[store]=lawson" \
  -d "payment_details[type]=konbini" 
curl -X POST https://komoju.com/api/v1/payments \
  -u sk_123456: \
  -d "amount=1000" \
  -d "currency=KRW" \
  -d "external_order_num=123" \
  -d "metadata[foobar]=hoge" \
  -d "payment_details[happy_money_id]=11111111" \
  -d "payment_details[happy_money_password]=11111111" \
  -d "payment_details[type]=happy_money" 
curl -X POST https://komoju.com/api/v1/payments \
  -u sk_123456: \
  -d "amount=1000" \
  -d "currency=JPY" \
  -d "external_order_num=123" \
  -d "metadata[foobar]=hoge" \
  -d "payment_details[email]=test@example.com" \
  -d "payment_details[family_name]=山田" \
  -d "payment_details[family_name_kana]=ヤマダ" \
  -d "payment_details[given_name]=太郎" \
  -d "payment_details[given_name_kana]=タロウ" \
  -d "payment_details[phone]=080-1111-2222" \
  -d "payment_details[type]=pay_easy" 
curl -X POST https://komoju.com/api/v1/payments \
  -u sk_123456: \
  -d "amount=1000" \
  -d "currency=JPY" \
  -d "external_order_num=123" \
  -d "metadata[foobar]=hoge" \
  -d "payment_details[email]=test@example.com" \
  -d "payment_details[prepaid_number]=1111111111111111" \
  -d "payment_details[type]=net_cash" 
curl -X POST https://komoju.com/api/v1/payments \
  -u sk_123456: \
  -d "amount=1000" \
  -d "currency=JPY" \
  -d "external_order_num=123" \
  -d "metadata[foobar]=hoge" \
  -d "payment_details[email]=test@example.com" \
  -d "payment_details[prepaid_number]=1111111111111111" \
  -d "payment_details[type]=web_money" 
curl -X POST https://komoju.com/api/v1/payments \
  -u sk_123456: \
  -d "amount=1000" \
  -d "currency=JPY" \
  -d "external_order_num=123" \
  -d "metadata[foobar]=hoge" \
  -d "payment_details[email]=test@example.com" \
  -d "payment_details[expiry_days]=14" \
  -d "payment_details[family_name]=山田" \
  -d "payment_details[family_name_kana]=ヤマダ" \
  -d "payment_details[given_name]=太郎" \
  -d "payment_details[given_name_kana]=タロウ" \
  -d "payment_details[phone]=080-1111-2222" \
  -d "payment_details[type]=bank_transfer" 
curl -X POST https://komoju.com/api/v1/payments \
  -u sk_123456: \
  -d "amount=1000" \
  -d "currency=KRW" \
  -d "external_order_num=123" \
  -d "metadata[foobar]=hoge" \
  -d "payment_details[culture_id]=11111111" \
  -d "payment_details[culture_password]=11111111" \
  -d "payment_details[type]=culture_voucher" 
curl -X POST https://komoju.com/api/v1/payments \
  -u sk_123456: \
  -d "amount=1000" \
  -d "currency=JPY" \
  -d "external_order_num=123" \
  -d "metadata[foobar]=hoge" \
  -d "payment_details[email]=test@example.com" \
  -d "payment_details[family_name]=Yamada" \
  -d "payment_details[given_name]=Taro" \
  -d "payment_details[month]=01" \
  -d "payment_details[number]=4111111111111111" \
  -d "payment_details[type]=credit_card" \
  -d "payment_details[verification_value]=123" \
  -d "payment_details[year]=2023" 
curl -X POST https://komoju.com/api/v1/payments \
  -u sk_123456: \
  -d "amount=1000" \
  -d "currency=JPY" \
  -d "external_order_num=123" \
  -d "metadata[foobar]=hoge" \
  -d "payment_details[email]=test@example.com" \
  -d "payment_details[prepaid_number]=1111111111111111" \
  -d "payment_details[type]=nanaco" 
{
  "id": "5a8j9st5hu2etnm5kxw2lp67g",
  "resource": "payment",
  "status": "captured",
  "amount": 100,
  "tax": 8,
  "customer": null,
  "payment_deadline": null,
  "payment_details": {
    "type": "bit_cash",
    "email": "test@example.com"
  },
  "payment_method_fee": 0,
  "total": 108,
  "currency": "JPY",
  "description": null,
  "captured_at": "2018-10-15T03:13:55Z",
  "external_order_num": null,
  "metadata": {
  },
  "created_at": "2018-10-15T03:13:55Z",
  "amount_refunded": 0,
  "locale": "ja",
  "refunds": [

  ],
  "refund_requests": [

  ]
}
{
  "id": "3cyp9bp73sz4uav4qjrd2s9fu",
  "resource": "payment",
  "status": "authorized",
  "amount": 1000,
  "tax": 80,
  "customer": null,
  "payment_deadline": "2018-10-18T14:59:59Z",
  "payment_details": {
    "type": "konbini",
    "email": "test@example.com",
    "store": "lawson",
    "confirmation_code": "2222",
    "receipt": "90865708838",
    "instructions_url": "https://komoju.com/ja/instructions/3cyp9bp73sz4uav4qjrd2s9fu"
  },
  "payment_method_fee": 0,
  "total": 1080,
  "currency": "JPY",
  "description": null,
  "captured_at": null,
  "external_order_num": "123",
  "metadata": {
    "foobar": "hoge"
  },
  "created_at": "2018-10-15T03:13:55Z",
  "amount_refunded": 0,
  "locale": "ja",
  "refunds": [

  ],
  "refund_requests": [

  ]
}
{
  "id": "a2wlvje0wxly52jfwhxfpvvb8",
  "resource": "payment",
  "status": "captured",
  "amount": 1000,
  "tax": 80,
  "customer": null,
  "payment_deadline": null,
  "payment_details": {
    "type": "happy_money",
    "email": null,
    "happy_money_id": "11111111"
  },
  "payment_method_fee": 0,
  "total": 1080,
  "currency": "KRW",
  "description": null,
  "captured_at": "2018-10-15T03:13:55Z",
  "external_order_num": "123",
  "metadata": {
    "foobar": "hoge"
  },
  "created_at": "2018-10-15T03:13:55Z",
  "amount_refunded": 0,
  "locale": "ja",
  "refunds": [

  ],
  "refund_requests": [

  ]
}
{
  "id": "2q59ydm37br20db0aiqkxvh3z",
  "resource": "payment",
  "status": "authorized",
  "amount": 1000,
  "tax": 80,
  "customer": null,
  "payment_deadline": "2018-10-25T14:59:59Z",
  "payment_details": {
    "type": "pay_easy",
    "email": "test@example.com",
    "bank_id": "58191",
    "customer_id": "20001900030947960025",
    "confirmation_id": "288916",
    "instructions_url": "https://komoju.com/ja/instructions/2q59ydm37br20db0aiqkxvh3z"
  },
  "payment_method_fee": 0,
  "total": 1080,
  "currency": "JPY",
  "description": null,
  "captured_at": null,
  "external_order_num": "123",
  "metadata": {
    "foobar": "hoge"
  },
  "created_at": "2018-10-15T03:13:55Z",
  "amount_refunded": 0,
  "locale": "ja",
  "refunds": [

  ],
  "refund_requests": [

  ]
}
{
  "id": "a41j8ur61djrudunxzfx3sif6",
  "resource": "payment",
  "status": "captured",
  "amount": 1000,
  "tax": 80,
  "customer": null,
  "payment_deadline": "2018-10-22T03:13:55Z",
  "payment_details": {
    "type": "net_cash",
    "email": "test@example.com",
    "short_amount": 0,
    "prepaid_cards": [
      {
        "last_four_digits": "1111",
        "points": 1080
      }
    ]
  },
  "payment_method_fee": 0,
  "total": 1080,
  "currency": "JPY",
  "description": null,
  "captured_at": "2018-10-15T03:13:55Z",
  "external_order_num": "123",
  "metadata": {
    "foobar": "hoge"
  },
  "created_at": "2018-10-15T03:13:55Z",
  "amount_refunded": 0,
  "locale": "ja",
  "refunds": [

  ],
  "refund_requests": [

  ]
}
{
  "id": "a4ptrr7a37opo5feu0ja5kg19",
  "resource": "payment",
  "status": "captured",
  "amount": 1000,
  "tax": 80,
  "customer": null,
  "payment_deadline": null,
  "payment_details": {
    "type": "web_money",
    "email": "test@example.com",
    "short_amount": 0,
    "prepaid_cards": [
      {
        "last_four_digits": "1111",
        "points": 1080
      }
    ]
  },
  "payment_method_fee": 0,
  "total": 1080,
  "currency": "JPY",
  "description": null,
  "captured_at": "2018-10-15T03:13:55Z",
  "external_order_num": "123",
  "metadata": {
    "foobar": "hoge"
  },
  "created_at": "2018-10-15T03:13:55Z",
  "amount_refunded": 0,
  "locale": "ja",
  "refunds": [

  ],
  "refund_requests": [

  ]
}
{
  "id": "2aqeiam40z5azgiowp1p3pn5l",
  "resource": "payment",
  "status": "authorized",
  "amount": 1000,
  "tax": 80,
  "customer": null,
  "payment_deadline": "2018-10-22T14:59:59Z",
  "payment_details": {
    "type": "bank_transfer",
    "email": "test@example.com",
    "order_id": "H2529456854",
    "bank_name": "三井住友銀行",
    "account_branch_name": "ひなぎく",
    "account_number": "51",
    "account_type": "普通預金",
    "account_name": "株式会社DEGICA(カブシキガイシャ デジカ)",
    "instructions_url": "https://komoju.com/ja/instructions/2aqeiam40z5azgiowp1p3pn5l"
  },
  "payment_method_fee": 0,
  "total": 1080,
  "currency": "JPY",
  "description": null,
  "captured_at": null,
  "external_order_num": "123",
  "metadata": {
    "foobar": "hoge"
  },
  "created_at": "2018-10-15T03:13:55Z",
  "amount_refunded": 0,
  "locale": "ja",
  "refunds": [

  ],
  "refund_requests": [

  ]
}
{
  "id": "dy2g82yqkakeyimfuc7c9n8yu",
  "resource": "payment",
  "status": "captured",
  "amount": 1000,
  "tax": 80,
  "customer": null,
  "payment_deadline": null,
  "payment_details": {
    "type": "culture_voucher",
    "email": null,
    "culture_id": "11111111"
  },
  "payment_method_fee": 0,
  "total": 1080,
  "currency": "KRW",
  "description": null,
  "captured_at": "2018-10-15T03:13:55Z",
  "external_order_num": "123",
  "metadata": {
    "foobar": "hoge"
  },
  "created_at": "2018-10-15T03:13:55Z",
  "amount_refunded": 0,
  "locale": "ja",
  "refunds": [

  ],
  "refund_requests": [

  ]
}
{
  "id": "dm3xo6yy6l05joook9lpubmn9",
  "resource": "payment",
  "status": "captured",
  "amount": 1000,
  "tax": 80,
  "customer": null,
  "payment_deadline": "2018-10-22T14:59:59Z",
  "payment_details": {
    "type": "credit_card",
    "email": "test@example.com",
    "brand": "visa",
    "last_four_digits": "1111",
    "month": 1,
    "year": 2023
  },
  "payment_method_fee": 0,
  "total": 1080,
  "currency": "JPY",
  "description": null,
  "captured_at": "2018-10-15T03:13:55Z",
  "external_order_num": "123",
  "metadata": {
    "foobar": "hoge"
  },
  "created_at": "2018-10-15T03:13:55Z",
  "amount_refunded": 0,
  "locale": "ja",
  "refunds": [

  ],
  "refund_requests": [

  ]
}
{
  "id": "14t82xjptssn8af3bl4e3pxgw",
  "resource": "payment",
  "status": "captured",
  "amount": 1000,
  "tax": 80,
  "customer": null,
  "payment_deadline": "2018-10-22T03:13:55Z",
  "payment_details": {
    "type": "nanaco",
    "email": "test@example.com",
    "short_amount": 0,
    "prepaid_cards": [
      {
        "last_four_digits": "1111",
        "points": 1080
      }
    ]
  },
  "payment_method_fee": 0,
  "total": 1080,
  "currency": "JPY",
  "description": null,
  "captured_at": "2018-10-15T03:13:55Z",
  "external_order_num": "123",
  "metadata": {
    "foobar": "hoge"
  },
  "created_at": "2018-10-15T03:13:55Z",
  "amount_refunded": 0,
  "locale": "ja",
  "refunds": [

  ],
  "refund_requests": [

  ]
}

パラメータ

名前 説明
amount
必須
The amount to be charged before tax. Must be equal or greater than 0. Use a ‘.’ as a decimal separator, and no thousands separator
currency
必須
3 letter ISO currency code of the transaction
capture
任意
If true, the payment will be immediately captured. This option is ignored if a payment type is not credit_card
description
任意
Plaintext description for annotating a resource.
tax
任意
The amount of tax to be charged, or ‘auto’ to use the current consumption tax rate in Japan. Use a ‘.’ as a decimal separator, and no thousands separator. If the tax is more precise than the currency allows, it will be rounded using a round half up algorithm.
external_order_num
任意
A unique ID from your application used to track this payment.
locale
任意
Sets language of instruction page for supported payment methods. Valid options are 'en', 'ja', and 'ko'.
metadata
任意
A set of key-value pairs
payment_details
任意
A hash or token describing the payment method used to make the payment.
customer
任意
The ID of an existing customer in which to provide payment details for the payment.