Create a payment

サンプル

  • クレジットカード
  • コンビニ
  • 銀行振込
  • PayEasy
  • WebMoney
  • ビットキャッシュ
  • nanaco
  • 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[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[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=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[prepaid_number]=1111111111111111" \
  -d "payment_details[type]=nanaco" 
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=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=100" \
  -d "currency=JPY" \
  -d "payment_details[email]=test@example.com" \
  -d "payment_details[prepaid_number]=1111111111111111" \
  -d "payment_details[type]=bit_cash" 
{
  "id": "07iedcgxay065ezhumssrw2by",
  "resource": "payment",
  "status": "authorized",
  "amount": 1000,
  "tax": 80,
  "customer": null,
  "payment_deadline": "2014-11-29T14:59:59Z",
  "payment_details": {
    "type": "pay_easy",
    "email": "test@example.com",
    "bank_id": "58021",
    "customer_id": "WNT51720341",
    "confirmation_id": "3769",
    "instructions_url": "https://komoju.com/ja/instructions/07iedcgxay065ezhumssrw2by"
  },
  "payment_method_fee": 0,
  "total": 1080,
  "currency": "JPY",
  "description": null,
  "captured_at": null,
  "external_order_num": "123",
  "metadata": {
    "foobar": "hoge"
  },
  "created_at": "2018-11-13T06:20:21Z",
  "amount_refunded": 0,
  "locale": "ja",
  "refunds": [

  ],
  "refund_requests": [

  ]
}
{
  "id": "8iq2urnegmrtezzx5qa3zy90w",
  "resource": "payment",
  "status": "authorized",
  "amount": 1000,
  "tax": 80,
  "customer": null,
  "payment_deadline": "2018-11-16T14:59:59Z",
  "payment_details": {
    "type": "konbini",
    "email": "test@example.com",
    "store": "lawson",
    "confirmation_code": "3769",
    "receipt": "WNT51790451",
    "instructions_url": "https://komoju.com/ja/instructions/8iq2urnegmrtezzx5qa3zy90w"
  },
  "payment_method_fee": 0,
  "total": 1080,
  "currency": "JPY",
  "description": null,
  "captured_at": null,
  "external_order_num": "123",
  "metadata": {
    "foobar": "hoge"
  },
  "created_at": "2018-11-13T06:20:21Z",
  "amount_refunded": 0,
  "locale": "ja",
  "refunds": [

  ],
  "refund_requests": [

  ]
}
{
  "id": "6nokevt8phsi8u17061tjgk92",
  "resource": "payment",
  "status": "captured",
  "amount": 1000,
  "tax": 80,
  "customer": null,
  "payment_deadline": "2018-11-20T06:20:21Z",
  "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-11-13T06:20:21Z",
  "external_order_num": "123",
  "metadata": {
    "foobar": "hoge"
  },
  "created_at": "2018-11-13T06:20:21Z",
  "amount_refunded": 0,
  "locale": "ja",
  "refunds": [

  ],
  "refund_requests": [

  ]
}
{
  "id": "c0gfz659e3qlk3i49x6taors4",
  "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-11-13T06:20:21Z",
  "external_order_num": "123",
  "metadata": {
    "foobar": "hoge"
  },
  "created_at": "2018-11-13T06:20:21Z",
  "amount_refunded": 0,
  "locale": "ja",
  "refunds": [

  ],
  "refund_requests": [

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

  ],
  "refund_requests": [

  ]
}
{
  "id": "9y41gy3yffuk8qyamqir5z7bn",
  "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-11-13T06:20:21Z",
  "external_order_num": "123",
  "metadata": {
    "foobar": "hoge"
  },
  "created_at": "2018-11-13T06:20:21Z",
  "amount_refunded": 0,
  "locale": "ja",
  "refunds": [

  ],
  "refund_requests": [

  ]
}
{
  "id": "b5jteviiy38ng7js5uebqprhn",
  "resource": "payment",
  "status": "captured",
  "amount": 1000,
  "tax": 80,
  "customer": null,
  "payment_deadline": "2018-11-20T06:20:21Z",
  "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-11-13T06:20:21Z",
  "external_order_num": "123",
  "metadata": {
    "foobar": "hoge"
  },
  "created_at": "2018-11-13T06:20:21Z",
  "amount_refunded": 0,
  "locale": "ja",
  "refunds": [

  ],
  "refund_requests": [

  ]
}
{
  "id": "1i3rilegwpnei2ef99mdcn303",
  "resource": "payment",
  "status": "captured",
  "amount": 1000,
  "tax": 80,
  "customer": null,
  "payment_deadline": "2018-11-20T14: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-11-13T06:20:21Z",
  "external_order_num": "123",
  "metadata": {
    "foobar": "hoge"
  },
  "created_at": "2018-11-13T06:20:21Z",
  "amount_refunded": 0,
  "locale": "ja",
  "refunds": [

  ],
  "refund_requests": [

  ]
}
{
  "id": "538rl207weidii7c2oa9ictxw",
  "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-11-13T06:20:21Z",
  "external_order_num": "123",
  "metadata": {
    "foobar": "hoge"
  },
  "created_at": "2018-11-13T06:20:21Z",
  "amount_refunded": 0,
  "locale": "ja",
  "refunds": [

  ],
  "refund_requests": [

  ]
}
{
  "id": "8iweaxszvquslnrzwtrpwa8ew",
  "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-11-13T06:20:21Z",
  "external_order_num": null,
  "metadata": {
  },
  "created_at": "2018-11-13T06:20:21Z",
  "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.