komoju 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6d08272600e72a92587e9444d1203dcf459cf6b1
4
- data.tar.gz: 7d5f27df41c681b20371734150c9150a091def85
3
+ metadata.gz: 9aa468573b03e3b7f7f434102e0ba9ed11e93318
4
+ data.tar.gz: 5f73f786782afdd5b8f4ed512b1b23210574fe44
5
5
  SHA512:
6
- metadata.gz: 2b236215d1fbd5a214e072063d9782a3dbde710385efe65c11e4738eef8ae5cb99a0800ef46e64a6ca9b9bb449c9ccadcd04fc88cb8cd7e08427d9be177a35ef
7
- data.tar.gz: 0cf4233ddd64bea3a088da00d9b37260e12cb2788ea1e7ec3a75aa8b7e6f55073a98602778b6df63f611f5412ce891b1af8519869f540fc9c03488cae2494027
6
+ metadata.gz: fdd1fd599ba411375fd4b35d51a604e73a49f9e63eed788decc11d5a0c91da80d80d15e5443c3bb6eea6821af4c47db44861ce4d05ab84fefa34ce741f6e2549
7
+ data.tar.gz: 780f7c6d7ecb35fa0a16b0f2928b516c6d83bce20027c4dddcc169fc3b32ca6740d287859cbe2499c4a3813f9fa7accfaad29ca16484a09e5426358ad2815756
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- komoju (0.0.3)
4
+ komoju (0.0.4)
5
5
  erubis (~> 2.0)
6
6
  excon
7
7
  moneta
@@ -3,7 +3,7 @@
3
3
  require 'bundler/setup'
4
4
  require 'heroics'
5
5
 
6
- schema_url = "https://komoju.com/api/v1/schema.json"
6
+ schema_url = "http://localhost:50130/api/v1/schema.json"
7
7
  schema = Heroics.download_schema(schema_url, {})
8
8
  endpoint_url = "https://komoju.com/api/v1"
9
9
 
@@ -118,7 +118,7 @@ module Komoju
118
118
  @subscriptions_resource ||= Subscriptions.new(@client)
119
119
  end
120
120
 
121
- # Subscription Customers
121
+ # Customers
122
122
  #
123
123
  # @return [Customers]
124
124
  def customers
@@ -284,15 +284,15 @@ module Komoju
284
284
  @client.subscriptions.create(body)
285
285
  end
286
286
 
287
- # Destroy a subscription
287
+ # Delete a subscription
288
288
  #
289
289
  # @param subscriptions_id: A unique identifier for a subscription.
290
- def destroy(subscriptions_id)
291
- @client.subscriptions.destroy(subscriptions_id)
290
+ def delete(subscriptions_id)
291
+ @client.subscriptions.delete(subscriptions_id)
292
292
  end
293
293
  end
294
294
 
295
- # Subscription Customers
295
+ # Customers
296
296
  class Customers
297
297
  def initialize(client)
298
298
  @client = client
@@ -327,11 +327,11 @@ module Komoju
327
327
  @client.customers.update(customers_id, body)
328
328
  end
329
329
 
330
- # Destroy a customer
330
+ # Delete a customer
331
331
  #
332
332
  # @param customers_id: A unique identifier for the customer.
333
- def destroy(customers_id)
334
- @client.customers.destroy(customers_id)
333
+ def delete(customers_id)
334
+ @client.customers.delete(customers_id)
335
335
  end
336
336
  end
337
337
 
@@ -368,6 +368,14 @@ module Komoju
368
368
  def preview(body)
369
369
  @client.invoices.preview(body)
370
370
  end
371
+
372
+ # Pay an invoice
373
+ #
374
+ # @param invoices_id: A unique identifier for the invoice.
375
+ # @param body: the object to pass as the request payload
376
+ def pay(invoices_id, body)
377
+ @client.invoices.pay(invoices_id, body)
378
+ end
371
379
  end
372
380
 
373
381
  # Subscription Invoice Items
@@ -379,8 +387,9 @@ module Komoju
379
387
  # List invoice items
380
388
  #
381
389
  # @param collection_options: additional collection options to pass with the request
382
- def list(collection_options = {})
383
- @client.invoice_items.list(collection_options)
390
+ # @param body: the object to pass as the request payload
391
+ def list(collection_options = {}, body)
392
+ @client.invoice_items.list(collection_options, body)
384
393
  end
385
394
 
386
395
  # Show an invoice item
@@ -432,11 +441,11 @@ module Komoju
432
441
  @client.plans.create(body)
433
442
  end
434
443
 
435
- # Destroy a plan
444
+ # Delete a plan
436
445
  #
437
446
  # @param plans_name: Name of the plan.
438
- def destroy(plans_name)
439
- @client.plans.destroy(plans_name)
447
+ def delete(plans_name)
448
+ @client.plans.delete(plans_name)
440
449
  end
441
450
  end
442
451
 
@@ -455,6 +464,2297 @@ module Komoju
455
464
  end
456
465
 
457
466
  SCHEMA = Heroics::Schema.new(MultiJson.load(<<-'HEROICS_SCHEMA'))
458
- {"$schema":"http://json-schema.org/draft-04/hyper-schema","definitions":{"list":{"type":["object"],"properties":{"resource":{"enum":["list"]},"total":{"type":["integer"]},"page":{"type":["integer"]},"per_page":{"type":["integer"]},"last_page":{"type":["integer"]},"data":{"oneOf":[{"type":["array"],"items":{"$ref":"#/definitions/payments"}},{"type":["array"],"items":{"$ref":"#/definitions/payouts"}},{"type":["array"],"items":{"$ref":"#/definitions/payouts/definitions/payout_item"}},{"type":["array"],"items":{"$ref":"#/definitions/events"}},{"type":["array"],"items":{"$ref":"#/definitions/tokens"}},{"type":["array"],"items":{"$ref":"#/definitions/customers"}},{"type":["array"],"items":{"$ref":"#/definitions/plans"}},{"type":["array"],"items":{"$ref":"#/definitions/subscriptions"}},{"type":["array"],"items":{"$ref":"#/definitions/invoices"}},{"type":["array"],"items":{"$ref":"#/definitions/invoice_items"}}]}}},"events":{"$schema":"http://json-schema.org/draft-04/hyper-schema","type":["object"],"definitions":{"id":{"example":"66a4824ac97cc7afff608f27c7","readOnly":true,"type":["string"],"description":"A unique identifier for an event."},"type":{"example":"payment.authorized","readOnly":true,"type":["string"]},"data":{"readOnly":true,"type":["object"],"description":"An object which creates an event"},"resource":{"example":"event","readOnly":true,"enum":["event"],"description":"Name of resource"},"created_at":{"example":"2015-03-06T06:52:35Z","format":"date-time","readOnly":true,"type":["string"],"description":"An ISO 8601 formatted timestamp of when the event was created."}},"links":[{"title":"List","description":"List events","href":"/events","method":"GET","rel":"instances","response_example":"events#index","targetSchema":{"$ref":"#/definitions/list/"}},{"title":"Show","description":"Show a event","href":"/events/{(%2Fdefinitions%2Fevents%2Fdefinitions%2Fid)}","method":"GET","rel":"self","response_example":"events#show","targetSchema":{"$ref":"#/definitions/events/"}}],"properties":{"id":{"$ref":"#/definitions/events/definitions/id"},"type":{"$ref":"#/definitions/events/definitions/type"},"resource":{"$ref":"#/definitions/events/definitions/resource"},"data":{"$ref":"#/definitions/events/definitions/data"},"created_at":{"$ref":"#/definitions/events/definitions/created_at"}},"description":"Event Resource","title":"Events"},"payments":{"$schema":"http://json-schema.org/draft-04/hyper-schema","type":["object"],"definitions":{"given_name":{"type":["string"]},"family_name":{"type":["string"]},"given_name_kana":{"type":["string"]},"family_name_kana":{"type":["string"]},"email":{"type":["string"],"format":"email"},"phone":{"type":["string"],"pattern":"\\A([() \\-_+]*[0-9]){10}[() \\-_+0-9]*\\Z"},"expiry_days":{"type":["integer"],"minimum":0,"maximum":59,"exclusiveMinimum":false,"exclusiveMaximum":false},"instructions_url":{"type":["string"],"format":"uri"},"external_order_num":{"type":["string"]},"bank_transfer_request":{"type":["object"],"properties":{"type":{"enum":["bank_transfer"]},"phone":{"$ref":"#/definitions/payments/definitions/phone"},"email":{"$ref":"#/definitions/payments/definitions/email"},"given_name":{"$ref":"#/definitions/payments/definitions/given_name"},"family_name":{"$ref":"#/definitions/payments/definitions/family_name"},"given_name_kana":{"$ref":"#/definitions/payments/definitions/given_name_kana"},"family_name_kana":{"$ref":"#/definitions/payments/definitions/family_name_kana"},"expiry_days":{"$ref":"#/definitions/payments/definitions/expiry_days"}},"required":["type","given_name","family_name","given_name_kana","family_name_kana","phone","email"]},"bank_transfer_response":{"type":["object"],"properties":{"type":{"enum":["bank_transfer"]},"email":{"$ref":"#/definitions/payments/definitions/email"},"order_id":{"type":["string"]},"bank_name":{"type":["string"]},"account_number":{"type":["integer"]},"account_type":{"type":["string"]},"account_name":{"type":["string"]}},"required":["type","email","order_id","bank_name","account_number","account_type","account_name"]},"konbini_request":{"type":["object"],"properties":{"type":{"enum":["konbini"]},"store":{"enum":["seven-eleven","lawson","family-mart","sunkus","circle-k","ministop","daily-yamazaki"]},"email":{"$ref":"#/definitions/payments/definitions/email"},"phone":{"$ref":"#/definitions/payments/definitions/phone"},"expiry_days":{"$ref":"#/definitions/payments/definitions/expiry_days"}},"required":["type","store","phone","email"]},"konbini_response":{"type":["object"],"properties":{"type":{"enum":["konbini"]},"store":{"enum":["seven-eleven","lawson","family-mart","sunkus","circle-k","ministop","daily-yamazaki"]},"instructions_url":{"$ref":"#/definitions/payments/definitions/instructions_url"},"confirmation_code":{"type":["string"]},"receipt":{"type":["string"]}},"required":["type","store","confirmation_code","receipt","instructions_url"]},"pay_easy_request":{"type":["object"],"properties":{"type":{"enum":["pay_easy"]},"email":{"$ref":"#/definitions/payments/definitions/email"},"given_name":{"$ref":"#/definitions/payments/definitions/given_name"},"family_name":{"$ref":"#/definitions/payments/definitions/family_name"},"given_name_kana":{"$ref":"#/definitions/payments/definitions/given_name_kana"},"family_name_kana":{"$ref":"#/definitions/payments/definitions/family_name_kana"},"instructions_url":{"$ref":"#/definitions/payments/definitions/instructions_url"},"phone":{"$ref":"#/definitions/payments/definitions/phone"},"expiry_days":{"$ref":"#/definitions/payments/definitions/expiry_days"}},"required":["type","given_name","family_name","given_name_kana","family_name_kana","email","phone"]},"pay_easy_response":{"type":["object"],"properties":{"type":{"enum":["pay_easy"]},"pay_url":{"type":["string"]},"instructions_url":{"$ref":"#/definitions/payments/definitions/instructions_url"}},"required":["type","pay_url","instructions_url"]},"web_money_request":{"type":["object"],"properties":{"type":{"enum":["web_money"]},"prepaid_number":{"type":["string"],"maxLength":16}},"required":["type","prepaid_number"]},"web_money_response":{"type":["object"],"properties":{"type":{"enum":["web_money"]},"short_amount":{"type":["integer"]}},"required":["type","short_amount"]},"credit_card_request":{"type":["object"],"properties":{"type":{"enum":["credit_card"]},"number":{"type":["string"]},"month":{"type":["integer"]},"year":{"type":["integer"]},"verification_value":{"type":["string"]},"given_name":{"$ref":"#/definitions/payments/definitions/given_name"},"family_name":{"$ref":"#/definitions/payments/definitions/family_name"},"last_four_digits":{"type":["string"]},"brand":{"enum":["visa","american_express","master","jcb"]}},"required":["type","number","month","year","given_name","family_name"]},"credit_card_response":{"type":["object"],"properties":{"type":{"enum":["credit_card"]},"month":{"type":["integer"]},"year":{"type":["integer"]},"last_four_digits":{"type":["string"]},"brand":{"enum":["visa","american_express","master","jcb"]}},"required":["type","brand","last_four_digits","month","year"]},"id":{"example":"94f128d4021b049bc616f5b1b0","readOnly":true,"type":["string"],"description":"A unique indentifier for the payment"},"resource":{"example":"payment","enum":["payment"],"description":"Value of `resource`."},"status":{"example":"pending","enum":["pending","authorized","captured","expired","cancelled","refunded"],"description":"The status of the payment."},"amount":{"example":"300","minimum":0,"type":["number"],"description":"The amount to be charged before tax. Must be equal or greater than 0. Use a ‘.’ as a decimal separator, and no thousands separator"},"tax":{"example":"30","type":["number","null"],"description":"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."},"payment_deadline":{"format":"date-time","example":"2015-03-09T06:52:34Z","type":["string","null"],"description":"Time when the payment will expire. This is a timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ."},"payment_method_fee":{"example":"0","type":["number"],"minimum":0,"description":"An additional fee added to specific payment types"},"total":{"example":"330","type":["number"],"description":"The payment total, this is the amount + tax + payment_method_fee"},"currency":{"example":"JPY","enum":["JPY","USD"],"description":"3 letter ISO currency code of the transaction"},"description":{"example":"","type":["string","null"],"description":"Description of the payment (used in e-mail receipts if enabled)."},"subscription":{"example":null,"type":["object","null"],"description":"Shown if payment was part of a subscription"},"captured_at":{"example":"2015-03-09T06:52:34Z","type":["string","null"],"description":"An ISO 8601 formatted timestamp of when a payment was captured"},"metadata":{"type":["object","null"],"example":{"order_id":"abcdefghijklmn"},"description":"A set of key-value pairs"},"payment_details_request":{"description":"A hash or token describing the payment method used to make the payment.","example":{"type":["konbini"],"store":"lawson","email":"foo@bar.com","phone":"08011111111"},"type":["string","object"],"properties":{"type":{"enum":["credit_card","bank_transfer","konbini","pay_easy","web_money"]}},"required":["type"]},"payment_details_response":{"description":"A hash or token describing the payment method used to make the payment.","example":{"type":["konbini"],"store":"lawson","confirmation_code":null,"receipt":"12345"},"oneOf":[{"type":["null"]},{"$ref":"#/definitions/payments/definitions/bank_transfer_response"},{"$ref":"#/definitions/payments/definitions/credit_card_response"},{"$ref":"#/definitions/payments/definitions/konbini_response"},{"$ref":"#/definitions/payments/definitions/pay_easy_response"},{"$ref":"#/definitions/payments/definitions/web_money_response"}]},"fraud_details":{"type":["object","null"],"properties":{"customer_ip":{"format":"ipv4","type":["string"]},"customer_email":{"format":"email","type":["string"]},"browser_language":{"type":["string"]},"browser_user_agent":{"type":["string"]}},"dependencies":{"customer_email":["customer_ip"],"browser_language":["customer_ip"],"browser_user_agent":["customer_ip"]},"additionalProperties":false},"created_at":{"example":"2015-03-06T06:52:35Z","format":"date-time","type":["string"],"description":"An ISO 8601 formatted timestamp of when a payment was created"}},"links":[{"title":"List","description":"List payments","href":"/payments","method":"GET","rel":"instances","response_example":"payments#index","targetSchema":{"$ref":"#/definitions/list/"}},{"title":"Show","description":"Show a payment","href":"/payments/{(%2Fdefinitions%2Fpayments%2Fdefinitions%2Fid)}","method":"GET","rel":"self","response_example":"payments#show","targetSchema":{"$ref":"#/definitions/payments/"}},{"title":"Create","description":"Create a payment","href":"/payments","method":"POST","rel":"create","response_example":"payments#create","targetSchema":{"$ref":"#/definitions/payments/"},"schema":{"type":["object"],"properties":{"amount":{"$ref":"#/definitions/payments/definitions/amount"},"tax":{"$ref":"#/definitions/payments/definitions/tax"},"currency":{"$ref":"#/definitions/payments/definitions/currency"},"external_order_num":{"$ref":"#/definitions/payments/definitions/external_order_num"},"metadata":{"$ref":"#/definitions/payments/definitions/metadata"},"payment_details":{"$ref":"#/definitions/payments/definitions/payment_details_request"},"fraud_details":{"$ref":"#/definitions/payments/definitions/fraud_details"}},"required":["amount","currency","payment_details"],"additionalProperties":false}},{"title":"Update","description":"Update a payment","href":"/payments/{(%2Fdefinitions%2Fpayments%2Fdefinitions%2Fid)}","method":"PATCH","rel":"self","response_example":"payments#update","targetSchema":{"$ref":"#/definitions/payments/"},"schema":{"type":["object"],"properties":{"description":{"$ref":"#/definitions/payments/definitions/description"},"metadata":{"$ref":"#/definitions/payments/definitions/metadata"},"payment_details":{"type":["object"],"properties":{"type":{"enum":["web_money"]}},"required":["type"]}},"additionalProperties":false}},{"title":"Refund","description":"Refund a payment","href":"/payments/{(%2Fdefinitions%2Fpayments%2Fdefinitions%2Fid)}/refund","method":"POST","rel":"self","response_example":"payments#refund","targetSchema":{"$ref":"#/definitions/payments/"},"schema":{"type":["object"],"properties":{"amount":{"$ref":"#/definitions/payments/definitions/amount"},"description":{"$ref":"#/definitions/payments/definitions/description"}}}},{"title":"Cancel","description":"Cancel a payment","href":"/payments/{(%2Fdefinitions%2Fpayments%2Fdefinitions%2Fid)}/cancel","method":"POST","rel":"self","response_example":"payments#cancel","targetSchema":{"$ref":"#/definitions/payments/"}}],"properties":{"id":{"$ref":"#/definitions/payments/definitions/id"},"resource":{"$ref":"#/definitions/payments/definitions/resource"},"status":{"$ref":"#/definitions/payments/definitions/status"},"amount":{"$ref":"#/definitions/payments/definitions/amount"},"tax":{"$ref":"#/definitions/payments/definitions/tax"},"payment_deadline":{"$ref":"#/definitions/payments/definitions/payment_deadline"},"payment_details":{"$ref":"#/definitions/payments/definitions/payment_details_response"},"payment_method_fee":{"$ref":"#/definitions/payments/definitions/payment_method_fee"},"total":{"$ref":"#/definitions/payments/definitions/total"},"currency":{"$ref":"#/definitions/payments/definitions/currency"},"description":{"$ref":"#/definitions/payments/definitions/description"},"subscription":{"$ref":"#/definitions/payments/definitions/subscription"},"captured_at":{"$ref":"#/definitions/payments/definitions/captured_at"},"metadata":{"$ref":"#/definitions/payments/definitions/metadata"},"created_at":{"$ref":"#/definitions/payments/definitions/created_at"},"refunds":{"type":["array"]}},"description":"Payment resource","title":"Payments"},"payouts":{"$schema":"http://json-schema.org/draft-04/hyper-schema","type":["object"],"definitions":{"id":{"example":"66a4824ac97cc7afff608f27c7","readOnly":true,"type":["string"],"description":"A unique identifier for a payout."},"resource":{"example":"event","readOnly":true,"enum":["payout"],"description":"Name of resource"},"payout_item":{"readOnly":true,"type":["object"],"properties":{"resource":{"example":"payout_item","readOnly":true,"enum":["payout_item"],"description":"Name of resource."},"event_type":{"example":"capture","readOnly":true,"enum":["capture","refund"],"description":"Describes whether the payout item is from a captured or refunded payment."},"timestamp":{"example":"2015-03-06T06:52:35Z","readOnly":true,"format":"date-time","description":"Timestamp describing when the payment was either captured or refunded."},"payment_method":{"example":"visa","readOnly":true,"enum":["visa","master_card","american_express","jcb","bank_transfer","web_money","lawson","family-mart","sunkus","circle-k","ministop","daily-yamazaki","seven-eleven"],"description":"The payment method of the payment."},"payment_fee":{"example":"300","type":["number"],"description":"Komoju platform fee deducted from the payment total."},"receivable":{"example":"300","type":["number"],"description":"The amount paid to your account for a given payment."},"amount":{"$ref":"#/definitions/payments/definitions/amount"},"tax":{"$ref":"#/definitions/payments/definitions/tax"},"total":{"$ref":"#/definitions/payments/definitions/total"}},"description":"Payout Item Resource"},"created_at":{"example":"2015-03-06T06:52:35Z","format":"date-time","readOnly":true,"type":["string"],"description":"An ISO 8601 formatted timestamp of when the payout was created."}},"links":[{"title":"List","description":"List payouts","href":"/payouts","method":"GET","rel":"instances","response_example":"payouts#index","targetSchema":{"$ref":"#/definitions/list/"}},{"title":"Show","description":"Show a payout","href":"/payouts/{(%2Fdefinitions%2Fpayouts%2Fdefinitions%2Fid)}","method":"GET","rel":"self","response_example":"payouts#show","targetSchema":{"$ref":"#/definitions/payouts/"}},{"title":"Payout Items","description":"List payout items","href":"/payouts/{(%2Fdefinitions%2Fpayouts%2Fdefinitions%2Fid)}/payout_items","method":"GET","rel":"instances","response_example":"payouts#payout_items","targetSchema":{"$ref":"#/definitions/list/"}}],"properties":{"id":{"$ref":"#/definitions/payouts/definitions/id"},"resource":{"$ref":"#/definitions/payouts/definitions/resource"},"payout_items":{"$ref":"#/definitions/list/"},"created_at":{"$ref":"#/definitions/payouts/definitions/created_at"}},"description":"Payout Resource","title":"Payouts"},"subscriptions":{"$schema":"http://json-schema.org/draft-04/hyper-schema","type":["object"],"definitions":{"id":{"example":"66a4824ac97cc7afff608f27c7","readOnly":true,"type":["string"],"description":"A unique identifier for a subscription."},"resource":{"example":"subscription","readOnly":true,"enum":["subscription"],"description":"Name of resource"},"status":{"example":"pending","readOnly":true,"enum":["cancelled","pending","active","past_due"],"description":"The status of the subscription."},"plan":{"$ref":"#/definitions/plans"},"customer":{"$ref":"#/definitions/customers"},"current_period_end_at":{"example":null,"format":"date-time","readOnly":true,"type":["string","null"],"description":"An ISO 8601 formatted timestamp of when the subscription will next be billed."},"cancel_at_period_end":{"type":["boolean"]},"metadata":{"$ref":"#/definitions/payments/definitions/metadata"},"created_at":{"example":"2015-03-06T06:52:35Z","format":"date-time","readOnly":true,"type":["string"],"description":"An ISO 8601 formatted timestamp of when the plan was created."}},"links":[{"title":"List","description":"List subscriptions","href":"/subscriptions","method":"GET","rel":"instances","response_example":"subscriptions#index","targetSchema":{"$ref":"#/definitions/list/"}},{"title":"Show","description":"Show a subscription","href":"/subscriptions/{(%2Fdefinitions%2Fsubscriptions%2Fdefinitions%2Fid)}","method":"GET","rel":"self","response_example":"subscriptions#show","targetSchema":{"$ref":"#/definitions/subscriptions/"}},{"title":"Create","description":"Create a subscription","href":"/subscriptions","method":"POST","rel":"create","response_example":"subscriptions#create","targetSchema":{"$ref":"#/definitions/subscriptions/"},"schema":{"type":["object"],"properties":{"customer":{"type":["string"]},"plan":{"type":["string"]},"metadata":{"$ref":"#/definitions/subscriptions/definitions/metadata"}},"required":["customer","plan"]}},{"title":"Destroy","description":"Destroy a subscription","href":"/subscriptions/{(%2Fdefinitions%2Fsubscriptions%2Fdefinitions%2Fid)}","method":"DELETE","rel":"destroy","response_example":"subscriptions#destroy","targetSchema":{"$ref":"#/definitions/subscriptions/"}}],"properties":{"id":{"$ref":"#/definitions/subscriptions/definitions/id"},"resource":{"$ref":"#/definitions/subscriptions/definitions/resource"},"status":{"$ref":"#/definitions/subscriptions/definitions/status"},"plan":{"$ref":"#/definitions/subscriptions/definitions/plan"},"customer":{"$ref":"#/definitions/subscriptions/definitions/customer"},"current_period_end_at":{"$ref":"#/definitions/subscriptions/definitions/current_period_end_at"},"metadata":{"$ref":"#/definitions/subscriptions/definitions/metadata"},"created_at":{"$ref":"#/definitions/subscriptions/definitions/created_at"}},"description":"Subscription Resource","title":"Subscriptions"},"customers":{"$schema":"http://json-schema.org/draft-04/hyper-schema","type":["object"],"definitions":{"id":{"example":"fa799fca14be29d3fae455f22d","readOnly":true,"type":["string"],"description":"A unique identifier for the customer."},"resource":{"example":"customer","readOnly":true,"enum":["customer"],"description":"Name of resource"},"payment_details":{"$ref":"#/definitions/payments/definitions/payment_details_response"},"metadata":{"$ref":"#/definitions/payments/definitions/metadata"},"email":{"type":["string","null"],"format":"email","description":"Customer's email address."},"created_at":{"example":"2015-03-06T06:52:35Z","format":"date-time","readOnly":true,"type":["string"],"description":"An ISO 8601 formatted timestamp of when the customer was created."}},"links":[{"title":"List","description":"List customers","href":"/customers","method":"GET","rel":"instances","response_example":"customers#index","targetSchema":{"$ref":"#/definitions/list/"}},{"title":"Show","description":"Show a customer","href":"/customers/{(%2Fdefinitions%2Fcustomers%2Fdefinitions%2Fid)}","method":"GET","rel":"self","response_example":"customers#show","targetSchema":{"$ref":"#/definitions/customers/"}},{"title":"Create","description":"Create a customer","href":"/customers","method":"POST","rel":"create","response_example":"customers#create","targetSchema":{"$ref":"#/definitions/customers/"},"schema":{"type":["object"],"properties":{"payment_details":{"$ref":"#/definitions/payments/definitions/payment_details_request"},"currency":{"$ref":"#/definitions/payments/definitions/currency"},"email":{"$ref":"#/definitions/customers/definitions/email"},"metadata":{"$ref":"#/definitions/customers/definitions/metadata"}},"required":["currency","payment_details"],"additionalFields":false}},{"title":"Update","description":"Update customers","href":"/customers/{(%2Fdefinitions%2Fcustomers%2Fdefinitions%2Fid)}","method":"PATCH","rel":"self","response_example":"customers#update","schema":{"type":["object"],"properties":{"payment_details":{"$ref":"#/definitions/payments/definitions/payment_details_request"},"currency":{"$ref":"#/definitions/payments/definitions/currency"},"email":{"$ref":"#/definitions/customers/definitions/email"},"metadata":{"$ref":"#/definitions/customers/definitions/metadata"}},"required":["payment_details"],"additionalFields":false},"targetSchema":{"$ref":"#/definitions/customers/"}},{"title":"Destroy","description":"Destroy a customer","href":"/customers/{(%2Fdefinitions%2Fcustomers%2Fdefinitions%2Fid)}","method":"DELETE","rel":"destroy","response_example":"customers#destroy","targetSchema":{"$ref":"#/definitions/customers/"}}],"properties":{"id":{"$ref":"#/definitions/customers/definitions/id"},"resource":{"$ref":"#/definitions/customers/definitions/resource"},"email":{"$ref":"#/definitions/customers/definitions/email"},"metadata":{"$ref":"#/definitions/customers/definitions/metadata"},"created_at":{"$ref":"#/definitions/customers/definitions/created_at"}},"description":"Subscription Customers","title":"Customers"},"invoices":{"$schema":"http://json-schema.org/draft-04/hyper-schema","type":["object"],"definitions":{"id":{"example":"66a4824ac97cc7afff608f27c7","readOnly":true,"type":["string"],"description":"A unique identifier for the invoice."},"resource":{"example":"invoice","readOnly":true,"enum":["invoice"],"description":"Name of resource."},"invoice":{"readOnly":true,"type":["string","null"]},"paid":{"readOnly":true,"type":["boolean"]},"created_at":{"readOnly":true,"format":"date-time","type":["string","null"],"description":"An ISO 8601 formatted timestamp of when the invoice was created."}},"links":[{"title":"List","description":"List invoices","href":"/invoices","method":"GET","rel":"instances","response_example":"invoices#index","targetSchema":{"$ref":"#/definitions/list/"}},{"title":"Show","description":"Show an invoice","href":"/invoices/{(%2Fdefinitions%2Finvoices%2Fdefinitions%2Fid)}","method":"GET","rel":"self","response_example":"invoices#show","targetSchema":{"$ref":"#/definitions/invoices/"}},{"title":"Create","description":"Create an invoice","href":"/invoices","method":"POST","rel":"create","response_example":"invoices#create","targetSchema":{"$ref":"#/definitions/invoices/"},"schema":{"type":["object"],"properties":{"customer":{"$ref":"#/definitions/customers/definitions/id"},"metadata":{"$ref":"#/definitions/subscriptions/definitions/metadata"}},"required":["customer"]}},{"title":"Preview","description":"Preview an upcoming invoice","href":"/invoices/preview","method":"GET","rel":"self","response_example":"invoices#preview","targetSchema":{"$ref":"#/definitions/invoices/"},"schema":{"type":["object"],"properties":{"subscription":{"$ref":"#/definitions/invoices/properties/subscription"}},"required":["subscription"]}}],"properties":{"id":{"$ref":"#/definitions/payments/definitions/id"},"resource":{"$ref":"#/definitions/invoices/definitions/resource"},"subscription":{"$ref":"#/definitions/subscriptions/definitions/id"},"paid":{"$ref":"#/definitions/invoices/definitions/paid"},"invoice_items":{"$ref":"#/definitions/list/"},"total":{"$ref":"#/definitions/payments/definitions/total"},"currency":{"$ref":"#/definitions/payments/definitions/currency"},"created_at":{"$ref":"#/definitions/invoices/definitions/created_at"}},"description":"Subscription Invoice","title":"Invoices"},"invoice_items":{"$schema":"http://json-schema.org/draft-04/hyper-schema","type":["object"],"definitions":{"id":{"example":"66a4824ac97cc7afff608f27c7","readOnly":true,"type":["string"],"description":"A unique identifier for the invoice items."},"resource":{"example":"invoice_item","readOnly":true,"enum":["invoice_item"],"description":"Name of resource"},"type":{"example":"invoice_item","readOnly":true,"enum":["invoice_item","plan"]},"plan":{"oneOf":[{"$ref":"#/definitions/plans/"},{"type":["null"]}]},"invoice":{"readOnly":true,"type":["string","null"]}},"links":[{"title":"List","description":"List invoice items","href":"/invoice_items","method":"GET","rel":"instances","response_example":"invoice_items#index","targetSchema":{"$ref":"#/definitions/list/"}},{"title":"Show","description":"Show an invoice item","href":"/invoice_items/{(%2Fdefinitions%2Finvoice_items%2Fdefinitions%2Fid)}","method":"GET","rel":"self","response_example":"invoice_items#show","targetSchema":{"$ref":"#/definitions/invoice_items/"}},{"title":"Create","description":"Create an invoice item","href":"/invoice_items","method":"POST","rel":"create","response_example":"invoice_items#create","targetSchema":{"$ref":"#/definitions/invoice_items/"},"schema":{"type":["object"],"properties":{"amount":{"$ref":"#/definitions/invoice_items/properties/amount"},"currency":{"$ref":"#/definitions/invoice_items/properties/currency"},"customer":{"$ref":"#/definitions/invoice_items/properties/customer"},"metadata":{"$ref":"#/definitions/invoice_items/properties/metadata"}},"required":["amount","currency","customer"]}},{"title":"Destroy","description":"Deletes an invoice item from the upcoming invoice.","href":"/invoice_items/{(%2Fdefinitions%2Finvoice_items%2Fdefinitions%2Fid)}","method":"DELETE","rel":"destroy","response_example":"invoice_items#destroy","targetSchema":{"$ref":"#/definitions/invoice_items/"}}],"properties":{"id":{"$ref":"#/definitions/payments/definitions/id"},"resource":{"$ref":"#/definitions/invoice_items/definitions/resource"},"type":{"$ref":"#/definitions/invoice_items/definitions/type"},"amount":{"$ref":"#/definitions/payments/definitions/amount"},"currency":{"$ref":"#/definitions/payments/definitions/currency"},"customer":{"$ref":"#/definitions/customers/definitions/id"},"invoice":{"$ref":"#/definitions/invoice_items/definitions/invoice"},"plan":{"$ref":"#/definitions/invoice_items/definitions/plan"},"metadata":{"$ref":"#/definitions/payments/definitions/metadata"}},"required":["id","resource","type","amount","customer","currency","invoice","metadata","plan"],"description":"Subscription Invoice Items","title":"Invoice Items"},"plans":{"$schema":"http://json-schema.org/draft-04/hyper-schema","type":["object"],"definitions":{"name":{"example":"name2","type":["string"],"description":"Name of the plan."},"resource":{"example":"plan","enum":["plan"],"description":"Name of resource"},"interval":{"example":"month","enum":["day","week","month","year"],"description":"The billing frequency of a subscription."},"interval_count":{"example":"1","type":["integer"],"minimum":1,"description":"The number of intervals before the end of each billing period. For example, `interval=month` and `interval_count=3` would bill every 3 months."},"amount":{"$ref":"#/definitions/payments/definitions/amount"},"tax_percent":{"type":["integer","null"]},"currency":{"$ref":"#/definitions/payments/definitions/currency"},"metadata":{"$ref":"#/definitions/payments/definitions/metadata"},"renewal_notice_days":{"example":1,"type":["integer"],"minimum":0},"created_at":{"example":"2015-03-06T06:52:35Z","format":"date-time","readOnly":true,"type":["string"],"description":"An ISO 8601 formatted timestamp of when the plan was created."}},"links":[{"title":"List","description":"List plans","href":"/plans","method":"GET","rel":"instances","response_example":"plans#index","targetSchema":{"$ref":"#/definitions/list/"}},{"title":"Show","description":"Show a plan","href":"/plans/{(%2Fdefinitions%2Fplans%2Fdefinitions%2Fname)}","method":"GET","rel":"self","response_example":"plans#show","targetSchema":{"$ref":"#/definitions/plans/"}},{"title":"Create","description":"Create a plan","href":"/plans","method":"POST","rel":"create","response_example":"plans#create","targetSchema":{"$ref":"#/definitions/plans/"},"schema":{"type":["object"],"properties":{"name":{"$ref":"#/definitions/plans/definitions/name"},"interval":{"$ref":"#/definitions/plans/definitions/interval"},"interval_count":{"$ref":"#/definitions/plans/definitions/interval_count"},"amount":{"$ref":"#/definitions/plans/definitions/amount"},"tax_percent":{"$ref":"#/definitions/plans/definitions/tax_percent"},"currency":{"$ref":"#/definitions/plans/definitions/currency"},"renewal_notice_days":{"$ref":"#/definitions/plans/definitions/renewal_notice_days"},"metadata":{"$ref":"#/definitions/plans/definitions/metadata"}},"required":["name","interval","amount","currency"]}},{"title":"Destroy","description":"Destroy a plan","href":"/plans/{(%2Fdefinitions%2Fplans%2Fdefinitions%2Fname)}","method":"DELETE","rel":"destroy","response_example":"plans#destroy","targetSchema":{"$ref":"#/definitions/plans/"}}],"properties":{"resource":{"$ref":"#/definitions/plans/definitions/resource"},"name":{"$ref":"#/definitions/plans/definitions/name"},"interval":{"$ref":"#/definitions/plans/definitions/interval"},"interval_count":{"$ref":"#/definitions/plans/definitions/interval_count"},"currency":{"$ref":"#/definitions/plans/definitions/currency"},"amount":{"$ref":"#/definitions/plans/definitions/amount"},"tax_percent":{"$ref":"#/definitions/plans/definitions/tax_percent"},"renewal_notice_days":{"$ref":"#/definitions/plans/definitions/renewal_notice_days"},"metadata":{"$ref":"#/definitions/plans/definitions/metadata"},"created_at":{"$ref":"#/definitions/plans/definitions/created_at"}},"description":"Subscription Plans","title":"Plans"},"tokens":{"$schema":"http://json-schema.org/draft-04/hyper-schema","type":["object"],"definitions":{"id":{"example":"tok_ed4119a0f69bc365286d5a9a8777f33cee024f19d532454e6abffccc42cf1452b6ad214de6b8e876cabc60ae6f","readOnly":true,"type":["string"],"description":"A unique identifier for the token."},"resource":{"example":"token","enum":["token"],"description":"Name of resource"},"payment_details":{"$ref":"#/definitions/payments/definitions/payment_details_response"},"created_at":{"example":"2015-03-06T06:52:35Z","format":"date-time","type":["string"],"description":"An ISO 8601 formatted timestamp of when the token was created."}},"links":[{"title":"Create","description":"Create a token","href":"/tokens","method":"POST","rel":"create","response_example":"tokens#create","targetSchema":{"$ref":"#/definitions/list/"},"schema":{"type":["object"],"properties":{"payment_details":{"$ref":"#/definitions/payments/definitions/payment_details_request"}},"required":["payment_details"],"additionalFields":false}}],"properties":{"id":{"$ref":"#/definitions/tokens/definitions/id"},"resource":{"$ref":"#/definitions/tokens/definitions/resource"},"created_at":{"$ref":"#/definitions/tokens/definitions/created_at"}},"description":"Token resource","title":"Tokens"}},"properties":{"events":{"$ref":"#/definitions/events"},"payments":{"$ref":"#/definitions/payments"},"payouts":{"$ref":"#/definitions/payouts"},"subscriptions":{"$ref":"#/definitions/subscriptions"},"customers":{"$ref":"#/definitions/customers"},"invoices":{"$ref":"#/definitions/invoices"},"invoice_items":{"$ref":"#/definitions/invoice_items"},"plans":{"$ref":"#/definitions/plans"},"tokens":{"$ref":"#/definitions/tokens"}},"type":["object"],"id":"komoju","links":[{"href":"https://komoju.com/api/v1","rel":"self"}],"description":"Komoju API auto-generated JSON Schema","title":"Komoju API"}
467
+ {
468
+ "$schema": "http://json-schema.org/draft-04/hyper-schema",
469
+ "definitions": {
470
+ "list": {
471
+ "type": [
472
+ "object"
473
+ ],
474
+ "properties": {
475
+ "resource": {
476
+ "enum": [
477
+ "list"
478
+ ]
479
+ },
480
+ "total": {
481
+ "type": [
482
+ "integer"
483
+ ]
484
+ },
485
+ "page": {
486
+ "type": [
487
+ "integer"
488
+ ]
489
+ },
490
+ "per_page": {
491
+ "type": [
492
+ "integer"
493
+ ]
494
+ },
495
+ "last_page": {
496
+ "type": [
497
+ "integer"
498
+ ]
499
+ },
500
+ "data": {
501
+ "oneOf": [
502
+ {
503
+ "type": [
504
+ "array"
505
+ ],
506
+ "items": {
507
+ "$ref": "#/definitions/payments"
508
+ }
509
+ },
510
+ {
511
+ "type": [
512
+ "array"
513
+ ],
514
+ "items": {
515
+ "$ref": "#/definitions/payouts"
516
+ }
517
+ },
518
+ {
519
+ "type": [
520
+ "array"
521
+ ],
522
+ "items": {
523
+ "$ref": "#/definitions/payouts/definitions/payout_item"
524
+ }
525
+ },
526
+ {
527
+ "type": [
528
+ "array"
529
+ ],
530
+ "items": {
531
+ "$ref": "#/definitions/events"
532
+ }
533
+ },
534
+ {
535
+ "type": [
536
+ "array"
537
+ ],
538
+ "items": {
539
+ "$ref": "#/definitions/tokens"
540
+ }
541
+ },
542
+ {
543
+ "type": [
544
+ "array"
545
+ ],
546
+ "items": {
547
+ "$ref": "#/definitions/customers"
548
+ }
549
+ },
550
+ {
551
+ "type": [
552
+ "array"
553
+ ],
554
+ "items": {
555
+ "$ref": "#/definitions/plans"
556
+ }
557
+ },
558
+ {
559
+ "type": [
560
+ "array"
561
+ ],
562
+ "items": {
563
+ "$ref": "#/definitions/subscriptions"
564
+ }
565
+ },
566
+ {
567
+ "type": [
568
+ "array"
569
+ ],
570
+ "items": {
571
+ "$ref": "#/definitions/invoices"
572
+ }
573
+ },
574
+ {
575
+ "type": [
576
+ "array"
577
+ ],
578
+ "items": {
579
+ "$ref": "#/definitions/invoice_items"
580
+ }
581
+ }
582
+ ]
583
+ }
584
+ }
585
+ },
586
+ "events": {
587
+ "$schema": "http://json-schema.org/draft-04/hyper-schema",
588
+ "type": [
589
+ "object"
590
+ ],
591
+ "definitions": {
592
+ "id": {
593
+ "example": "66a4824ac97cc7afff608f27c7",
594
+ "readOnly": true,
595
+ "type": [
596
+ "string"
597
+ ],
598
+ "description": "A unique identifier for an event."
599
+ },
600
+ "type": {
601
+ "example": "payment.authorized",
602
+ "readOnly": true,
603
+ "type": [
604
+ "string"
605
+ ]
606
+ },
607
+ "data": {
608
+ "readOnly": true,
609
+ "type": [
610
+ "object"
611
+ ],
612
+ "description": "An object which creates an event"
613
+ },
614
+ "resource": {
615
+ "example": "event",
616
+ "readOnly": true,
617
+ "enum": [
618
+ "event"
619
+ ],
620
+ "description": "Name of resource"
621
+ },
622
+ "created_at": {
623
+ "example": "2015-03-06T06:52:35Z",
624
+ "format": "date-time",
625
+ "readOnly": true,
626
+ "type": [
627
+ "string"
628
+ ],
629
+ "description": "An ISO 8601 formatted timestamp of when the event was created."
630
+ }
631
+ },
632
+ "links": [
633
+ {
634
+ "title": "List",
635
+ "description": "List events",
636
+ "href": "/events",
637
+ "method": "GET",
638
+ "rel": "instances",
639
+ "response_example": "events#index",
640
+ "targetSchema": {
641
+ "$ref": "#/definitions/list/"
642
+ }
643
+ },
644
+ {
645
+ "title": "Show",
646
+ "description": "Show a event",
647
+ "href": "/events/{(%2Fdefinitions%2Fevents%2Fdefinitions%2Fid)}",
648
+ "method": "GET",
649
+ "rel": "self",
650
+ "response_example": "events#show",
651
+ "targetSchema": {
652
+ "$ref": "#/definitions/events/"
653
+ }
654
+ }
655
+ ],
656
+ "properties": {
657
+ "id": {
658
+ "$ref": "#/definitions/events/definitions/id"
659
+ },
660
+ "type": {
661
+ "$ref": "#/definitions/events/definitions/type"
662
+ },
663
+ "resource": {
664
+ "$ref": "#/definitions/events/definitions/resource"
665
+ },
666
+ "data": {
667
+ "$ref": "#/definitions/events/definitions/data"
668
+ },
669
+ "created_at": {
670
+ "$ref": "#/definitions/events/definitions/created_at"
671
+ }
672
+ },
673
+ "description": "Event Resource",
674
+ "title": "Events"
675
+ },
676
+ "payments": {
677
+ "$schema": "http://json-schema.org/draft-04/hyper-schema",
678
+ "type": [
679
+ "object"
680
+ ],
681
+ "definitions": {
682
+ "given_name": {
683
+ "type": [
684
+ "string"
685
+ ]
686
+ },
687
+ "family_name": {
688
+ "type": [
689
+ "string"
690
+ ]
691
+ },
692
+ "given_name_kana": {
693
+ "type": [
694
+ "string"
695
+ ]
696
+ },
697
+ "family_name_kana": {
698
+ "type": [
699
+ "string"
700
+ ]
701
+ },
702
+ "email": {
703
+ "type": [
704
+ "string"
705
+ ],
706
+ "format": "email"
707
+ },
708
+ "phone": {
709
+ "type": [
710
+ "string"
711
+ ],
712
+ "pattern": "\\A([() \\-_+]*[0-9]){10}[() \\-_+0-9]*\\Z"
713
+ },
714
+ "customer": {
715
+ "type": [
716
+ "string"
717
+ ],
718
+ "description": "The ID of an existing customer in which to provide payment details for the payment."
719
+ },
720
+ "expiry_days": {
721
+ "type": [
722
+ "integer"
723
+ ],
724
+ "minimum": 0,
725
+ "maximum": 59,
726
+ "exclusiveMinimum": false,
727
+ "exclusiveMaximum": false
728
+ },
729
+ "instructions_url": {
730
+ "type": [
731
+ "string"
732
+ ],
733
+ "format": "uri"
734
+ },
735
+ "external_order_num": {
736
+ "type": [
737
+ "string"
738
+ ]
739
+ },
740
+ "bank_transfer_request": {
741
+ "type": [
742
+ "object"
743
+ ],
744
+ "properties": {
745
+ "type": {
746
+ "enum": [
747
+ "bank_transfer"
748
+ ]
749
+ },
750
+ "phone": {
751
+ "$ref": "#/definitions/payments/definitions/phone"
752
+ },
753
+ "email": {
754
+ "$ref": "#/definitions/payments/definitions/email"
755
+ },
756
+ "given_name": {
757
+ "$ref": "#/definitions/payments/definitions/given_name"
758
+ },
759
+ "family_name": {
760
+ "$ref": "#/definitions/payments/definitions/family_name"
761
+ },
762
+ "given_name_kana": {
763
+ "$ref": "#/definitions/payments/definitions/given_name_kana"
764
+ },
765
+ "family_name_kana": {
766
+ "$ref": "#/definitions/payments/definitions/family_name_kana"
767
+ },
768
+ "expiry_days": {
769
+ "$ref": "#/definitions/payments/definitions/expiry_days"
770
+ }
771
+ },
772
+ "required": [
773
+ "type",
774
+ "given_name",
775
+ "family_name",
776
+ "given_name_kana",
777
+ "family_name_kana",
778
+ "phone",
779
+ "email"
780
+ ]
781
+ },
782
+ "bank_transfer_response": {
783
+ "type": [
784
+ "object"
785
+ ],
786
+ "properties": {
787
+ "type": {
788
+ "enum": [
789
+ "bank_transfer"
790
+ ]
791
+ },
792
+ "email": {
793
+ "$ref": "#/definitions/payments/definitions/email"
794
+ },
795
+ "order_id": {
796
+ "type": [
797
+ "string"
798
+ ]
799
+ },
800
+ "bank_name": {
801
+ "type": [
802
+ "string"
803
+ ]
804
+ },
805
+ "account_number": {
806
+ "type": [
807
+ "integer"
808
+ ]
809
+ },
810
+ "account_type": {
811
+ "type": [
812
+ "string"
813
+ ]
814
+ },
815
+ "account_name": {
816
+ "type": [
817
+ "string"
818
+ ]
819
+ },
820
+ "instructions_url": {
821
+ "$ref": "#/definitions/payments/definitions/instructions_url"
822
+ }
823
+ },
824
+ "required": [
825
+ "type",
826
+ "email",
827
+ "order_id",
828
+ "bank_name",
829
+ "account_number",
830
+ "account_type",
831
+ "account_name",
832
+ "instructions_url"
833
+ ]
834
+ },
835
+ "konbini_request": {
836
+ "type": [
837
+ "object"
838
+ ],
839
+ "properties": {
840
+ "type": {
841
+ "enum": [
842
+ "konbini"
843
+ ]
844
+ },
845
+ "store": {
846
+ "enum": [
847
+ "seven-eleven",
848
+ "lawson",
849
+ "family-mart",
850
+ "sunkus",
851
+ "circle-k",
852
+ "ministop",
853
+ "daily-yamazaki"
854
+ ]
855
+ },
856
+ "email": {
857
+ "$ref": "#/definitions/payments/definitions/email"
858
+ },
859
+ "phone": {
860
+ "$ref": "#/definitions/payments/definitions/phone"
861
+ },
862
+ "expiry_days": {
863
+ "$ref": "#/definitions/payments/definitions/expiry_days"
864
+ }
865
+ },
866
+ "required": [
867
+ "type",
868
+ "store",
869
+ "phone",
870
+ "email"
871
+ ]
872
+ },
873
+ "konbini_response": {
874
+ "type": [
875
+ "object"
876
+ ],
877
+ "properties": {
878
+ "type": {
879
+ "enum": [
880
+ "konbini"
881
+ ]
882
+ },
883
+ "store": {
884
+ "enum": [
885
+ "seven-eleven",
886
+ "lawson",
887
+ "family-mart",
888
+ "sunkus",
889
+ "circle-k",
890
+ "ministop",
891
+ "daily-yamazaki"
892
+ ]
893
+ },
894
+ "instructions_url": {
895
+ "$ref": "#/definitions/payments/definitions/instructions_url"
896
+ },
897
+ "confirmation_code": {
898
+ "type": [
899
+ "string"
900
+ ]
901
+ },
902
+ "receipt": {
903
+ "type": [
904
+ "string"
905
+ ]
906
+ }
907
+ },
908
+ "required": [
909
+ "type",
910
+ "store",
911
+ "confirmation_code",
912
+ "receipt",
913
+ "instructions_url"
914
+ ]
915
+ },
916
+ "pay_easy_request": {
917
+ "type": [
918
+ "object"
919
+ ],
920
+ "properties": {
921
+ "type": {
922
+ "enum": [
923
+ "pay_easy"
924
+ ]
925
+ },
926
+ "email": {
927
+ "$ref": "#/definitions/payments/definitions/email"
928
+ },
929
+ "given_name": {
930
+ "$ref": "#/definitions/payments/definitions/given_name"
931
+ },
932
+ "family_name": {
933
+ "$ref": "#/definitions/payments/definitions/family_name"
934
+ },
935
+ "given_name_kana": {
936
+ "$ref": "#/definitions/payments/definitions/given_name_kana"
937
+ },
938
+ "family_name_kana": {
939
+ "$ref": "#/definitions/payments/definitions/family_name_kana"
940
+ },
941
+ "phone": {
942
+ "$ref": "#/definitions/payments/definitions/phone"
943
+ },
944
+ "expiry_days": {
945
+ "$ref": "#/definitions/payments/definitions/expiry_days"
946
+ }
947
+ },
948
+ "required": [
949
+ "type",
950
+ "given_name",
951
+ "family_name",
952
+ "given_name_kana",
953
+ "family_name_kana",
954
+ "email",
955
+ "phone"
956
+ ]
957
+ },
958
+ "pay_easy_response": {
959
+ "type": [
960
+ "object"
961
+ ],
962
+ "properties": {
963
+ "type": {
964
+ "enum": [
965
+ "pay_easy"
966
+ ]
967
+ },
968
+ "email": {
969
+ "$ref": "#/definitions/payments/definitions/email"
970
+ },
971
+ "bank_id": {
972
+ "type": [
973
+ "string"
974
+ ]
975
+ },
976
+ "customer_id": {
977
+ "type": [
978
+ "string"
979
+ ]
980
+ },
981
+ "confirmation_id": {
982
+ "type": [
983
+ "string"
984
+ ]
985
+ },
986
+ "instructions_url": {
987
+ "$ref": "#/definitions/payments/definitions/instructions_url"
988
+ }
989
+ },
990
+ "required": [
991
+ "type",
992
+ "bank_id",
993
+ "customer_id",
994
+ "confirmation_id",
995
+ "instructions_url"
996
+ ]
997
+ },
998
+ "web_money_request": {
999
+ "type": [
1000
+ "object"
1001
+ ],
1002
+ "properties": {
1003
+ "type": {
1004
+ "enum": [
1005
+ "web_money"
1006
+ ]
1007
+ },
1008
+ "prepaid_number": {
1009
+ "type": [
1010
+ "string"
1011
+ ],
1012
+ "maxLength": 16,
1013
+ "minLength": 16
1014
+ }
1015
+ },
1016
+ "required": [
1017
+ "type",
1018
+ "prepaid_number"
1019
+ ]
1020
+ },
1021
+ "web_money_response": {
1022
+ "type": [
1023
+ "object"
1024
+ ],
1025
+ "properties": {
1026
+ "type": {
1027
+ "enum": [
1028
+ "web_money"
1029
+ ]
1030
+ },
1031
+ "email": {
1032
+ "type": [
1033
+ "string",
1034
+ "null"
1035
+ ],
1036
+ "format": "email"
1037
+ },
1038
+ "short_amount": {
1039
+ "type": [
1040
+ "integer"
1041
+ ]
1042
+ },
1043
+ "prepaid_cards": {
1044
+ "type": [
1045
+ "array"
1046
+ ],
1047
+ "items": {
1048
+ "type": [
1049
+ "object"
1050
+ ],
1051
+ "properties": {
1052
+ "last_four_digits": {
1053
+ "type": [
1054
+ "string"
1055
+ ]
1056
+ },
1057
+ "points": {
1058
+ "type": [
1059
+ "number"
1060
+ ]
1061
+ }
1062
+ },
1063
+ "additionalProperties": false
1064
+ }
1065
+ }
1066
+ },
1067
+ "additionalProperties": false
1068
+ },
1069
+ "credit_card_request": {
1070
+ "type": [
1071
+ "object"
1072
+ ],
1073
+ "properties": {
1074
+ "type": {
1075
+ "enum": [
1076
+ "credit_card"
1077
+ ]
1078
+ },
1079
+ "number": {
1080
+ "type": [
1081
+ "string"
1082
+ ]
1083
+ },
1084
+ "month": {
1085
+ "type": [
1086
+ "integer"
1087
+ ]
1088
+ },
1089
+ "year": {
1090
+ "type": [
1091
+ "integer"
1092
+ ]
1093
+ },
1094
+ "verification_value": {
1095
+ "type": [
1096
+ "string"
1097
+ ]
1098
+ },
1099
+ "given_name": {
1100
+ "$ref": "#/definitions/payments/definitions/given_name"
1101
+ },
1102
+ "family_name": {
1103
+ "$ref": "#/definitions/payments/definitions/family_name"
1104
+ },
1105
+ "last_four_digits": {
1106
+ "type": [
1107
+ "string"
1108
+ ]
1109
+ },
1110
+ "brand": {
1111
+ "enum": [
1112
+ "visa",
1113
+ "american_express",
1114
+ "master",
1115
+ "jcb"
1116
+ ]
1117
+ }
1118
+ },
1119
+ "required": [
1120
+ "type",
1121
+ "number",
1122
+ "month",
1123
+ "year",
1124
+ "given_name",
1125
+ "family_name"
1126
+ ]
1127
+ },
1128
+ "credit_card_response": {
1129
+ "type": [
1130
+ "object"
1131
+ ],
1132
+ "properties": {
1133
+ "type": {
1134
+ "enum": [
1135
+ "credit_card"
1136
+ ]
1137
+ },
1138
+ "month": {
1139
+ "type": [
1140
+ "integer"
1141
+ ]
1142
+ },
1143
+ "year": {
1144
+ "type": [
1145
+ "integer"
1146
+ ]
1147
+ },
1148
+ "last_four_digits": {
1149
+ "type": [
1150
+ "string"
1151
+ ]
1152
+ },
1153
+ "brand": {
1154
+ "enum": [
1155
+ "visa",
1156
+ "american_express",
1157
+ "master",
1158
+ "jcb"
1159
+ ]
1160
+ }
1161
+ },
1162
+ "required": [
1163
+ "type",
1164
+ "brand",
1165
+ "last_four_digits",
1166
+ "month",
1167
+ "year"
1168
+ ]
1169
+ },
1170
+ "id": {
1171
+ "example": "94f128d4021b049bc616f5b1b0",
1172
+ "readOnly": true,
1173
+ "type": [
1174
+ "string"
1175
+ ],
1176
+ "description": "A unique indentifier for the payment"
1177
+ },
1178
+ "resource": {
1179
+ "example": "payment",
1180
+ "enum": [
1181
+ "payment"
1182
+ ],
1183
+ "description": "Value of `resource`."
1184
+ },
1185
+ "status": {
1186
+ "example": "pending",
1187
+ "enum": [
1188
+ "pending",
1189
+ "authorized",
1190
+ "captured",
1191
+ "expired",
1192
+ "cancelled",
1193
+ "refunded"
1194
+ ],
1195
+ "description": "The status of the payment."
1196
+ },
1197
+ "amount": {
1198
+ "example": "300",
1199
+ "minimum": 0,
1200
+ "type": [
1201
+ "number"
1202
+ ],
1203
+ "description": "The amount to be charged before tax. Must be equal or greater than 0. Use a ‘.’ as a decimal separator, and no thousands separator"
1204
+ },
1205
+ "tax": {
1206
+ "example": "30",
1207
+ "type": [
1208
+ "number",
1209
+ "null"
1210
+ ],
1211
+ "description": "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."
1212
+ },
1213
+ "payment_deadline": {
1214
+ "format": "date-time",
1215
+ "example": "2015-03-09T06:52:34Z",
1216
+ "type": [
1217
+ "string",
1218
+ "null"
1219
+ ],
1220
+ "description": "Time when the payment will expire. This is a timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ."
1221
+ },
1222
+ "payment_method_fee": {
1223
+ "example": "0",
1224
+ "type": [
1225
+ "number"
1226
+ ],
1227
+ "minimum": 0,
1228
+ "description": "An additional fee added to specific payment types"
1229
+ },
1230
+ "total": {
1231
+ "example": "330",
1232
+ "type": [
1233
+ "number"
1234
+ ],
1235
+ "description": "The payment total, this is the amount + tax + payment_method_fee"
1236
+ },
1237
+ "currency": {
1238
+ "example": "JPY",
1239
+ "enum": [
1240
+ "JPY",
1241
+ "USD"
1242
+ ],
1243
+ "description": "3 letter ISO currency code of the transaction"
1244
+ },
1245
+ "description": {
1246
+ "example": "",
1247
+ "type": [
1248
+ "string",
1249
+ "null"
1250
+ ],
1251
+ "description": "Description of the payment (used in e-mail receipts if enabled)."
1252
+ },
1253
+ "subscription": {
1254
+ "example": null,
1255
+ "type": [
1256
+ "object",
1257
+ "null"
1258
+ ],
1259
+ "description": "Shown if payment was part of a subscription"
1260
+ },
1261
+ "captured_at": {
1262
+ "example": "2015-03-09T06:52:34Z",
1263
+ "type": [
1264
+ "string",
1265
+ "null"
1266
+ ],
1267
+ "description": "An ISO 8601 formatted timestamp of when a payment was captured"
1268
+ },
1269
+ "metadata": {
1270
+ "type": [
1271
+ "object",
1272
+ "null"
1273
+ ],
1274
+ "example": {
1275
+ "order_id": "abcdefghijklmn"
1276
+ },
1277
+ "description": "A set of key-value pairs"
1278
+ },
1279
+ "payment_details_request": {
1280
+ "description": "A hash or token describing the payment method used to make the payment.",
1281
+ "example": {
1282
+ "type": [
1283
+ "konbini"
1284
+ ],
1285
+ "store": "lawson",
1286
+ "email": "foo@bar.com",
1287
+ "phone": "08011111111"
1288
+ },
1289
+ "type": [
1290
+ "string",
1291
+ "object"
1292
+ ],
1293
+ "properties": {
1294
+ "type": {
1295
+ "enum": [
1296
+ "credit_card",
1297
+ "bank_transfer",
1298
+ "konbini",
1299
+ "pay_easy",
1300
+ "web_money"
1301
+ ]
1302
+ }
1303
+ },
1304
+ "required": [
1305
+ "type"
1306
+ ]
1307
+ },
1308
+ "payment_details_response": {
1309
+ "description": "A hash or token describing the payment method used to make the payment.",
1310
+ "example": {
1311
+ "type": [
1312
+ "konbini"
1313
+ ],
1314
+ "store": "lawson",
1315
+ "confirmation_code": null,
1316
+ "receipt": "12345"
1317
+ },
1318
+ "oneOf": [
1319
+ {
1320
+ "type": [
1321
+ "null"
1322
+ ]
1323
+ },
1324
+ {
1325
+ "$ref": "#/definitions/payments/definitions/bank_transfer_response"
1326
+ },
1327
+ {
1328
+ "$ref": "#/definitions/payments/definitions/credit_card_response"
1329
+ },
1330
+ {
1331
+ "$ref": "#/definitions/payments/definitions/konbini_response"
1332
+ },
1333
+ {
1334
+ "$ref": "#/definitions/payments/definitions/pay_easy_response"
1335
+ },
1336
+ {
1337
+ "$ref": "#/definitions/payments/definitions/web_money_response"
1338
+ }
1339
+ ]
1340
+ },
1341
+ "fraud_details": {
1342
+ "type": [
1343
+ "object",
1344
+ "null"
1345
+ ],
1346
+ "properties": {
1347
+ "customer_ip": {
1348
+ "type": [
1349
+ "string"
1350
+ ],
1351
+ "oneOf": [
1352
+ {
1353
+ "format": "ipv4"
1354
+ },
1355
+ {
1356
+ "format": "ipv6"
1357
+ }
1358
+ ]
1359
+ },
1360
+ "customer_email": {
1361
+ "format": "email",
1362
+ "type": [
1363
+ "string"
1364
+ ]
1365
+ },
1366
+ "browser_language": {
1367
+ "type": [
1368
+ "string"
1369
+ ]
1370
+ },
1371
+ "browser_user_agent": {
1372
+ "type": [
1373
+ "string"
1374
+ ]
1375
+ }
1376
+ },
1377
+ "dependencies": {
1378
+ "customer_email": [
1379
+ "customer_ip"
1380
+ ],
1381
+ "browser_language": [
1382
+ "customer_ip"
1383
+ ],
1384
+ "browser_user_agent": [
1385
+ "customer_ip"
1386
+ ]
1387
+ },
1388
+ "additionalProperties": false
1389
+ },
1390
+ "created_at": {
1391
+ "example": "2015-03-06T06:52:35Z",
1392
+ "format": "date-time",
1393
+ "type": [
1394
+ "string"
1395
+ ],
1396
+ "description": "An ISO 8601 formatted timestamp of when a payment was created"
1397
+ }
1398
+ },
1399
+ "links": [
1400
+ {
1401
+ "title": "List",
1402
+ "description": "List payments",
1403
+ "href": "/payments",
1404
+ "method": "GET",
1405
+ "rel": "instances",
1406
+ "response_example": "payments#index",
1407
+ "targetSchema": {
1408
+ "$ref": "#/definitions/list/"
1409
+ }
1410
+ },
1411
+ {
1412
+ "title": "Show",
1413
+ "description": "Show a payment",
1414
+ "href": "/payments/{(%2Fdefinitions%2Fpayments%2Fdefinitions%2Fid)}",
1415
+ "method": "GET",
1416
+ "rel": "self",
1417
+ "response_example": "payments#show",
1418
+ "targetSchema": {
1419
+ "$ref": "#/definitions/payments/"
1420
+ }
1421
+ },
1422
+ {
1423
+ "title": "Create",
1424
+ "description": "Create a payment",
1425
+ "href": "/payments",
1426
+ "method": "POST",
1427
+ "rel": "create",
1428
+ "response_example": "payments#create",
1429
+ "targetSchema": {
1430
+ "$ref": "#/definitions/payments/"
1431
+ },
1432
+ "schema": {
1433
+ "type": [
1434
+ "object"
1435
+ ],
1436
+ "properties": {
1437
+ "amount": {
1438
+ "$ref": "#/definitions/payments/definitions/amount"
1439
+ },
1440
+ "tax": {
1441
+ "$ref": "#/definitions/payments/definitions/tax"
1442
+ },
1443
+ "currency": {
1444
+ "$ref": "#/definitions/payments/definitions/currency"
1445
+ },
1446
+ "external_order_num": {
1447
+ "$ref": "#/definitions/payments/definitions/external_order_num"
1448
+ },
1449
+ "metadata": {
1450
+ "$ref": "#/definitions/payments/definitions/metadata"
1451
+ },
1452
+ "payment_details": {
1453
+ "$ref": "#/definitions/payments/definitions/payment_details_request"
1454
+ },
1455
+ "customer": {
1456
+ "$ref": "#/definitions/payments/definitions/customer"
1457
+ },
1458
+ "fraud_details": {
1459
+ "$ref": "#/definitions/payments/definitions/fraud_details"
1460
+ }
1461
+ },
1462
+ "required": [
1463
+ "amount",
1464
+ "currency"
1465
+ ],
1466
+ "additionalProperties": false
1467
+ }
1468
+ },
1469
+ {
1470
+ "title": "Update",
1471
+ "description": "Update a payment",
1472
+ "href": "/payments/{(%2Fdefinitions%2Fpayments%2Fdefinitions%2Fid)}",
1473
+ "method": "PATCH",
1474
+ "rel": "self",
1475
+ "response_example": "payments#update",
1476
+ "targetSchema": {
1477
+ "$ref": "#/definitions/payments/"
1478
+ },
1479
+ "schema": {
1480
+ "type": [
1481
+ "object"
1482
+ ],
1483
+ "properties": {
1484
+ "description": {
1485
+ "$ref": "#/definitions/payments/definitions/description"
1486
+ },
1487
+ "metadata": {
1488
+ "$ref": "#/definitions/payments/definitions/metadata"
1489
+ },
1490
+ "payment_details": {
1491
+ "type": [
1492
+ "object"
1493
+ ],
1494
+ "properties": {
1495
+ "type": {
1496
+ "enum": [
1497
+ "web_money"
1498
+ ]
1499
+ }
1500
+ },
1501
+ "required": [
1502
+ "type"
1503
+ ]
1504
+ }
1505
+ },
1506
+ "additionalProperties": false
1507
+ }
1508
+ },
1509
+ {
1510
+ "title": "Refund",
1511
+ "description": "Refund a payment",
1512
+ "href": "/payments/{(%2Fdefinitions%2Fpayments%2Fdefinitions%2Fid)}/refund",
1513
+ "method": "POST",
1514
+ "rel": "self",
1515
+ "response_example": "payments#refund",
1516
+ "targetSchema": {
1517
+ "$ref": "#/definitions/payments/"
1518
+ },
1519
+ "schema": {
1520
+ "type": [
1521
+ "object"
1522
+ ],
1523
+ "properties": {
1524
+ "amount": {
1525
+ "$ref": "#/definitions/payments/definitions/amount"
1526
+ },
1527
+ "description": {
1528
+ "$ref": "#/definitions/payments/definitions/description"
1529
+ }
1530
+ }
1531
+ }
1532
+ },
1533
+ {
1534
+ "title": "Cancel",
1535
+ "description": "Cancel a payment",
1536
+ "href": "/payments/{(%2Fdefinitions%2Fpayments%2Fdefinitions%2Fid)}/cancel",
1537
+ "method": "POST",
1538
+ "rel": "self",
1539
+ "response_example": "payments#cancel",
1540
+ "targetSchema": {
1541
+ "$ref": "#/definitions/payments/"
1542
+ }
1543
+ }
1544
+ ],
1545
+ "properties": {
1546
+ "id": {
1547
+ "$ref": "#/definitions/payments/definitions/id"
1548
+ },
1549
+ "resource": {
1550
+ "$ref": "#/definitions/payments/definitions/resource"
1551
+ },
1552
+ "status": {
1553
+ "$ref": "#/definitions/payments/definitions/status"
1554
+ },
1555
+ "amount": {
1556
+ "$ref": "#/definitions/payments/definitions/amount"
1557
+ },
1558
+ "tax": {
1559
+ "$ref": "#/definitions/payments/definitions/tax"
1560
+ },
1561
+ "payment_deadline": {
1562
+ "$ref": "#/definitions/payments/definitions/payment_deadline"
1563
+ },
1564
+ "payment_details": {
1565
+ "$ref": "#/definitions/payments/definitions/payment_details_response"
1566
+ },
1567
+ "payment_method_fee": {
1568
+ "$ref": "#/definitions/payments/definitions/payment_method_fee"
1569
+ },
1570
+ "total": {
1571
+ "$ref": "#/definitions/payments/definitions/total"
1572
+ },
1573
+ "currency": {
1574
+ "$ref": "#/definitions/payments/definitions/currency"
1575
+ },
1576
+ "description": {
1577
+ "$ref": "#/definitions/payments/definitions/description"
1578
+ },
1579
+ "subscription": {
1580
+ "$ref": "#/definitions/payments/definitions/subscription"
1581
+ },
1582
+ "captured_at": {
1583
+ "$ref": "#/definitions/payments/definitions/captured_at"
1584
+ },
1585
+ "metadata": {
1586
+ "$ref": "#/definitions/payments/definitions/metadata"
1587
+ },
1588
+ "created_at": {
1589
+ "$ref": "#/definitions/payments/definitions/created_at"
1590
+ },
1591
+ "refunds": {
1592
+ "type": [
1593
+ "array"
1594
+ ]
1595
+ }
1596
+ },
1597
+ "description": "Payment resource",
1598
+ "title": "Payments"
1599
+ },
1600
+ "payouts": {
1601
+ "$schema": "http://json-schema.org/draft-04/hyper-schema",
1602
+ "type": [
1603
+ "object"
1604
+ ],
1605
+ "definitions": {
1606
+ "id": {
1607
+ "example": "66a4824ac97cc7afff608f27c7",
1608
+ "readOnly": true,
1609
+ "type": [
1610
+ "string"
1611
+ ],
1612
+ "description": "A unique identifier for a payout."
1613
+ },
1614
+ "resource": {
1615
+ "example": "event",
1616
+ "readOnly": true,
1617
+ "enum": [
1618
+ "payout"
1619
+ ],
1620
+ "description": "Name of resource"
1621
+ },
1622
+ "payout_item": {
1623
+ "readOnly": true,
1624
+ "type": [
1625
+ "object"
1626
+ ],
1627
+ "properties": {
1628
+ "resource": {
1629
+ "example": "payout_item",
1630
+ "readOnly": true,
1631
+ "enum": [
1632
+ "payout_item"
1633
+ ],
1634
+ "description": "Name of resource."
1635
+ },
1636
+ "event_type": {
1637
+ "example": "capture",
1638
+ "readOnly": true,
1639
+ "enum": [
1640
+ "capture",
1641
+ "refund"
1642
+ ],
1643
+ "description": "Describes whether the payout item is from a captured or refunded payment."
1644
+ },
1645
+ "timestamp": {
1646
+ "example": "2015-03-06T06:52:35Z",
1647
+ "readOnly": true,
1648
+ "format": "date-time",
1649
+ "description": "Timestamp describing when the payment was either captured or refunded."
1650
+ },
1651
+ "payment_method": {
1652
+ "example": "visa",
1653
+ "readOnly": true,
1654
+ "enum": [
1655
+ "visa",
1656
+ "master_card",
1657
+ "american_express",
1658
+ "jcb",
1659
+ "bank_transfer",
1660
+ "web_money",
1661
+ "lawson",
1662
+ "family-mart",
1663
+ "sunkus",
1664
+ "circle-k",
1665
+ "ministop",
1666
+ "daily-yamazaki",
1667
+ "seven-eleven"
1668
+ ],
1669
+ "description": "The payment method of the payment."
1670
+ },
1671
+ "payment_fee": {
1672
+ "example": "300",
1673
+ "type": [
1674
+ "number"
1675
+ ],
1676
+ "description": "Komoju platform fee deducted from the payment total."
1677
+ },
1678
+ "receivable": {
1679
+ "example": "300",
1680
+ "type": [
1681
+ "number"
1682
+ ],
1683
+ "description": "The amount paid to your account for a given payment."
1684
+ },
1685
+ "amount": {
1686
+ "$ref": "#/definitions/payments/definitions/amount"
1687
+ },
1688
+ "tax": {
1689
+ "$ref": "#/definitions/payments/definitions/tax"
1690
+ },
1691
+ "total": {
1692
+ "$ref": "#/definitions/payments/definitions/total"
1693
+ }
1694
+ },
1695
+ "description": "Payout Item Resource"
1696
+ },
1697
+ "created_at": {
1698
+ "example": "2015-03-06T06:52:35Z",
1699
+ "format": "date-time",
1700
+ "readOnly": true,
1701
+ "type": [
1702
+ "string"
1703
+ ],
1704
+ "description": "An ISO 8601 formatted timestamp of when the payout was created."
1705
+ }
1706
+ },
1707
+ "links": [
1708
+ {
1709
+ "title": "List",
1710
+ "description": "List payouts",
1711
+ "href": "/payouts",
1712
+ "method": "GET",
1713
+ "rel": "instances",
1714
+ "response_example": "payouts#index",
1715
+ "targetSchema": {
1716
+ "$ref": "#/definitions/list/"
1717
+ }
1718
+ },
1719
+ {
1720
+ "title": "Show",
1721
+ "description": "Show a payout",
1722
+ "href": "/payouts/{(%2Fdefinitions%2Fpayouts%2Fdefinitions%2Fid)}",
1723
+ "method": "GET",
1724
+ "rel": "self",
1725
+ "response_example": "payouts#show",
1726
+ "targetSchema": {
1727
+ "$ref": "#/definitions/payouts/"
1728
+ }
1729
+ },
1730
+ {
1731
+ "title": "Payout Items",
1732
+ "description": "List payout items",
1733
+ "href": "/payouts/{(%2Fdefinitions%2Fpayouts%2Fdefinitions%2Fid)}/payout_items",
1734
+ "method": "GET",
1735
+ "rel": "instances",
1736
+ "response_example": "payouts#payout_items",
1737
+ "targetSchema": {
1738
+ "$ref": "#/definitions/list/"
1739
+ }
1740
+ }
1741
+ ],
1742
+ "properties": {
1743
+ "id": {
1744
+ "$ref": "#/definitions/payouts/definitions/id"
1745
+ },
1746
+ "resource": {
1747
+ "$ref": "#/definitions/payouts/definitions/resource"
1748
+ },
1749
+ "payout_items": {
1750
+ "$ref": "#/definitions/list/"
1751
+ },
1752
+ "created_at": {
1753
+ "$ref": "#/definitions/payouts/definitions/created_at"
1754
+ }
1755
+ },
1756
+ "description": "Payout Resource",
1757
+ "title": "Payouts"
1758
+ },
1759
+ "subscriptions": {
1760
+ "$schema": "http://json-schema.org/draft-04/hyper-schema",
1761
+ "type": [
1762
+ "object"
1763
+ ],
1764
+ "definitions": {
1765
+ "id": {
1766
+ "example": "66a4824ac97cc7afff608f27c7",
1767
+ "readOnly": true,
1768
+ "type": [
1769
+ "string"
1770
+ ],
1771
+ "description": "A unique identifier for a subscription."
1772
+ },
1773
+ "resource": {
1774
+ "example": "subscription",
1775
+ "readOnly": true,
1776
+ "enum": [
1777
+ "subscription"
1778
+ ],
1779
+ "description": "Name of resource"
1780
+ },
1781
+ "status": {
1782
+ "example": "pending",
1783
+ "readOnly": true,
1784
+ "enum": [
1785
+ "cancelled",
1786
+ "pending",
1787
+ "active",
1788
+ "past_due"
1789
+ ],
1790
+ "description": "The status of the subscription."
1791
+ },
1792
+ "plan": {
1793
+ "$ref": "#/definitions/plans"
1794
+ },
1795
+ "customer": {
1796
+ "$ref": "#/definitions/customers"
1797
+ },
1798
+ "current_period_end_at": {
1799
+ "example": null,
1800
+ "format": "date-time",
1801
+ "readOnly": true,
1802
+ "type": [
1803
+ "string",
1804
+ "null"
1805
+ ],
1806
+ "description": "An ISO 8601 formatted timestamp of when the subscription will next be billed."
1807
+ },
1808
+ "cancel_at_period_end": {
1809
+ "type": [
1810
+ "boolean"
1811
+ ]
1812
+ },
1813
+ "metadata": {
1814
+ "$ref": "#/definitions/payments/definitions/metadata"
1815
+ },
1816
+ "created_at": {
1817
+ "example": "2015-03-06T06:52:35Z",
1818
+ "format": "date-time",
1819
+ "readOnly": true,
1820
+ "type": [
1821
+ "string"
1822
+ ],
1823
+ "description": "An ISO 8601 formatted timestamp of when the plan was created."
1824
+ }
1825
+ },
1826
+ "links": [
1827
+ {
1828
+ "title": "List",
1829
+ "description": "List subscriptions",
1830
+ "href": "/subscriptions",
1831
+ "method": "GET",
1832
+ "rel": "instances",
1833
+ "response_example": "subscriptions#index",
1834
+ "targetSchema": {
1835
+ "$ref": "#/definitions/list/"
1836
+ }
1837
+ },
1838
+ {
1839
+ "title": "Show",
1840
+ "description": "Show a subscription",
1841
+ "href": "/subscriptions/{(%2Fdefinitions%2Fsubscriptions%2Fdefinitions%2Fid)}",
1842
+ "method": "GET",
1843
+ "rel": "self",
1844
+ "response_example": "subscriptions#show",
1845
+ "targetSchema": {
1846
+ "$ref": "#/definitions/subscriptions/"
1847
+ }
1848
+ },
1849
+ {
1850
+ "title": "Create",
1851
+ "description": "Create a subscription",
1852
+ "href": "/subscriptions",
1853
+ "method": "POST",
1854
+ "rel": "create",
1855
+ "response_example": "subscriptions#create",
1856
+ "targetSchema": {
1857
+ "$ref": "#/definitions/subscriptions/"
1858
+ },
1859
+ "schema": {
1860
+ "type": [
1861
+ "object"
1862
+ ],
1863
+ "properties": {
1864
+ "customer": {
1865
+ "type": [
1866
+ "string"
1867
+ ]
1868
+ },
1869
+ "plan": {
1870
+ "type": [
1871
+ "string"
1872
+ ]
1873
+ },
1874
+ "metadata": {
1875
+ "$ref": "#/definitions/subscriptions/definitions/metadata"
1876
+ }
1877
+ },
1878
+ "required": [
1879
+ "customer",
1880
+ "plan"
1881
+ ]
1882
+ }
1883
+ },
1884
+ {
1885
+ "title": "Delete",
1886
+ "description": "Delete a subscription",
1887
+ "href": "/subscriptions/{(%2Fdefinitions%2Fsubscriptions%2Fdefinitions%2Fid)}",
1888
+ "method": "DELETE",
1889
+ "rel": "destroy",
1890
+ "response_example": "subscriptions#destroy",
1891
+ "targetSchema": {
1892
+ "$ref": "#/definitions/subscriptions/"
1893
+ }
1894
+ }
1895
+ ],
1896
+ "properties": {
1897
+ "id": {
1898
+ "$ref": "#/definitions/subscriptions/definitions/id"
1899
+ },
1900
+ "resource": {
1901
+ "$ref": "#/definitions/subscriptions/definitions/resource"
1902
+ },
1903
+ "status": {
1904
+ "$ref": "#/definitions/subscriptions/definitions/status"
1905
+ },
1906
+ "plan": {
1907
+ "$ref": "#/definitions/subscriptions/definitions/plan"
1908
+ },
1909
+ "customer": {
1910
+ "$ref": "#/definitions/subscriptions/definitions/customer"
1911
+ },
1912
+ "current_period_end_at": {
1913
+ "$ref": "#/definitions/subscriptions/definitions/current_period_end_at"
1914
+ },
1915
+ "metadata": {
1916
+ "$ref": "#/definitions/subscriptions/definitions/metadata"
1917
+ },
1918
+ "created_at": {
1919
+ "$ref": "#/definitions/subscriptions/definitions/created_at"
1920
+ }
1921
+ },
1922
+ "description": "Subscription Resource",
1923
+ "title": "Subscriptions"
1924
+ },
1925
+ "customers": {
1926
+ "$schema": "http://json-schema.org/draft-04/hyper-schema",
1927
+ "type": [
1928
+ "object"
1929
+ ],
1930
+ "definitions": {
1931
+ "id": {
1932
+ "example": "fa799fca14be29d3fae455f22d",
1933
+ "readOnly": true,
1934
+ "type": [
1935
+ "string"
1936
+ ],
1937
+ "description": "A unique identifier for the customer."
1938
+ },
1939
+ "resource": {
1940
+ "example": "customer",
1941
+ "readOnly": true,
1942
+ "enum": [
1943
+ "customer"
1944
+ ],
1945
+ "description": "Name of resource"
1946
+ },
1947
+ "currency": {
1948
+ "readOnly": true,
1949
+ "type": [
1950
+ "string",
1951
+ "null"
1952
+ ]
1953
+ },
1954
+ "payment_details": {
1955
+ "$ref": "#/definitions/payments/definitions/payment_details_response"
1956
+ },
1957
+ "metadata": {
1958
+ "$ref": "#/definitions/payments/definitions/metadata"
1959
+ },
1960
+ "email": {
1961
+ "type": [
1962
+ "string",
1963
+ "null"
1964
+ ],
1965
+ "format": "email",
1966
+ "description": "Customer's email address."
1967
+ },
1968
+ "created_at": {
1969
+ "example": "2015-03-06T06:52:35Z",
1970
+ "format": "date-time",
1971
+ "readOnly": true,
1972
+ "type": [
1973
+ "string"
1974
+ ],
1975
+ "description": "An ISO 8601 formatted timestamp of when the customer was created."
1976
+ }
1977
+ },
1978
+ "links": [
1979
+ {
1980
+ "title": "List",
1981
+ "description": "List customers",
1982
+ "href": "/customers",
1983
+ "method": "GET",
1984
+ "rel": "instances",
1985
+ "response_example": "customers#index",
1986
+ "targetSchema": {
1987
+ "$ref": "#/definitions/list/"
1988
+ }
1989
+ },
1990
+ {
1991
+ "title": "Show",
1992
+ "description": "Show a customer",
1993
+ "href": "/customers/{(%2Fdefinitions%2Fcustomers%2Fdefinitions%2Fid)}",
1994
+ "method": "GET",
1995
+ "rel": "self",
1996
+ "response_example": "customers#show",
1997
+ "targetSchema": {
1998
+ "$ref": "#/definitions/customers/"
1999
+ }
2000
+ },
2001
+ {
2002
+ "title": "Create",
2003
+ "description": "Create a customer",
2004
+ "href": "/customers",
2005
+ "method": "POST",
2006
+ "rel": "create",
2007
+ "response_example": "customers#create",
2008
+ "targetSchema": {
2009
+ "$ref": "#/definitions/customers/"
2010
+ },
2011
+ "schema": {
2012
+ "type": [
2013
+ "object"
2014
+ ],
2015
+ "properties": {
2016
+ "payment_details": {
2017
+ "$ref": "#/definitions/payments/definitions/payment_details_request"
2018
+ },
2019
+ "email": {
2020
+ "$ref": "#/definitions/customers/definitions/email"
2021
+ },
2022
+ "metadata": {
2023
+ "$ref": "#/definitions/customers/definitions/metadata"
2024
+ }
2025
+ },
2026
+ "additionalFields": false
2027
+ }
2028
+ },
2029
+ {
2030
+ "title": "Update",
2031
+ "description": "Update customers",
2032
+ "href": "/customers/{(%2Fdefinitions%2Fcustomers%2Fdefinitions%2Fid)}",
2033
+ "method": "PATCH",
2034
+ "rel": "self",
2035
+ "response_example": "customers#update",
2036
+ "schema": {
2037
+ "type": [
2038
+ "object"
2039
+ ],
2040
+ "properties": {
2041
+ "payment_details": {
2042
+ "$ref": "#/definitions/payments/definitions/payment_details_request"
2043
+ },
2044
+ "currency": {
2045
+ "$ref": "#/definitions/payments/definitions/currency"
2046
+ },
2047
+ "email": {
2048
+ "$ref": "#/definitions/customers/definitions/email"
2049
+ },
2050
+ "metadata": {
2051
+ "$ref": "#/definitions/customers/definitions/metadata"
2052
+ }
2053
+ },
2054
+ "additionalFields": false
2055
+ },
2056
+ "targetSchema": {
2057
+ "$ref": "#/definitions/customers/"
2058
+ }
2059
+ },
2060
+ {
2061
+ "title": "Delete",
2062
+ "description": "Delete a customer",
2063
+ "href": "/customers/{(%2Fdefinitions%2Fcustomers%2Fdefinitions%2Fid)}",
2064
+ "method": "DELETE",
2065
+ "rel": "destroy",
2066
+ "response_example": "customers#destroy",
2067
+ "targetSchema": {
2068
+ "$ref": "#/definitions/customers/"
2069
+ }
2070
+ }
2071
+ ],
2072
+ "properties": {
2073
+ "id": {
2074
+ "$ref": "#/definitions/customers/definitions/id"
2075
+ },
2076
+ "resource": {
2077
+ "$ref": "#/definitions/customers/definitions/resource"
2078
+ },
2079
+ "currency": {
2080
+ "$ref": "#/definitions/customers/definitions/currency"
2081
+ },
2082
+ "email": {
2083
+ "$ref": "#/definitions/customers/definitions/email"
2084
+ },
2085
+ "metadata": {
2086
+ "$ref": "#/definitions/customers/definitions/metadata"
2087
+ },
2088
+ "created_at": {
2089
+ "$ref": "#/definitions/customers/definitions/created_at"
2090
+ }
2091
+ },
2092
+ "description": "Customers",
2093
+ "title": "Customers"
2094
+ },
2095
+ "invoices": {
2096
+ "$schema": "http://json-schema.org/draft-04/hyper-schema",
2097
+ "type": [
2098
+ "object"
2099
+ ],
2100
+ "definitions": {
2101
+ "id": {
2102
+ "readOnly": true,
2103
+ "type": [
2104
+ "string"
2105
+ ],
2106
+ "description": "A unique identifier for the invoice."
2107
+ },
2108
+ "resource": {
2109
+ "example": "invoice",
2110
+ "readOnly": true,
2111
+ "enum": [
2112
+ "invoice"
2113
+ ],
2114
+ "description": "Name of resource."
2115
+ },
2116
+ "invoice": {
2117
+ "readOnly": true,
2118
+ "type": [
2119
+ "string",
2120
+ "null"
2121
+ ]
2122
+ },
2123
+ "paid": {
2124
+ "readOnly": true,
2125
+ "type": [
2126
+ "boolean"
2127
+ ]
2128
+ },
2129
+ "created_at": {
2130
+ "readOnly": true,
2131
+ "format": "date-time",
2132
+ "type": [
2133
+ "string",
2134
+ "null"
2135
+ ],
2136
+ "description": "An ISO 8601 formatted timestamp of when the invoice was created."
2137
+ }
2138
+ },
2139
+ "links": [
2140
+ {
2141
+ "title": "List",
2142
+ "description": "List invoices",
2143
+ "href": "/invoices",
2144
+ "method": "GET",
2145
+ "rel": "instances",
2146
+ "response_example": "invoices#index",
2147
+ "targetSchema": {
2148
+ "$ref": "#/definitions/list/"
2149
+ }
2150
+ },
2151
+ {
2152
+ "title": "Show",
2153
+ "description": "Show an invoice",
2154
+ "href": "/invoices/{(%2Fdefinitions%2Finvoices%2Fdefinitions%2Fid)}",
2155
+ "method": "GET",
2156
+ "rel": "self",
2157
+ "response_example": "invoices#show",
2158
+ "targetSchema": {
2159
+ "$ref": "#/definitions/invoices/"
2160
+ }
2161
+ },
2162
+ {
2163
+ "title": "Create",
2164
+ "description": "Create an invoice",
2165
+ "href": "/invoices",
2166
+ "method": "POST",
2167
+ "rel": "create",
2168
+ "response_example": "invoices#create",
2169
+ "targetSchema": {
2170
+ "$ref": "#/definitions/invoices/"
2171
+ },
2172
+ "schema": {
2173
+ "type": [
2174
+ "object"
2175
+ ],
2176
+ "properties": {
2177
+ "subscription": {
2178
+ "$ref": "#/definitions/subscriptions/definitions/id"
2179
+ },
2180
+ "metadata": {
2181
+ "$ref": "#/definitions/subscriptions/definitions/metadata"
2182
+ }
2183
+ },
2184
+ "required": [
2185
+ "subscription"
2186
+ ]
2187
+ }
2188
+ },
2189
+ {
2190
+ "title": "Preview",
2191
+ "description": "Preview an upcoming invoice",
2192
+ "href": "/invoices/preview",
2193
+ "method": "GET",
2194
+ "rel": "self",
2195
+ "response_example": "invoices#preview",
2196
+ "targetSchema": {
2197
+ "$ref": "#/definitions/invoices/"
2198
+ },
2199
+ "schema": {
2200
+ "type": [
2201
+ "object"
2202
+ ],
2203
+ "properties": {
2204
+ "customer": {
2205
+ "$ref": "#/definitions/customers/definitions/id"
2206
+ },
2207
+ "subscription": {
2208
+ "$ref": "#/definitions/subscriptions/definitions/id"
2209
+ }
2210
+ },
2211
+ "required": [
2212
+ "customer"
2213
+ ]
2214
+ }
2215
+ },
2216
+ {
2217
+ "title": "Pay",
2218
+ "description": "Pay an invoice",
2219
+ "href": "/invoices/{(%2Fdefinitions%2Finvoices%2Fdefinitions%2Fid)}/pay",
2220
+ "method": "POST",
2221
+ "rel": "self",
2222
+ "response_example": "invoices#pay",
2223
+ "targetSchema": {
2224
+ "$ref": "#/definitions/invoices/"
2225
+ },
2226
+ "schema": {
2227
+ "type": [
2228
+ "object"
2229
+ ],
2230
+ "properties": {
2231
+ "payment_details": {
2232
+ "$ref": "#/definitions/payments/definitions/payment_details_request"
2233
+ },
2234
+ "fraud_details": {
2235
+ "$ref": "#/definitions/payments/definitions/fraud_details"
2236
+ }
2237
+ },
2238
+ "required": [
2239
+ "payment_details"
2240
+ ]
2241
+ }
2242
+ }
2243
+ ],
2244
+ "properties": {
2245
+ "id": {
2246
+ "$ref": "#/definitions/payments/definitions/id"
2247
+ },
2248
+ "resource": {
2249
+ "$ref": "#/definitions/invoices/definitions/resource"
2250
+ },
2251
+ "subscription": {
2252
+ "$ref": "#/definitions/subscriptions"
2253
+ },
2254
+ "paid": {
2255
+ "$ref": "#/definitions/invoices/definitions/paid"
2256
+ },
2257
+ "invoice_items": {
2258
+ "$ref": "#/definitions/list/"
2259
+ },
2260
+ "total": {
2261
+ "$ref": "#/definitions/payments/definitions/total"
2262
+ },
2263
+ "currency": {
2264
+ "$ref": "#/definitions/payments/definitions/currency"
2265
+ },
2266
+ "created_at": {
2267
+ "$ref": "#/definitions/invoices/definitions/created_at"
2268
+ }
2269
+ },
2270
+ "description": "Subscription Invoice",
2271
+ "title": "Invoices"
2272
+ },
2273
+ "invoice_items": {
2274
+ "$schema": "http://json-schema.org/draft-04/hyper-schema",
2275
+ "type": [
2276
+ "object"
2277
+ ],
2278
+ "definitions": {
2279
+ "id": {
2280
+ "readOnly": true,
2281
+ "type": [
2282
+ "string"
2283
+ ],
2284
+ "description": "A unique identifier for the invoice items."
2285
+ },
2286
+ "resource": {
2287
+ "example": "invoice_item",
2288
+ "readOnly": true,
2289
+ "enum": [
2290
+ "invoice_item"
2291
+ ],
2292
+ "description": "Name of resource"
2293
+ },
2294
+ "type": {
2295
+ "example": "invoice_item",
2296
+ "readOnly": true,
2297
+ "enum": [
2298
+ "invoice_item",
2299
+ "plan"
2300
+ ]
2301
+ },
2302
+ "plan": {
2303
+ "oneOf": [
2304
+ {
2305
+ "$ref": "#/definitions/plans/"
2306
+ },
2307
+ {
2308
+ "type": [
2309
+ "null"
2310
+ ]
2311
+ }
2312
+ ]
2313
+ },
2314
+ "invoice": {
2315
+ "readOnly": true,
2316
+ "type": [
2317
+ "string",
2318
+ "null"
2319
+ ]
2320
+ }
2321
+ },
2322
+ "links": [
2323
+ {
2324
+ "title": "List",
2325
+ "description": "List invoice items",
2326
+ "href": "/invoice_items",
2327
+ "method": "GET",
2328
+ "rel": "instances",
2329
+ "response_example": "invoice_items#index",
2330
+ "schema": {
2331
+ "type": [
2332
+ "object"
2333
+ ],
2334
+ "properties": {
2335
+ "customer": {
2336
+ "$ref": "#/definitions/customers/definitions/id"
2337
+ }
2338
+ }
2339
+ },
2340
+ "targetSchema": {
2341
+ "$ref": "#/definitions/list/"
2342
+ }
2343
+ },
2344
+ {
2345
+ "title": "Show",
2346
+ "description": "Show an invoice item",
2347
+ "href": "/invoice_items/{(%2Fdefinitions%2Finvoice_items%2Fdefinitions%2Fid)}",
2348
+ "method": "GET",
2349
+ "rel": "self",
2350
+ "response_example": "invoice_items#show",
2351
+ "targetSchema": {
2352
+ "$ref": "#/definitions/invoice_items/"
2353
+ }
2354
+ },
2355
+ {
2356
+ "title": "Create",
2357
+ "description": "Create an invoice item",
2358
+ "href": "/invoice_items",
2359
+ "method": "POST",
2360
+ "rel": "create",
2361
+ "response_example": "invoice_items#create",
2362
+ "targetSchema": {
2363
+ "$ref": "#/definitions/invoice_items/"
2364
+ },
2365
+ "schema": {
2366
+ "type": [
2367
+ "object"
2368
+ ],
2369
+ "properties": {
2370
+ "amount": {
2371
+ "$ref": "#/definitions/invoice_items/properties/amount"
2372
+ },
2373
+ "currency": {
2374
+ "$ref": "#/definitions/invoice_items/properties/currency"
2375
+ },
2376
+ "customer": {
2377
+ "$ref": "#/definitions/invoice_items/properties/customer"
2378
+ },
2379
+ "metadata": {
2380
+ "$ref": "#/definitions/invoice_items/properties/metadata"
2381
+ }
2382
+ },
2383
+ "required": [
2384
+ "amount",
2385
+ "currency",
2386
+ "customer"
2387
+ ]
2388
+ }
2389
+ },
2390
+ {
2391
+ "title": "Destroy",
2392
+ "description": "Deletes an invoice item from the upcoming invoice.",
2393
+ "href": "/invoice_items/{(%2Fdefinitions%2Finvoice_items%2Fdefinitions%2Fid)}",
2394
+ "method": "DELETE",
2395
+ "rel": "destroy",
2396
+ "response_example": "invoice_items#destroy",
2397
+ "targetSchema": {
2398
+ "$ref": "#/definitions/invoice_items/"
2399
+ }
2400
+ }
2401
+ ],
2402
+ "properties": {
2403
+ "id": {
2404
+ "$ref": "#/definitions/payments/definitions/id"
2405
+ },
2406
+ "resource": {
2407
+ "$ref": "#/definitions/invoice_items/definitions/resource"
2408
+ },
2409
+ "type": {
2410
+ "$ref": "#/definitions/invoice_items/definitions/type"
2411
+ },
2412
+ "amount": {
2413
+ "$ref": "#/definitions/payments/definitions/amount"
2414
+ },
2415
+ "currency": {
2416
+ "$ref": "#/definitions/payments/definitions/currency"
2417
+ },
2418
+ "customer": {
2419
+ "$ref": "#/definitions/customers/definitions/id"
2420
+ },
2421
+ "invoice": {
2422
+ "$ref": "#/definitions/invoice_items/definitions/invoice"
2423
+ },
2424
+ "plan": {
2425
+ "$ref": "#/definitions/invoice_items/definitions/plan"
2426
+ },
2427
+ "metadata": {
2428
+ "$ref": "#/definitions/payments/definitions/metadata"
2429
+ }
2430
+ },
2431
+ "required": [
2432
+ "id",
2433
+ "resource",
2434
+ "type",
2435
+ "amount",
2436
+ "customer",
2437
+ "currency",
2438
+ "invoice",
2439
+ "metadata",
2440
+ "plan"
2441
+ ],
2442
+ "description": "Subscription Invoice Items",
2443
+ "title": "Invoice Items"
2444
+ },
2445
+ "plans": {
2446
+ "$schema": "http://json-schema.org/draft-04/hyper-schema",
2447
+ "type": [
2448
+ "object"
2449
+ ],
2450
+ "definitions": {
2451
+ "name": {
2452
+ "example": "name2",
2453
+ "type": [
2454
+ "string"
2455
+ ],
2456
+ "description": "Name of the plan."
2457
+ },
2458
+ "resource": {
2459
+ "example": "plan",
2460
+ "enum": [
2461
+ "plan"
2462
+ ],
2463
+ "description": "Name of resource"
2464
+ },
2465
+ "interval": {
2466
+ "example": "month",
2467
+ "enum": [
2468
+ "day",
2469
+ "week",
2470
+ "month",
2471
+ "year"
2472
+ ],
2473
+ "description": "The billing frequency of a subscription."
2474
+ },
2475
+ "interval_count": {
2476
+ "example": "1",
2477
+ "type": [
2478
+ "integer"
2479
+ ],
2480
+ "minimum": 1,
2481
+ "description": "The number of intervals before the end of each billing period. For example, `interval=month` and `interval_count=3` would bill every 3 months."
2482
+ },
2483
+ "amount": {
2484
+ "$ref": "#/definitions/payments/definitions/amount"
2485
+ },
2486
+ "tax_percent": {
2487
+ "type": [
2488
+ "integer",
2489
+ "null"
2490
+ ]
2491
+ },
2492
+ "currency": {
2493
+ "$ref": "#/definitions/payments/definitions/currency"
2494
+ },
2495
+ "metadata": {
2496
+ "$ref": "#/definitions/payments/definitions/metadata"
2497
+ },
2498
+ "renewal_notice_days": {
2499
+ "example": 1,
2500
+ "type": [
2501
+ "integer"
2502
+ ],
2503
+ "minimum": 0
2504
+ },
2505
+ "trial_period_days": {
2506
+ "type": [
2507
+ "integer"
2508
+ ],
2509
+ "minimum": 1
2510
+ },
2511
+ "created_at": {
2512
+ "example": "2015-03-06T06:52:35Z",
2513
+ "format": "date-time",
2514
+ "readOnly": true,
2515
+ "type": [
2516
+ "string"
2517
+ ],
2518
+ "description": "An ISO 8601 formatted timestamp of when the plan was created."
2519
+ }
2520
+ },
2521
+ "links": [
2522
+ {
2523
+ "title": "List",
2524
+ "description": "List plans",
2525
+ "href": "/plans",
2526
+ "method": "GET",
2527
+ "rel": "instances",
2528
+ "response_example": "plans#index",
2529
+ "targetSchema": {
2530
+ "$ref": "#/definitions/list/"
2531
+ }
2532
+ },
2533
+ {
2534
+ "title": "Show",
2535
+ "description": "Show a plan",
2536
+ "href": "/plans/{(%2Fdefinitions%2Fplans%2Fdefinitions%2Fname)}",
2537
+ "method": "GET",
2538
+ "rel": "self",
2539
+ "response_example": "plans#show",
2540
+ "targetSchema": {
2541
+ "$ref": "#/definitions/plans/"
2542
+ }
2543
+ },
2544
+ {
2545
+ "title": "Create",
2546
+ "description": "Create a plan",
2547
+ "href": "/plans",
2548
+ "method": "POST",
2549
+ "rel": "create",
2550
+ "response_example": "plans#create",
2551
+ "targetSchema": {
2552
+ "$ref": "#/definitions/plans/"
2553
+ },
2554
+ "schema": {
2555
+ "type": [
2556
+ "object"
2557
+ ],
2558
+ "properties": {
2559
+ "name": {
2560
+ "$ref": "#/definitions/plans/definitions/name"
2561
+ },
2562
+ "interval": {
2563
+ "$ref": "#/definitions/plans/definitions/interval"
2564
+ },
2565
+ "interval_count": {
2566
+ "$ref": "#/definitions/plans/definitions/interval_count"
2567
+ },
2568
+ "amount": {
2569
+ "$ref": "#/definitions/plans/definitions/amount"
2570
+ },
2571
+ "tax_percent": {
2572
+ "$ref": "#/definitions/plans/definitions/tax_percent"
2573
+ },
2574
+ "currency": {
2575
+ "$ref": "#/definitions/plans/definitions/currency"
2576
+ },
2577
+ "renewal_notice_days": {
2578
+ "$ref": "#/definitions/plans/definitions/renewal_notice_days"
2579
+ },
2580
+ "trial_period_days": {
2581
+ "$ref": "#/definitions/plans/definitions/trial_period_days"
2582
+ },
2583
+ "metadata": {
2584
+ "$ref": "#/definitions/plans/definitions/metadata"
2585
+ }
2586
+ },
2587
+ "required": [
2588
+ "name",
2589
+ "interval",
2590
+ "amount",
2591
+ "currency"
2592
+ ]
2593
+ }
2594
+ },
2595
+ {
2596
+ "title": "Delete",
2597
+ "description": "Delete a plan",
2598
+ "href": "/plans/{(%2Fdefinitions%2Fplans%2Fdefinitions%2Fname)}",
2599
+ "method": "DELETE",
2600
+ "rel": "destroy",
2601
+ "response_example": "plans#destroy",
2602
+ "targetSchema": {
2603
+ "$ref": "#/definitions/plans/"
2604
+ }
2605
+ }
2606
+ ],
2607
+ "properties": {
2608
+ "resource": {
2609
+ "$ref": "#/definitions/plans/definitions/resource"
2610
+ },
2611
+ "name": {
2612
+ "$ref": "#/definitions/plans/definitions/name"
2613
+ },
2614
+ "interval": {
2615
+ "$ref": "#/definitions/plans/definitions/interval"
2616
+ },
2617
+ "interval_count": {
2618
+ "$ref": "#/definitions/plans/definitions/interval_count"
2619
+ },
2620
+ "currency": {
2621
+ "$ref": "#/definitions/plans/definitions/currency"
2622
+ },
2623
+ "amount": {
2624
+ "$ref": "#/definitions/plans/definitions/amount"
2625
+ },
2626
+ "tax_percent": {
2627
+ "$ref": "#/definitions/plans/definitions/tax_percent"
2628
+ },
2629
+ "renewal_notice_days": {
2630
+ "$ref": "#/definitions/plans/definitions/renewal_notice_days"
2631
+ },
2632
+ "metadata": {
2633
+ "$ref": "#/definitions/plans/definitions/metadata"
2634
+ },
2635
+ "created_at": {
2636
+ "$ref": "#/definitions/plans/definitions/created_at"
2637
+ }
2638
+ },
2639
+ "description": "Subscription Plans",
2640
+ "title": "Plans"
2641
+ },
2642
+ "tokens": {
2643
+ "$schema": "http://json-schema.org/draft-04/hyper-schema",
2644
+ "type": [
2645
+ "object"
2646
+ ],
2647
+ "definitions": {
2648
+ "id": {
2649
+ "example": "tok_ed4119a0f69bc365286d5a9a8777f33cee024f19d532454e6abffccc42cf1452b6ad214de6b8e876cabc60ae6f",
2650
+ "readOnly": true,
2651
+ "type": [
2652
+ "string"
2653
+ ],
2654
+ "description": "A unique identifier for the token."
2655
+ },
2656
+ "resource": {
2657
+ "example": "token",
2658
+ "enum": [
2659
+ "token"
2660
+ ],
2661
+ "description": "Name of resource"
2662
+ },
2663
+ "payment_details": {
2664
+ "$ref": "#/definitions/payments/definitions/payment_details_response"
2665
+ },
2666
+ "created_at": {
2667
+ "example": "2015-03-06T06:52:35Z",
2668
+ "format": "date-time",
2669
+ "type": [
2670
+ "string"
2671
+ ],
2672
+ "description": "An ISO 8601 formatted timestamp of when the token was created."
2673
+ }
2674
+ },
2675
+ "links": [
2676
+ {
2677
+ "title": "Create",
2678
+ "description": "Create a token",
2679
+ "href": "/tokens",
2680
+ "method": "POST",
2681
+ "rel": "create",
2682
+ "response_example": "tokens#create",
2683
+ "targetSchema": {
2684
+ "$ref": "#/definitions/list/"
2685
+ },
2686
+ "schema": {
2687
+ "type": [
2688
+ "object"
2689
+ ],
2690
+ "properties": {
2691
+ "payment_details": {
2692
+ "$ref": "#/definitions/payments/definitions/payment_details_request"
2693
+ }
2694
+ },
2695
+ "required": [
2696
+ "payment_details"
2697
+ ],
2698
+ "additionalFields": false
2699
+ }
2700
+ }
2701
+ ],
2702
+ "properties": {
2703
+ "id": {
2704
+ "$ref": "#/definitions/tokens/definitions/id"
2705
+ },
2706
+ "resource": {
2707
+ "$ref": "#/definitions/tokens/definitions/resource"
2708
+ },
2709
+ "created_at": {
2710
+ "$ref": "#/definitions/tokens/definitions/created_at"
2711
+ }
2712
+ },
2713
+ "description": "Token resource",
2714
+ "title": "Tokens"
2715
+ }
2716
+ },
2717
+ "properties": {
2718
+ "events": {
2719
+ "$ref": "#/definitions/events"
2720
+ },
2721
+ "payments": {
2722
+ "$ref": "#/definitions/payments"
2723
+ },
2724
+ "payouts": {
2725
+ "$ref": "#/definitions/payouts"
2726
+ },
2727
+ "subscriptions": {
2728
+ "$ref": "#/definitions/subscriptions"
2729
+ },
2730
+ "customers": {
2731
+ "$ref": "#/definitions/customers"
2732
+ },
2733
+ "invoices": {
2734
+ "$ref": "#/definitions/invoices"
2735
+ },
2736
+ "invoice_items": {
2737
+ "$ref": "#/definitions/invoice_items"
2738
+ },
2739
+ "plans": {
2740
+ "$ref": "#/definitions/plans"
2741
+ },
2742
+ "tokens": {
2743
+ "$ref": "#/definitions/tokens"
2744
+ }
2745
+ },
2746
+ "type": [
2747
+ "object"
2748
+ ],
2749
+ "id": "komoju",
2750
+ "links": [
2751
+ {
2752
+ "href": "https://komoju.com/api/v1",
2753
+ "rel": "self"
2754
+ }
2755
+ ],
2756
+ "description": "Komoju API auto-generated JSON Schema",
2757
+ "title": "Komoju API"
2758
+ }
459
2759
  HEROICS_SCHEMA
460
2760
  end