{"openapi":"3.1.0","info":{"title":"ElasticPay API Docs","version":"1.0.0"},"security":[{"SecretKeyAuth":[]},{"PublicKeyAuth":[]}],"components":{"schemas":{},"parameters":{},"securitySchemes":{"SecretKeyAuth":{"type":"http","scheme":"bearer","bearerFormat":"API Key","description":"Use your secret key: sk_..."},"PublicKeyAuth":{"type":"http","scheme":"bearer","bearerFormat":"API Key","description":"Use your publishable key: pk_..."}}},"paths":{"/api/v1/customers":{"post":{"tags":["Customer"],"summary":"Create a new Customer","operationId":"post_CustomerCreate","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","description":"Full name of the customer"},"email":{"type":"string","format":"email"},"reference":{"type":"string","description":"Your internal reference for this customer"},"status":{"type":"string","enum":["active","inactive"]},"business_name":{"type":"string"},"billing_address":{"type":"object","properties":{"line1":{"type":"string"},"line2":{"type":"string"},"city_or_suburb":{"type":"string"},"state_or_region":{"type":"string"},"postal_code":{"type":"string"},"country":{"type":"string"}}},"shipping_address":{"type":"object","properties":{"line1":{"type":"string"},"line2":{"type":"string"},"city_or_suburb":{"type":"string"},"state_or_region":{"type":"string"},"postal_code":{"type":"string"},"country":{"type":"string"}}},"notification_preferences":{"type":"object","properties":{"send_payment_emails":{"type":"boolean"},"send_sms_reminders":{"type":"boolean"},"send_sms_failures":{"type":"boolean"}}},"fee_preferences":{"type":"object","properties":{"customer_pays_transaction_fees":{"type":"boolean"}}},"additional_attributes":{"type":"object","additionalProperties":{}},"phones":{"type":"array","items":{"type":"object","properties":{"kind":{"type":"string"},"raw":{"type":"string"},"country_code":{"type":"string"}},"required":["raw"]}},"test_clock":{"type":"string","description":"Test clock ID (clk_...) to attach this customer to. Sandbox only."}},"required":["name"]}}}},"responses":{"201":{"description":"Returns the created Customer","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"Customer ID","example":"cus_32charactersofbase62letters89012"},"name":{"type":["string","null"]},"email":{"type":["string","null"]},"reference":{"type":["string","null"]},"status":{"type":["string","null"]},"business_name":{"type":["string","null"]},"billing_address":{"type":["object","null"],"additionalProperties":{}},"shipping_address":{"type":["object","null"],"additionalProperties":{}},"notification_preferences":{"type":["object","null"],"additionalProperties":{}},"fee_preferences":{"type":["object","null"],"additionalProperties":{}},"additional_attributes":{"type":["object","null"],"additionalProperties":{}},"phones":{"type":["array","null"],"items":{}},"biller_id":{"type":["string","null"]},"test_clock":{"type":["string","null"]},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"deleted_at":{"type":["string","null"],"format":"date-time"}},"required":["id"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string","example":"Payment intent not found"},"type":{"type":"string","example":"invalid_request_error"},"code":{"type":"string","example":"payment_intent_not_found"},"details":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"path":{"type":"string"}},"required":["code","message"]}}},"required":["message","type"]}},"required":["error"]}}}},"401":{"description":"Unauthenticated","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string","example":"Payment intent not found"},"type":{"type":"string","example":"invalid_request_error"},"code":{"type":"string","example":"payment_intent_not_found"},"details":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"path":{"type":"string"}},"required":["code","message"]}}},"required":["message","type"]}},"required":["error"]}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string","example":"Payment intent not found"},"type":{"type":"string","example":"invalid_request_error"},"code":{"type":"string","example":"payment_intent_not_found"},"details":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"path":{"type":"string"}},"required":["code","message"]}}},"required":["message","type"]}},"required":["error"]}}}},"422":{"description":"Unprocessable entity","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string","example":"Payment intent not found"},"type":{"type":"string","example":"invalid_request_error"},"code":{"type":"string","example":"payment_intent_not_found"},"details":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"path":{"type":"string"}},"required":["code","message"]}}},"required":["message","type"]}},"required":["error"]}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string","example":"Payment intent not found"},"type":{"type":"string","example":"invalid_request_error"},"code":{"type":"string","example":"payment_intent_not_found"},"details":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"path":{"type":"string"}},"required":["code","message"]}}},"required":["message","type"]}},"required":["error"]}}}}}},"get":{"tags":["Customer"],"summary":"List Customers","operationId":"get_CustomerList","parameters":[{"schema":{"type":"string"},"required":false,"name":"status","in":"query"},{"schema":{"type":"string"},"required":false,"name":"email","in":"query"},{"schema":{"type":"string"},"required":false,"name":"name","in":"query"},{"schema":{"type":"string"},"required":false,"name":"reference","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string","description":"Customer ID","example":"cus_32charactersofbase62letters89012"},"required":false,"description":"Customer ID","name":"starting_after","in":"query"}],"responses":{"200":{"description":"Returns a paginated list of Customers","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Customer ID","example":"cus_32charactersofbase62letters89012"},"name":{"type":["string","null"]},"email":{"type":["string","null"]},"reference":{"type":["string","null"]},"status":{"type":["string","null"]},"business_name":{"type":["string","null"]},"billing_address":{"type":["object","null"],"additionalProperties":{}},"shipping_address":{"type":["object","null"],"additionalProperties":{}},"notification_preferences":{"type":["object","null"],"additionalProperties":{}},"fee_preferences":{"type":["object","null"],"additionalProperties":{}},"additional_attributes":{"type":["object","null"],"additionalProperties":{}},"phones":{"type":["array","null"],"items":{}},"biller_id":{"type":["string","null"]},"test_clock":{"type":["string","null"]},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"deleted_at":{"type":["string","null"],"format":"date-time"}},"required":["id"]}},"has_more":{"type":"boolean"}},"required":["data","has_more"]}}}},"401":{"description":"Unauthenticated","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string","example":"Payment intent not found"},"type":{"type":"string","example":"invalid_request_error"},"code":{"type":"string","example":"payment_intent_not_found"},"details":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"path":{"type":"string"}},"required":["code","message"]}}},"required":["message","type"]}},"required":["error"]}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string","example":"Payment intent not found"},"type":{"type":"string","example":"invalid_request_error"},"code":{"type":"string","example":"payment_intent_not_found"},"details":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"path":{"type":"string"}},"required":["code","message"]}}},"required":["message","type"]}},"required":["error"]}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string","example":"Payment intent not found"},"type":{"type":"string","example":"invalid_request_error"},"code":{"type":"string","example":"payment_intent_not_found"},"details":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"path":{"type":"string"}},"required":["code","message"]}}},"required":["message","type"]}},"required":["error"]}}}}}}},"/api/v1/customers/{customer_id}":{"get":{"tags":["Customer"],"summary":"Fetch a Customer","operationId":"get_CustomerFetch","parameters":[{"schema":{"type":"string","description":"Customer ID","example":"cus_32charactersofbase62letters89012"},"required":true,"description":"Customer ID","name":"customer_id","in":"path"}],"responses":{"200":{"description":"Returns the Customer","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"Customer ID","example":"cus_32charactersofbase62letters89012"},"name":{"type":["string","null"]},"email":{"type":["string","null"]},"reference":{"type":["string","null"]},"status":{"type":["string","null"]},"business_name":{"type":["string","null"]},"billing_address":{"type":["object","null"],"additionalProperties":{}},"shipping_address":{"type":["object","null"],"additionalProperties":{}},"notification_preferences":{"type":["object","null"],"additionalProperties":{}},"fee_preferences":{"type":["object","null"],"additionalProperties":{}},"additional_attributes":{"type":["object","null"],"additionalProperties":{}},"phones":{"type":["array","null"],"items":{}},"biller_id":{"type":["string","null"]},"test_clock":{"type":["string","null"]},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"deleted_at":{"type":["string","null"],"format":"date-time"}},"required":["id"]}}}},"401":{"description":"Unauthenticated","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string","example":"Payment intent not found"},"type":{"type":"string","example":"invalid_request_error"},"code":{"type":"string","example":"payment_intent_not_found"},"details":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"path":{"type":"string"}},"required":["code","message"]}}},"required":["message","type"]}},"required":["error"]}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string","example":"Payment intent not found"},"type":{"type":"string","example":"invalid_request_error"},"code":{"type":"string","example":"payment_intent_not_found"},"details":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"path":{"type":"string"}},"required":["code","message"]}}},"required":["message","type"]}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string","example":"Payment intent not found"},"type":{"type":"string","example":"invalid_request_error"},"code":{"type":"string","example":"payment_intent_not_found"},"details":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"path":{"type":"string"}},"required":["code","message"]}}},"required":["message","type"]}},"required":["error"]}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string","example":"Payment intent not found"},"type":{"type":"string","example":"invalid_request_error"},"code":{"type":"string","example":"payment_intent_not_found"},"details":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"path":{"type":"string"}},"required":["code","message"]}}},"required":["message","type"]}},"required":["error"]}}}}}},"put":{"tags":["Customer"],"summary":"Update a Customer","operationId":"put_CustomerUpdate","parameters":[{"schema":{"type":"string","description":"Customer ID","example":"cus_32charactersofbase62letters89012"},"required":true,"description":"Customer ID","name":"customer_id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","description":"Full name of the customer"},"email":{"type":"string","format":"email"},"reference":{"type":"string","description":"Your internal reference for this customer"},"status":{"type":"string","enum":["active","inactive"]},"business_name":{"type":"string"},"billing_address":{"type":"object","properties":{"line1":{"type":"string"},"line2":{"type":"string"},"city_or_suburb":{"type":"string"},"state_or_region":{"type":"string"},"postal_code":{"type":"string"},"country":{"type":"string"}}},"shipping_address":{"type":"object","properties":{"line1":{"type":"string"},"line2":{"type":"string"},"city_or_suburb":{"type":"string"},"state_or_region":{"type":"string"},"postal_code":{"type":"string"},"country":{"type":"string"}}},"notification_preferences":{"type":"object","properties":{"send_payment_emails":{"type":"boolean"},"send_sms_reminders":{"type":"boolean"},"send_sms_failures":{"type":"boolean"}}},"fee_preferences":{"type":"object","properties":{"customer_pays_transaction_fees":{"type":"boolean"}}},"additional_attributes":{"type":"object","additionalProperties":{}},"phones":{"type":"array","items":{"type":"object","properties":{"kind":{"type":"string"},"raw":{"type":"string"},"country_code":{"type":"string"}},"required":["raw"]}},"test_clock":{"type":"string","description":"Test clock ID (clk_...) to attach this customer to. Sandbox only."}}}}}},"responses":{"200":{"description":"Returns the updated Customer","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"Customer ID","example":"cus_32charactersofbase62letters89012"},"name":{"type":["string","null"]},"email":{"type":["string","null"]},"reference":{"type":["string","null"]},"status":{"type":["string","null"]},"business_name":{"type":["string","null"]},"billing_address":{"type":["object","null"],"additionalProperties":{}},"shipping_address":{"type":["object","null"],"additionalProperties":{}},"notification_preferences":{"type":["object","null"],"additionalProperties":{}},"fee_preferences":{"type":["object","null"],"additionalProperties":{}},"additional_attributes":{"type":["object","null"],"additionalProperties":{}},"phones":{"type":["array","null"],"items":{}},"biller_id":{"type":["string","null"]},"test_clock":{"type":["string","null"]},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"deleted_at":{"type":["string","null"],"format":"date-time"}},"required":["id"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string","example":"Payment intent not found"},"type":{"type":"string","example":"invalid_request_error"},"code":{"type":"string","example":"payment_intent_not_found"},"details":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"path":{"type":"string"}},"required":["code","message"]}}},"required":["message","type"]}},"required":["error"]}}}},"401":{"description":"Unauthenticated","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string","example":"Payment intent not found"},"type":{"type":"string","example":"invalid_request_error"},"code":{"type":"string","example":"payment_intent_not_found"},"details":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"path":{"type":"string"}},"required":["code","message"]}}},"required":["message","type"]}},"required":["error"]}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string","example":"Payment intent not found"},"type":{"type":"string","example":"invalid_request_error"},"code":{"type":"string","example":"payment_intent_not_found"},"details":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"path":{"type":"string"}},"required":["code","message"]}}},"required":["message","type"]}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string","example":"Payment intent not found"},"type":{"type":"string","example":"invalid_request_error"},"code":{"type":"string","example":"payment_intent_not_found"},"details":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"path":{"type":"string"}},"required":["code","message"]}}},"required":["message","type"]}},"required":["error"]}}}},"422":{"description":"Unprocessable entity","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string","example":"Payment intent not found"},"type":{"type":"string","example":"invalid_request_error"},"code":{"type":"string","example":"payment_intent_not_found"},"details":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"path":{"type":"string"}},"required":["code","message"]}}},"required":["message","type"]}},"required":["error"]}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string","example":"Payment intent not found"},"type":{"type":"string","example":"invalid_request_error"},"code":{"type":"string","example":"payment_intent_not_found"},"details":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"path":{"type":"string"}},"required":["code","message"]}}},"required":["message","type"]}},"required":["error"]}}}}}},"delete":{"tags":["Customer"],"summary":"Delete a Customer","operationId":"delete_CustomerDelete","parameters":[{"schema":{"type":"string","description":"Customer ID","example":"cus_32charactersofbase62letters89012"},"required":true,"description":"Customer ID","name":"customer_id","in":"path"}],"responses":{"200":{"description":"Returns the deleted Customer","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"Customer ID","example":"cus_32charactersofbase62letters89012"},"name":{"type":["string","null"]},"email":{"type":["string","null"]},"reference":{"type":["string","null"]},"status":{"type":["string","null"]},"business_name":{"type":["string","null"]},"billing_address":{"type":["object","null"],"additionalProperties":{}},"shipping_address":{"type":["object","null"],"additionalProperties":{}},"notification_preferences":{"type":["object","null"],"additionalProperties":{}},"fee_preferences":{"type":["object","null"],"additionalProperties":{}},"additional_attributes":{"type":["object","null"],"additionalProperties":{}},"phones":{"type":["array","null"],"items":{}},"biller_id":{"type":["string","null"]},"test_clock":{"type":["string","null"]},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"deleted_at":{"type":["string","null"],"format":"date-time"}},"required":["id"]}}}},"401":{"description":"Unauthenticated","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string","example":"Payment intent not found"},"type":{"type":"string","example":"invalid_request_error"},"code":{"type":"string","example":"payment_intent_not_found"},"details":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"path":{"type":"string"}},"required":["code","message"]}}},"required":["message","type"]}},"required":["error"]}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string","example":"Payment intent not found"},"type":{"type":"string","example":"invalid_request_error"},"code":{"type":"string","example":"payment_intent_not_found"},"details":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"path":{"type":"string"}},"required":["code","message"]}}},"required":["message","type"]}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string","example":"Payment intent not found"},"type":{"type":"string","example":"invalid_request_error"},"code":{"type":"string","example":"payment_intent_not_found"},"details":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"path":{"type":"string"}},"required":["code","message"]}}},"required":["message","type"]}},"required":["error"]}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string","example":"Payment intent not found"},"type":{"type":"string","example":"invalid_request_error"},"code":{"type":"string","example":"payment_intent_not_found"},"details":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"path":{"type":"string"}},"required":["code","message"]}}},"required":["message","type"]}},"required":["error"]}}}}}}},"/api/v1/customers/{customer_id}/payment_intents":{"get":{"tags":["Customer"],"summary":"List PaymentIntents for a Customer","operationId":"get_CustomerPaymentIntentList","parameters":[{"schema":{"type":"string","description":"Customer ID","example":"cus_32charactersofbase62letters89012"},"required":true,"description":"Customer ID","name":"customer_id","in":"path"},{"schema":{"type":"string"},"required":false,"name":"status","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string"},"required":false,"name":"starting_after","in":"query"}],"responses":{"200":{"description":"Returns a paginated list of PaymentIntents for the customer","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","additionalProperties":{}}},"has_more":{"type":"boolean"}},"required":["data","has_more"]}}}},"401":{"description":"Unauthenticated","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string","example":"Payment intent not found"},"type":{"type":"string","example":"invalid_request_error"},"code":{"type":"string","example":"payment_intent_not_found"},"details":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"path":{"type":"string"}},"required":["code","message"]}}},"required":["message","type"]}},"required":["error"]}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string","example":"Payment intent not found"},"type":{"type":"string","example":"invalid_request_error"},"code":{"type":"string","example":"payment_intent_not_found"},"details":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"path":{"type":"string"}},"required":["code","message"]}}},"required":["message","type"]}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string","example":"Payment intent not found"},"type":{"type":"string","example":"invalid_request_error"},"code":{"type":"string","example":"payment_intent_not_found"},"details":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"path":{"type":"string"}},"required":["code","message"]}}},"required":["message","type"]}},"required":["error"]}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string","example":"Payment intent not found"},"type":{"type":"string","example":"invalid_request_error"},"code":{"type":"string","example":"payment_intent_not_found"},"details":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"path":{"type":"string"}},"required":["code","message"]}}},"required":["message","type"]}},"required":["error"]}}}}}}},"/api/v1/payment_methods":{"post":{"tags":["PaymentMethod"],"summary":"Create a new PaymentMethod","operationId":"post_PaymentMethodCreate","requestBody":{"content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["card"]},"payment_method_data":{"type":"object","properties":{"card_name":{"type":"string","maxLength":30},"card_number_token":{"type":"string"},"card_number_end":{"type":"string","minLength":4,"maxLength":4},"card_bin":{"type":"string","pattern":"^[0-9]{8}$"},"expiry_month":{"type":"integer","minimum":1,"maximum":12},"expiry_year":{"type":"integer"},"fingerprint":{"type":"string"},"wallet":{"type":"string"},"card_brand":{"type":"string"},"token_metadata":{"type":"object","properties":{"type":{"type":"string"},"token":{"type":"string"},"data":{"type":"string"}},"required":["type","token","data"]}},"required":["expiry_month","expiry_year","token_metadata"]},"customer_reference":{"type":"string"}},"required":["type","payment_method_data"]},{"type":"object","properties":{"type":{"type":"string","enum":["au_becs_debit"]},"payment_method_data":{"type":"object","properties":{"bsb_number":{"type":"string"},"account_name":{"type":"string"},"account_number_token":{"type":"string"},"account_number_end":{"type":"string","minLength":4,"maxLength":4},"fingerprint":{"type":"string"},"account_number":{"type":"string","minLength":6,"maxLength":9}},"required":["bsb_number","account_name","account_number"]},"customer_reference":{"type":"string"}},"required":["type","payment_method_data"]}]}}}},"responses":{"200":{"description":"Returns the created PaymentMethod","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"payment_method":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string"},"card":{"type":"object","properties":{"last4":{"type":"string"},"exp_month":{"type":"integer"},"exp_year":{"type":"integer"},"brand":{"type":"string"},"wallet":{"type":"string"}}},"au_becs_debit":{"type":"object","properties":{"bsb_number":{"type":"string"},"account_name":{"type":"string"},"last4":{"type":"string"}}}},"required":["id","type"]}},"required":["success","payment_method"]},"example":{"success":true,"payment_method":{"id":"pm_xxx","type":"card","card":{"last4":"4242","exp_month":12,"exp_year":2028}}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string","example":"Payment intent not found"},"type":{"type":"string","example":"invalid_request_error"},"code":{"type":"string","example":"payment_intent_not_found"},"details":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"path":{"type":"string"}},"required":["code","message"]}}},"required":["message","type"]}},"required":["error"]}}}},"401":{"description":"Unauthenticated","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string","example":"Payment intent not found"},"type":{"type":"string","example":"invalid_request_error"},"code":{"type":"string","example":"payment_intent_not_found"},"details":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"path":{"type":"string"}},"required":["code","message"]}}},"required":["message","type"]}},"required":["error"]}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string","example":"Payment intent not found"},"type":{"type":"string","example":"invalid_request_error"},"code":{"type":"string","example":"payment_intent_not_found"},"details":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"path":{"type":"string"}},"required":["code","message"]}}},"required":["message","type"]}},"required":["error"]}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string","example":"Payment intent not found"},"type":{"type":"string","example":"invalid_request_error"},"code":{"type":"string","example":"payment_intent_not_found"},"details":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"path":{"type":"string"}},"required":["code","message"]}}},"required":["message","type"]}},"required":["error"]}}}}}},"get":{"tags":["PaymentMethod"],"summary":"List PaymentMethods","operationId":"get_PaymentMethodList","responses":{"200":{"description":"Returns payment methods for the authenticated biller","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"payment_methods":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string"},"instrument_data":{"type":"object","additionalProperties":{}}},"required":["id","type","instrument_data"]}}},"required":["success","payment_methods"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string","example":"Payment intent not found"},"type":{"type":"string","example":"invalid_request_error"},"code":{"type":"string","example":"payment_intent_not_found"},"details":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"path":{"type":"string"}},"required":["code","message"]}}},"required":["message","type"]}},"required":["error"]}}}},"401":{"description":"Unauthenticated","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string","example":"Payment intent not found"},"type":{"type":"string","example":"invalid_request_error"},"code":{"type":"string","example":"payment_intent_not_found"},"details":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"path":{"type":"string"}},"required":["code","message"]}}},"required":["message","type"]}},"required":["error"]}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string","example":"Payment intent not found"},"type":{"type":"string","example":"invalid_request_error"},"code":{"type":"string","example":"payment_intent_not_found"},"details":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"path":{"type":"string"}},"required":["code","message"]}}},"required":["message","type"]}},"required":["error"]}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string","example":"Payment intent not found"},"type":{"type":"string","example":"invalid_request_error"},"code":{"type":"string","example":"payment_intent_not_found"},"details":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"path":{"type":"string"}},"required":["code","message"]}}},"required":["message","type"]}},"required":["error"]}}}}}}},"/api/v1/payment_methods/{payment_method_id}":{"get":{"tags":["PaymentMethod"],"summary":"Fetch a PaymentMethod","operationId":"get_PaymentMethodFetch","parameters":[{"schema":{"type":"string","description":"PaymentMethod ID (pm_xxx)"},"required":true,"description":"PaymentMethod ID (pm_xxx)","name":"payment_method_id","in":"path"}],"responses":{"200":{"description":"Returns the requested PaymentMethod","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"payment_method":{"oneOf":[{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","enum":["card"]},"instrument_data":{"type":"object","properties":{"card_name":{"type":"string","maxLength":30},"card_number_token":{"type":"string"},"card_number_end":{"type":"string","minLength":4,"maxLength":4},"card_bin":{"type":"string","pattern":"^[0-9]{8}$"},"expiry_month":{"type":"integer","minimum":1,"maximum":12},"expiry_year":{"type":"integer"},"fingerprint":{"type":"string"},"wallet":{"type":"string"}},"required":["card_name","expiry_month","expiry_year"]}},"required":["id","type","instrument_data"]},{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","enum":["au_becs_debit"]},"instrument_data":{"type":"object","properties":{"bsb_number":{"type":"string"},"account_name":{"type":"string"},"account_number_token":{"type":"string"},"account_number_end":{"type":"string","minLength":4,"maxLength":4},"fingerprint":{"type":"string"}},"required":["bsb_number","account_name"]}},"required":["id","type","instrument_data"]},{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","enum":["klarna"]},"instrument_data":{"type":"object","properties":{"dob":{"type":["object","null"],"properties":{"day":{"type":["integer","null"]},"month":{"type":["integer","null"]},"year":{"type":["integer","null"]}},"required":["day","month","year"]}}}},"required":["id","type","instrument_data"]},{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","enum":["pay_id"]},"instrument_data":{"type":"object","properties":{"payid":{"type":"string"},"payid_type":{"type":"string"},"account_name":{"type":"string"}},"required":["payid","account_name"]}},"required":["id","type","instrument_data"]},{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","enum":["paypal"]},"instrument_data":{"type":"object","properties":{"paypal_email":{"type":"string","format":"email"},"paypal_token":{"type":"string"},"account_name":{"type":"string"}},"required":["paypal_email","account_name"]}},"required":["id","type","instrument_data"]}]}},"required":["success","payment_method"]},"example":{"success":true,"payment_method":{"id":"pm_xxx","type":"card","instrument_data":{"card_name":"Cardholder","card_number_end":"4242","card_bin":"41111111","expiry_month":12,"expiry_year":2028,"wallet":"apple_pay"}}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string","example":"Payment intent not found"},"type":{"type":"string","example":"invalid_request_error"},"code":{"type":"string","example":"payment_intent_not_found"},"details":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"path":{"type":"string"}},"required":["code","message"]}}},"required":["message","type"]}},"required":["error"]}}}},"401":{"description":"Unauthenticated","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string","example":"Payment intent not found"},"type":{"type":"string","example":"invalid_request_error"},"code":{"type":"string","example":"payment_intent_not_found"},"details":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"path":{"type":"string"}},"required":["code","message"]}}},"required":["message","type"]}},"required":["error"]}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string","example":"Payment intent not found"},"type":{"type":"string","example":"invalid_request_error"},"code":{"type":"string","example":"payment_intent_not_found"},"details":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"path":{"type":"string"}},"required":["code","message"]}}},"required":["message","type"]}},"required":["error"]}}}},"404":{"description":"Payment method not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string","example":"Payment intent not found"},"type":{"type":"string","example":"invalid_request_error"},"code":{"type":"string","example":"payment_intent_not_found"},"details":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"path":{"type":"string"}},"required":["code","message"]}}},"required":["message","type"]}},"required":["error"]}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string","example":"Payment intent not found"},"type":{"type":"string","example":"invalid_request_error"},"code":{"type":"string","example":"payment_intent_not_found"},"details":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"path":{"type":"string"}},"required":["code","message"]}}},"required":["message","type"]}},"required":["error"]}}}}}}},"/api/v1/customers/{customer_id}/payment_methods":{"get":{"tags":["PaymentMethod"],"summary":"List PaymentMethods for customer","operationId":"get_CustomerPaymentMethodList","parameters":[{"schema":{"type":"string","description":"Customer ID (cus_xxx)"},"required":true,"description":"Customer ID (cus_xxx)","name":"customer_id","in":"path"}],"responses":{"200":{"description":"Returns payment methods for a customer","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"payment_methods":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string"},"instrument_data":{"type":"object","additionalProperties":{}}},"required":["id","type","instrument_data"]}}},"required":["success","payment_methods"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string","example":"Payment intent not found"},"type":{"type":"string","example":"invalid_request_error"},"code":{"type":"string","example":"payment_intent_not_found"},"details":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"path":{"type":"string"}},"required":["code","message"]}}},"required":["message","type"]}},"required":["error"]}}}},"401":{"description":"Unauthenticated","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string","example":"Payment intent not found"},"type":{"type":"string","example":"invalid_request_error"},"code":{"type":"string","example":"payment_intent_not_found"},"details":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"path":{"type":"string"}},"required":["code","message"]}}},"required":["message","type"]}},"required":["error"]}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string","example":"Payment intent not found"},"type":{"type":"string","example":"invalid_request_error"},"code":{"type":"string","example":"payment_intent_not_found"},"details":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"path":{"type":"string"}},"required":["code","message"]}}},"required":["message","type"]}},"required":["error"]}}}},"404":{"description":"Customer not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string","example":"Payment intent not found"},"type":{"type":"string","example":"invalid_request_error"},"code":{"type":"string","example":"payment_intent_not_found"},"details":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"path":{"type":"string"}},"required":["code","message"]}}},"required":["message","type"]}},"required":["error"]}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string","example":"Payment intent not found"},"type":{"type":"string","example":"invalid_request_error"},"code":{"type":"string","example":"payment_intent_not_found"},"details":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"path":{"type":"string"}},"required":["code","message"]}}},"required":["message","type"]}},"required":["error"]}}}}}}},"/api/v1/customers/{customer_id}/payment_methods/{payment_method_id}":{"get":{"tags":["PaymentMethod"],"summary":"Fetch a customer PaymentMethod","operationId":"get_CustomerPaymentMethodFetch","parameters":[{"schema":{"type":"string","description":"Customer ID (cus_xxx)"},"required":true,"description":"Customer ID (cus_xxx)","name":"customer_id","in":"path"},{"schema":{"type":"string","description":"PaymentMethod ID (pm_xxx)"},"required":true,"description":"PaymentMethod ID (pm_xxx)","name":"payment_method_id","in":"path"}],"responses":{"200":{"description":"Returns one payment method for a customer","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"payment_method":{"oneOf":[{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","enum":["card"]},"instrument_data":{"type":"object","properties":{"card_name":{"type":"string","maxLength":30},"card_number_token":{"type":"string"},"card_number_end":{"type":"string","minLength":4,"maxLength":4},"card_bin":{"type":"string","pattern":"^[0-9]{8}$"},"expiry_month":{"type":"integer","minimum":1,"maximum":12},"expiry_year":{"type":"integer"},"fingerprint":{"type":"string"},"wallet":{"type":"string"}},"required":["card_name","expiry_month","expiry_year"]}},"required":["id","type","instrument_data"]},{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","enum":["au_becs_debit"]},"instrument_data":{"type":"object","properties":{"bsb_number":{"type":"string"},"account_name":{"type":"string"},"account_number_token":{"type":"string"},"account_number_end":{"type":"string","minLength":4,"maxLength":4},"fingerprint":{"type":"string"}},"required":["bsb_number","account_name"]}},"required":["id","type","instrument_data"]},{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","enum":["klarna"]},"instrument_data":{"type":"object","properties":{"dob":{"type":["object","null"],"properties":{"day":{"type":["integer","null"]},"month":{"type":["integer","null"]},"year":{"type":["integer","null"]}},"required":["day","month","year"]}}}},"required":["id","type","instrument_data"]},{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","enum":["pay_id"]},"instrument_data":{"type":"object","properties":{"payid":{"type":"string"},"payid_type":{"type":"string"},"account_name":{"type":"string"}},"required":["payid","account_name"]}},"required":["id","type","instrument_data"]},{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","enum":["paypal"]},"instrument_data":{"type":"object","properties":{"paypal_email":{"type":"string","format":"email"},"paypal_token":{"type":"string"},"account_name":{"type":"string"}},"required":["paypal_email","account_name"]}},"required":["id","type","instrument_data"]}]}},"required":["success","payment_method"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string","example":"Payment intent not found"},"type":{"type":"string","example":"invalid_request_error"},"code":{"type":"string","example":"payment_intent_not_found"},"details":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"path":{"type":"string"}},"required":["code","message"]}}},"required":["message","type"]}},"required":["error"]}}}},"401":{"description":"Unauthenticated","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string","example":"Payment intent not found"},"type":{"type":"string","example":"invalid_request_error"},"code":{"type":"string","example":"payment_intent_not_found"},"details":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"path":{"type":"string"}},"required":["code","message"]}}},"required":["message","type"]}},"required":["error"]}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string","example":"Payment intent not found"},"type":{"type":"string","example":"invalid_request_error"},"code":{"type":"string","example":"payment_intent_not_found"},"details":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"path":{"type":"string"}},"required":["code","message"]}}},"required":["message","type"]}},"required":["error"]}}}},"404":{"description":"Payment method not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string","example":"Payment intent not found"},"type":{"type":"string","example":"invalid_request_error"},"code":{"type":"string","example":"payment_intent_not_found"},"details":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"path":{"type":"string"}},"required":["code","message"]}}},"required":["message","type"]}},"required":["error"]}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string","example":"Payment intent not found"},"type":{"type":"string","example":"invalid_request_error"},"code":{"type":"string","example":"payment_intent_not_found"},"details":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"path":{"type":"string"}},"required":["code","message"]}}},"required":["message","type"]}},"required":["error"]}}}}}}},"/api/v1/payment_methods/{payment_method_id}/detach":{"post":{"tags":["PaymentMethod"],"summary":"Detach a PaymentMethod","operationId":"post_PaymentMethodDetach","parameters":[{"schema":{"type":"string","description":"PaymentMethod ID (pm_xxx)"},"required":true,"description":"PaymentMethod ID (pm_xxx)","name":"payment_method_id","in":"path"}],"responses":{"200":{"description":"Returns the detached PaymentMethod","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"payment_method":{"oneOf":[{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","enum":["card"]},"instrument_data":{"type":"object","properties":{"card_name":{"type":"string","maxLength":30},"card_number_token":{"type":"string"},"card_number_end":{"type":"string","minLength":4,"maxLength":4},"card_bin":{"type":"string","pattern":"^[0-9]{8}$"},"expiry_month":{"type":"integer","minimum":1,"maximum":12},"expiry_year":{"type":"integer"},"fingerprint":{"type":"string"},"wallet":{"type":"string"}},"required":["card_name","expiry_month","expiry_year"]}},"required":["id","type","instrument_data"]},{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","enum":["au_becs_debit"]},"instrument_data":{"type":"object","properties":{"bsb_number":{"type":"string"},"account_name":{"type":"string"},"account_number_token":{"type":"string"},"account_number_end":{"type":"string","minLength":4,"maxLength":4},"fingerprint":{"type":"string"}},"required":["bsb_number","account_name"]}},"required":["id","type","instrument_data"]},{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","enum":["klarna"]},"instrument_data":{"type":"object","properties":{"dob":{"type":["object","null"],"properties":{"day":{"type":["integer","null"]},"month":{"type":["integer","null"]},"year":{"type":["integer","null"]}},"required":["day","month","year"]}}}},"required":["id","type","instrument_data"]},{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","enum":["pay_id"]},"instrument_data":{"type":"object","properties":{"payid":{"type":"string"},"payid_type":{"type":"string"},"account_name":{"type":"string"}},"required":["payid","account_name"]}},"required":["id","type","instrument_data"]},{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","enum":["paypal"]},"instrument_data":{"type":"object","properties":{"paypal_email":{"type":"string","format":"email"},"paypal_token":{"type":"string"},"account_name":{"type":"string"}},"required":["paypal_email","account_name"]}},"required":["id","type","instrument_data"]}]}},"required":["success","payment_method"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string","example":"Payment intent not found"},"type":{"type":"string","example":"invalid_request_error"},"code":{"type":"string","example":"payment_intent_not_found"},"details":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"path":{"type":"string"}},"required":["code","message"]}}},"required":["message","type"]}},"required":["error"]}}}},"401":{"description":"Unauthenticated","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string","example":"Payment intent not found"},"type":{"type":"string","example":"invalid_request_error"},"code":{"type":"string","example":"payment_intent_not_found"},"details":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"path":{"type":"string"}},"required":["code","message"]}}},"required":["message","type"]}},"required":["error"]}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string","example":"Payment intent not found"},"type":{"type":"string","example":"invalid_request_error"},"code":{"type":"string","example":"payment_intent_not_found"},"details":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"path":{"type":"string"}},"required":["code","message"]}}},"required":["message","type"]}},"required":["error"]}}}},"404":{"description":"Payment method not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string","example":"Payment intent not found"},"type":{"type":"string","example":"invalid_request_error"},"code":{"type":"string","example":"payment_intent_not_found"},"details":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"path":{"type":"string"}},"required":["code","message"]}}},"required":["message","type"]}},"required":["error"]}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string","example":"Payment intent not found"},"type":{"type":"string","example":"invalid_request_error"},"code":{"type":"string","example":"payment_intent_not_found"},"details":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"path":{"type":"string"}},"required":["code","message"]}}},"required":["message","type"]}},"required":["error"]}}}}}}},"/api/v1/payment_intents":{"post":{"tags":["PaymentIntent"],"summary":"Create a new PaymentIntent","operationId":"post_PaymentIntentCreate","parameters":[{"schema":{"type":["string","null"],"description":"Unique key for idempotent requests"},"required":false,"description":"Unique key for idempotent requests","name":"Idempotency-Key","in":"header"},{"schema":{"type":["string","null"],"description":"TTL in seconds for idempotency key"},"required":false,"description":"TTL in seconds for idempotency key","name":"Idempotency-TTL","in":"header"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"amount":{"type":"number","minimum":0,"maximum":100000},"currency":{"type":"string","enum":["USD","AUD","NZD","EUR","GBP","JPY"]},"customer_id":{"type":"string","description":"Customer ID","example":"cus_32charactersofbase62letters89012"},"biller_id":{"type":"string","description":"Biller Account ID","example":"acct_32charactersofbase62letters89012"},"payment_method":{"type":"string"},"payment_method_data":{"type":"object","properties":{},"additionalProperties":{}},"metadata":{"type":"object","additionalProperties":{"type":"string"}},"surcharge_applied":{"type":"boolean"},"scheduled_payment_date":{"type":"string","format":"date","description":"ISO date (YYYY-MM-DD) on which this payment should be automatically processed. Must be today or in the future, at most 366 days out. Requires a saved payment_method (pm_xxx)."},"statement_descriptor":{"type":"string","maxLength":22,"description":"Per-PaymentIntent soft descriptor override that should name the biller on the payer's statement. Falls back to the biller-level default when omitted."}},"required":["amount","currency"]}}}},"responses":{"201":{"description":"Returns the created PaymentIntent","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"PaymentIntent ID","example":"pi_sandbox_32charactersofbase62letters89012"},"client_secret":{"type":"string"},"amount":{"type":"number","example":2500,"description":"Base amount in minor units"},"total_amount":{"type":"number","example":2583,"description":"Total charged amount (base + surcharge) in minor units"},"fee_amount":{"type":"number","example":83,"description":"Calculated fee in minor units"},"surcharge_amount":{"type":"number","example":83,"description":"Surcharge component in minor units (0 if not surcharged)"},"surcharge_applied":{"type":"boolean","example":true,"description":"Whether surcharge was applied to this payment"},"currency":{"type":"string","enum":["USD","AUD","NZD","EUR","GBP","JPY"]},"status":{"type":"string","example":"succeeded"},"payment_method_id":{"type":"string","example":"pm_sandbox_1234"},"customer_id":{"type":"string","description":"Customer ID","example":"cus_32charactersofbase62letters89012"},"biller_id":{"type":"string","description":"Biller Account ID","example":"acct_32charactersofbase62letters89012"},"metadata":{"type":"object","additionalProperties":{"type":"string"}},"scheduled_payment_date":{"type":"string","example":"2026-06-01","description":"ISO date (YYYY-MM-DD) on which this payment is scheduled to process. Present only for future-dated scheduled payments."},"statement_descriptor":{"type":"string","example":"ACME CAFE","description":"Soft descriptor that should name the biller on the payer's statement (per-PI override or biller default)."},"total_refunded_amount":{"type":"number","example":0,"description":"Cumulative refunded amount in minor units"},"last_payment_error":{"type":["object","null"],"properties":{"code":{"type":"string","example":"card_declined","description":"Coarse decline category from the PSP."},"message":{"type":"string","example":"Your card was declined.","description":"Customer-readable decline reason."}},"required":["code","message"]},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"livemode":{"type":"boolean"}},"required":["id","amount","total_amount","fee_amount","surcharge_amount","surcharge_applied","currency","status","created_at","updated_at","livemode"]},"example":{"id":"pi_1234567890","amount":2500,"currency":"USD","status":"requires_payment_method","customer_id":"cus_1234567890","biller_id":"biller_12345","metadata":{"order_id":"order_123"},"created_at":"2026-01-15T10:30:00Z","updated_at":"2026-01-15T10:30:00Z","livemode":false}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string","example":"Payment intent not found"},"type":{"type":"string","example":"invalid_request_error"},"code":{"type":"string","example":"payment_intent_not_found"},"details":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"path":{"type":"string"}},"required":["code","message"]}}},"required":["message","type"]}},"required":["error"]}}}},"401":{"description":"Unauthenticated","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string","example":"Payment intent not found"},"type":{"type":"string","example":"invalid_request_error"},"code":{"type":"string","example":"payment_intent_not_found"},"details":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"path":{"type":"string"}},"required":["code","message"]}}},"required":["message","type"]}},"required":["error"]}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string","example":"Payment intent not found"},"type":{"type":"string","example":"invalid_request_error"},"code":{"type":"string","example":"payment_intent_not_found"},"details":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"path":{"type":"string"}},"required":["code","message"]}}},"required":["message","type"]}},"required":["error"]}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string","example":"Payment intent not found"},"type":{"type":"string","example":"invalid_request_error"},"code":{"type":"string","example":"payment_intent_not_found"},"details":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"path":{"type":"string"}},"required":["code","message"]}}},"required":["message","type"]}},"required":["error"]}}}}}}},"/api/v1/payment_intents/{payment_intent_id}":{"get":{"tags":["PaymentIntent"],"summary":"Fetch a PaymentIntent","operationId":"get_PaymentIntentFetch","parameters":[{"schema":{"type":"string","description":"PaymentIntent ID","example":"pi_sandbox_32charactersofbase62letters89012"},"required":true,"description":"PaymentIntent ID","name":"payment_intent_id","in":"path"}],"responses":{"200":{"description":"Returns the PaymentIntent","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"PaymentIntent ID","example":"pi_sandbox_32charactersofbase62letters89012"},"client_secret":{"type":"string"},"amount":{"type":"number","example":2500,"description":"Base amount in minor units"},"total_amount":{"type":"number","example":2583,"description":"Total charged amount (base + surcharge) in minor units"},"fee_amount":{"type":"number","example":83,"description":"Calculated fee in minor units"},"surcharge_amount":{"type":"number","example":83,"description":"Surcharge component in minor units (0 if not surcharged)"},"surcharge_applied":{"type":"boolean","example":true,"description":"Whether surcharge was applied to this payment"},"currency":{"type":"string","enum":["USD","AUD","NZD","EUR","GBP","JPY"]},"status":{"type":"string","example":"succeeded"},"payment_method_id":{"type":"string","example":"pm_sandbox_1234"},"customer_id":{"type":"string","description":"Customer ID","example":"cus_32charactersofbase62letters89012"},"biller_id":{"type":"string","description":"Biller Account ID","example":"acct_32charactersofbase62letters89012"},"metadata":{"type":"object","additionalProperties":{"type":"string"}},"scheduled_payment_date":{"type":"string","example":"2026-06-01","description":"ISO date (YYYY-MM-DD) on which this payment is scheduled to process. Present only for future-dated scheduled payments."},"statement_descriptor":{"type":"string","example":"ACME CAFE","description":"Soft descriptor that should name the biller on the payer's statement (per-PI override or biller default)."},"total_refunded_amount":{"type":"number","example":0,"description":"Cumulative refunded amount in minor units"},"last_payment_error":{"type":["object","null"],"properties":{"code":{"type":"string","example":"card_declined","description":"Coarse decline category from the PSP."},"message":{"type":"string","example":"Your card was declined.","description":"Customer-readable decline reason."}},"required":["code","message"]},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"livemode":{"type":"boolean"}},"required":["id","amount","total_amount","fee_amount","surcharge_amount","surcharge_applied","currency","status","created_at","updated_at","livemode"]},"example":{"id":"pi_1234567890","amount":2500,"currency":"USD","status":"succeeded","payment_method_id":"pm_1234567890","customer_id":"cus_1234567890","biller_id":"biller_12345","metadata":{"order_id":"order_123"},"created_at":"2026-01-15T10:30:00Z","updated_at":"2026-01-15T10:35:00Z","livemode":false}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string","example":"Payment intent not found"},"type":{"type":"string","example":"invalid_request_error"},"code":{"type":"string","example":"payment_intent_not_found"},"details":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"path":{"type":"string"}},"required":["code","message"]}}},"required":["message","type"]}},"required":["error"]}}}},"401":{"description":"Unauthenticated","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string","example":"Payment intent not found"},"type":{"type":"string","example":"invalid_request_error"},"code":{"type":"string","example":"payment_intent_not_found"},"details":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"path":{"type":"string"}},"required":["code","message"]}}},"required":["message","type"]}},"required":["error"]}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string","example":"Payment intent not found"},"type":{"type":"string","example":"invalid_request_error"},"code":{"type":"string","example":"payment_intent_not_found"},"details":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"path":{"type":"string"}},"required":["code","message"]}}},"required":["message","type"]}},"required":["error"]}}}},"404":{"description":"PaymentIntent not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string","example":"Payment intent not found"},"type":{"type":"string","example":"invalid_request_error"},"code":{"type":"string","example":"payment_intent_not_found"},"details":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"path":{"type":"string"}},"required":["code","message"]}}},"required":["message","type"]}},"required":["error"]}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string","example":"Payment intent not found"},"type":{"type":"string","example":"invalid_request_error"},"code":{"type":"string","example":"payment_intent_not_found"},"details":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"path":{"type":"string"}},"required":["code","message"]}}},"required":["message","type"]}},"required":["error"]}}}}}},"put":{"tags":["PaymentIntent"],"summary":"Update a PaymentIntent","operationId":"put_PaymentIntentUpdate","parameters":[{"schema":{"type":"string","description":"PaymentIntent ID","example":"pi_sandbox_32charactersofbase62letters89012"},"required":true,"description":"PaymentIntent ID","name":"payment_intent_id","in":"path"},{"schema":{"type":["string","null"],"description":"Unique key for idempotent requests"},"required":false,"description":"Unique key for idempotent requests","name":"Idempotency-Key","in":"header"},{"schema":{"type":["string","null"],"description":"TTL in seconds for idempotency key"},"required":false,"description":"TTL in seconds for idempotency key","name":"Idempotency-TTL","in":"header"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"amount":{"type":"number","minimum":0,"maximum":100000},"currency":{"type":"string","enum":["USD","AUD","NZD","EUR","GBP","JPY"]},"customer_id":{"type":"string","description":"Customer ID","example":"cus_32charactersofbase62letters89012"},"biller_id":{"type":"string","description":"Biller Account ID","example":"acct_32charactersofbase62letters89012"},"payment_method":{"type":"string"},"payment_method_data":{"type":"object","properties":{},"additionalProperties":{}},"metadata":{"type":"object","additionalProperties":{"type":"string"}},"scheduled_payment_date":{"type":"string","format":"date","description":"ISO date (YYYY-MM-DD) on which this payment should be automatically processed."},"statement_descriptor":{"type":"string","maxLength":22,"description":"Per-PaymentIntent soft descriptor override that should name the biller on the payer's statement."}}}}}},"responses":{"200":{"description":"Returns the updated PaymentIntent","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"PaymentIntent ID","example":"pi_sandbox_32charactersofbase62letters89012"},"client_secret":{"type":"string"},"amount":{"type":"number","example":2500,"description":"Base amount in minor units"},"total_amount":{"type":"number","example":2583,"description":"Total charged amount (base + surcharge) in minor units"},"fee_amount":{"type":"number","example":83,"description":"Calculated fee in minor units"},"surcharge_amount":{"type":"number","example":83,"description":"Surcharge component in minor units (0 if not surcharged)"},"surcharge_applied":{"type":"boolean","example":true,"description":"Whether surcharge was applied to this payment"},"currency":{"type":"string","enum":["USD","AUD","NZD","EUR","GBP","JPY"]},"status":{"type":"string","example":"succeeded"},"payment_method_id":{"type":"string","example":"pm_sandbox_1234"},"customer_id":{"type":"string","description":"Customer ID","example":"cus_32charactersofbase62letters89012"},"biller_id":{"type":"string","description":"Biller Account ID","example":"acct_32charactersofbase62letters89012"},"metadata":{"type":"object","additionalProperties":{"type":"string"}},"scheduled_payment_date":{"type":"string","example":"2026-06-01","description":"ISO date (YYYY-MM-DD) on which this payment is scheduled to process. Present only for future-dated scheduled payments."},"statement_descriptor":{"type":"string","example":"ACME CAFE","description":"Soft descriptor that should name the biller on the payer's statement (per-PI override or biller default)."},"total_refunded_amount":{"type":"number","example":0,"description":"Cumulative refunded amount in minor units"},"last_payment_error":{"type":["object","null"],"properties":{"code":{"type":"string","example":"card_declined","description":"Coarse decline category from the PSP."},"message":{"type":"string","example":"Your card was declined.","description":"Customer-readable decline reason."}},"required":["code","message"]},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"livemode":{"type":"boolean"}},"required":["id","amount","total_amount","fee_amount","surcharge_amount","surcharge_applied","currency","status","created_at","updated_at","livemode"]},"example":{"id":"pi_1234567890","amount":2500,"currency":"USD","status":"processing","payment_method_id":"pm_1234567890","customer_id":"cus_1234567890","biller_id":"biller_12345","metadata":{"order_id":"order_123"},"created_at":"2026-01-15T10:30:00Z","updated_at":"2026-01-15T10:31:00Z","livemode":false}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string","example":"Payment intent not found"},"type":{"type":"string","example":"invalid_request_error"},"code":{"type":"string","example":"payment_intent_not_found"},"details":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"path":{"type":"string"}},"required":["code","message"]}}},"required":["message","type"]}},"required":["error"]}}}},"401":{"description":"Unauthenticated","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string","example":"Payment intent not found"},"type":{"type":"string","example":"invalid_request_error"},"code":{"type":"string","example":"payment_intent_not_found"},"details":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"path":{"type":"string"}},"required":["code","message"]}}},"required":["message","type"]}},"required":["error"]}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string","example":"Payment intent not found"},"type":{"type":"string","example":"invalid_request_error"},"code":{"type":"string","example":"payment_intent_not_found"},"details":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"path":{"type":"string"}},"required":["code","message"]}}},"required":["message","type"]}},"required":["error"]}}}},"404":{"description":"PaymentIntent not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string","example":"Payment intent not found"},"type":{"type":"string","example":"invalid_request_error"},"code":{"type":"string","example":"payment_intent_not_found"},"details":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"path":{"type":"string"}},"required":["code","message"]}}},"required":["message","type"]}},"required":["error"]}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string","example":"Payment intent not found"},"type":{"type":"string","example":"invalid_request_error"},"code":{"type":"string","example":"payment_intent_not_found"},"details":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"path":{"type":"string"}},"required":["code","message"]}}},"required":["message","type"]}},"required":["error"]}}}}}}},"/api/v1/payment_intents/{payment_intent_id}/confirm":{"post":{"tags":["PaymentIntent"],"summary":"Confirm a PaymentIntent with payment method","description":"Confirms a PaymentIntent and processes the payment. Can be called with either sk_ (secret key) or pk_ (publishable key) + X-Client-Secret header.","operationId":"post_PaymentIntentConfirm","parameters":[{"schema":{"type":"string","description":"PaymentIntent ID","example":"pi_sandbox_32charactersofbase62letters89012"},"required":true,"description":"PaymentIntent ID","name":"payment_intent_id","in":"path"},{"schema":{"type":["string","null"],"description":"Client secret for client-side confirmation (required with pk_ keys)"},"required":false,"description":"Client secret for client-side confirmation (required with pk_ keys)","name":"X-Client-Secret","in":"header"},{"schema":{"type":["string","null"],"description":"Unique key for idempotent requests"},"required":false,"description":"Unique key for idempotent requests","name":"Idempotency-Key","in":"header"},{"schema":{"type":["string","null"],"description":"TTL in seconds for idempotency key"},"required":false,"description":"TTL in seconds for idempotency key","name":"Idempotency-TTL","in":"header"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"payment_method":{"type":"string"},"payment_method_data":{"type":"object","properties":{},"additionalProperties":{}}}}}}},"responses":{"200":{"description":"Returns the confirmed PaymentIntent","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"PaymentIntent ID","example":"pi_sandbox_32charactersofbase62letters89012"},"client_secret":{"type":"string"},"amount":{"type":"number","example":2500,"description":"Base amount in minor units"},"total_amount":{"type":"number","example":2583,"description":"Total charged amount (base + surcharge) in minor units"},"fee_amount":{"type":"number","example":83,"description":"Calculated fee in minor units"},"surcharge_amount":{"type":"number","example":83,"description":"Surcharge component in minor units (0 if not surcharged)"},"surcharge_applied":{"type":"boolean","example":true,"description":"Whether surcharge was applied to this payment"},"currency":{"type":"string","enum":["USD","AUD","NZD","EUR","GBP","JPY"]},"status":{"type":"string","example":"succeeded"},"payment_method_id":{"type":"string","example":"pm_sandbox_1234"},"customer_id":{"type":"string","description":"Customer ID","example":"cus_32charactersofbase62letters89012"},"biller_id":{"type":"string","description":"Biller Account ID","example":"acct_32charactersofbase62letters89012"},"metadata":{"type":"object","additionalProperties":{"type":"string"}},"scheduled_payment_date":{"type":"string","example":"2026-06-01","description":"ISO date (YYYY-MM-DD) on which this payment is scheduled to process. Present only for future-dated scheduled payments."},"statement_descriptor":{"type":"string","example":"ACME CAFE","description":"Soft descriptor that should name the biller on the payer's statement (per-PI override or biller default)."},"total_refunded_amount":{"type":"number","example":0,"description":"Cumulative refunded amount in minor units"},"last_payment_error":{"type":["object","null"],"properties":{"code":{"type":"string","example":"card_declined","description":"Coarse decline category from the PSP."},"message":{"type":"string","example":"Your card was declined.","description":"Customer-readable decline reason."}},"required":["code","message"]},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"livemode":{"type":"boolean"}},"required":["id","amount","total_amount","fee_amount","surcharge_amount","surcharge_applied","currency","status","created_at","updated_at","livemode"]},"example":{"id":"pi_1234567890","amount":2500,"currency":"USD","status":"succeeded","payment_method_id":"pm_1234567890","customer_id":"cus_1234567890","biller_id":"biller_12345","metadata":{"order_id":"order_123"},"created_at":"2026-01-15T10:30:00Z","updated_at":"2026-01-15T10:31:00Z","livemode":false}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string","example":"Payment intent not found"},"type":{"type":"string","example":"invalid_request_error"},"code":{"type":"string","example":"payment_intent_not_found"},"details":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"path":{"type":"string"}},"required":["code","message"]}}},"required":["message","type"]}},"required":["error"]}}}},"401":{"description":"Unauthenticated","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string","example":"Payment intent not found"},"type":{"type":"string","example":"invalid_request_error"},"code":{"type":"string","example":"payment_intent_not_found"},"details":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"path":{"type":"string"}},"required":["code","message"]}}},"required":["message","type"]}},"required":["error"]}}}},"403":{"description":"Invalid client secret or insufficient permissions","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string","example":"Payment intent not found"},"type":{"type":"string","example":"invalid_request_error"},"code":{"type":"string","example":"payment_intent_not_found"},"details":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"path":{"type":"string"}},"required":["code","message"]}}},"required":["message","type"]}},"required":["error"]}}}},"404":{"description":"PaymentIntent not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string","example":"Payment intent not found"},"type":{"type":"string","example":"invalid_request_error"},"code":{"type":"string","example":"payment_intent_not_found"},"details":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"path":{"type":"string"}},"required":["code","message"]}}},"required":["message","type"]}},"required":["error"]}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string","example":"Payment intent not found"},"type":{"type":"string","example":"invalid_request_error"},"code":{"type":"string","example":"payment_intent_not_found"},"details":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"path":{"type":"string"}},"required":["code","message"]}}},"required":["message","type"]}},"required":["error"]}}}}}}},"/api/v1/payment_intents/{payment_intent_id}/cancel":{"post":{"tags":["PaymentIntent"],"summary":"Cancel a PaymentIntent","operationId":"post_PaymentIntentCancel","parameters":[{"schema":{"type":"string","description":"PaymentIntent ID","example":"pi_sandbox_32charactersofbase62letters89012"},"required":true,"description":"PaymentIntent ID","name":"payment_intent_id","in":"path"}],"responses":{"200":{"description":"Returns the canceled PaymentIntent","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"PaymentIntent ID","example":"pi_sandbox_32charactersofbase62letters89012"},"client_secret":{"type":"string"},"amount":{"type":"number","example":2500,"description":"Base amount in minor units"},"total_amount":{"type":"number","example":2583,"description":"Total charged amount (base + surcharge) in minor units"},"fee_amount":{"type":"number","example":83,"description":"Calculated fee in minor units"},"surcharge_amount":{"type":"number","example":83,"description":"Surcharge component in minor units (0 if not surcharged)"},"surcharge_applied":{"type":"boolean","example":true,"description":"Whether surcharge was applied to this payment"},"currency":{"type":"string","enum":["USD","AUD","NZD","EUR","GBP","JPY"]},"status":{"type":"string","example":"succeeded"},"payment_method_id":{"type":"string","example":"pm_sandbox_1234"},"customer_id":{"type":"string","description":"Customer ID","example":"cus_32charactersofbase62letters89012"},"biller_id":{"type":"string","description":"Biller Account ID","example":"acct_32charactersofbase62letters89012"},"metadata":{"type":"object","additionalProperties":{"type":"string"}},"scheduled_payment_date":{"type":"string","example":"2026-06-01","description":"ISO date (YYYY-MM-DD) on which this payment is scheduled to process. Present only for future-dated scheduled payments."},"statement_descriptor":{"type":"string","example":"ACME CAFE","description":"Soft descriptor that should name the biller on the payer's statement (per-PI override or biller default)."},"total_refunded_amount":{"type":"number","example":0,"description":"Cumulative refunded amount in minor units"},"last_payment_error":{"type":["object","null"],"properties":{"code":{"type":"string","example":"card_declined","description":"Coarse decline category from the PSP."},"message":{"type":"string","example":"Your card was declined.","description":"Customer-readable decline reason."}},"required":["code","message"]},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"livemode":{"type":"boolean"}},"required":["id","amount","total_amount","fee_amount","surcharge_amount","surcharge_applied","currency","status","created_at","updated_at","livemode"]},"example":{"id":"pi_1234567890","amount":2500,"currency":"USD","status":"canceled","customer_id":"cus_1234567890","biller_id":"biller_12345","metadata":{"order_id":"order_123"},"created_at":"2026-01-15T10:30:00Z","updated_at":"2026-01-15T10:32:00Z","livemode":false}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string","example":"Payment intent not found"},"type":{"type":"string","example":"invalid_request_error"},"code":{"type":"string","example":"payment_intent_not_found"},"details":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"path":{"type":"string"}},"required":["code","message"]}}},"required":["message","type"]}},"required":["error"]}}}},"401":{"description":"Unauthenticated","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string","example":"Payment intent not found"},"type":{"type":"string","example":"invalid_request_error"},"code":{"type":"string","example":"payment_intent_not_found"},"details":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"path":{"type":"string"}},"required":["code","message"]}}},"required":["message","type"]}},"required":["error"]}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string","example":"Payment intent not found"},"type":{"type":"string","example":"invalid_request_error"},"code":{"type":"string","example":"payment_intent_not_found"},"details":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"path":{"type":"string"}},"required":["code","message"]}}},"required":["message","type"]}},"required":["error"]}}}},"404":{"description":"PaymentIntent not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string","example":"Payment intent not found"},"type":{"type":"string","example":"invalid_request_error"},"code":{"type":"string","example":"payment_intent_not_found"},"details":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"path":{"type":"string"}},"required":["code","message"]}}},"required":["message","type"]}},"required":["error"]}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string","example":"Payment intent not found"},"type":{"type":"string","example":"invalid_request_error"},"code":{"type":"string","example":"payment_intent_not_found"},"details":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"path":{"type":"string"}},"required":["code","message"]}}},"required":["message","type"]}},"required":["error"]}}}}}}},"/api/v1/payment_intents/{payment_intent_id}/refunds":{"post":{"tags":["PaymentIntent"],"summary":"Refund a PaymentIntent","operationId":"post_PaymentIntentRefund","parameters":[{"schema":{"type":"string","description":"PaymentIntent ID","example":"pi_sandbox_32charactersofbase62letters89012"},"required":true,"description":"PaymentIntent ID","name":"payment_intent_id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"amount":{"type":"number","exclusiveMinimum":0},"currency":{"type":"string","enum":["USD","AUD","NZD","EUR","GBP","JPY"]},"reason":{"type":"string"},"metadata":{"type":"object","additionalProperties":{"type":"string"}},"psp_transaction_id":{"type":"string"},"allocations":{"type":"array","items":{"type":"object","properties":{"part_type":{"type":"string"},"position":{"type":"integer"},"refund_amount_cents":{"type":"integer"},"fee_reversal_cents":{"type":"integer"},"original_amount_cents":{"type":"integer"},"original_fee_cents":{"type":"integer"}},"required":["part_type","position","refund_amount_cents","fee_reversal_cents","original_amount_cents","original_fee_cents"]}}}}}}},"responses":{"200":{"description":"Returns the refund result","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"status":{"type":"string","enum":["succeeded","pending","failed"]},"transaction_id":{"type":"string"},"refund_id":{"type":"string"},"message":{"type":"string"},"amount_cents":{"type":"number"},"currency":{"type":"string","enum":["USD","AUD","NZD","EUR","GBP","JPY"]},"payment_intent_status":{"type":"string","example":"refunded","description":"New PaymentIntent status after this refund (e.g. refunded, partially_refunded)."},"allocations":{"type":"array","items":{"type":"object","properties":{"part_type":{"type":"string"},"position":{"type":"integer"},"refund_amount_cents":{"type":"integer"},"fee_reversal_cents":{"type":"integer"},"original_amount_cents":{"type":"integer"},"original_fee_cents":{"type":"integer"}},"required":["part_type","position","refund_amount_cents","fee_reversal_cents","original_amount_cents","original_fee_cents"]}}},"required":["success","status","transaction_id","message","amount_cents","currency"]},"example":{"success":true,"status":"succeeded","transaction_id":"pi_1234567890","refund_id":"re_1234567890","message":"Refund processed successfully","amount_cents":500,"currency":"USD"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string","example":"Payment intent not found"},"type":{"type":"string","example":"invalid_request_error"},"code":{"type":"string","example":"payment_intent_not_found"},"details":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"path":{"type":"string"}},"required":["code","message"]}}},"required":["message","type"]}},"required":["error"]}}}},"404":{"description":"PaymentIntent not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string","example":"Payment intent not found"},"type":{"type":"string","example":"invalid_request_error"},"code":{"type":"string","example":"payment_intent_not_found"},"details":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"path":{"type":"string"}},"required":["code","message"]}}},"required":["message","type"]}},"required":["error"]}}}}}},"get":{"tags":["PaymentIntent"],"summary":"List refunds for a PaymentIntent","operationId":"get_PaymentIntentRefundList","parameters":[{"schema":{"type":"string","description":"PaymentIntent ID","example":"pi_sandbox_32charactersofbase62letters89012"},"required":true,"description":"PaymentIntent ID","name":"payment_intent_id","in":"path"}],"responses":{"200":{"description":"Returns the refund list","content":{"application/json":{"schema":{"type":"object","properties":{"series":{"type":"object","properties":{"success":{"type":"boolean"},"result":{"type":"object","properties":{"refunds":{"type":"array","items":{"type":"object","properties":{"refund_id":{"type":"string","example":"re_sandbox_1234"},"amount_cents":{"type":"number","example":500},"currency":{"type":"string","enum":["USD","AUD","NZD","EUR","GBP","JPY"]},"status":{"type":"string","enum":["succeeded","pending","failed"]},"created_at":{"type":"string","format":"date-time","example":"2026-01-15T10:30:00Z"}},"required":["amount_cents","currency","status","created_at"]}}},"required":["refunds"]}},"required":["success","result"]}},"required":["series"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string","example":"Payment intent not found"},"type":{"type":"string","example":"invalid_request_error"},"code":{"type":"string","example":"payment_intent_not_found"},"details":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"path":{"type":"string"}},"required":["code","message"]}}},"required":["message","type"]}},"required":["error"]}}}},"404":{"description":"PaymentIntent not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string","example":"Payment intent not found"},"type":{"type":"string","example":"invalid_request_error"},"code":{"type":"string","example":"payment_intent_not_found"},"details":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"path":{"type":"string"}},"required":["code","message"]}}},"required":["message","type"]}},"required":["error"]}}}}}}},"/api/v1/payment_plans":{"post":{"tags":["PaymentPlan"],"summary":"Create a new PaymentPlan","operationId":"post_PaymentPlanCreate","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"customer_id":{"type":"string","description":"Customer ID","example":"cus_32charactersofbase62letters89012"},"name":{"type":"string"},"category":{"type":"string"},"frequency_type":{"type":"string","enum":["weekly","fortnightly","monthly","quarterly","annual","adhoc"]},"frequency_period":{"type":"integer"},"start_date":{"type":"string","format":"date","description":"ISO date (YYYY-MM-DD) for when the plan starts"},"first_date":{"type":"string","format":"date","description":"ISO date (YYYY-MM-DD) for the first payment, if different from start_date"},"recurring_amount_cents":{"type":"integer","minimum":0},"first_amount_cents":{"type":"integer","minimum":0},"total_amount_cents":{"type":"integer","minimum":0},"until_further_notice":{"type":"boolean"},"specify_total_amount":{"type":"boolean","description":"Set to true when providing total_amount_cents instead of number_of_payments"},"number_of_payments":{"type":"integer","minimum":0},"failure_behaviour":{"type":"string","enum":["NEW_AT_END","TRY_AGAIN","DOUBLE_UP","DO_NOTHING"]},"payment_instrument_id":{"type":"string"}},"required":["customer_id"]}}}},"responses":{"201":{"description":"Returns the created PaymentPlan","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"PaymentPlan ID","example":"pp_sandbox_32charactersofbase62letters89012"},"customer_id":{"type":["string","null"],"description":"Customer ID","example":"cus_32charactersofbase62letters89012"},"biller_id":{"type":["string","null"]},"name":{"type":["string","null"]},"category":{"type":["string","null"]},"state":{"type":["string","null"]},"frequency_type":{"type":["string","null"]},"frequency_period":{"type":["integer","null"]},"start_date":{"type":["string","null"]},"first_date":{"type":["string","null"]},"recurring_amount_cents":{"type":["integer","null"]},"first_amount_cents":{"type":["integer","null"]},"total_amount_cents":{"type":["integer","null"]},"collected_amount_cents":{"type":["integer","null"]},"until_further_notice":{"type":["boolean","null"]},"currency":{"type":["string","null"]},"failure_behaviour":{"type":["string","null"]},"payment_instrument_id":{"type":["string","null"]},"next_date":{"type":["string","null"]},"marked_for_closure_at":{"type":["string","null"],"format":"date-time"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"required":["id"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string","example":"Payment intent not found"},"type":{"type":"string","example":"invalid_request_error"},"code":{"type":"string","example":"payment_intent_not_found"},"details":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"path":{"type":"string"}},"required":["code","message"]}}},"required":["message","type"]}},"required":["error"]}}}},"401":{"description":"Unauthenticated","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string","example":"Payment intent not found"},"type":{"type":"string","example":"invalid_request_error"},"code":{"type":"string","example":"payment_intent_not_found"},"details":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"path":{"type":"string"}},"required":["code","message"]}}},"required":["message","type"]}},"required":["error"]}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string","example":"Payment intent not found"},"type":{"type":"string","example":"invalid_request_error"},"code":{"type":"string","example":"payment_intent_not_found"},"details":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"path":{"type":"string"}},"required":["code","message"]}}},"required":["message","type"]}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string","example":"Payment intent not found"},"type":{"type":"string","example":"invalid_request_error"},"code":{"type":"string","example":"payment_intent_not_found"},"details":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"path":{"type":"string"}},"required":["code","message"]}}},"required":["message","type"]}},"required":["error"]}}}},"422":{"description":"Unprocessable entity","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string","example":"Payment intent not found"},"type":{"type":"string","example":"invalid_request_error"},"code":{"type":"string","example":"payment_intent_not_found"},"details":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"path":{"type":"string"}},"required":["code","message"]}}},"required":["message","type"]}},"required":["error"]}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string","example":"Payment intent not found"},"type":{"type":"string","example":"invalid_request_error"},"code":{"type":"string","example":"payment_intent_not_found"},"details":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"path":{"type":"string"}},"required":["code","message"]}}},"required":["message","type"]}},"required":["error"]}}}}}},"get":{"tags":["PaymentPlan"],"summary":"List PaymentPlans","operationId":"get_PaymentPlanList","parameters":[{"schema":{"type":"string","description":"Customer ID","example":"cus_32charactersofbase62letters89012"},"required":false,"description":"Customer ID","name":"customer_id","in":"query"},{"schema":{"type":"string"},"required":false,"name":"state","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string","description":"PaymentPlan ID","example":"pp_sandbox_32charactersofbase62letters89012"},"required":false,"description":"PaymentPlan ID","name":"starting_after","in":"query"}],"responses":{"200":{"description":"Returns a paginated list of PaymentPlans","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"PaymentPlan ID","example":"pp_sandbox_32charactersofbase62letters89012"},"customer_id":{"type":["string","null"],"description":"Customer ID","example":"cus_32charactersofbase62letters89012"},"biller_id":{"type":["string","null"]},"name":{"type":["string","null"]},"category":{"type":["string","null"]},"state":{"type":["string","null"]},"frequency_type":{"type":["string","null"]},"frequency_period":{"type":["integer","null"]},"start_date":{"type":["string","null"]},"first_date":{"type":["string","null"]},"recurring_amount_cents":{"type":["integer","null"]},"first_amount_cents":{"type":["integer","null"]},"total_amount_cents":{"type":["integer","null"]},"collected_amount_cents":{"type":["integer","null"]},"until_further_notice":{"type":["boolean","null"]},"currency":{"type":["string","null"]},"failure_behaviour":{"type":["string","null"]},"payment_instrument_id":{"type":["string","null"]},"next_date":{"type":["string","null"]},"marked_for_closure_at":{"type":["string","null"],"format":"date-time"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"required":["id"]}},"has_more":{"type":"boolean"}},"required":["data","has_more"]}}}},"401":{"description":"Unauthenticated","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string","example":"Payment intent not found"},"type":{"type":"string","example":"invalid_request_error"},"code":{"type":"string","example":"payment_intent_not_found"},"details":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"path":{"type":"string"}},"required":["code","message"]}}},"required":["message","type"]}},"required":["error"]}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string","example":"Payment intent not found"},"type":{"type":"string","example":"invalid_request_error"},"code":{"type":"string","example":"payment_intent_not_found"},"details":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"path":{"type":"string"}},"required":["code","message"]}}},"required":["message","type"]}},"required":["error"]}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string","example":"Payment intent not found"},"type":{"type":"string","example":"invalid_request_error"},"code":{"type":"string","example":"payment_intent_not_found"},"details":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"path":{"type":"string"}},"required":["code","message"]}}},"required":["message","type"]}},"required":["error"]}}}}}}},"/api/v1/payment_plans/{payment_plan_id}":{"get":{"tags":["PaymentPlan"],"summary":"Fetch a PaymentPlan","operationId":"get_PaymentPlanFetch","parameters":[{"schema":{"type":"string","description":"PaymentPlan ID","example":"pp_sandbox_32charactersofbase62letters89012"},"required":true,"description":"PaymentPlan ID","name":"payment_plan_id","in":"path"}],"responses":{"200":{"description":"Returns the PaymentPlan","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"PaymentPlan ID","example":"pp_sandbox_32charactersofbase62letters89012"},"customer_id":{"type":["string","null"],"description":"Customer ID","example":"cus_32charactersofbase62letters89012"},"biller_id":{"type":["string","null"]},"name":{"type":["string","null"]},"category":{"type":["string","null"]},"state":{"type":["string","null"]},"frequency_type":{"type":["string","null"]},"frequency_period":{"type":["integer","null"]},"start_date":{"type":["string","null"]},"first_date":{"type":["string","null"]},"recurring_amount_cents":{"type":["integer","null"]},"first_amount_cents":{"type":["integer","null"]},"total_amount_cents":{"type":["integer","null"]},"collected_amount_cents":{"type":["integer","null"]},"until_further_notice":{"type":["boolean","null"]},"currency":{"type":["string","null"]},"failure_behaviour":{"type":["string","null"]},"payment_instrument_id":{"type":["string","null"]},"next_date":{"type":["string","null"]},"marked_for_closure_at":{"type":["string","null"],"format":"date-time"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"required":["id"]}}}},"401":{"description":"Unauthenticated","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string","example":"Payment intent not found"},"type":{"type":"string","example":"invalid_request_error"},"code":{"type":"string","example":"payment_intent_not_found"},"details":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"path":{"type":"string"}},"required":["code","message"]}}},"required":["message","type"]}},"required":["error"]}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string","example":"Payment intent not found"},"type":{"type":"string","example":"invalid_request_error"},"code":{"type":"string","example":"payment_intent_not_found"},"details":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"path":{"type":"string"}},"required":["code","message"]}}},"required":["message","type"]}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string","example":"Payment intent not found"},"type":{"type":"string","example":"invalid_request_error"},"code":{"type":"string","example":"payment_intent_not_found"},"details":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"path":{"type":"string"}},"required":["code","message"]}}},"required":["message","type"]}},"required":["error"]}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string","example":"Payment intent not found"},"type":{"type":"string","example":"invalid_request_error"},"code":{"type":"string","example":"payment_intent_not_found"},"details":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"path":{"type":"string"}},"required":["code","message"]}}},"required":["message","type"]}},"required":["error"]}}}}}},"put":{"tags":["PaymentPlan"],"summary":"Update a PaymentPlan","operationId":"put_PaymentPlanUpdate","parameters":[{"schema":{"type":"string","description":"PaymentPlan ID","example":"pp_sandbox_32charactersofbase62letters89012"},"required":true,"description":"PaymentPlan ID","name":"payment_plan_id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"category":{"type":"string"},"frequency_type":{"type":"string","enum":["weekly","fortnightly","monthly","quarterly","annual","adhoc"]},"frequency_period":{"type":"integer"},"start_date":{"type":"string","format":"date","description":"ISO date (YYYY-MM-DD) for when the plan starts"},"first_date":{"type":"string","format":"date","description":"ISO date (YYYY-MM-DD) for the first payment, if different from start_date"},"recurring_amount_cents":{"type":"integer","minimum":0},"first_amount_cents":{"type":"integer","minimum":0},"total_amount_cents":{"type":"integer","minimum":0},"until_further_notice":{"type":"boolean"},"specify_total_amount":{"type":"boolean","description":"Set to true when providing total_amount_cents instead of number_of_payments"},"number_of_payments":{"type":"integer","minimum":0},"failure_behaviour":{"type":"string","enum":["NEW_AT_END","TRY_AGAIN","DOUBLE_UP","DO_NOTHING"]},"payment_instrument_id":{"type":"string"}}}}}},"responses":{"200":{"description":"Returns the updated PaymentPlan","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"PaymentPlan ID","example":"pp_sandbox_32charactersofbase62letters89012"},"customer_id":{"type":["string","null"],"description":"Customer ID","example":"cus_32charactersofbase62letters89012"},"biller_id":{"type":["string","null"]},"name":{"type":["string","null"]},"category":{"type":["string","null"]},"state":{"type":["string","null"]},"frequency_type":{"type":["string","null"]},"frequency_period":{"type":["integer","null"]},"start_date":{"type":["string","null"]},"first_date":{"type":["string","null"]},"recurring_amount_cents":{"type":["integer","null"]},"first_amount_cents":{"type":["integer","null"]},"total_amount_cents":{"type":["integer","null"]},"collected_amount_cents":{"type":["integer","null"]},"until_further_notice":{"type":["boolean","null"]},"currency":{"type":["string","null"]},"failure_behaviour":{"type":["string","null"]},"payment_instrument_id":{"type":["string","null"]},"next_date":{"type":["string","null"]},"marked_for_closure_at":{"type":["string","null"],"format":"date-time"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"required":["id"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string","example":"Payment intent not found"},"type":{"type":"string","example":"invalid_request_error"},"code":{"type":"string","example":"payment_intent_not_found"},"details":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"path":{"type":"string"}},"required":["code","message"]}}},"required":["message","type"]}},"required":["error"]}}}},"401":{"description":"Unauthenticated","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string","example":"Payment intent not found"},"type":{"type":"string","example":"invalid_request_error"},"code":{"type":"string","example":"payment_intent_not_found"},"details":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"path":{"type":"string"}},"required":["code","message"]}}},"required":["message","type"]}},"required":["error"]}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string","example":"Payment intent not found"},"type":{"type":"string","example":"invalid_request_error"},"code":{"type":"string","example":"payment_intent_not_found"},"details":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"path":{"type":"string"}},"required":["code","message"]}}},"required":["message","type"]}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string","example":"Payment intent not found"},"type":{"type":"string","example":"invalid_request_error"},"code":{"type":"string","example":"payment_intent_not_found"},"details":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"path":{"type":"string"}},"required":["code","message"]}}},"required":["message","type"]}},"required":["error"]}}}},"422":{"description":"Unprocessable entity","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string","example":"Payment intent not found"},"type":{"type":"string","example":"invalid_request_error"},"code":{"type":"string","example":"payment_intent_not_found"},"details":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"path":{"type":"string"}},"required":["code","message"]}}},"required":["message","type"]}},"required":["error"]}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string","example":"Payment intent not found"},"type":{"type":"string","example":"invalid_request_error"},"code":{"type":"string","example":"payment_intent_not_found"},"details":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"path":{"type":"string"}},"required":["code","message"]}}},"required":["message","type"]}},"required":["error"]}}}}}}},"/api/v1/payment_plans/{payment_plan_id}/activate":{"post":{"tags":["PaymentPlan"],"summary":"Activate a PaymentPlan","operationId":"post_PaymentPlanActivate","parameters":[{"schema":{"type":"string","description":"PaymentPlan ID","example":"pp_sandbox_32charactersofbase62letters89012"},"required":true,"description":"PaymentPlan ID","name":"payment_plan_id","in":"path"}],"responses":{"200":{"description":"Returns the activated PaymentPlan","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"PaymentPlan ID","example":"pp_sandbox_32charactersofbase62letters89012"},"customer_id":{"type":["string","null"],"description":"Customer ID","example":"cus_32charactersofbase62letters89012"},"biller_id":{"type":["string","null"]},"name":{"type":["string","null"]},"category":{"type":["string","null"]},"state":{"type":["string","null"]},"frequency_type":{"type":["string","null"]},"frequency_period":{"type":["integer","null"]},"start_date":{"type":["string","null"]},"first_date":{"type":["string","null"]},"recurring_amount_cents":{"type":["integer","null"]},"first_amount_cents":{"type":["integer","null"]},"total_amount_cents":{"type":["integer","null"]},"collected_amount_cents":{"type":["integer","null"]},"until_further_notice":{"type":["boolean","null"]},"currency":{"type":["string","null"]},"failure_behaviour":{"type":["string","null"]},"payment_instrument_id":{"type":["string","null"]},"next_date":{"type":["string","null"]},"marked_for_closure_at":{"type":["string","null"],"format":"date-time"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"required":["id"]}}}},"401":{"description":"Unauthenticated","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string","example":"Payment intent not found"},"type":{"type":"string","example":"invalid_request_error"},"code":{"type":"string","example":"payment_intent_not_found"},"details":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"path":{"type":"string"}},"required":["code","message"]}}},"required":["message","type"]}},"required":["error"]}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string","example":"Payment intent not found"},"type":{"type":"string","example":"invalid_request_error"},"code":{"type":"string","example":"payment_intent_not_found"},"details":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"path":{"type":"string"}},"required":["code","message"]}}},"required":["message","type"]}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string","example":"Payment intent not found"},"type":{"type":"string","example":"invalid_request_error"},"code":{"type":"string","example":"payment_intent_not_found"},"details":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"path":{"type":"string"}},"required":["code","message"]}}},"required":["message","type"]}},"required":["error"]}}}},"422":{"description":"Unprocessable entity","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string","example":"Payment intent not found"},"type":{"type":"string","example":"invalid_request_error"},"code":{"type":"string","example":"payment_intent_not_found"},"details":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"path":{"type":"string"}},"required":["code","message"]}}},"required":["message","type"]}},"required":["error"]}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string","example":"Payment intent not found"},"type":{"type":"string","example":"invalid_request_error"},"code":{"type":"string","example":"payment_intent_not_found"},"details":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"path":{"type":"string"}},"required":["code","message"]}}},"required":["message","type"]}},"required":["error"]}}}}}}},"/api/v1/payment_plans/{payment_plan_id}/deactivate":{"post":{"tags":["PaymentPlan"],"summary":"Deactivate a PaymentPlan","operationId":"post_PaymentPlanDeactivate","parameters":[{"schema":{"type":"string","description":"PaymentPlan ID","example":"pp_sandbox_32charactersofbase62letters89012"},"required":true,"description":"PaymentPlan ID","name":"payment_plan_id","in":"path"}],"responses":{"200":{"description":"Returns the deactivated PaymentPlan","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"PaymentPlan ID","example":"pp_sandbox_32charactersofbase62letters89012"},"customer_id":{"type":["string","null"],"description":"Customer ID","example":"cus_32charactersofbase62letters89012"},"biller_id":{"type":["string","null"]},"name":{"type":["string","null"]},"category":{"type":["string","null"]},"state":{"type":["string","null"]},"frequency_type":{"type":["string","null"]},"frequency_period":{"type":["integer","null"]},"start_date":{"type":["string","null"]},"first_date":{"type":["string","null"]},"recurring_amount_cents":{"type":["integer","null"]},"first_amount_cents":{"type":["integer","null"]},"total_amount_cents":{"type":["integer","null"]},"collected_amount_cents":{"type":["integer","null"]},"until_further_notice":{"type":["boolean","null"]},"currency":{"type":["string","null"]},"failure_behaviour":{"type":["string","null"]},"payment_instrument_id":{"type":["string","null"]},"next_date":{"type":["string","null"]},"marked_for_closure_at":{"type":["string","null"],"format":"date-time"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"required":["id"]}}}},"401":{"description":"Unauthenticated","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string","example":"Payment intent not found"},"type":{"type":"string","example":"invalid_request_error"},"code":{"type":"string","example":"payment_intent_not_found"},"details":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"path":{"type":"string"}},"required":["code","message"]}}},"required":["message","type"]}},"required":["error"]}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string","example":"Payment intent not found"},"type":{"type":"string","example":"invalid_request_error"},"code":{"type":"string","example":"payment_intent_not_found"},"details":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"path":{"type":"string"}},"required":["code","message"]}}},"required":["message","type"]}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string","example":"Payment intent not found"},"type":{"type":"string","example":"invalid_request_error"},"code":{"type":"string","example":"payment_intent_not_found"},"details":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"path":{"type":"string"}},"required":["code","message"]}}},"required":["message","type"]}},"required":["error"]}}}},"422":{"description":"Unprocessable entity","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string","example":"Payment intent not found"},"type":{"type":"string","example":"invalid_request_error"},"code":{"type":"string","example":"payment_intent_not_found"},"details":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"path":{"type":"string"}},"required":["code","message"]}}},"required":["message","type"]}},"required":["error"]}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string","example":"Payment intent not found"},"type":{"type":"string","example":"invalid_request_error"},"code":{"type":"string","example":"payment_intent_not_found"},"details":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"path":{"type":"string"}},"required":["code","message"]}}},"required":["message","type"]}},"required":["error"]}}}}}}},"/api/v1/payment_plans/{payment_plan_id}/suspend":{"post":{"tags":["PaymentPlan"],"summary":"Suspend a PaymentPlan","operationId":"post_PaymentPlanSuspend","parameters":[{"schema":{"type":"string","description":"PaymentPlan ID","example":"pp_sandbox_32charactersofbase62letters89012"},"required":true,"description":"PaymentPlan ID","name":"payment_plan_id","in":"path"}],"responses":{"200":{"description":"Returns the suspended PaymentPlan","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"PaymentPlan ID","example":"pp_sandbox_32charactersofbase62letters89012"},"customer_id":{"type":["string","null"],"description":"Customer ID","example":"cus_32charactersofbase62letters89012"},"biller_id":{"type":["string","null"]},"name":{"type":["string","null"]},"category":{"type":["string","null"]},"state":{"type":["string","null"]},"frequency_type":{"type":["string","null"]},"frequency_period":{"type":["integer","null"]},"start_date":{"type":["string","null"]},"first_date":{"type":["string","null"]},"recurring_amount_cents":{"type":["integer","null"]},"first_amount_cents":{"type":["integer","null"]},"total_amount_cents":{"type":["integer","null"]},"collected_amount_cents":{"type":["integer","null"]},"until_further_notice":{"type":["boolean","null"]},"currency":{"type":["string","null"]},"failure_behaviour":{"type":["string","null"]},"payment_instrument_id":{"type":["string","null"]},"next_date":{"type":["string","null"]},"marked_for_closure_at":{"type":["string","null"],"format":"date-time"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"required":["id"]}}}},"401":{"description":"Unauthenticated","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string","example":"Payment intent not found"},"type":{"type":"string","example":"invalid_request_error"},"code":{"type":"string","example":"payment_intent_not_found"},"details":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"path":{"type":"string"}},"required":["code","message"]}}},"required":["message","type"]}},"required":["error"]}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string","example":"Payment intent not found"},"type":{"type":"string","example":"invalid_request_error"},"code":{"type":"string","example":"payment_intent_not_found"},"details":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"path":{"type":"string"}},"required":["code","message"]}}},"required":["message","type"]}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string","example":"Payment intent not found"},"type":{"type":"string","example":"invalid_request_error"},"code":{"type":"string","example":"payment_intent_not_found"},"details":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"path":{"type":"string"}},"required":["code","message"]}}},"required":["message","type"]}},"required":["error"]}}}},"422":{"description":"Unprocessable entity","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string","example":"Payment intent not found"},"type":{"type":"string","example":"invalid_request_error"},"code":{"type":"string","example":"payment_intent_not_found"},"details":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"path":{"type":"string"}},"required":["code","message"]}}},"required":["message","type"]}},"required":["error"]}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string","example":"Payment intent not found"},"type":{"type":"string","example":"invalid_request_error"},"code":{"type":"string","example":"payment_intent_not_found"},"details":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"path":{"type":"string"}},"required":["code","message"]}}},"required":["message","type"]}},"required":["error"]}}}}}}},"/api/v1/payment_plans/{payment_plan_id}/resume":{"post":{"tags":["PaymentPlan"],"summary":"Resume a suspended PaymentPlan","operationId":"post_PaymentPlanResume","parameters":[{"schema":{"type":"string","description":"PaymentPlan ID","example":"pp_sandbox_32charactersofbase62letters89012"},"required":true,"description":"PaymentPlan ID","name":"payment_plan_id","in":"path"}],"responses":{"200":{"description":"Returns the resumed PaymentPlan","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"PaymentPlan ID","example":"pp_sandbox_32charactersofbase62letters89012"},"customer_id":{"type":["string","null"],"description":"Customer ID","example":"cus_32charactersofbase62letters89012"},"biller_id":{"type":["string","null"]},"name":{"type":["string","null"]},"category":{"type":["string","null"]},"state":{"type":["string","null"]},"frequency_type":{"type":["string","null"]},"frequency_period":{"type":["integer","null"]},"start_date":{"type":["string","null"]},"first_date":{"type":["string","null"]},"recurring_amount_cents":{"type":["integer","null"]},"first_amount_cents":{"type":["integer","null"]},"total_amount_cents":{"type":["integer","null"]},"collected_amount_cents":{"type":["integer","null"]},"until_further_notice":{"type":["boolean","null"]},"currency":{"type":["string","null"]},"failure_behaviour":{"type":["string","null"]},"payment_instrument_id":{"type":["string","null"]},"next_date":{"type":["string","null"]},"marked_for_closure_at":{"type":["string","null"],"format":"date-time"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"required":["id"]}}}},"401":{"description":"Unauthenticated","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string","example":"Payment intent not found"},"type":{"type":"string","example":"invalid_request_error"},"code":{"type":"string","example":"payment_intent_not_found"},"details":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"path":{"type":"string"}},"required":["code","message"]}}},"required":["message","type"]}},"required":["error"]}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string","example":"Payment intent not found"},"type":{"type":"string","example":"invalid_request_error"},"code":{"type":"string","example":"payment_intent_not_found"},"details":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"path":{"type":"string"}},"required":["code","message"]}}},"required":["message","type"]}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string","example":"Payment intent not found"},"type":{"type":"string","example":"invalid_request_error"},"code":{"type":"string","example":"payment_intent_not_found"},"details":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"path":{"type":"string"}},"required":["code","message"]}}},"required":["message","type"]}},"required":["error"]}}}},"422":{"description":"Unprocessable entity","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string","example":"Payment intent not found"},"type":{"type":"string","example":"invalid_request_error"},"code":{"type":"string","example":"payment_intent_not_found"},"details":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"path":{"type":"string"}},"required":["code","message"]}}},"required":["message","type"]}},"required":["error"]}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string","example":"Payment intent not found"},"type":{"type":"string","example":"invalid_request_error"},"code":{"type":"string","example":"payment_intent_not_found"},"details":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"path":{"type":"string"}},"required":["code","message"]}}},"required":["message","type"]}},"required":["error"]}}}}}}},"/api/v1/payment_plans/{payment_plan_id}/close":{"post":{"tags":["PaymentPlan"],"summary":"Close a PaymentPlan","operationId":"post_PaymentPlanClose","parameters":[{"schema":{"type":"string","description":"PaymentPlan ID","example":"pp_sandbox_32charactersofbase62letters89012"},"required":true,"description":"PaymentPlan ID","name":"payment_plan_id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"closing_payment_amount":{"type":"integer","minimum":0,"description":"Optional final closing payment amount in cents"}}}}}},"responses":{"200":{"description":"Returns the closed PaymentPlan","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"PaymentPlan ID","example":"pp_sandbox_32charactersofbase62letters89012"},"customer_id":{"type":["string","null"],"description":"Customer ID","example":"cus_32charactersofbase62letters89012"},"biller_id":{"type":["string","null"]},"name":{"type":["string","null"]},"category":{"type":["string","null"]},"state":{"type":["string","null"]},"frequency_type":{"type":["string","null"]},"frequency_period":{"type":["integer","null"]},"start_date":{"type":["string","null"]},"first_date":{"type":["string","null"]},"recurring_amount_cents":{"type":["integer","null"]},"first_amount_cents":{"type":["integer","null"]},"total_amount_cents":{"type":["integer","null"]},"collected_amount_cents":{"type":["integer","null"]},"until_further_notice":{"type":["boolean","null"]},"currency":{"type":["string","null"]},"failure_behaviour":{"type":["string","null"]},"payment_instrument_id":{"type":["string","null"]},"next_date":{"type":["string","null"]},"marked_for_closure_at":{"type":["string","null"],"format":"date-time"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"required":["id"]}}}},"401":{"description":"Unauthenticated","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string","example":"Payment intent not found"},"type":{"type":"string","example":"invalid_request_error"},"code":{"type":"string","example":"payment_intent_not_found"},"details":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"path":{"type":"string"}},"required":["code","message"]}}},"required":["message","type"]}},"required":["error"]}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string","example":"Payment intent not found"},"type":{"type":"string","example":"invalid_request_error"},"code":{"type":"string","example":"payment_intent_not_found"},"details":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"path":{"type":"string"}},"required":["code","message"]}}},"required":["message","type"]}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string","example":"Payment intent not found"},"type":{"type":"string","example":"invalid_request_error"},"code":{"type":"string","example":"payment_intent_not_found"},"details":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"path":{"type":"string"}},"required":["code","message"]}}},"required":["message","type"]}},"required":["error"]}}}},"422":{"description":"Unprocessable entity","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string","example":"Payment intent not found"},"type":{"type":"string","example":"invalid_request_error"},"code":{"type":"string","example":"payment_intent_not_found"},"details":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"path":{"type":"string"}},"required":["code","message"]}}},"required":["message","type"]}},"required":["error"]}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string","example":"Payment intent not found"},"type":{"type":"string","example":"invalid_request_error"},"code":{"type":"string","example":"payment_intent_not_found"},"details":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"path":{"type":"string"}},"required":["code","message"]}}},"required":["message","type"]}},"required":["error"]}}}}}}},"/api/v1/payment_plans/{payment_plan_id}/payment_intents":{"get":{"tags":["PaymentPlan"],"summary":"List PaymentIntents for a PaymentPlan","operationId":"get_PaymentPlanPaymentIntentList","parameters":[{"schema":{"type":"string","description":"PaymentPlan ID","example":"pp_sandbox_32charactersofbase62letters89012"},"required":true,"description":"PaymentPlan ID","name":"payment_plan_id","in":"path"},{"schema":{"type":"string"},"required":false,"name":"status","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string"},"required":false,"name":"starting_after","in":"query"}],"responses":{"200":{"description":"Returns a paginated list of PaymentIntents for the plan","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","additionalProperties":{}}},"has_more":{"type":"boolean"}},"required":["data","has_more"]}}}},"401":{"description":"Unauthenticated","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string","example":"Payment intent not found"},"type":{"type":"string","example":"invalid_request_error"},"code":{"type":"string","example":"payment_intent_not_found"},"details":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"path":{"type":"string"}},"required":["code","message"]}}},"required":["message","type"]}},"required":["error"]}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string","example":"Payment intent not found"},"type":{"type":"string","example":"invalid_request_error"},"code":{"type":"string","example":"payment_intent_not_found"},"details":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"path":{"type":"string"}},"required":["code","message"]}}},"required":["message","type"]}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string","example":"Payment intent not found"},"type":{"type":"string","example":"invalid_request_error"},"code":{"type":"string","example":"payment_intent_not_found"},"details":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"path":{"type":"string"}},"required":["code","message"]}}},"required":["message","type"]}},"required":["error"]}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string","example":"Payment intent not found"},"type":{"type":"string","example":"invalid_request_error"},"code":{"type":"string","example":"payment_intent_not_found"},"details":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"path":{"type":"string"}},"required":["code","message"]}}},"required":["message","type"]}},"required":["error"]}}}}}}},"/api/v1/setup_intents":{"post":{"tags":["SetupIntent"],"summary":"Create a SetupIntent","operationId":"post_SetupIntentCreate","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"customer_id":{"type":"string"},"payment_method_types":{"type":"array","items":{"type":"string"}},"allowed_origin":{"type":"string"},"metadata":{"type":"object","additionalProperties":{"type":"string"}}}}}}},"responses":{"201":{"description":"SetupIntent created"},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string","example":"Payment intent not found"},"type":{"type":"string","example":"invalid_request_error"},"code":{"type":"string","example":"payment_intent_not_found"},"details":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"path":{"type":"string"}},"required":["code","message"]}}},"required":["message","type"]}},"required":["error"]}}}},"401":{"description":"Unauthenticated","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string","example":"Payment intent not found"},"type":{"type":"string","example":"invalid_request_error"},"code":{"type":"string","example":"payment_intent_not_found"},"details":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"path":{"type":"string"}},"required":["code","message"]}}},"required":["message","type"]}},"required":["error"]}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string","example":"Payment intent not found"},"type":{"type":"string","example":"invalid_request_error"},"code":{"type":"string","example":"payment_intent_not_found"},"details":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"path":{"type":"string"}},"required":["code","message"]}}},"required":["message","type"]}},"required":["error"]}}}}}}},"/api/v1/setup_intents/{setup_intent_id}":{"get":{"tags":["SetupIntent"],"summary":"Fetch a SetupIntent","operationId":"get_SetupIntentFetch","parameters":[{"schema":{"type":"string","description":"SetupIntent ID"},"required":true,"description":"SetupIntent ID","name":"setup_intent_id","in":"path"}],"responses":{"200":{"description":"SetupIntent found"},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string","example":"Payment intent not found"},"type":{"type":"string","example":"invalid_request_error"},"code":{"type":"string","example":"payment_intent_not_found"},"details":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"path":{"type":"string"}},"required":["code","message"]}}},"required":["message","type"]}},"required":["error"]}}}}}}},"/api/v1/setup_intents/{setup_intent_id}/confirm":{"post":{"tags":["SetupIntent"],"summary":"Confirm a SetupIntent","operationId":"post_SetupIntentConfirm","parameters":[{"schema":{"type":"string","description":"SetupIntent ID"},"required":true,"description":"SetupIntent ID","name":"setup_intent_id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"payment_method_type":{"type":"string"},"payment_method_data":{"type":"object","additionalProperties":{}},"payment_method_id":{"type":"string"},"mandate_acceptance":{"type":"object","properties":{"ip_address":{"type":"string"},"user_agent":{"type":"string"},"accepted_at":{"type":"string"},"type":{"type":"string"},"source_url":{"type":"string"}}}}}}}},"responses":{"200":{"description":"SetupIntent confirmed"},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string","example":"Payment intent not found"},"type":{"type":"string","example":"invalid_request_error"},"code":{"type":"string","example":"payment_intent_not_found"},"details":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"path":{"type":"string"}},"required":["code","message"]}}},"required":["message","type"]}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string","example":"Payment intent not found"},"type":{"type":"string","example":"invalid_request_error"},"code":{"type":"string","example":"payment_intent_not_found"},"details":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"path":{"type":"string"}},"required":["code","message"]}}},"required":["message","type"]}},"required":["error"]}}}}}}},"/api/v1/test_helpers/test_clocks":{"post":{"tags":["TestHelpers"],"summary":"Create a test clock (sandbox only)","operationId":"post_TestClockCreate","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","description":"Optional label for this test clock"},"frozen_time":{"type":"string","description":"ISO 8601 datetime to start the clock at"}},"required":["frozen_time"]}}}},"responses":{"201":{"description":"Returns the created TestClock","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"TestClock ID","example":"clk_sandbox_24charsbase62string"},"object":{"type":"string"},"name":{"type":["string","null"]},"status":{"type":"string"},"frozen_time":{"type":["string","null"],"format":"date-time"},"expires_at":{"type":["string","null"],"format":"date-time"},"created_at":{"type":["string","null"],"format":"date-time"},"livemode":{"type":"boolean"}},"required":["id"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string","example":"Payment intent not found"},"type":{"type":"string","example":"invalid_request_error"},"code":{"type":"string","example":"payment_intent_not_found"},"details":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"path":{"type":"string"}},"required":["code","message"]}}},"required":["message","type"]}},"required":["error"]}}}},"401":{"description":"Unauthenticated","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string","example":"Payment intent not found"},"type":{"type":"string","example":"invalid_request_error"},"code":{"type":"string","example":"payment_intent_not_found"},"details":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"path":{"type":"string"}},"required":["code","message"]}}},"required":["message","type"]}},"required":["error"]}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string","example":"Payment intent not found"},"type":{"type":"string","example":"invalid_request_error"},"code":{"type":"string","example":"payment_intent_not_found"},"details":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"path":{"type":"string"}},"required":["code","message"]}}},"required":["message","type"]}},"required":["error"]}}}},"422":{"description":"Unprocessable entity","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string","example":"Payment intent not found"},"type":{"type":"string","example":"invalid_request_error"},"code":{"type":"string","example":"payment_intent_not_found"},"details":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"path":{"type":"string"}},"required":["code","message"]}}},"required":["message","type"]}},"required":["error"]}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string","example":"Payment intent not found"},"type":{"type":"string","example":"invalid_request_error"},"code":{"type":"string","example":"payment_intent_not_found"},"details":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"path":{"type":"string"}},"required":["code","message"]}}},"required":["message","type"]}},"required":["error"]}}}}}},"get":{"tags":["TestHelpers"],"summary":"List test clocks (sandbox only)","operationId":"get_TestClockList","parameters":[{"schema":{"type":"integer","minimum":1,"maximum":100},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string","description":"TestClock ID","example":"clk_sandbox_24charsbase62string"},"required":false,"description":"TestClock ID","name":"starting_after","in":"query"}],"responses":{"200":{"description":"Returns a paginated list of TestClocks","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"TestClock ID","example":"clk_sandbox_24charsbase62string"},"object":{"type":"string"},"name":{"type":["string","null"]},"status":{"type":"string"},"frozen_time":{"type":["string","null"],"format":"date-time"},"expires_at":{"type":["string","null"],"format":"date-time"},"created_at":{"type":["string","null"],"format":"date-time"},"livemode":{"type":"boolean"}},"required":["id"]}},"has_more":{"type":"boolean"}},"required":["data","has_more"]}}}},"401":{"description":"Unauthenticated","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string","example":"Payment intent not found"},"type":{"type":"string","example":"invalid_request_error"},"code":{"type":"string","example":"payment_intent_not_found"},"details":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"path":{"type":"string"}},"required":["code","message"]}}},"required":["message","type"]}},"required":["error"]}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string","example":"Payment intent not found"},"type":{"type":"string","example":"invalid_request_error"},"code":{"type":"string","example":"payment_intent_not_found"},"details":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"path":{"type":"string"}},"required":["code","message"]}}},"required":["message","type"]}},"required":["error"]}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string","example":"Payment intent not found"},"type":{"type":"string","example":"invalid_request_error"},"code":{"type":"string","example":"payment_intent_not_found"},"details":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"path":{"type":"string"}},"required":["code","message"]}}},"required":["message","type"]}},"required":["error"]}}}}}}},"/api/v1/test_helpers/test_clocks/{test_clock_id}":{"get":{"tags":["TestHelpers"],"summary":"Retrieve a test clock (sandbox only)","operationId":"get_TestClockRetrieve","parameters":[{"schema":{"type":"string","description":"TestClock ID","example":"clk_sandbox_24charsbase62string"},"required":true,"description":"TestClock ID","name":"test_clock_id","in":"path"}],"responses":{"200":{"description":"Returns the TestClock","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"TestClock ID","example":"clk_sandbox_24charsbase62string"},"object":{"type":"string"},"name":{"type":["string","null"]},"status":{"type":"string"},"frozen_time":{"type":["string","null"],"format":"date-time"},"expires_at":{"type":["string","null"],"format":"date-time"},"created_at":{"type":["string","null"],"format":"date-time"},"livemode":{"type":"boolean"}},"required":["id"]}}}},"401":{"description":"Unauthenticated","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string","example":"Payment intent not found"},"type":{"type":"string","example":"invalid_request_error"},"code":{"type":"string","example":"payment_intent_not_found"},"details":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"path":{"type":"string"}},"required":["code","message"]}}},"required":["message","type"]}},"required":["error"]}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string","example":"Payment intent not found"},"type":{"type":"string","example":"invalid_request_error"},"code":{"type":"string","example":"payment_intent_not_found"},"details":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"path":{"type":"string"}},"required":["code","message"]}}},"required":["message","type"]}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string","example":"Payment intent not found"},"type":{"type":"string","example":"invalid_request_error"},"code":{"type":"string","example":"payment_intent_not_found"},"details":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"path":{"type":"string"}},"required":["code","message"]}}},"required":["message","type"]}},"required":["error"]}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string","example":"Payment intent not found"},"type":{"type":"string","example":"invalid_request_error"},"code":{"type":"string","example":"payment_intent_not_found"},"details":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"path":{"type":"string"}},"required":["code","message"]}}},"required":["message","type"]}},"required":["error"]}}}}}},"delete":{"tags":["TestHelpers"],"summary":"Delete a test clock (sandbox only)","operationId":"delete_TestClockDelete","parameters":[{"schema":{"type":"string","description":"TestClock ID","example":"clk_sandbox_24charsbase62string"},"required":true,"description":"TestClock ID","name":"test_clock_id","in":"path"}],"responses":{"200":{"description":"Returns the deleted TestClock","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"TestClock ID","example":"clk_sandbox_24charsbase62string"},"object":{"type":"string"},"name":{"type":["string","null"]},"status":{"type":"string"},"frozen_time":{"type":["string","null"],"format":"date-time"},"expires_at":{"type":["string","null"],"format":"date-time"},"created_at":{"type":["string","null"],"format":"date-time"},"livemode":{"type":"boolean"}},"required":["id"]}}}},"401":{"description":"Unauthenticated","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string","example":"Payment intent not found"},"type":{"type":"string","example":"invalid_request_error"},"code":{"type":"string","example":"payment_intent_not_found"},"details":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"path":{"type":"string"}},"required":["code","message"]}}},"required":["message","type"]}},"required":["error"]}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string","example":"Payment intent not found"},"type":{"type":"string","example":"invalid_request_error"},"code":{"type":"string","example":"payment_intent_not_found"},"details":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"path":{"type":"string"}},"required":["code","message"]}}},"required":["message","type"]}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string","example":"Payment intent not found"},"type":{"type":"string","example":"invalid_request_error"},"code":{"type":"string","example":"payment_intent_not_found"},"details":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"path":{"type":"string"}},"required":["code","message"]}}},"required":["message","type"]}},"required":["error"]}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string","example":"Payment intent not found"},"type":{"type":"string","example":"invalid_request_error"},"code":{"type":"string","example":"payment_intent_not_found"},"details":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"path":{"type":"string"}},"required":["code","message"]}}},"required":["message","type"]}},"required":["error"]}}}}}}},"/api/v1/test_helpers/test_clocks/{test_clock_id}/advance":{"post":{"tags":["TestHelpers"],"summary":"Advance a test clock (sandbox only)","operationId":"post_TestClockAdvance","parameters":[{"schema":{"type":"string","description":"TestClock ID","example":"clk_sandbox_24charsbase62string"},"required":true,"description":"TestClock ID","name":"test_clock_id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"frozen_time":{"type":"string","description":"ISO 8601 datetime to advance the clock to (must be after current frozen_time)"}},"required":["frozen_time"]}}}},"responses":{"202":{"description":"Clock is advancing — returns TestClock in advancing state","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"TestClock ID","example":"clk_sandbox_24charsbase62string"},"object":{"type":"string"},"name":{"type":["string","null"]},"status":{"type":"string"},"frozen_time":{"type":["string","null"],"format":"date-time"},"expires_at":{"type":["string","null"],"format":"date-time"},"created_at":{"type":["string","null"],"format":"date-time"},"livemode":{"type":"boolean"}},"required":["id"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string","example":"Payment intent not found"},"type":{"type":"string","example":"invalid_request_error"},"code":{"type":"string","example":"payment_intent_not_found"},"details":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"path":{"type":"string"}},"required":["code","message"]}}},"required":["message","type"]}},"required":["error"]}}}},"401":{"description":"Unauthenticated","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string","example":"Payment intent not found"},"type":{"type":"string","example":"invalid_request_error"},"code":{"type":"string","example":"payment_intent_not_found"},"details":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"path":{"type":"string"}},"required":["code","message"]}}},"required":["message","type"]}},"required":["error"]}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string","example":"Payment intent not found"},"type":{"type":"string","example":"invalid_request_error"},"code":{"type":"string","example":"payment_intent_not_found"},"details":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"path":{"type":"string"}},"required":["code","message"]}}},"required":["message","type"]}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string","example":"Payment intent not found"},"type":{"type":"string","example":"invalid_request_error"},"code":{"type":"string","example":"payment_intent_not_found"},"details":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"path":{"type":"string"}},"required":["code","message"]}}},"required":["message","type"]}},"required":["error"]}}}},"422":{"description":"Unprocessable entity","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string","example":"Payment intent not found"},"type":{"type":"string","example":"invalid_request_error"},"code":{"type":"string","example":"payment_intent_not_found"},"details":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"path":{"type":"string"}},"required":["code","message"]}}},"required":["message","type"]}},"required":["error"]}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string","example":"Payment intent not found"},"type":{"type":"string","example":"invalid_request_error"},"code":{"type":"string","example":"payment_intent_not_found"},"details":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"path":{"type":"string"}},"required":["code","message"]}}},"required":["message","type"]}},"required":["error"]}}}}}}}},"webhooks":{}}