{"id":125835,"date":"2024-05-24T10:30:06","date_gmt":"2024-05-24T01:30:06","guid":{"rendered":"https:\/\/support.questetra.com\/?p=125835"},"modified":"2024-05-24T10:44:27","modified_gmt":"2024-05-24T01:44:27","slug":"service-task-stripe-invoice-charge","status":"publish","type":"post","link":"https:\/\/support.questetra.com\/en\/bpmn-icons\/service-task-stripe-invoice-charge\/","title":{"rendered":"Stripe: Charge by Invoice"},"content":{"rendered":"\n<div style=\"height:50px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<figure class=\"wp-block-image size-large\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"58\" data-attachment-id=\"113160\" data-permalink=\"https:\/\/support.questetra.com\/en\/developer-blog\/how-to-use-timer-start-event\/attachment\/advanced-banner-new-en\/\" data-orig-file=\"https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2021\/05\/advanced-banner-new-en.png?fit=1200%2C68&amp;ssl=1\" data-orig-size=\"1200,68\" data-comments-opened=\"0\" data-image-title=\"advanced-banner-new-en\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2021\/05\/advanced-banner-new-en.png?fit=1024%2C58&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2021\/05\/advanced-banner-new-en-1024x58.png?resize=1024%2C58&#038;ssl=1\" alt=\"\" class=\"wp-image-113160\" srcset=\"https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2021\/05\/advanced-banner-new-en.png?resize=1024%2C58&amp;ssl=1 1024w, https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2021\/05\/advanced-banner-new-en.png?resize=600%2C34&amp;ssl=1 600w, https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2021\/05\/advanced-banner-new-en.png?resize=768%2C44&amp;ssl=1 768w, https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2021\/05\/advanced-banner-new-en.png?w=1200&amp;ssl=1 1200w\" sizes=\"auto, (max-width: 1000px) 100vw, 1000px\" \/><\/figure>\n\n\n\n<div style=\"height:50px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h4 class=\"wp-block-heading has-border-color has-product-main-border-color has-white-color has-product-main-background-color has-text-color has-background has-link-color\" style=\"border-width:2px;margin-top:0;margin-right:0;margin-bottom:0;margin-left:0;padding-top:var(--wp--preset--spacing--10);padding-right:var(--wp--preset--spacing--20);padding-bottom:var(--wp--preset--spacing--10);padding-left:var(--wp--preset--spacing--20)\"><strong>Stripe: Charge by Invoice<\/strong><\/h4>\n\n\n\n<p class=\"has-text-align-right has-border-color has-product-main-border-color has-white-color has-product-main-background-color has-text-color has-background has-link-color has-small-font-size mt-0 pt-0 wp-block-paragraph\" style=\"border-width:2px;margin-top:0;margin-right:0;margin-bottom:0;margin-left:0;padding-top:0;padding-right:var(--wp--preset--spacing--20);padding-bottom:0;padding-left:var(--wp--preset--spacing--20)\"><a href=\"https:\/\/support.questetra.com\/en\/bpmn-icons\/service-task-stripe-invoice-charge\/\">Stripe: \u8acb\u6c42\u66f8\u3067\u8ab2\u91d1<\/a><\/p>\n\n\n\n<p class=\"has-border-color has-product-main-border-color has-text-color has-white-background-color has-background has-link-color mt-0 pt-0 wp-block-paragraph\" style=\"border-width:2px;margin-top:0;margin-right:0;margin-bottom:var(--wp--preset--spacing--30);margin-left:0;padding-top:var(--wp--preset--spacing--20);padding-right:var(--wp--preset--spacing--20);padding-bottom:var(--wp--preset--spacing--20);padding-left:var(--wp--preset--spacing--20)\">This item charges the customer based on a finalized invoice on Stripe. If the default payment method fails, this item tries to charge other payment methods (card) attached to the customer. An error occurs if no charge succeeded.<\/p>\n\n\n\n<figure class=\"wp-block-image alignright has-custom-border is-style-default\"><img decoding=\"async\" src=\"data:image;base64,\n        iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAvJJREFUWEfF\n        l19I01EUxz\/XKZqWNbVS6cH+UfSUGQlCD0EQRCkoFDkDUzENi6IgkB4sKEgjDStFnVlzalC9+BBR\n        IEFBEeVbFP3R\/lhRpLRpKHO78dtv021u+pszfnv87Zzv+dxzzj33XoHOP6E1fvleGe9KJF\/CDiSZ\n        CDIAo8d\/BMkggn4BfVE27rX0ir9atOcEKC6WqdEOTkuoAOK0iALjAponY7jY0SF+zOYzK0CJSVYI\n        uAQkaAwcaDYm4VS7VTSH8g8JUFokryOpnGdgfzdBk7lTHAmmFRSgxCS7BBxYkOAeEQnd7VZRGKg5\n        A2BBVz4z2oxM+AF4at60kCsP1JJQ6dsTUwBKtxscvI+g4bRyjzljWOfdHVMAZSZZL+G4VpVI7AQ0\n        tFnFCUXDDaAMGWciv8PY55HEV3zHDTaSlWHlBigzySIJlvmoxsbBxHj4ngIOtllFpxug1CTNQMls\n        MjnbIS0d7t6etmpshe9DcKEmfACg3WwVpSpAoXyFIDNQZuMm2J2rfk1Ng6XL4NlTSE4Blwt6LOB0\n        QtEhkBKGvsCdHli9FnLzoe8h9L8MASfpN3eJLd4MDPscLFMeTTcgOhocDjXNi5fAr5+wYqUa+NOA\n        ClF9FiYnVdtHD2DnLpiYgNhYqKmGr5+DQoyYrSLJCyCDmdQ1gtEIdpv6r7LKbgscroKr9ZC\/Dzpa\n        VIBr9VBeBYYoiDKotkLA\/V7\/svnGMVuFYuLugaAAx05C+ipIWa4KShe8eA7ZOdB4GQr2TwMMfoSM\n        NfDuLazfALY\/YLdD9y148zp4GXwBgpag9goYk2BkGJ48hj15MDoK8QnQUAtZ26DrJrRaVMBRO9Sd\n        h7wC2JylAp87A9+G5ipBiCbU0ttbs6HiqFqCkA0XTCigCefchqFgFsWrO2TggxZcP5vpbRjJIAo7\n        rMfBbxDpPoo941i\/w0gB0P04ViB0vZB4m0nXK5kXQtdL6X\/JRLjXcp9M6Pcw8ULo+jTznXK6PU7n\n        O2q1+v0D2nRCMMki7aoAAAAASUVORK5CYII=\n    \" alt=\"Auto Step icon\" class=\"has-border-color has-ast-global-color-6-border-color\" style=\"border-width:0.5em\"\/><\/figure>\n\n\n\n<div class=\"wp-block-coblocks-accordion\">\n<div class=\"wp-block-coblocks-accordion-item\"><details open><summary class=\"wp-block-coblocks-accordion-item__title\">Basic Configs<\/summary><div class=\"wp-block-coblocks-accordion-item__content\">\n<dl style=\"0 0 -0.7em 0\">\n<dt style=\"font-weight: 300; font-size: 50%; margin: -1em 0 0 0; color: #C3C3C3;\"><\/dt><dd style=\"margin: -0.5em 0 0.1em 1em\">Step Name<\/dd>\n<dt style=\"font-weight: 300; font-size: 50%; margin: -1em 0 0 0; color: #C3C3C3;\"><\/dt><dd style=\"margin: -0.5em 0 0.1em 1em\">Note<\/dd>\n<\/dl>\n<\/div><\/details><\/div>\n<\/div>\n\n\n\n<div class=\"wp-block-coblocks-accordion\">\n<div class=\"wp-block-coblocks-accordion-item\"><details open><summary class=\"wp-block-coblocks-accordion-item__title\">Configs for this Auto Step<\/summary><div class=\"wp-block-coblocks-accordion-item__content\">\n<dl style=\"0 0 -0.7em 0\">\n<dt style=\"font-weight: 300; font-size: 50%; margin: -1em 0 0 0; color: #aaa;\">conf_Auth<\/dt><dd style=\"margin: -0.5em 0 0.1em 1em\">C1: Authorization Setting in which API Secret Key is set<span style=\"color:#990000;\"> *<\/span><\/dd>\n<dt style=\"font-weight: 300; font-size: 50%; margin: -1em 0 0 0; color: #aaa;\">conf_InvoiceId<\/dt><dd style=\"margin: -0.5em 0 0.1em 1em\">C2: Finalized Invoice ID<span style=\"color:#990000;\"> *<\/span><\/dd>\n<dt style=\"font-weight: 300; font-size: 50%; margin: -1em 0 0 0; color: #aaa;\">conf_SendReceipt<\/dt><dd style=\"margin: -0.5em 0 0.1em 1em\">C3: Email the receipt to the customer when the charge completed<\/dd>\n\n<\/dl>\n<\/div><\/details><\/div>\n<\/div>\n\n\n\n<h3 class=\"wp-block-heading\"><i class=\"fal fa-lightbulb-exclamation\"><\/i> Notes<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>To get Stripe\u2019s API Secret Key, visit&nbsp;<a rel=\"noreferrer noopener\" href=\"https:\/\/dashboard.stripe.com\/apikeys\" target=\"_blank\">https:\/\/dashboard.stripe.com\/apikeys<\/a> (Stripe login required)<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\"><i class=\"fal fa-images\"><\/i> Capture<\/h3>\n\n\n\n<figure class=\"wp-block-image size-large\"><img data-recalc-dims=\"1\" decoding=\"async\" data-attachment-id=\"84005\" data-permalink=\"https:\/\/support.questetra.com\/en\/bpmn-icons\/onedrive-file-upload\/attachment\/setting-service-task-pdf-generation-en\/\" data-orig-file=\"https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2020\/01\/setting-service-task-pdf-generation-en.png?fit=959%2C833&amp;ssl=1\" data-orig-size=\"959,833\" data-comments-opened=\"0\" data-image-title=\"setting-service-task-pdf-generation-en\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2020\/01\/setting-service-task-pdf-generation-en.png?fit=725%2C630&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2022\/08\/stripe-invoice-charge_capture_en.png?ssl=1\" alt=\"\" class=\"wp-image-84005\" style=\"border:10px solid #aaaaaa; padding:5px; margin:5px;\"><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\"><i class=\"fal fa-balance-scale\"><\/i> See also<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a rel=\"noreferrer noopener\" href=\"https:\/\/support.questetra.com\/en\/bpmn-icons\/service-task-stripe-invoice-create\/\" target=\"_blank\">Stripe: Create Draft Invoice<\/a><\/li>\n\n\n\n<li><a rel=\"noreferrer noopener\" href=\"https:\/\/support.questetra.com\/en\/bpmn-icons\/service-task-stripe-invoice-finalize\/\" target=\"_blank\">Stripe: Finalize Draft Invoice<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/support.questetra.com\/en\/bpmn-icons\/intermediate-error-catch-event-boundary-type\/\" target=\"_blank\" rel=\"noreferrer noopener\">Intermediate Error Catch Event (Boundary Type)<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/support.questetra.com\/en\/developer-blog\/stripe-charge\/\" target=\"_blank\" rel=\"noreferrer noopener\">Tutorial: Utilize Stripe to Set Up Automatic Billing<\/a><\/li>\n<\/ul>\n\n\n\n<div class=\"wp-block-coblocks-accordion\">\n<div class=\"wp-block-coblocks-accordion-item\"><details><summary class=\"wp-block-coblocks-accordion-item__title\">Script (click to open)<\/summary><div class=\"wp-block-coblocks-accordion-item__content\">\n<ul class=\"wp-block-list\">\n<li>An XML file that contains the code below is available to download\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/raw.githubusercontent.com\/Questetra\/Addon-XML\/release-2024-04-30\/stripe-invoice-charge.xml\" target=\"_blank\" rel=\"noreferrer noopener\">stripe-invoice-charge.xml<\/a> (C) Questetra, Inc. (MIT License)<\/li>\n\n\n\n<li>If you are using Professional, you can modify the contents of this file and use it as your own add-on auto step<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-js\" data-lang=\"JavaScript\"><code>\n\nconst STRIPE_API_VERSION = &apos;2022-08-01&apos;;\n\nfunction main(){\n    \/\/\/\/ == Config Retrieving \/ \u5de5\u7a0b\u30b3\u30f3\u30d5\u30a3\u30b0\u306e\u53c2\u7167 ==\n    const auth = configs.getObject(&apos;conf_Auth&apos;);\n    const invoiceId = retrieveInvoiceId();\n    const sendReceipt = configs.getObject(&apos;conf_SendReceipt&apos;);\n\n    \/\/\/\/ == Calculating \/ \u6f14\u7b97 ==\n    const {customerId, paymentIntentId} = checkInvoice(auth, invoiceId);\n    const {customerEmail, defaultPaymentMethodId} = getCustomer(auth, customerId);\n    updatePaymentIntent(auth, paymentIntentId, sendReceipt, customerEmail);\n    chargeByInvoice(auth, invoiceId, defaultPaymentMethodId, customerId);\n}\n\n\/**\n  * config \u304b\u3089\u8acb\u6c42\u66f8\u306e ID \u3092\u8aad\u307f\u51fa\u3059\u3002\u7a7a\u6587\u5b57\u5217\u306e\u5834\u5408\u306f\u30a8\u30e9\u30fc\n  * @return {String} invoiceId \u8acb\u6c42\u66f8\u306e ID\n  *\/\nfunction retrieveInvoiceId() {\n    const invoiceId = engine.findData(configs.getObject(&apos;conf_InvoiceId&apos;));\n    if (invoiceId === null) {\n        throw new Error(&apos;Invoice ID is blank.&apos;);\n    }\n    return invoiceId;\n}\n\n\/**\n  * \u8acb\u6c42\u66f8\u306e\u30b9\u30c6\u30fc\u30bf\u30b9\u3092\u30c1\u30a7\u30c3\u30af\u3057\u3001\u9867\u5ba2 ID \u3068\u652f\u6255\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306e ID \u3092\u8fd4\u3059\n  * - \u30b9\u30c6\u30fc\u30bf\u30b9\u304c open, uncollectible \u4ee5\u5916\u306e\u5834\u5408\u306f\u30a8\u30e9\u30fc\n  * @param {AuthSettingWrapper} auth  HTTP \u8a8d\u8a3c\u8a2d\u5b9a \u30c8\u30fc\u30af\u30f3\u76f4\u63a5\u6307\u5b9a\n  * @param {String} invoiceId \u8acb\u6c42\u66f8\u306e ID\n  * @return {Object} returnObj\n  * @return {String} returnObj.customerId \u9867\u5ba2 ID\n  * @return {String} returnObj.paymentIntentId \u652f\u6255\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306e ID\n  *\/\nfunction checkInvoice(auth, invoiceId) {\n    const apiUri = `https:\/\/api.stripe.com\/v1\/invoices\/${encodeURIComponent(invoiceId)}`;\n    const response = httpClient.begin()\n        .authSetting(auth) \/\/ with &quot;Authorization: Bearer XX&quot;\n        .header(&apos;Stripe-Version&apos;, STRIPE_API_VERSION)\n        .get(apiUri);\n    const status = response.getStatusCode();\n    const responseStr = response.getResponseAsString();\n    if (status !== 200) { \/\/ \u524a\u9664\u6e08\u307f\u306e\u5834\u5408\u3082\u30a8\u30e9\u30fc\u30ec\u30b9\u30dd\u30f3\u30b9\n        engine.log(responseStr);\n        throw new Error(`Failed to retrieve invoice. status: ${status}`);\n    }\n    const invoiceObj = JSON.parse(responseStr);\n    switch (invoiceObj.status) {\n        case &apos;draft&apos;:\n            throw new Error(&apos;The invoice is still draft. It needs to be finalized first.&apos;);\n        case &apos;paid&apos;:\n            throw new Error(&apos;The invoice is already paid.&apos;);\n        case &apos;void&apos;:\n            throw new Error(&apos;The invoice is void.&apos;);\n        default: \/\/ open or uncollectible\n            \/\/ do nothing\n    }\n    const customerId = invoiceObj.customer;\n    const paymentIntentId = invoiceObj.payment_intent;\n    return {customerId, paymentIntentId};\n}\n\n\/**\n  * \u9867\u5ba2\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3092\u53d6\u5f97\u3057\u3001\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9\u3068\u30c7\u30d5\u30a9\u30eb\u30c8\u306e\u652f\u6255\u65b9\u6cd5\u306e ID \u3092\u8fd4\u3059\n  * - \u9867\u5ba2\u304c\u524a\u9664\u6e08\u307f\u306e\u5834\u5408\u3001\u30a8\u30e9\u30fc\n  * @param {AuthSettingWrapper} auth  HTTP \u8a8d\u8a3c\u8a2d\u5b9a \u30c8\u30fc\u30af\u30f3\u76f4\u63a5\u6307\u5b9a\n  * @param {String} customerId \u9867\u5ba2 ID\n  * @return {Object} returnObj\n  * @return {String} returnObj.customerEmail \u9867\u5ba2\u306e\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9\u3002\u672a\u8a2d\u5b9a\u306e\u5834\u5408\u306f null\n  * @return {String} returnObj.defaultPaymentMethodId \u9867\u5ba2\u306e\u30c7\u30d5\u30a9\u30eb\u30c8\u306e\u652f\u6255\u65b9\u6cd5\u306e ID\u3002\u672a\u8a2d\u5b9a\u306e\u5834\u5408\u306f null\n  *\/\nfunction getCustomer(auth, customerId) {\n    const apiUri = `https:\/\/api.stripe.com\/v1\/customers\/${customerId}`;\n    const response = httpClient.begin()\n        .authSetting(auth) \/\/ with &quot;Authorization: Bearer XX&quot;\n        .header(&apos;Stripe-Version&apos;, STRIPE_API_VERSION)\n        .get(apiUri);\n    const status = response.getStatusCode();\n    const responseStr = response.getResponseAsString();\n    if (status !== 200) {\n        engine.log(responseStr);\n        throw new Error(`Failed to retrieve customer. status: ${status}`);\n    }\n    const customerObj = JSON.parse(responseStr);\n    if (customerObj.deleted) {\n        throw new Error(&apos;The customer is deleted.&apos;);\n    }\n    \/\/ \u9867\u5ba2\u306e\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9\u4ee5\u5916\u306b\u300c\u8acb\u6c42\u5148\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9\u300d\u3082\u30c0\u30c3\u30b7\u30e5\u30dc\u30fc\u30c9\u304b\u3089\u306f\u8a2d\u5b9a\u3067\u304d\u308b\u304c\u3001API \u3067\u306f\u53d6\u5f97\u4e0d\u53ef\n    const customerEmail = customerObj.email;\n    let defaultPaymentMethodId = customerObj.invoice_settings.default_payment_method;\n    if (defaultPaymentMethodId === null) {\n        \/\/ \u5f93\u6765\u306e\u767b\u9332\u65b9\u6cd5\u3067 Source \u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3068\u3057\u3066\u767b\u9332\u3055\u308c\u3066\u3044\u308b\u5834\u5408\u306f default_source \u306b\u8a2d\u5b9a\u3055\u308c\u308b\n        defaultPaymentMethodId = customerObj.default_source;\n    }\n    return {customerEmail, defaultPaymentMethodId};\n}\n\n\/**\n  * \u652f\u6255\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3092\u66f4\u65b0\u3057\u3001\u9818\u53ce\u66f8\u9001\u4ed8\u5148\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9\u3092\u8a2d\u5b9a\u3059\u308b\n  * @param {AuthSettingWrapper} auth  HTTP \u8a8d\u8a3c\u8a2d\u5b9a \u30c8\u30fc\u30af\u30f3\u76f4\u63a5\u6307\u5b9a\n  * @param {String} paymentIntentId \u652f\u6255\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306e ID\n  * @param {boolean} sendReceipt \u9818\u53ce\u66f8\u3092\u30e1\u30fc\u30eb\u9001\u4ed8\u3059\u308b\u304b\u3069\u3046\u304b\n  * @param {String} customerEmail \u9867\u5ba2\u306e\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9\n  *\/\nfunction updatePaymentIntent(auth, paymentIntentId, sendReceipt, customerEmail) {\n    let receiptEmail = &apos;&apos;;\n    if (sendReceipt) {\n        if (customerEmail === null) {\n            throw new Error(&quot;The customer&apos;s email is not set. Unable to send the receipt.&quot;);\n        }\n        receiptEmail = customerEmail;\n    }\n    const apiUri = `https:\/\/api.stripe.com\/v1\/payment_intents\/${paymentIntentId}`;\n    const response = httpClient.begin()\n        .authSetting(auth) \/\/ with &quot;Authorization: Bearer XX&quot;\n        .header(&apos;Stripe-Version&apos;, STRIPE_API_VERSION)\n        .formParam(&apos;receipt_email&apos;, receiptEmail)\n        .post(apiUri);\n    const status = response.getStatusCode();\n    const responseStr = response.getResponseAsString();\n    if (status !== 200) {\n        engine.log(responseStr);\n        throw new Error(`Failed to update payment intent. status: ${status}`);\n    }\n}\n\n\/**\n  * \u8acb\u6c42\u66f8\u3067\u8ab2\u91d1\u3059\u308b\u3002\u8ab2\u91d1\u3092\u8a66\u307f\u308b\u652f\u6255\u65b9\u6cd5\u306e\u9806\u5e8f\u306f\n  * 1. \u9867\u5ba2\u306e\u30c7\u30d5\u30a9\u30eb\u30c8\u306e\u652f\u6255\u65b9\u6cd5\n  * 2. \u9867\u5ba2\u306e\u4e88\u5099\u306e\u652f\u6255\u65b9\u6cd5\uff08\u30ab\u30fc\u30c9\uff09\n  * @param {AuthSettingWrapper} auth  HTTP \u8a8d\u8a3c\u8a2d\u5b9a \u30c8\u30fc\u30af\u30f3\u76f4\u63a5\u6307\u5b9a\n  * @param {String} invoiceId \u8acb\u6c42\u66f8\u306e ID\n  * @param {String} defaultPaymentMethodId \u9867\u5ba2\u306e\u30c7\u30d5\u30a9\u30eb\u30c8\u306e\u652f\u6255\u65b9\u6cd5\u306e ID\n  * @param {String} customerId \u9867\u5ba2 ID (\u30c7\u30d5\u30a9\u30eb\u30c8\u306e\u652f\u6255\u65b9\u6cd5\u306b\u5931\u6557\u3057\u305f\u5834\u5408\u306b\u4f7f\u7528)\n  *\/\nfunction chargeByInvoice(auth, invoiceId, defaultPaymentMethodId, customerId) {\n    let succeeded = false;\n    if (defaultPaymentMethodId !== null) {\n        succeeded = tryCharge(auth, invoiceId, defaultPaymentMethodId);\n    }\n    if (succeeded) {\n        return;\n    }\n    const customerPaymentMethodIds = getCustomerPaymentMethodIds(auth, customerId);\n    const otherPaymentMethodIds = customerPaymentMethodIds.filter(id =&gt; id !== defaultPaymentMethodId);\n    const httpLimit = httpClient.getRequestingLimit();\n    for (let i = 0; i &lt; otherPaymentMethodIds.length; i++) {\n        succeeded = tryCharge(auth, invoiceId, otherPaymentMethodIds[i]);\n        if (succeeded) {\n            return;\n        }\n    }\n    throw new Error(&apos;No payment method succeeded.&apos;);\n}\n\n\/**\n  * \u6307\u5b9a\u3057\u305f\u652f\u6255\u65b9\u6cd5\u3078\u306e\u8ab2\u91d1\u3092\u8a66\u307f\u308b\n  * @param {AuthSettingWrapper} auth  HTTP \u8a8d\u8a3c\u8a2d\u5b9a \u30c8\u30fc\u30af\u30f3\u76f4\u63a5\u6307\u5b9a\n  * @param {String} invoiceId \u8acb\u6c42\u66f8\u306e ID\n  * @param {String} paymentMethodId \u652f\u6255\u65b9\u6cd5\u306e ID\n  * @return {boolean} succeeded \u8ab2\u91d1\u304c\u6210\u529f\u3057\u305f\u304b\u3069\u3046\u304b\n  *\/\nfunction tryCharge(auth, invoiceId, paymentMethodId) {\n    const apiUri = `https:\/\/api.stripe.com\/v1\/invoices\/${encodeURIComponent(invoiceId)}\/pay`;\n    const response = httpClient.begin()\n        .authSetting(auth) \/\/ with &quot;Authorization: Bearer XX&quot;\n        .header(&apos;Stripe-Version&apos;, STRIPE_API_VERSION)\n        .formParam(&apos;payment_method&apos;, paymentMethodId)\n        .post(apiUri);\n    const status = response.getStatusCode();\n    const responseStr = response.getResponseAsString();\n    if (status !== 200) {\n        let errorLog = `Failed to charge by the payment method: ${paymentMethodId}, status: ${status}`;\n        const error = JSON.parse(responseStr).error;\n        if (error !== undefined &amp;&amp; error.message !== undefined) {\n            errorLog += `, message: ${error.message}`;\n        }\n        engine.log(errorLog);\n        return false;\n    }\n    return true;\n}\n\n\/**\n  * \u9867\u5ba2\u306e\u652f\u6255\u65b9\u6cd5\uff08\u30ab\u30fc\u30c9\uff09\u306e ID \u4e00\u89a7\u3092\u53d6\u5f97\u3059\u308b\n  * @param {AuthSettingWrapper} auth  HTTP \u8a8d\u8a3c\u8a2d\u5b9a \u30c8\u30fc\u30af\u30f3\u76f4\u63a5\u6307\u5b9a\n  * @param {String} customerId \u9867\u5ba2 ID\n  * @return {Array&lt;String&gt;} paymentMethodIds \u652f\u6255\u65b9\u6cd5\uff08\u30ab\u30fc\u30c9\uff09\u306e ID \u4e00\u89a7\n  *\/\nfunction getCustomerPaymentMethodIds(auth, customerId) {\n    const apiUri = `https:\/\/api.stripe.com\/v1\/customers\/${customerId}\/payment_methods`;\n    const response = httpClient.begin()\n        .authSetting(auth) \/\/ with &quot;Authorization: Bearer XX&quot;\n        .header(&apos;Stripe-Version&apos;, STRIPE_API_VERSION)\n        .queryParam(&apos;type&apos;, &apos;card&apos;) \/\/ required\n        .queryParam(&apos;limit&apos;, &apos;100&apos;) \/\/ maximum limit\n        .get(apiUri);\n    const status = response.getStatusCode();\n    const responseStr = response.getResponseAsString();\n    if (status !== 200) {\n        engine.log(responseStr);\n        throw new Error(`Failed to get the customer&apos;s payment methods. status: ${status}`);\n    }\n    const responseObj = JSON.parse(responseStr);\n    const paymentMethods = responseObj.data;\n    if (paymentMethods.length === 0) {\n        throw new Error(&apos;The customer has no card-type payment methods.&apos;);\n    }\n    return paymentMethods.map(paymentMethod =&gt; paymentMethod.id);\n}\n\n    <\/code><\/pre><\/div>\n<\/div><\/details><\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>This item charges the customer based on a finalized invoice on Stripe. If the default payment method fails, this item tries to charge other payment methods (card) attached to the customer. An error occurs if no charge succeeded.<\/p>\n","protected":false},"author":17,"featured_media":125421,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_coblocks_attr":"","_coblocks_dimensions":"","_coblocks_responsive_height":"","_coblocks_accordion_ie_support":"","_uag_custom_page_level_css":"","advanced_seo_description":"","jetpack_seo_html_title":"","jetpack_seo_noindex":false,"jetpack_seo_schema_type":"","_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_wpcom_ai_launchpad_first_post":false,"_jetpack_hide_featured_image":false,"_jetpack_featured_image_duplicate_dismissed":0,"_jetpack_feature_clip_id":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"{title}\n\n{excerpt}\n\n{url}","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"_wpas_customize_per_network":false,"jetpack_post_was_ever_published":false},"categories":[551],"tags":[404],"faq_section":[],"class_list":["post-125835","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-bpmn-icons","tag-stripe-api"],"jetpack_publicize_connections":[],"uagb_featured_image_src":{"full":["https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2022\/07\/stripe-icon-fi-1.png?fit=1200%2C675&ssl=1",1200,675,false],"thumbnail":["https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2022\/07\/stripe-icon-fi-1.png?resize=440%2C440&ssl=1",440,440,true],"medium":["https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2022\/07\/stripe-icon-fi-1.png?fit=560%2C315&ssl=1",560,315,true],"medium_large":["https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2022\/07\/stripe-icon-fi-1.png?fit=768%2C432&ssl=1",768,432,true],"large":["https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2022\/07\/stripe-icon-fi-1.png?fit=1024%2C576&ssl=1",1024,576,true],"1536x1536":["https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2022\/07\/stripe-icon-fi-1.png?fit=1200%2C675&ssl=1",1200,675,true],"2048x2048":["https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2022\/07\/stripe-icon-fi-1.png?fit=1200%2C675&ssl=1",1200,675,true],"newspack-article-block-landscape-large":["https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2022\/07\/stripe-icon-fi-1.png?resize=1200%2C675&ssl=1",1200,675,true],"newspack-article-block-portrait-large":["https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2022\/07\/stripe-icon-fi-1.png?resize=900%2C675&ssl=1",900,675,true],"newspack-article-block-square-large":["https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2022\/07\/stripe-icon-fi-1.png?resize=1200%2C675&ssl=1",1200,675,true],"newspack-article-block-landscape-medium":["https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2022\/07\/stripe-icon-fi-1.png?resize=800%2C600&ssl=1",800,600,true],"newspack-article-block-portrait-medium":["https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2022\/07\/stripe-icon-fi-1.png?resize=600%2C675&ssl=1",600,675,true],"newspack-article-block-square-medium":["https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2022\/07\/stripe-icon-fi-1.png?resize=800%2C675&ssl=1",800,675,true],"newspack-article-block-landscape-intermediate":["https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2022\/07\/stripe-icon-fi-1.png?resize=600%2C450&ssl=1",600,450,true],"newspack-article-block-portrait-intermediate":["https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2022\/07\/stripe-icon-fi-1.png?resize=450%2C600&ssl=1",450,600,true],"newspack-article-block-square-intermediate":["https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2022\/07\/stripe-icon-fi-1.png?resize=600%2C600&ssl=1",600,600,true],"newspack-article-block-landscape-small":["https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2022\/07\/stripe-icon-fi-1.png?resize=400%2C300&ssl=1",400,300,true],"newspack-article-block-portrait-small":["https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2022\/07\/stripe-icon-fi-1.png?resize=300%2C400&ssl=1",300,400,true],"newspack-article-block-square-small":["https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2022\/07\/stripe-icon-fi-1.png?resize=400%2C400&ssl=1",400,400,true],"newspack-article-block-landscape-tiny":["https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2022\/07\/stripe-icon-fi-1.png?resize=200%2C150&ssl=1",200,150,true],"newspack-article-block-portrait-tiny":["https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2022\/07\/stripe-icon-fi-1.png?resize=150%2C200&ssl=1",150,200,true],"newspack-article-block-square-tiny":["https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2022\/07\/stripe-icon-fi-1.png?resize=200%2C200&ssl=1",200,200,true],"newspack-article-block-uncropped":["https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2022\/07\/stripe-icon-fi-1.png?fit=1200%2C675&ssl=1",1200,675,true]},"uagb_author_info":{"display_name":"Shiho Tatsumi","author_link":"https:\/\/support.questetra.com\/en\/author\/tatsumi48c607ec82\/"},"uagb_comment_info":2,"uagb_excerpt":"This item charges the customer based on a finalized invoice on Stripe. If the default payment method fails, this item tries to charge other payment methods (card) attached to the customer. An error occurs if no charge succeeded.","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p9DiIh-wJB","jetpack-related-posts":[{"id":88658,"url":"https:\/\/support.questetra.com\/en\/addons\/stripe-charge-object-create\/","url_meta":{"origin":125835,"position":0},"title":"Stripe: Charge Object, Create","author":"IMAMURA, Genichi","date":"2020-06-03","format":false,"excerpt":"Creates the Charge object on the payment platform Stripe to charge the Customer ID (cus_12345678901234) for any amount in any currency. If the charging process fails, Charge object is not created and error log such as expired_card is output.","rel":"","context":"In &quot;Add-ons&quot;","block_context":{"text":"Add-ons","link":"https:\/\/support.questetra.com\/en\/category\/addons\/"},"img":{"alt_text":"Stripe: Charge Object, Create","src":"https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2020\/06\/Stripe-Charge-Object-Create-en.png?fit=1200%2C675&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2020\/06\/Stripe-Charge-Object-Create-en.png?fit=1200%2C675&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2020\/06\/Stripe-Charge-Object-Create-en.png?fit=1200%2C675&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2020\/06\/Stripe-Charge-Object-Create-en.png?fit=1200%2C675&ssl=1&resize=700%2C400 2x, https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2020\/06\/Stripe-Charge-Object-Create-en.png?fit=1200%2C675&ssl=1&resize=1050%2C600 3x"},"classes":[]},{"id":143586,"url":"https:\/\/support.questetra.com\/en\/developer-blog\/stripe-charge\/","url_meta":{"origin":125835,"position":1},"title":"Utilize Stripe to Set Up Automatic Billing","author":"Hirotaka NISHI","date":"2023-03-15","format":false,"excerpt":"This section explains the difference between [Stripe: Charge by Invoice] and [Stripe: Send Invoice], their uses, and how automatic billing works with [Stripe: Charge by Invoice].","rel":"","context":"In &quot;Questetra Developers Blog&quot;","block_context":{"text":"Questetra Developers Blog","link":"https:\/\/support.questetra.com\/en\/category\/developer-blog\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2023\/03\/stripe-charge-fi-en1.png?fit=1200%2C675&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2023\/03\/stripe-charge-fi-en1.png?fit=1200%2C675&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2023\/03\/stripe-charge-fi-en1.png?fit=1200%2C675&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2023\/03\/stripe-charge-fi-en1.png?fit=1200%2C675&ssl=1&resize=700%2C400 2x, https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2023\/03\/stripe-charge-fi-en1.png?fit=1200%2C675&ssl=1&resize=1050%2C600 3x"},"classes":[]},{"id":88633,"url":"https:\/\/support.questetra.com\/en\/addons\/stripe-customer-object-create\/","url_meta":{"origin":125835,"position":2},"title":"Stripe: Customer Object, Create","author":"IMAMURA, Genichi","date":"2020-06-03","format":false,"excerpt":"Creates the Customer object on the payment platform Stripe. Once the object is created, subsequent card billing is possible. Token ID and the customer email etc are required. Realizes a billing environment that does not touch sensitive info.","rel":"","context":"In &quot;Add-ons&quot;","block_context":{"text":"Add-ons","link":"https:\/\/support.questetra.com\/en\/category\/addons\/"},"img":{"alt_text":"Stripe: Customer Object, Create","src":"https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2020\/06\/Stripe-Customer-Object-Create-en.png?fit=1200%2C675&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2020\/06\/Stripe-Customer-Object-Create-en.png?fit=1200%2C675&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2020\/06\/Stripe-Customer-Object-Create-en.png?fit=1200%2C675&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2020\/06\/Stripe-Customer-Object-Create-en.png?fit=1200%2C675&ssl=1&resize=700%2C400 2x, https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2020\/06\/Stripe-Customer-Object-Create-en.png?fit=1200%2C675&ssl=1&resize=1050%2C600 3x"},"classes":[]},{"id":67490,"url":"https:\/\/support.questetra.com\/en\/addons\/stripe-chargecreate\/","url_meta":{"origin":125835,"position":3},"title":"Stripe Charge to Customer ID","author":"Hirotaka NISHI","date":"2017-09-09","format":false,"excerpt":"From Customer ID, charge amount, currency code etc. stores Charge ID, last 4 digits of credit card number, status of registration process, communication log respectively into data items as billing record *Note It requires acquiring Secret Key at Stripe Dashboard in advance Supported cards or currency vary from country to\u2026","rel":"","context":"In &quot;Add-ons&quot;","block_context":{"text":"Add-ons","link":"https:\/\/support.questetra.com\/en\/category\/addons\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2017\/09\/stripe-charge-create-header.png?fit=1200%2C675&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2017\/09\/stripe-charge-create-header.png?fit=1200%2C675&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2017\/09\/stripe-charge-create-header.png?fit=1200%2C675&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2017\/09\/stripe-charge-create-header.png?fit=1200%2C675&ssl=1&resize=700%2C400 2x, https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2017\/09\/stripe-charge-create-header.png?fit=1200%2C675&ssl=1&resize=1050%2C600 3x"},"classes":[]},{"id":141572,"url":"https:\/\/support.questetra.com\/en\/developer-blog\/stripe-invoicing\/","url_meta":{"origin":125835,"position":4},"title":"Sending Invoices with Stripe","author":"Hirotaka NISHI","date":"2023-01-26","format":false,"excerpt":"Explaining the automated process of creating an invoice on Stripe and sending it to the customer by email.","rel":"","context":"In &quot;Questetra Developers Blog&quot;","block_context":{"text":"Questetra Developers Blog","link":"https:\/\/support.questetra.com\/en\/category\/developer-blog\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2023\/01\/stripe-billing-fi-en.png?fit=1200%2C675&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2023\/01\/stripe-billing-fi-en.png?fit=1200%2C675&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2023\/01\/stripe-billing-fi-en.png?fit=1200%2C675&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2023\/01\/stripe-billing-fi-en.png?fit=1200%2C675&ssl=1&resize=700%2C400 2x, https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2023\/01\/stripe-billing-fi-en.png?fit=1200%2C675&ssl=1&resize=1050%2C600 3x"},"classes":[]},{"id":88772,"url":"https:\/\/support.questetra.com\/en\/addons\/stripe-charge-object-create-with-transfer-amount\/","url_meta":{"origin":125835,"position":5},"title":"Stripe: Charge Object, Create with Transfer Amount","author":"IMAMURA, Genichi","date":"2020-06-08","format":false,"excerpt":"Creates the Charge object with Transfer Amount to charge the Customer ID for any amount in any currency. Any Connected Account as the Transfer Destination, any Transfer Amount within the Charge amount are available. If fails, the object not created.","rel":"","context":"In &quot;Add-ons&quot;","block_context":{"text":"Add-ons","link":"https:\/\/support.questetra.com\/en\/category\/addons\/"},"img":{"alt_text":"Stripe: Charge Object, Create with Transfer Amount","src":"https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2020\/06\/Stripe-Charge-Object-Create-with-Transfer-Amount-en.png?fit=1200%2C675&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2020\/06\/Stripe-Charge-Object-Create-with-Transfer-Amount-en.png?fit=1200%2C675&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2020\/06\/Stripe-Charge-Object-Create-with-Transfer-Amount-en.png?fit=1200%2C675&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2020\/06\/Stripe-Charge-Object-Create-with-Transfer-Amount-en.png?fit=1200%2C675&ssl=1&resize=700%2C400 2x, https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2020\/06\/Stripe-Charge-Object-Create-with-Transfer-Amount-en.png?fit=1200%2C675&ssl=1&resize=1050%2C600 3x"},"classes":[]}],"jetpack_featured_media_url":"https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2022\/07\/stripe-icon-fi-1.png?fit=1200%2C675&ssl=1","_links":{"self":[{"href":"https:\/\/support.questetra.com\/en\/wp-json\/wp\/v2\/posts\/125835","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/support.questetra.com\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/support.questetra.com\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/support.questetra.com\/en\/wp-json\/wp\/v2\/users\/17"}],"replies":[{"embeddable":true,"href":"https:\/\/support.questetra.com\/en\/wp-json\/wp\/v2\/comments?post=125835"}],"version-history":[{"count":11,"href":"https:\/\/support.questetra.com\/en\/wp-json\/wp\/v2\/posts\/125835\/revisions"}],"predecessor-version":[{"id":161778,"href":"https:\/\/support.questetra.com\/en\/wp-json\/wp\/v2\/posts\/125835\/revisions\/161778"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/support.questetra.com\/en\/wp-json\/wp\/v2\/media\/125421"}],"wp:attachment":[{"href":"https:\/\/support.questetra.com\/en\/wp-json\/wp\/v2\/media?parent=125835"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/support.questetra.com\/en\/wp-json\/wp\/v2\/categories?post=125835"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/support.questetra.com\/en\/wp-json\/wp\/v2\/tags?post=125835"},{"taxonomy":"faq_section","embeddable":true,"href":"https:\/\/support.questetra.com\/en\/wp-json\/wp\/v2\/faq_section?post=125835"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}