Skip to main content
POST
/
v1
/
mock-apis
/
{mockApiId}
/
mappings
/
import
Import stub mappings
curl --request POST \
  --url https://wmc.wiremockapi.cloud/v1/mock-apis/{mockApiId}/mappings/import \
  --header 'Authorization: <api-key>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "mappings": [
    {
      "id": "7e6d6733-881e-416d-9f6c-bad8d5015d0f",
      "name": "Get v2 invoicing invoices by invoiceId",
      "request": {
        "urlPathTemplate": "/v2/invoicing/invoices/{invoiceId}",
        "method": "GET",
        "pathParameters": {
          "invoiceId": {
            "equalTo": "INV2-NS4E-L7P4-RZ6B-KNZY"
          }
        }
      },
      "response": {
        "status": 200,
        "body": "{\"id\":\"INV2-NS4E-L7P4-RZ6B-KNZY\",\"status\":\"DRAFT\",\"detail\":{\"reference\":\"<The reference data. Includes a post office (PO) number.>\",\"currency_code\":\"USD\",\"note\":\"<A note to the invoice recipient. Also appears on the invoice notification email.>\",\"terms_and_conditions\":\"<The general terms of the invoice. Can include return or cancellation policy and other terms and conditions.>\",\"memo\":\"<A private bookkeeping note for merchant.>\",\"additional_data\":\"<Any additional information. Includes business hours.>\",\"category_code\":\"SHIPPABLE\",\"invoice_number\":\"17494664982\",\"invoice_date\":\"2022-02-04\",\"payment_term\":{\"term_type\":\"NET_10\",\"due_date\":\"2022-02-14\"},\"viewed_by_recipient\":false,\"group_draft\":false,\"metadata\":{\"create_time\":\"2025-06-09T10:54:58Z\",\"last_update_time\":\"2025-06-09T10:54:58Z\",\"created_by_flow\":\"REGULAR_SINGLE\",\"recipient_view_url\":\"https://www.sandbox.paypal.com/invoice/p/#NS4EL7P4RZ6BKNZY\",\"invoicer_view_url\":\"https://www.sandbox.paypal.com/invoice/details/INV2-NS4E-L7P4-RZ6B-KNZY\",\"caller_type\":\"API_V2_INVOICE\",\"spam_info\":{}},\"archived\":false},\"invoicer\":{\"name\":{\"given_name\":\"David\",\"surname\":\"Larusso\",\"full_name\":\"David Larusso\"},\"address\":{\"address_line_1\":\"123 Townsend St\",\"address_line_2\":\"Floor 6\",\"admin_area_2\":\"San Francisco\",\"admin_area_1\":\"CA\",\"postal_code\":\"94107\",\"country_code\":\"US\"},\"phones\":[{\"country_code\":\"001\",\"national_number\":\"4085551234\",\"phone_type\":\"MOBILE\"}],\"website\":\"www.example.com\",\"tax_id\":\"XX-XXXXXXX\",\"additional_notes\":\"<Any additional information. Includes business hours.>\",\"logo_url\":\"https://example.com/logo.png\"},\"primary_recipients\":[{\"billing_info\":{\"name\":{\"given_name\":\"Stephanie\",\"surname\":\"Meyers\",\"full_name\":\"Stephanie Meyers\"},\"address\":{\"address_line_1\":\"1234 Main Street\",\"admin_area_2\":\"Anytown\",\"admin_area_1\":\"CA\",\"postal_code\":\"98765\",\"country_code\":\"US\"},\"email_address\":\"foobuyer@example.com\"},\"shipping_info\":{\"name\":{\"given_name\":\"Stephanie\",\"surname\":\"Meyers\",\"full_name\":\"Stephanie Meyers\"},\"address\":{\"address_line_1\":\"1234 Main Street\",\"admin_area_2\":\"Anytown\",\"admin_area_1\":\"CA\",\"postal_code\":\"98765\",\"country_code\":\"US\"}}}],\"items\":[{\"id\":\"ITEM-4M535543K7257150H\",\"name\":\"Yoga Mat\",\"description\":\"Elastic mat to practice yoga.\",\"quantity\":\"1\",\"unit_amount\":{\"currency_code\":\"USD\",\"value\":\"50.00\"},\"tax\":{\"id\":\"TAX-1R2044969B8060438\",\"name\":\"Sales Tax\",\"percent\":\"7.25\",\"amount\":{\"currency_code\":\"USD\",\"value\":\"3.27\"}},\"discount\":{\"percent\":\"5\",\"amount\":{\"currency_code\":\"USD\",\"value\":\"-2.50\"}},\"unit_of_measure\":\"QUANTITY\"},{\"id\":\"ITEM-0SE42747HP857643T\",\"name\":\"Yoga t-shirt\",\"quantity\":\"1\",\"unit_amount\":{\"currency_code\":\"USD\",\"value\":\"10.00\"},\"tax\":{\"id\":\"TAX-1R2044969B8060438\",\"name\":\"Sales Tax\",\"percent\":\"7.25\",\"amount\":{\"currency_code\":\"USD\",\"value\":\"0.34\"}},\"discount\":{\"amount\":{\"currency_code\":\"USD\",\"value\":\"-5.00\"}},\"unit_of_measure\":\"QUANTITY\"}],\"configuration\":{\"tax_calculated_after_discount\":true,\"tax_inclusive\":false,\"allow_tip\":true,\"partial_payment\":{\"allow_partial_payment\":true,\"minimum_amount_due\":{\"currency_code\":\"USD\",\"value\":\"20.00\"}},\"allow_only_pay_by_bank\":false,\"template_id\":\"TEMP-0P400848HY4308238\"},\"amount\":{\"breakdown\":{\"item_total\":{\"currency_code\":\"USD\",\"value\":\"60.00\"},\"discount\":{\"invoice_discount\":{\"percent\":\"5\",\"amount\":{\"currency_code\":\"USD\",\"value\":\"-2.63\"}},\"item_discount\":{\"currency_code\":\"USD\",\"value\":\"-7.50\"}},\"tax_total\":{\"currency_code\":\"USD\",\"value\":\"4.34\"},\"shipping\":{\"amount\":{\"currency_code\":\"USD\",\"value\":\"10.00\"},\"tax\":{\"id\":\"TAX-1R2044969B8060438\",\"name\":\"Sales Tax\",\"percent\":\"7.25\",\"amount\":{\"currency_code\":\"USD\",\"value\":\"0.73\"}}},\"custom\":{\"label\":\"Packing Charges\",\"amount\":{\"currency_code\":\"USD\",\"value\":\"10.00\"}}},\"currency_code\":\"USD\",\"value\":\"74.21\"},\"due_amount\":{\"currency_code\":\"USD\",\"value\":\"74.21\"},\"links\":[{\"href\":\"https://api.sandbox.paypal.com/v2/invoicing/invoices/INV2-NS4E-L7P4-RZ6B-KNZY\",\"rel\":\"self\",\"method\":\"GET\"},{\"href\":\"https://api.sandbox.paypal.com/v2/invoicing/invoices/INV2-NS4E-L7P4-RZ6B-KNZY/send\",\"rel\":\"send\",\"method\":\"POST\"},{\"href\":\"https://api.sandbox.paypal.com/v2/invoicing/invoices/INV2-NS4E-L7P4-RZ6B-KNZY\",\"rel\":\"replace\",\"method\":\"PUT\"},{\"href\":\"https://api.sandbox.paypal.com/v2/invoicing/invoices/INV2-NS4E-L7P4-RZ6B-KNZY\",\"rel\":\"delete\",\"method\":\"DELETE\"},{\"href\":\"https://api.sandbox.paypal.com/v2/invoicing/invoices/INV2-NS4E-L7P4-RZ6B-KNZY/payments\",\"rel\":\"record-payment\",\"method\":\"POST\"}],\"unilateral\":false}",
        "headers": {
          "Strict-Transport-Security": "max-age=31536000; includeSubDomains",
          "Cache-Control": "max-age=0, no-cache, no-store, must-revalidate",
          "Vary": "Accept-Encoding",
          "Content-Type": "application/json"
        }
      },
      "persistent": true
    },
    {
      "id": "2791b6fe-bbbe-4102-a3fd-721fb9ba1557",
      "name": "Create v2 invoicing invoices",
      "request": {
        "urlPathTemplate": "/v2/invoicing/invoices",
        "method": "POST",
        "bodyPatterns": [
          {
            "equalToJson": "{\n    \"detail\": {\n        \"invoice_number\": \"17494664982\",\n        \"invoice_date\": \"2022-02-04\",\n        \"payment_term\": {\n            \"term_type\": \"NET_10\",\n            \"due_date\": \"2022-02-14\"\n        },\n        \"currency_code\": \"USD\",\n        \"reference\": \"<The reference data. Includes a post office (PO) number.>\",\n        \"note\": \"<A note to the invoice recipient. Also appears on the invoice notification email.>\",\n        \"terms_and_conditions\": \"<The general terms of the invoice. Can include return or cancellation policy and other terms and conditions.>\",\n        \"memo\": \"<A private bookkeeping note for merchant.>\"\n    },\n    \"invoicer\": {\n        \"name\": {\n            \"given_name\": \"David\",\n            \"surname\": \"Larusso\"\n        },\n        \"address\": {\n            \"address_line_1\": \"123 Townsend St\",\n            \"address_line_2\": \"Floor 6\",\n            \"admin_area_2\": \"San Francisco\",\n            \"admin_area_1\": \"CA\",\n            \"postal_code\": \"94107\",\n            \"country_code\": \"US\"\n        },\n        \"phones\": [\n            {\n                \"country_code\": \"001\",\n                \"national_number\": \"4085551234\",\n                \"phone_type\": \"MOBILE\"\n            }\n        ],\n        \"website\": \"www.example.com\",\n        \"tax_id\": \"XX-XXXXXXX\",\n        \"logo_url\": \"https://example.com/logo.png\",\n        \"additional_notes\": \"<Any additional information. Includes business hours.>\"\n    },\n    \"primary_recipients\": [\n        {\n            \"billing_info\": {\n                \"name\": {\n                    \"given_name\": \"Stephanie\",\n                    \"surname\": \"Meyers\"\n                },\n                \"address\": {\n                    \"address_line_1\": \"1234 Main Street\",\n                    \"admin_area_2\": \"Anytown\",\n                    \"admin_area_1\": \"CA\",\n                    \"postal_code\": \"98765\",\n                    \"country_code\": \"US\"\n                },\n                \"email_address\": \"foobuyer@example.com\",\n                \"phones\": [\n                    {\n                        \"country_code\": \"001\",\n                        \"national_number\": \"4884551234\",\n                        \"phone_type\": \"HOME\"\n                    }\n                ],\n                \"additional_info_value\": \"add-info\"\n            },\n            \"shipping_info\": {\n                \"name\": {\n                    \"given_name\": \"Stephanie\",\n                    \"surname\": \"Meyers\"\n                },\n                \"address\": {\n                    \"address_line_1\": \"1234 Main Street\",\n                    \"admin_area_2\": \"Anytown\",\n                    \"admin_area_1\": \"CA\",\n                    \"postal_code\": \"98765\",\n                    \"country_code\": \"US\"\n                }\n            }\n        }\n    ],\n    \"items\": [\n        {\n            \"name\": \"Yoga Mat\",\n            \"description\": \"Elastic mat to practice yoga.\",\n            \"quantity\": \"1\",\n            \"unit_amount\": {\n                \"currency_code\": \"USD\",\n                \"value\": \"50.00\"\n            },\n            \"tax\": {\n                \"name\": \"Sales Tax\",\n                \"percent\": \"7.25\"\n            },\n            \"discount\": {\n                \"percent\": \"5\"\n            },\n            \"unit_of_measure\": \"QUANTITY\"\n        },\n        {\n            \"name\": \"Yoga t-shirt\",\n            \"quantity\": \"1\",\n            \"unit_amount\": {\n                \"currency_code\": \"USD\",\n                \"value\": \"10.00\"\n            },\n            \"tax\": {\n                \"name\": \"Sales Tax\",\n                \"percent\": \"7.25\"\n            },\n            \"discount\": {\n                \"amount\": {\n                    \"currency_code\": \"USD\",\n                    \"value\": \"5.00\"\n                }\n            },\n            \"unit_of_measure\": \"QUANTITY\"\n        }\n    ],\n    \"configuration\": {\n        \"partial_payment\": {\n            \"allow_partial_payment\": true,\n            \"minimum_amount_due\": {\n                \"currency_code\": \"USD\",\n                \"value\": \"20.00\"\n            }\n        },\n        \"allow_tip\": true,\n        \"tax_calculated_after_discount\": true,\n        \"tax_inclusive\": false\n    },\n    \"amount\": {\n        \"breakdown\": {\n            \"custom\": {\n                \"label\": \"Packing Charges\",\n                \"amount\": {\n                    \"currency_code\": \"USD\",\n                    \"value\": \"10.00\"\n                }\n            },\n            \"shipping\": {\n                \"amount\": {\n                    \"currency_code\": \"USD\",\n                    \"value\": \"10.00\"\n                },\n                \"tax\": {\n                    \"name\": \"Sales Tax\",\n                    \"percent\": \"7.25\"\n                }\n            },\n            \"discount\": {\n                \"invoice_discount\": {\n                    \"percent\": \"5\"\n                }\n            }\n        }\n    }\n}",
            "ignoreArrayOrder": true,
            "ignoreExtraElements": true
          }
        ]
      },
      "response": {
        "status": 201,
        "body": "{\"id\":\"INV2-NS4E-L7P4-RZ6B-KNZY\",\"status\":\"DRAFT\",\"detail\":{\"reference\":\"<The reference data. Includes a post office (PO) number.>\",\"currency_code\":\"USD\",\"note\":\"<A note to the invoice recipient. Also appears on the invoice notification email.>\",\"terms_and_conditions\":\"<The general terms of the invoice. Can include return or cancellation policy and other terms and conditions.>\",\"memo\":\"<A private bookkeeping note for merchant.>\",\"additional_data\":\"<Any additional information. Includes business hours.>\",\"category_code\":\"SHIPPABLE\",\"invoice_number\":\"17494664982\",\"invoice_date\":\"2022-02-04\",\"payment_term\":{\"term_type\":\"NET_10\",\"due_date\":\"2022-02-14\"},\"viewed_by_recipient\":false,\"group_draft\":false,\"metadata\":{\"create_time\":\"2025-06-09T10:54:58Z\",\"last_update_time\":\"2025-06-09T10:54:58Z\",\"created_by_flow\":\"REGULAR_SINGLE\",\"recipient_view_url\":\"https://www.sandbox.paypal.com/invoice/p/#NS4EL7P4RZ6BKNZY\",\"invoicer_view_url\":\"https://www.sandbox.paypal.com/invoice/details/INV2-NS4E-L7P4-RZ6B-KNZY\",\"caller_type\":\"API_V2_INVOICE\",\"spam_info\":{}},\"archived\":false},\"invoicer\":{\"name\":{\"given_name\":\"David\",\"surname\":\"Larusso\",\"full_name\":\"David Larusso\"},\"address\":{\"address_line_1\":\"123 Townsend St\",\"address_line_2\":\"Floor 6\",\"admin_area_2\":\"San Francisco\",\"admin_area_1\":\"CA\",\"postal_code\":\"94107\",\"country_code\":\"US\"},\"phones\":[{\"country_code\":\"001\",\"national_number\":\"4085551234\",\"phone_type\":\"MOBILE\"}],\"website\":\"www.example.com\",\"tax_id\":\"XX-XXXXXXX\",\"additional_notes\":\"<Any additional information. Includes business hours.>\",\"logo_url\":\"https://example.com/logo.png\"},\"primary_recipients\":[{\"billing_info\":{\"name\":{\"given_name\":\"Stephanie\",\"surname\":\"Meyers\",\"full_name\":\"Stephanie Meyers\"},\"address\":{\"address_line_1\":\"1234 Main Street\",\"admin_area_2\":\"Anytown\",\"admin_area_1\":\"CA\",\"postal_code\":\"98765\",\"country_code\":\"US\"},\"email_address\":\"foobuyer@example.com\"},\"shipping_info\":{\"name\":{\"given_name\":\"Stephanie\",\"surname\":\"Meyers\",\"full_name\":\"Stephanie Meyers\"},\"address\":{\"address_line_1\":\"1234 Main Street\",\"admin_area_2\":\"Anytown\",\"admin_area_1\":\"CA\",\"postal_code\":\"98765\",\"country_code\":\"US\"}}}],\"items\":[{\"id\":\"ITEM-4M535543K7257150H\",\"name\":\"Yoga Mat\",\"description\":\"Elastic mat to practice yoga.\",\"quantity\":\"1\",\"unit_amount\":{\"currency_code\":\"USD\",\"value\":\"50.00\"},\"tax\":{\"id\":\"TAX-1R2044969B8060438\",\"name\":\"Sales Tax\",\"percent\":\"7.25\",\"amount\":{\"currency_code\":\"USD\",\"value\":\"3.27\"}},\"discount\":{\"percent\":\"5\",\"amount\":{\"currency_code\":\"USD\",\"value\":\"-2.50\"}},\"unit_of_measure\":\"QUANTITY\"},{\"id\":\"ITEM-0SE42747HP857643T\",\"name\":\"Yoga t-shirt\",\"quantity\":\"1\",\"unit_amount\":{\"currency_code\":\"USD\",\"value\":\"10.00\"},\"tax\":{\"id\":\"TAX-1R2044969B8060438\",\"name\":\"Sales Tax\",\"percent\":\"7.25\",\"amount\":{\"currency_code\":\"USD\",\"value\":\"0.34\"}},\"discount\":{\"amount\":{\"currency_code\":\"USD\",\"value\":\"-5.00\"}},\"unit_of_measure\":\"QUANTITY\"}],\"configuration\":{\"tax_calculated_after_discount\":true,\"tax_inclusive\":false,\"allow_tip\":true,\"partial_payment\":{\"allow_partial_payment\":true,\"minimum_amount_due\":{\"currency_code\":\"USD\",\"value\":\"20.00\"}},\"allow_only_pay_by_bank\":false,\"template_id\":\"TEMP-0P400848HY4308238\"},\"amount\":{\"breakdown\":{\"item_total\":{\"currency_code\":\"USD\",\"value\":\"60.00\"},\"discount\":{\"invoice_discount\":{\"percent\":\"5\",\"amount\":{\"currency_code\":\"USD\",\"value\":\"-2.63\"}},\"item_discount\":{\"currency_code\":\"USD\",\"value\":\"-7.50\"}},\"tax_total\":{\"currency_code\":\"USD\",\"value\":\"4.34\"},\"shipping\":{\"amount\":{\"currency_code\":\"USD\",\"value\":\"10.00\"},\"tax\":{\"id\":\"TAX-1R2044969B8060438\",\"name\":\"Sales Tax\",\"percent\":\"7.25\",\"amount\":{\"currency_code\":\"USD\",\"value\":\"0.73\"}}},\"custom\":{\"label\":\"Packing Charges\",\"amount\":{\"currency_code\":\"USD\",\"value\":\"10.00\"}}},\"currency_code\":\"USD\",\"value\":\"74.21\"},\"due_amount\":{\"currency_code\":\"USD\",\"value\":\"74.21\"},\"links\":[{\"href\":\"https://api.sandbox.paypal.com/v2/invoicing/invoices/INV2-NS4E-L7P4-RZ6B-KNZY\",\"rel\":\"self\",\"method\":\"GET\"},{\"href\":\"https://api.sandbox.paypal.com/v2/invoicing/invoices/INV2-NS4E-L7P4-RZ6B-KNZY/send\",\"rel\":\"send\",\"method\":\"POST\"},{\"href\":\"https://api.sandbox.paypal.com/v2/invoicing/invoices/INV2-NS4E-L7P4-RZ6B-KNZY\",\"rel\":\"replace\",\"method\":\"PUT\"},{\"href\":\"https://api.sandbox.paypal.com/v2/invoicing/invoices/INV2-NS4E-L7P4-RZ6B-KNZY\",\"rel\":\"delete\",\"method\":\"DELETE\"},{\"href\":\"https://api.sandbox.paypal.com/v2/invoicing/invoices/INV2-NS4E-L7P4-RZ6B-KNZY/payments\",\"rel\":\"record-payment\",\"method\":\"POST\"}],\"unilateral\":false}",
        "headers": {
          "Strict-Transport-Security": "max-age=31536000; includeSubDomains",
          "Cache-Control": "max-age=0, no-cache, no-store, must-revalidate",
          "Vary": "Accept-Encoding",
          "Location": "https://api-m.sandbox.paypal.com:8443/v2/invoicing/invoices/INV2-NS4E-L7P4-RZ6B-KNZY",
          "Content-Type": "application/json"
        }
      },
      "persistent": true
    }
  ]
}
'
import requests

url = "https://wmc.wiremockapi.cloud/v1/mock-apis/{mockApiId}/mappings/import"

payload = { "mappings": [
{
"id": "7e6d6733-881e-416d-9f6c-bad8d5015d0f",
"name": "Get v2 invoicing invoices by invoiceId",
"request": {
"urlPathTemplate": "/v2/invoicing/invoices/{invoiceId}",
"method": "GET",
"pathParameters": { "invoiceId": { "equalTo": "INV2-NS4E-L7P4-RZ6B-KNZY" } }
},
"response": {
"status": 200,
"body": "{\"id\":\"INV2-NS4E-L7P4-RZ6B-KNZY\",\"status\":\"DRAFT\",\"detail\":{\"reference\":\"<The reference data. Includes a post office (PO) number.>\",\"currency_code\":\"USD\",\"note\":\"<A note to the invoice recipient. Also appears on the invoice notification email.>\",\"terms_and_conditions\":\"<The general terms of the invoice. Can include return or cancellation policy and other terms and conditions.>\",\"memo\":\"<A private bookkeeping note for merchant.>\",\"additional_data\":\"<Any additional information. Includes business hours.>\",\"category_code\":\"SHIPPABLE\",\"invoice_number\":\"17494664982\",\"invoice_date\":\"2022-02-04\",\"payment_term\":{\"term_type\":\"NET_10\",\"due_date\":\"2022-02-14\"},\"viewed_by_recipient\":false,\"group_draft\":false,\"metadata\":{\"create_time\":\"2025-06-09T10:54:58Z\",\"last_update_time\":\"2025-06-09T10:54:58Z\",\"created_by_flow\":\"REGULAR_SINGLE\",\"recipient_view_url\":\"https://www.sandbox.paypal.com/invoice/p/#NS4EL7P4RZ6BKNZY\",\"invoicer_view_url\":\"https://www.sandbox.paypal.com/invoice/details/INV2-NS4E-L7P4-RZ6B-KNZY\",\"caller_type\":\"API_V2_INVOICE\",\"spam_info\":{}},\"archived\":false},\"invoicer\":{\"name\":{\"given_name\":\"David\",\"surname\":\"Larusso\",\"full_name\":\"David Larusso\"},\"address\":{\"address_line_1\":\"123 Townsend St\",\"address_line_2\":\"Floor 6\",\"admin_area_2\":\"San Francisco\",\"admin_area_1\":\"CA\",\"postal_code\":\"94107\",\"country_code\":\"US\"},\"phones\":[{\"country_code\":\"001\",\"national_number\":\"4085551234\",\"phone_type\":\"MOBILE\"}],\"website\":\"www.example.com\",\"tax_id\":\"XX-XXXXXXX\",\"additional_notes\":\"<Any additional information. Includes business hours.>\",\"logo_url\":\"https://example.com/logo.png\"},\"primary_recipients\":[{\"billing_info\":{\"name\":{\"given_name\":\"Stephanie\",\"surname\":\"Meyers\",\"full_name\":\"Stephanie Meyers\"},\"address\":{\"address_line_1\":\"1234 Main Street\",\"admin_area_2\":\"Anytown\",\"admin_area_1\":\"CA\",\"postal_code\":\"98765\",\"country_code\":\"US\"},\"email_address\":\"foobuyer@example.com\"},\"shipping_info\":{\"name\":{\"given_name\":\"Stephanie\",\"surname\":\"Meyers\",\"full_name\":\"Stephanie Meyers\"},\"address\":{\"address_line_1\":\"1234 Main Street\",\"admin_area_2\":\"Anytown\",\"admin_area_1\":\"CA\",\"postal_code\":\"98765\",\"country_code\":\"US\"}}}],\"items\":[{\"id\":\"ITEM-4M535543K7257150H\",\"name\":\"Yoga Mat\",\"description\":\"Elastic mat to practice yoga.\",\"quantity\":\"1\",\"unit_amount\":{\"currency_code\":\"USD\",\"value\":\"50.00\"},\"tax\":{\"id\":\"TAX-1R2044969B8060438\",\"name\":\"Sales Tax\",\"percent\":\"7.25\",\"amount\":{\"currency_code\":\"USD\",\"value\":\"3.27\"}},\"discount\":{\"percent\":\"5\",\"amount\":{\"currency_code\":\"USD\",\"value\":\"-2.50\"}},\"unit_of_measure\":\"QUANTITY\"},{\"id\":\"ITEM-0SE42747HP857643T\",\"name\":\"Yoga t-shirt\",\"quantity\":\"1\",\"unit_amount\":{\"currency_code\":\"USD\",\"value\":\"10.00\"},\"tax\":{\"id\":\"TAX-1R2044969B8060438\",\"name\":\"Sales Tax\",\"percent\":\"7.25\",\"amount\":{\"currency_code\":\"USD\",\"value\":\"0.34\"}},\"discount\":{\"amount\":{\"currency_code\":\"USD\",\"value\":\"-5.00\"}},\"unit_of_measure\":\"QUANTITY\"}],\"configuration\":{\"tax_calculated_after_discount\":true,\"tax_inclusive\":false,\"allow_tip\":true,\"partial_payment\":{\"allow_partial_payment\":true,\"minimum_amount_due\":{\"currency_code\":\"USD\",\"value\":\"20.00\"}},\"allow_only_pay_by_bank\":false,\"template_id\":\"TEMP-0P400848HY4308238\"},\"amount\":{\"breakdown\":{\"item_total\":{\"currency_code\":\"USD\",\"value\":\"60.00\"},\"discount\":{\"invoice_discount\":{\"percent\":\"5\",\"amount\":{\"currency_code\":\"USD\",\"value\":\"-2.63\"}},\"item_discount\":{\"currency_code\":\"USD\",\"value\":\"-7.50\"}},\"tax_total\":{\"currency_code\":\"USD\",\"value\":\"4.34\"},\"shipping\":{\"amount\":{\"currency_code\":\"USD\",\"value\":\"10.00\"},\"tax\":{\"id\":\"TAX-1R2044969B8060438\",\"name\":\"Sales Tax\",\"percent\":\"7.25\",\"amount\":{\"currency_code\":\"USD\",\"value\":\"0.73\"}}},\"custom\":{\"label\":\"Packing Charges\",\"amount\":{\"currency_code\":\"USD\",\"value\":\"10.00\"}}},\"currency_code\":\"USD\",\"value\":\"74.21\"},\"due_amount\":{\"currency_code\":\"USD\",\"value\":\"74.21\"},\"links\":[{\"href\":\"https://api.sandbox.paypal.com/v2/invoicing/invoices/INV2-NS4E-L7P4-RZ6B-KNZY\",\"rel\":\"self\",\"method\":\"GET\"},{\"href\":\"https://api.sandbox.paypal.com/v2/invoicing/invoices/INV2-NS4E-L7P4-RZ6B-KNZY/send\",\"rel\":\"send\",\"method\":\"POST\"},{\"href\":\"https://api.sandbox.paypal.com/v2/invoicing/invoices/INV2-NS4E-L7P4-RZ6B-KNZY\",\"rel\":\"replace\",\"method\":\"PUT\"},{\"href\":\"https://api.sandbox.paypal.com/v2/invoicing/invoices/INV2-NS4E-L7P4-RZ6B-KNZY\",\"rel\":\"delete\",\"method\":\"DELETE\"},{\"href\":\"https://api.sandbox.paypal.com/v2/invoicing/invoices/INV2-NS4E-L7P4-RZ6B-KNZY/payments\",\"rel\":\"record-payment\",\"method\":\"POST\"}],\"unilateral\":false}",
"headers": {
"Strict-Transport-Security": "max-age=31536000; includeSubDomains",
"Cache-Control": "max-age=0, no-cache, no-store, must-revalidate",
"Vary": "Accept-Encoding",
"Content-Type": "application/json"
}
},
"persistent": True
},
{
"id": "2791b6fe-bbbe-4102-a3fd-721fb9ba1557",
"name": "Create v2 invoicing invoices",
"request": {
"urlPathTemplate": "/v2/invoicing/invoices",
"method": "POST",
"bodyPatterns": [
{
"equalToJson": "{
\"detail\": {
\"invoice_number\": \"17494664982\",
\"invoice_date\": \"2022-02-04\",
\"payment_term\": {
\"term_type\": \"NET_10\",
\"due_date\": \"2022-02-14\"
},
\"currency_code\": \"USD\",
\"reference\": \"<The reference data. Includes a post office (PO) number.>\",
\"note\": \"<A note to the invoice recipient. Also appears on the invoice notification email.>\",
\"terms_and_conditions\": \"<The general terms of the invoice. Can include return or cancellation policy and other terms and conditions.>\",
\"memo\": \"<A private bookkeeping note for merchant.>\"
},
\"invoicer\": {
\"name\": {
\"given_name\": \"David\",
\"surname\": \"Larusso\"
},
\"address\": {
\"address_line_1\": \"123 Townsend St\",
\"address_line_2\": \"Floor 6\",
\"admin_area_2\": \"San Francisco\",
\"admin_area_1\": \"CA\",
\"postal_code\": \"94107\",
\"country_code\": \"US\"
},
\"phones\": [
{
\"country_code\": \"001\",
\"national_number\": \"4085551234\",
\"phone_type\": \"MOBILE\"
}
],
\"website\": \"www.example.com\",
\"tax_id\": \"XX-XXXXXXX\",
\"logo_url\": \"https://example.com/logo.png\",
\"additional_notes\": \"<Any additional information. Includes business hours.>\"
},
\"primary_recipients\": [
{
\"billing_info\": {
\"name\": {
\"given_name\": \"Stephanie\",
\"surname\": \"Meyers\"
},
\"address\": {
\"address_line_1\": \"1234 Main Street\",
\"admin_area_2\": \"Anytown\",
\"admin_area_1\": \"CA\",
\"postal_code\": \"98765\",
\"country_code\": \"US\"
},
\"email_address\": \"foobuyer@example.com\",
\"phones\": [
{
\"country_code\": \"001\",
\"national_number\": \"4884551234\",
\"phone_type\": \"HOME\"
}
],
\"additional_info_value\": \"add-info\"
},
\"shipping_info\": {
\"name\": {
\"given_name\": \"Stephanie\",
\"surname\": \"Meyers\"
},
\"address\": {
\"address_line_1\": \"1234 Main Street\",
\"admin_area_2\": \"Anytown\",
\"admin_area_1\": \"CA\",
\"postal_code\": \"98765\",
\"country_code\": \"US\"
}
}
}
],
\"items\": [
{
\"name\": \"Yoga Mat\",
\"description\": \"Elastic mat to practice yoga.\",
\"quantity\": \"1\",
\"unit_amount\": {
\"currency_code\": \"USD\",
\"value\": \"50.00\"
},
\"tax\": {
\"name\": \"Sales Tax\",
\"percent\": \"7.25\"
},
\"discount\": {
\"percent\": \"5\"
},
\"unit_of_measure\": \"QUANTITY\"
},
{
\"name\": \"Yoga t-shirt\",
\"quantity\": \"1\",
\"unit_amount\": {
\"currency_code\": \"USD\",
\"value\": \"10.00\"
},
\"tax\": {
\"name\": \"Sales Tax\",
\"percent\": \"7.25\"
},
\"discount\": {
\"amount\": {
\"currency_code\": \"USD\",
\"value\": \"5.00\"
}
},
\"unit_of_measure\": \"QUANTITY\"
}
],
\"configuration\": {
\"partial_payment\": {
\"allow_partial_payment\": true,
\"minimum_amount_due\": {
\"currency_code\": \"USD\",
\"value\": \"20.00\"
}
},
\"allow_tip\": true,
\"tax_calculated_after_discount\": true,
\"tax_inclusive\": false
},
\"amount\": {
\"breakdown\": {
\"custom\": {
\"label\": \"Packing Charges\",
\"amount\": {
\"currency_code\": \"USD\",
\"value\": \"10.00\"
}
},
\"shipping\": {
\"amount\": {
\"currency_code\": \"USD\",
\"value\": \"10.00\"
},
\"tax\": {
\"name\": \"Sales Tax\",
\"percent\": \"7.25\"
}
},
\"discount\": {
\"invoice_discount\": {
\"percent\": \"5\"
}
}
}
}
}",
"ignoreArrayOrder": True,
"ignoreExtraElements": True
}
]
},
"response": {
"status": 201,
"body": "{\"id\":\"INV2-NS4E-L7P4-RZ6B-KNZY\",\"status\":\"DRAFT\",\"detail\":{\"reference\":\"<The reference data. Includes a post office (PO) number.>\",\"currency_code\":\"USD\",\"note\":\"<A note to the invoice recipient. Also appears on the invoice notification email.>\",\"terms_and_conditions\":\"<The general terms of the invoice. Can include return or cancellation policy and other terms and conditions.>\",\"memo\":\"<A private bookkeeping note for merchant.>\",\"additional_data\":\"<Any additional information. Includes business hours.>\",\"category_code\":\"SHIPPABLE\",\"invoice_number\":\"17494664982\",\"invoice_date\":\"2022-02-04\",\"payment_term\":{\"term_type\":\"NET_10\",\"due_date\":\"2022-02-14\"},\"viewed_by_recipient\":false,\"group_draft\":false,\"metadata\":{\"create_time\":\"2025-06-09T10:54:58Z\",\"last_update_time\":\"2025-06-09T10:54:58Z\",\"created_by_flow\":\"REGULAR_SINGLE\",\"recipient_view_url\":\"https://www.sandbox.paypal.com/invoice/p/#NS4EL7P4RZ6BKNZY\",\"invoicer_view_url\":\"https://www.sandbox.paypal.com/invoice/details/INV2-NS4E-L7P4-RZ6B-KNZY\",\"caller_type\":\"API_V2_INVOICE\",\"spam_info\":{}},\"archived\":false},\"invoicer\":{\"name\":{\"given_name\":\"David\",\"surname\":\"Larusso\",\"full_name\":\"David Larusso\"},\"address\":{\"address_line_1\":\"123 Townsend St\",\"address_line_2\":\"Floor 6\",\"admin_area_2\":\"San Francisco\",\"admin_area_1\":\"CA\",\"postal_code\":\"94107\",\"country_code\":\"US\"},\"phones\":[{\"country_code\":\"001\",\"national_number\":\"4085551234\",\"phone_type\":\"MOBILE\"}],\"website\":\"www.example.com\",\"tax_id\":\"XX-XXXXXXX\",\"additional_notes\":\"<Any additional information. Includes business hours.>\",\"logo_url\":\"https://example.com/logo.png\"},\"primary_recipients\":[{\"billing_info\":{\"name\":{\"given_name\":\"Stephanie\",\"surname\":\"Meyers\",\"full_name\":\"Stephanie Meyers\"},\"address\":{\"address_line_1\":\"1234 Main Street\",\"admin_area_2\":\"Anytown\",\"admin_area_1\":\"CA\",\"postal_code\":\"98765\",\"country_code\":\"US\"},\"email_address\":\"foobuyer@example.com\"},\"shipping_info\":{\"name\":{\"given_name\":\"Stephanie\",\"surname\":\"Meyers\",\"full_name\":\"Stephanie Meyers\"},\"address\":{\"address_line_1\":\"1234 Main Street\",\"admin_area_2\":\"Anytown\",\"admin_area_1\":\"CA\",\"postal_code\":\"98765\",\"country_code\":\"US\"}}}],\"items\":[{\"id\":\"ITEM-4M535543K7257150H\",\"name\":\"Yoga Mat\",\"description\":\"Elastic mat to practice yoga.\",\"quantity\":\"1\",\"unit_amount\":{\"currency_code\":\"USD\",\"value\":\"50.00\"},\"tax\":{\"id\":\"TAX-1R2044969B8060438\",\"name\":\"Sales Tax\",\"percent\":\"7.25\",\"amount\":{\"currency_code\":\"USD\",\"value\":\"3.27\"}},\"discount\":{\"percent\":\"5\",\"amount\":{\"currency_code\":\"USD\",\"value\":\"-2.50\"}},\"unit_of_measure\":\"QUANTITY\"},{\"id\":\"ITEM-0SE42747HP857643T\",\"name\":\"Yoga t-shirt\",\"quantity\":\"1\",\"unit_amount\":{\"currency_code\":\"USD\",\"value\":\"10.00\"},\"tax\":{\"id\":\"TAX-1R2044969B8060438\",\"name\":\"Sales Tax\",\"percent\":\"7.25\",\"amount\":{\"currency_code\":\"USD\",\"value\":\"0.34\"}},\"discount\":{\"amount\":{\"currency_code\":\"USD\",\"value\":\"-5.00\"}},\"unit_of_measure\":\"QUANTITY\"}],\"configuration\":{\"tax_calculated_after_discount\":true,\"tax_inclusive\":false,\"allow_tip\":true,\"partial_payment\":{\"allow_partial_payment\":true,\"minimum_amount_due\":{\"currency_code\":\"USD\",\"value\":\"20.00\"}},\"allow_only_pay_by_bank\":false,\"template_id\":\"TEMP-0P400848HY4308238\"},\"amount\":{\"breakdown\":{\"item_total\":{\"currency_code\":\"USD\",\"value\":\"60.00\"},\"discount\":{\"invoice_discount\":{\"percent\":\"5\",\"amount\":{\"currency_code\":\"USD\",\"value\":\"-2.63\"}},\"item_discount\":{\"currency_code\":\"USD\",\"value\":\"-7.50\"}},\"tax_total\":{\"currency_code\":\"USD\",\"value\":\"4.34\"},\"shipping\":{\"amount\":{\"currency_code\":\"USD\",\"value\":\"10.00\"},\"tax\":{\"id\":\"TAX-1R2044969B8060438\",\"name\":\"Sales Tax\",\"percent\":\"7.25\",\"amount\":{\"currency_code\":\"USD\",\"value\":\"0.73\"}}},\"custom\":{\"label\":\"Packing Charges\",\"amount\":{\"currency_code\":\"USD\",\"value\":\"10.00\"}}},\"currency_code\":\"USD\",\"value\":\"74.21\"},\"due_amount\":{\"currency_code\":\"USD\",\"value\":\"74.21\"},\"links\":[{\"href\":\"https://api.sandbox.paypal.com/v2/invoicing/invoices/INV2-NS4E-L7P4-RZ6B-KNZY\",\"rel\":\"self\",\"method\":\"GET\"},{\"href\":\"https://api.sandbox.paypal.com/v2/invoicing/invoices/INV2-NS4E-L7P4-RZ6B-KNZY/send\",\"rel\":\"send\",\"method\":\"POST\"},{\"href\":\"https://api.sandbox.paypal.com/v2/invoicing/invoices/INV2-NS4E-L7P4-RZ6B-KNZY\",\"rel\":\"replace\",\"method\":\"PUT\"},{\"href\":\"https://api.sandbox.paypal.com/v2/invoicing/invoices/INV2-NS4E-L7P4-RZ6B-KNZY\",\"rel\":\"delete\",\"method\":\"DELETE\"},{\"href\":\"https://api.sandbox.paypal.com/v2/invoicing/invoices/INV2-NS4E-L7P4-RZ6B-KNZY/payments\",\"rel\":\"record-payment\",\"method\":\"POST\"}],\"unilateral\":false}",
"headers": {
"Strict-Transport-Security": "max-age=31536000; includeSubDomains",
"Cache-Control": "max-age=0, no-cache, no-store, must-revalidate",
"Vary": "Accept-Encoding",
"Location": "https://api-m.sandbox.paypal.com:8443/v2/invoicing/invoices/INV2-NS4E-L7P4-RZ6B-KNZY",
"Content-Type": "application/json"
}
},
"persistent": True
}
] }
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
mappings: [
{
id: '7e6d6733-881e-416d-9f6c-bad8d5015d0f',
name: 'Get v2 invoicing invoices by invoiceId',
request: {
urlPathTemplate: '/v2/invoicing/invoices/{invoiceId}',
method: 'GET',
pathParameters: {invoiceId: {equalTo: 'INV2-NS4E-L7P4-RZ6B-KNZY'}}
},
response: {
status: 200,
body: JSON.stringify('{"id":"INV2-NS4E-L7P4-RZ6B-KNZY","status":"DRAFT","detail":{"reference":"<The reference data. Includes a post office (PO) number.>","currency_code":"USD","note":"<A note to the invoice recipient. Also appears on the invoice notification email.>","terms_and_conditions":"<The general terms of the invoice. Can include return or cancellation policy and other terms and conditions.>","memo":"<A private bookkeeping note for merchant.>","additional_data":"<Any additional information. Includes business hours.>","category_code":"SHIPPABLE","invoice_number":"17494664982","invoice_date":"2022-02-04","payment_term":{"term_type":"NET_10","due_date":"2022-02-14"},"viewed_by_recipient":false,"group_draft":false,"metadata":{"create_time":"2025-06-09T10:54:58Z","last_update_time":"2025-06-09T10:54:58Z","created_by_flow":"REGULAR_SINGLE","recipient_view_url":"https://www.sandbox.paypal.com/invoice/p/#NS4EL7P4RZ6BKNZY","invoicer_view_url":"https://www.sandbox.paypal.com/invoice/details/INV2-NS4E-L7P4-RZ6B-KNZY","caller_type":"API_V2_INVOICE","spam_info":{}},"archived":false},"invoicer":{"name":{"given_name":"David","surname":"Larusso","full_name":"David Larusso"},"address":{"address_line_1":"123 Townsend St","address_line_2":"Floor 6","admin_area_2":"San Francisco","admin_area_1":"CA","postal_code":"94107","country_code":"US"},"phones":[{"country_code":"001","national_number":"4085551234","phone_type":"MOBILE"}],"website":"www.example.com","tax_id":"XX-XXXXXXX","additional_notes":"<Any additional information. Includes business hours.>","logo_url":"https://example.com/logo.png"},"primary_recipients":[{"billing_info":{"name":{"given_name":"Stephanie","surname":"Meyers","full_name":"Stephanie Meyers"},"address":{"address_line_1":"1234 Main Street","admin_area_2":"Anytown","admin_area_1":"CA","postal_code":"98765","country_code":"US"},"email_address":"foobuyer@example.com"},"shipping_info":{"name":{"given_name":"Stephanie","surname":"Meyers","full_name":"Stephanie Meyers"},"address":{"address_line_1":"1234 Main Street","admin_area_2":"Anytown","admin_area_1":"CA","postal_code":"98765","country_code":"US"}}}],"items":[{"id":"ITEM-4M535543K7257150H","name":"Yoga Mat","description":"Elastic mat to practice yoga.","quantity":"1","unit_amount":{"currency_code":"USD","value":"50.00"},"tax":{"id":"TAX-1R2044969B8060438","name":"Sales Tax","percent":"7.25","amount":{"currency_code":"USD","value":"3.27"}},"discount":{"percent":"5","amount":{"currency_code":"USD","value":"-2.50"}},"unit_of_measure":"QUANTITY"},{"id":"ITEM-0SE42747HP857643T","name":"Yoga t-shirt","quantity":"1","unit_amount":{"currency_code":"USD","value":"10.00"},"tax":{"id":"TAX-1R2044969B8060438","name":"Sales Tax","percent":"7.25","amount":{"currency_code":"USD","value":"0.34"}},"discount":{"amount":{"currency_code":"USD","value":"-5.00"}},"unit_of_measure":"QUANTITY"}],"configuration":{"tax_calculated_after_discount":true,"tax_inclusive":false,"allow_tip":true,"partial_payment":{"allow_partial_payment":true,"minimum_amount_due":{"currency_code":"USD","value":"20.00"}},"allow_only_pay_by_bank":false,"template_id":"TEMP-0P400848HY4308238"},"amount":{"breakdown":{"item_total":{"currency_code":"USD","value":"60.00"},"discount":{"invoice_discount":{"percent":"5","amount":{"currency_code":"USD","value":"-2.63"}},"item_discount":{"currency_code":"USD","value":"-7.50"}},"tax_total":{"currency_code":"USD","value":"4.34"},"shipping":{"amount":{"currency_code":"USD","value":"10.00"},"tax":{"id":"TAX-1R2044969B8060438","name":"Sales Tax","percent":"7.25","amount":{"currency_code":"USD","value":"0.73"}}},"custom":{"label":"Packing Charges","amount":{"currency_code":"USD","value":"10.00"}}},"currency_code":"USD","value":"74.21"},"due_amount":{"currency_code":"USD","value":"74.21"},"links":[{"href":"https://api.sandbox.paypal.com/v2/invoicing/invoices/INV2-NS4E-L7P4-RZ6B-KNZY","rel":"self","method":"GET"},{"href":"https://api.sandbox.paypal.com/v2/invoicing/invoices/INV2-NS4E-L7P4-RZ6B-KNZY/send","rel":"send","method":"POST"},{"href":"https://api.sandbox.paypal.com/v2/invoicing/invoices/INV2-NS4E-L7P4-RZ6B-KNZY","rel":"replace","method":"PUT"},{"href":"https://api.sandbox.paypal.com/v2/invoicing/invoices/INV2-NS4E-L7P4-RZ6B-KNZY","rel":"delete","method":"DELETE"},{"href":"https://api.sandbox.paypal.com/v2/invoicing/invoices/INV2-NS4E-L7P4-RZ6B-KNZY/payments","rel":"record-payment","method":"POST"}],"unilateral":false}'),
headers: {
'Strict-Transport-Security': 'max-age=31536000; includeSubDomains',
'Cache-Control': 'max-age=0, no-cache, no-store, must-revalidate',
Vary: 'Accept-Encoding',
'Content-Type': 'application/json'
}
},
persistent: true
},
{
id: '2791b6fe-bbbe-4102-a3fd-721fb9ba1557',
name: 'Create v2 invoicing invoices',
request: {
urlPathTemplate: '/v2/invoicing/invoices',
method: 'POST',
bodyPatterns: [
{
equalToJson: '{\n "detail": {\n "invoice_number": "17494664982",\n "invoice_date": "2022-02-04",\n "payment_term": {\n "term_type": "NET_10",\n "due_date": "2022-02-14"\n },\n "currency_code": "USD",\n "reference": "<The reference data. Includes a post office (PO) number.>",\n "note": "<A note to the invoice recipient. Also appears on the invoice notification email.>",\n "terms_and_conditions": "<The general terms of the invoice. Can include return or cancellation policy and other terms and conditions.>",\n "memo": "<A private bookkeeping note for merchant.>"\n },\n "invoicer": {\n "name": {\n "given_name": "David",\n "surname": "Larusso"\n },\n "address": {\n "address_line_1": "123 Townsend St",\n "address_line_2": "Floor 6",\n "admin_area_2": "San Francisco",\n "admin_area_1": "CA",\n "postal_code": "94107",\n "country_code": "US"\n },\n "phones": [\n {\n "country_code": "001",\n "national_number": "4085551234",\n "phone_type": "MOBILE"\n }\n ],\n "website": "www.example.com",\n "tax_id": "XX-XXXXXXX",\n "logo_url": "https://example.com/logo.png",\n "additional_notes": "<Any additional information. Includes business hours.>"\n },\n "primary_recipients": [\n {\n "billing_info": {\n "name": {\n "given_name": "Stephanie",\n "surname": "Meyers"\n },\n "address": {\n "address_line_1": "1234 Main Street",\n "admin_area_2": "Anytown",\n "admin_area_1": "CA",\n "postal_code": "98765",\n "country_code": "US"\n },\n "email_address": "foobuyer@example.com",\n "phones": [\n {\n "country_code": "001",\n "national_number": "4884551234",\n "phone_type": "HOME"\n }\n ],\n "additional_info_value": "add-info"\n },\n "shipping_info": {\n "name": {\n "given_name": "Stephanie",\n "surname": "Meyers"\n },\n "address": {\n "address_line_1": "1234 Main Street",\n "admin_area_2": "Anytown",\n "admin_area_1": "CA",\n "postal_code": "98765",\n "country_code": "US"\n }\n }\n }\n ],\n "items": [\n {\n "name": "Yoga Mat",\n "description": "Elastic mat to practice yoga.",\n "quantity": "1",\n "unit_amount": {\n "currency_code": "USD",\n "value": "50.00"\n },\n "tax": {\n "name": "Sales Tax",\n "percent": "7.25"\n },\n "discount": {\n "percent": "5"\n },\n "unit_of_measure": "QUANTITY"\n },\n {\n "name": "Yoga t-shirt",\n "quantity": "1",\n "unit_amount": {\n "currency_code": "USD",\n "value": "10.00"\n },\n "tax": {\n "name": "Sales Tax",\n "percent": "7.25"\n },\n "discount": {\n "amount": {\n "currency_code": "USD",\n "value": "5.00"\n }\n },\n "unit_of_measure": "QUANTITY"\n }\n ],\n "configuration": {\n "partial_payment": {\n "allow_partial_payment": true,\n "minimum_amount_due": {\n "currency_code": "USD",\n "value": "20.00"\n }\n },\n "allow_tip": true,\n "tax_calculated_after_discount": true,\n "tax_inclusive": false\n },\n "amount": {\n "breakdown": {\n "custom": {\n "label": "Packing Charges",\n "amount": {\n "currency_code": "USD",\n "value": "10.00"\n }\n },\n "shipping": {\n "amount": {\n "currency_code": "USD",\n "value": "10.00"\n },\n "tax": {\n "name": "Sales Tax",\n "percent": "7.25"\n }\n },\n "discount": {\n "invoice_discount": {\n "percent": "5"\n }\n }\n }\n }\n}',
ignoreArrayOrder: true,
ignoreExtraElements: true
}
]
},
response: {
status: 201,
body: JSON.stringify('{"id":"INV2-NS4E-L7P4-RZ6B-KNZY","status":"DRAFT","detail":{"reference":"<The reference data. Includes a post office (PO) number.>","currency_code":"USD","note":"<A note to the invoice recipient. Also appears on the invoice notification email.>","terms_and_conditions":"<The general terms of the invoice. Can include return or cancellation policy and other terms and conditions.>","memo":"<A private bookkeeping note for merchant.>","additional_data":"<Any additional information. Includes business hours.>","category_code":"SHIPPABLE","invoice_number":"17494664982","invoice_date":"2022-02-04","payment_term":{"term_type":"NET_10","due_date":"2022-02-14"},"viewed_by_recipient":false,"group_draft":false,"metadata":{"create_time":"2025-06-09T10:54:58Z","last_update_time":"2025-06-09T10:54:58Z","created_by_flow":"REGULAR_SINGLE","recipient_view_url":"https://www.sandbox.paypal.com/invoice/p/#NS4EL7P4RZ6BKNZY","invoicer_view_url":"https://www.sandbox.paypal.com/invoice/details/INV2-NS4E-L7P4-RZ6B-KNZY","caller_type":"API_V2_INVOICE","spam_info":{}},"archived":false},"invoicer":{"name":{"given_name":"David","surname":"Larusso","full_name":"David Larusso"},"address":{"address_line_1":"123 Townsend St","address_line_2":"Floor 6","admin_area_2":"San Francisco","admin_area_1":"CA","postal_code":"94107","country_code":"US"},"phones":[{"country_code":"001","national_number":"4085551234","phone_type":"MOBILE"}],"website":"www.example.com","tax_id":"XX-XXXXXXX","additional_notes":"<Any additional information. Includes business hours.>","logo_url":"https://example.com/logo.png"},"primary_recipients":[{"billing_info":{"name":{"given_name":"Stephanie","surname":"Meyers","full_name":"Stephanie Meyers"},"address":{"address_line_1":"1234 Main Street","admin_area_2":"Anytown","admin_area_1":"CA","postal_code":"98765","country_code":"US"},"email_address":"foobuyer@example.com"},"shipping_info":{"name":{"given_name":"Stephanie","surname":"Meyers","full_name":"Stephanie Meyers"},"address":{"address_line_1":"1234 Main Street","admin_area_2":"Anytown","admin_area_1":"CA","postal_code":"98765","country_code":"US"}}}],"items":[{"id":"ITEM-4M535543K7257150H","name":"Yoga Mat","description":"Elastic mat to practice yoga.","quantity":"1","unit_amount":{"currency_code":"USD","value":"50.00"},"tax":{"id":"TAX-1R2044969B8060438","name":"Sales Tax","percent":"7.25","amount":{"currency_code":"USD","value":"3.27"}},"discount":{"percent":"5","amount":{"currency_code":"USD","value":"-2.50"}},"unit_of_measure":"QUANTITY"},{"id":"ITEM-0SE42747HP857643T","name":"Yoga t-shirt","quantity":"1","unit_amount":{"currency_code":"USD","value":"10.00"},"tax":{"id":"TAX-1R2044969B8060438","name":"Sales Tax","percent":"7.25","amount":{"currency_code":"USD","value":"0.34"}},"discount":{"amount":{"currency_code":"USD","value":"-5.00"}},"unit_of_measure":"QUANTITY"}],"configuration":{"tax_calculated_after_discount":true,"tax_inclusive":false,"allow_tip":true,"partial_payment":{"allow_partial_payment":true,"minimum_amount_due":{"currency_code":"USD","value":"20.00"}},"allow_only_pay_by_bank":false,"template_id":"TEMP-0P400848HY4308238"},"amount":{"breakdown":{"item_total":{"currency_code":"USD","value":"60.00"},"discount":{"invoice_discount":{"percent":"5","amount":{"currency_code":"USD","value":"-2.63"}},"item_discount":{"currency_code":"USD","value":"-7.50"}},"tax_total":{"currency_code":"USD","value":"4.34"},"shipping":{"amount":{"currency_code":"USD","value":"10.00"},"tax":{"id":"TAX-1R2044969B8060438","name":"Sales Tax","percent":"7.25","amount":{"currency_code":"USD","value":"0.73"}}},"custom":{"label":"Packing Charges","amount":{"currency_code":"USD","value":"10.00"}}},"currency_code":"USD","value":"74.21"},"due_amount":{"currency_code":"USD","value":"74.21"},"links":[{"href":"https://api.sandbox.paypal.com/v2/invoicing/invoices/INV2-NS4E-L7P4-RZ6B-KNZY","rel":"self","method":"GET"},{"href":"https://api.sandbox.paypal.com/v2/invoicing/invoices/INV2-NS4E-L7P4-RZ6B-KNZY/send","rel":"send","method":"POST"},{"href":"https://api.sandbox.paypal.com/v2/invoicing/invoices/INV2-NS4E-L7P4-RZ6B-KNZY","rel":"replace","method":"PUT"},{"href":"https://api.sandbox.paypal.com/v2/invoicing/invoices/INV2-NS4E-L7P4-RZ6B-KNZY","rel":"delete","method":"DELETE"},{"href":"https://api.sandbox.paypal.com/v2/invoicing/invoices/INV2-NS4E-L7P4-RZ6B-KNZY/payments","rel":"record-payment","method":"POST"}],"unilateral":false}'),
headers: {
'Strict-Transport-Security': 'max-age=31536000; includeSubDomains',
'Cache-Control': 'max-age=0, no-cache, no-store, must-revalidate',
Vary: 'Accept-Encoding',
Location: 'https://api-m.sandbox.paypal.com:8443/v2/invoicing/invoices/INV2-NS4E-L7P4-RZ6B-KNZY',
'Content-Type': 'application/json'
}
},
persistent: true
}
]
})
};

fetch('https://wmc.wiremockapi.cloud/v1/mock-apis/{mockApiId}/mappings/import', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://wmc.wiremockapi.cloud/v1/mock-apis/{mockApiId}/mappings/import",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'mappings' => [
[
'id' => '7e6d6733-881e-416d-9f6c-bad8d5015d0f',
'name' => 'Get v2 invoicing invoices by invoiceId',
'request' => [
'urlPathTemplate' => '/v2/invoicing/invoices/{invoiceId}',
'method' => 'GET',
'pathParameters' => [
'invoiceId' => [
'equalTo' => 'INV2-NS4E-L7P4-RZ6B-KNZY'
]
]
],
'response' => [
'status' => 200,
'body' => '{"id":"INV2-NS4E-L7P4-RZ6B-KNZY","status":"DRAFT","detail":{"reference":"<The reference data. Includes a post office (PO) number.>","currency_code":"USD","note":"<A note to the invoice recipient. Also appears on the invoice notification email.>","terms_and_conditions":"<The general terms of the invoice. Can include return or cancellation policy and other terms and conditions.>","memo":"<A private bookkeeping note for merchant.>","additional_data":"<Any additional information. Includes business hours.>","category_code":"SHIPPABLE","invoice_number":"17494664982","invoice_date":"2022-02-04","payment_term":{"term_type":"NET_10","due_date":"2022-02-14"},"viewed_by_recipient":false,"group_draft":false,"metadata":{"create_time":"2025-06-09T10:54:58Z","last_update_time":"2025-06-09T10:54:58Z","created_by_flow":"REGULAR_SINGLE","recipient_view_url":"https://www.sandbox.paypal.com/invoice/p/#NS4EL7P4RZ6BKNZY","invoicer_view_url":"https://www.sandbox.paypal.com/invoice/details/INV2-NS4E-L7P4-RZ6B-KNZY","caller_type":"API_V2_INVOICE","spam_info":{}},"archived":false},"invoicer":{"name":{"given_name":"David","surname":"Larusso","full_name":"David Larusso"},"address":{"address_line_1":"123 Townsend St","address_line_2":"Floor 6","admin_area_2":"San Francisco","admin_area_1":"CA","postal_code":"94107","country_code":"US"},"phones":[{"country_code":"001","national_number":"4085551234","phone_type":"MOBILE"}],"website":"www.example.com","tax_id":"XX-XXXXXXX","additional_notes":"<Any additional information. Includes business hours.>","logo_url":"https://example.com/logo.png"},"primary_recipients":[{"billing_info":{"name":{"given_name":"Stephanie","surname":"Meyers","full_name":"Stephanie Meyers"},"address":{"address_line_1":"1234 Main Street","admin_area_2":"Anytown","admin_area_1":"CA","postal_code":"98765","country_code":"US"},"email_address":"foobuyer@example.com"},"shipping_info":{"name":{"given_name":"Stephanie","surname":"Meyers","full_name":"Stephanie Meyers"},"address":{"address_line_1":"1234 Main Street","admin_area_2":"Anytown","admin_area_1":"CA","postal_code":"98765","country_code":"US"}}}],"items":[{"id":"ITEM-4M535543K7257150H","name":"Yoga Mat","description":"Elastic mat to practice yoga.","quantity":"1","unit_amount":{"currency_code":"USD","value":"50.00"},"tax":{"id":"TAX-1R2044969B8060438","name":"Sales Tax","percent":"7.25","amount":{"currency_code":"USD","value":"3.27"}},"discount":{"percent":"5","amount":{"currency_code":"USD","value":"-2.50"}},"unit_of_measure":"QUANTITY"},{"id":"ITEM-0SE42747HP857643T","name":"Yoga t-shirt","quantity":"1","unit_amount":{"currency_code":"USD","value":"10.00"},"tax":{"id":"TAX-1R2044969B8060438","name":"Sales Tax","percent":"7.25","amount":{"currency_code":"USD","value":"0.34"}},"discount":{"amount":{"currency_code":"USD","value":"-5.00"}},"unit_of_measure":"QUANTITY"}],"configuration":{"tax_calculated_after_discount":true,"tax_inclusive":false,"allow_tip":true,"partial_payment":{"allow_partial_payment":true,"minimum_amount_due":{"currency_code":"USD","value":"20.00"}},"allow_only_pay_by_bank":false,"template_id":"TEMP-0P400848HY4308238"},"amount":{"breakdown":{"item_total":{"currency_code":"USD","value":"60.00"},"discount":{"invoice_discount":{"percent":"5","amount":{"currency_code":"USD","value":"-2.63"}},"item_discount":{"currency_code":"USD","value":"-7.50"}},"tax_total":{"currency_code":"USD","value":"4.34"},"shipping":{"amount":{"currency_code":"USD","value":"10.00"},"tax":{"id":"TAX-1R2044969B8060438","name":"Sales Tax","percent":"7.25","amount":{"currency_code":"USD","value":"0.73"}}},"custom":{"label":"Packing Charges","amount":{"currency_code":"USD","value":"10.00"}}},"currency_code":"USD","value":"74.21"},"due_amount":{"currency_code":"USD","value":"74.21"},"links":[{"href":"https://api.sandbox.paypal.com/v2/invoicing/invoices/INV2-NS4E-L7P4-RZ6B-KNZY","rel":"self","method":"GET"},{"href":"https://api.sandbox.paypal.com/v2/invoicing/invoices/INV2-NS4E-L7P4-RZ6B-KNZY/send","rel":"send","method":"POST"},{"href":"https://api.sandbox.paypal.com/v2/invoicing/invoices/INV2-NS4E-L7P4-RZ6B-KNZY","rel":"replace","method":"PUT"},{"href":"https://api.sandbox.paypal.com/v2/invoicing/invoices/INV2-NS4E-L7P4-RZ6B-KNZY","rel":"delete","method":"DELETE"},{"href":"https://api.sandbox.paypal.com/v2/invoicing/invoices/INV2-NS4E-L7P4-RZ6B-KNZY/payments","rel":"record-payment","method":"POST"}],"unilateral":false}',
'headers' => [
'Strict-Transport-Security' => 'max-age=31536000; includeSubDomains',
'Cache-Control' => 'max-age=0, no-cache, no-store, must-revalidate',
'Vary' => 'Accept-Encoding',
'Content-Type' => 'application/json'
]
],
'persistent' => true
],
[
'id' => '2791b6fe-bbbe-4102-a3fd-721fb9ba1557',
'name' => 'Create v2 invoicing invoices',
'request' => [
'urlPathTemplate' => '/v2/invoicing/invoices',
'method' => 'POST',
'bodyPatterns' => [
[
'equalToJson' => '{
"detail": {
"invoice_number": "17494664982",
"invoice_date": "2022-02-04",
"payment_term": {
"term_type": "NET_10",
"due_date": "2022-02-14"
},
"currency_code": "USD",
"reference": "<The reference data. Includes a post office (PO) number.>",
"note": "<A note to the invoice recipient. Also appears on the invoice notification email.>",
"terms_and_conditions": "<The general terms of the invoice. Can include return or cancellation policy and other terms and conditions.>",
"memo": "<A private bookkeeping note for merchant.>"
},
"invoicer": {
"name": {
"given_name": "David",
"surname": "Larusso"
},
"address": {
"address_line_1": "123 Townsend St",
"address_line_2": "Floor 6",
"admin_area_2": "San Francisco",
"admin_area_1": "CA",
"postal_code": "94107",
"country_code": "US"
},
"phones": [
{
"country_code": "001",
"national_number": "4085551234",
"phone_type": "MOBILE"
}
],
"website": "www.example.com",
"tax_id": "XX-XXXXXXX",
"logo_url": "https://example.com/logo.png",
"additional_notes": "<Any additional information. Includes business hours.>"
},
"primary_recipients": [
{
"billing_info": {
"name": {
"given_name": "Stephanie",
"surname": "Meyers"
},
"address": {
"address_line_1": "1234 Main Street",
"admin_area_2": "Anytown",
"admin_area_1": "CA",
"postal_code": "98765",
"country_code": "US"
},
"email_address": "foobuyer@example.com",
"phones": [
{
"country_code": "001",
"national_number": "4884551234",
"phone_type": "HOME"
}
],
"additional_info_value": "add-info"
},
"shipping_info": {
"name": {
"given_name": "Stephanie",
"surname": "Meyers"
},
"address": {
"address_line_1": "1234 Main Street",
"admin_area_2": "Anytown",
"admin_area_1": "CA",
"postal_code": "98765",
"country_code": "US"
}
}
}
],
"items": [
{
"name": "Yoga Mat",
"description": "Elastic mat to practice yoga.",
"quantity": "1",
"unit_amount": {
"currency_code": "USD",
"value": "50.00"
},
"tax": {
"name": "Sales Tax",
"percent": "7.25"
},
"discount": {
"percent": "5"
},
"unit_of_measure": "QUANTITY"
},
{
"name": "Yoga t-shirt",
"quantity": "1",
"unit_amount": {
"currency_code": "USD",
"value": "10.00"
},
"tax": {
"name": "Sales Tax",
"percent": "7.25"
},
"discount": {
"amount": {
"currency_code": "USD",
"value": "5.00"
}
},
"unit_of_measure": "QUANTITY"
}
],
"configuration": {
"partial_payment": {
"allow_partial_payment": true,
"minimum_amount_due": {
"currency_code": "USD",
"value": "20.00"
}
},
"allow_tip": true,
"tax_calculated_after_discount": true,
"tax_inclusive": false
},
"amount": {
"breakdown": {
"custom": {
"label": "Packing Charges",
"amount": {
"currency_code": "USD",
"value": "10.00"
}
},
"shipping": {
"amount": {
"currency_code": "USD",
"value": "10.00"
},
"tax": {
"name": "Sales Tax",
"percent": "7.25"
}
},
"discount": {
"invoice_discount": {
"percent": "5"
}
}
}
}
}',
'ignoreArrayOrder' => true,
'ignoreExtraElements' => true
]
]
],
'response' => [
'status' => 201,
'body' => '{"id":"INV2-NS4E-L7P4-RZ6B-KNZY","status":"DRAFT","detail":{"reference":"<The reference data. Includes a post office (PO) number.>","currency_code":"USD","note":"<A note to the invoice recipient. Also appears on the invoice notification email.>","terms_and_conditions":"<The general terms of the invoice. Can include return or cancellation policy and other terms and conditions.>","memo":"<A private bookkeeping note for merchant.>","additional_data":"<Any additional information. Includes business hours.>","category_code":"SHIPPABLE","invoice_number":"17494664982","invoice_date":"2022-02-04","payment_term":{"term_type":"NET_10","due_date":"2022-02-14"},"viewed_by_recipient":false,"group_draft":false,"metadata":{"create_time":"2025-06-09T10:54:58Z","last_update_time":"2025-06-09T10:54:58Z","created_by_flow":"REGULAR_SINGLE","recipient_view_url":"https://www.sandbox.paypal.com/invoice/p/#NS4EL7P4RZ6BKNZY","invoicer_view_url":"https://www.sandbox.paypal.com/invoice/details/INV2-NS4E-L7P4-RZ6B-KNZY","caller_type":"API_V2_INVOICE","spam_info":{}},"archived":false},"invoicer":{"name":{"given_name":"David","surname":"Larusso","full_name":"David Larusso"},"address":{"address_line_1":"123 Townsend St","address_line_2":"Floor 6","admin_area_2":"San Francisco","admin_area_1":"CA","postal_code":"94107","country_code":"US"},"phones":[{"country_code":"001","national_number":"4085551234","phone_type":"MOBILE"}],"website":"www.example.com","tax_id":"XX-XXXXXXX","additional_notes":"<Any additional information. Includes business hours.>","logo_url":"https://example.com/logo.png"},"primary_recipients":[{"billing_info":{"name":{"given_name":"Stephanie","surname":"Meyers","full_name":"Stephanie Meyers"},"address":{"address_line_1":"1234 Main Street","admin_area_2":"Anytown","admin_area_1":"CA","postal_code":"98765","country_code":"US"},"email_address":"foobuyer@example.com"},"shipping_info":{"name":{"given_name":"Stephanie","surname":"Meyers","full_name":"Stephanie Meyers"},"address":{"address_line_1":"1234 Main Street","admin_area_2":"Anytown","admin_area_1":"CA","postal_code":"98765","country_code":"US"}}}],"items":[{"id":"ITEM-4M535543K7257150H","name":"Yoga Mat","description":"Elastic mat to practice yoga.","quantity":"1","unit_amount":{"currency_code":"USD","value":"50.00"},"tax":{"id":"TAX-1R2044969B8060438","name":"Sales Tax","percent":"7.25","amount":{"currency_code":"USD","value":"3.27"}},"discount":{"percent":"5","amount":{"currency_code":"USD","value":"-2.50"}},"unit_of_measure":"QUANTITY"},{"id":"ITEM-0SE42747HP857643T","name":"Yoga t-shirt","quantity":"1","unit_amount":{"currency_code":"USD","value":"10.00"},"tax":{"id":"TAX-1R2044969B8060438","name":"Sales Tax","percent":"7.25","amount":{"currency_code":"USD","value":"0.34"}},"discount":{"amount":{"currency_code":"USD","value":"-5.00"}},"unit_of_measure":"QUANTITY"}],"configuration":{"tax_calculated_after_discount":true,"tax_inclusive":false,"allow_tip":true,"partial_payment":{"allow_partial_payment":true,"minimum_amount_due":{"currency_code":"USD","value":"20.00"}},"allow_only_pay_by_bank":false,"template_id":"TEMP-0P400848HY4308238"},"amount":{"breakdown":{"item_total":{"currency_code":"USD","value":"60.00"},"discount":{"invoice_discount":{"percent":"5","amount":{"currency_code":"USD","value":"-2.63"}},"item_discount":{"currency_code":"USD","value":"-7.50"}},"tax_total":{"currency_code":"USD","value":"4.34"},"shipping":{"amount":{"currency_code":"USD","value":"10.00"},"tax":{"id":"TAX-1R2044969B8060438","name":"Sales Tax","percent":"7.25","amount":{"currency_code":"USD","value":"0.73"}}},"custom":{"label":"Packing Charges","amount":{"currency_code":"USD","value":"10.00"}}},"currency_code":"USD","value":"74.21"},"due_amount":{"currency_code":"USD","value":"74.21"},"links":[{"href":"https://api.sandbox.paypal.com/v2/invoicing/invoices/INV2-NS4E-L7P4-RZ6B-KNZY","rel":"self","method":"GET"},{"href":"https://api.sandbox.paypal.com/v2/invoicing/invoices/INV2-NS4E-L7P4-RZ6B-KNZY/send","rel":"send","method":"POST"},{"href":"https://api.sandbox.paypal.com/v2/invoicing/invoices/INV2-NS4E-L7P4-RZ6B-KNZY","rel":"replace","method":"PUT"},{"href":"https://api.sandbox.paypal.com/v2/invoicing/invoices/INV2-NS4E-L7P4-RZ6B-KNZY","rel":"delete","method":"DELETE"},{"href":"https://api.sandbox.paypal.com/v2/invoicing/invoices/INV2-NS4E-L7P4-RZ6B-KNZY/payments","rel":"record-payment","method":"POST"}],"unilateral":false}',
'headers' => [
'Strict-Transport-Security' => 'max-age=31536000; includeSubDomains',
'Cache-Control' => 'max-age=0, no-cache, no-store, must-revalidate',
'Vary' => 'Accept-Encoding',
'Location' => 'https://api-m.sandbox.paypal.com:8443/v2/invoicing/invoices/INV2-NS4E-L7P4-RZ6B-KNZY',
'Content-Type' => 'application/json'
]
],
'persistent' => true
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main

import (
"fmt"
"strings"
"net/http"
"io"
)

func main() {

url := "https://wmc.wiremockapi.cloud/v1/mock-apis/{mockApiId}/mappings/import"

payload := strings.NewReader("{\n \"mappings\": [\n {\n \"id\": \"7e6d6733-881e-416d-9f6c-bad8d5015d0f\",\n \"name\": \"Get v2 invoicing invoices by invoiceId\",\n \"request\": {\n \"urlPathTemplate\": \"/v2/invoicing/invoices/{invoiceId}\",\n \"method\": \"GET\",\n \"pathParameters\": {\n \"invoiceId\": {\n \"equalTo\": \"INV2-NS4E-L7P4-RZ6B-KNZY\"\n }\n }\n },\n \"response\": {\n \"status\": 200,\n \"body\": \"{\\\"id\\\":\\\"INV2-NS4E-L7P4-RZ6B-KNZY\\\",\\\"status\\\":\\\"DRAFT\\\",\\\"detail\\\":{\\\"reference\\\":\\\"<The reference data. Includes a post office (PO) number.>\\\",\\\"currency_code\\\":\\\"USD\\\",\\\"note\\\":\\\"<A note to the invoice recipient. Also appears on the invoice notification email.>\\\",\\\"terms_and_conditions\\\":\\\"<The general terms of the invoice. Can include return or cancellation policy and other terms and conditions.>\\\",\\\"memo\\\":\\\"<A private bookkeeping note for merchant.>\\\",\\\"additional_data\\\":\\\"<Any additional information. Includes business hours.>\\\",\\\"category_code\\\":\\\"SHIPPABLE\\\",\\\"invoice_number\\\":\\\"17494664982\\\",\\\"invoice_date\\\":\\\"2022-02-04\\\",\\\"payment_term\\\":{\\\"term_type\\\":\\\"NET_10\\\",\\\"due_date\\\":\\\"2022-02-14\\\"},\\\"viewed_by_recipient\\\":false,\\\"group_draft\\\":false,\\\"metadata\\\":{\\\"create_time\\\":\\\"2025-06-09T10:54:58Z\\\",\\\"last_update_time\\\":\\\"2025-06-09T10:54:58Z\\\",\\\"created_by_flow\\\":\\\"REGULAR_SINGLE\\\",\\\"recipient_view_url\\\":\\\"https://www.sandbox.paypal.com/invoice/p/#NS4EL7P4RZ6BKNZY\\\",\\\"invoicer_view_url\\\":\\\"https://www.sandbox.paypal.com/invoice/details/INV2-NS4E-L7P4-RZ6B-KNZY\\\",\\\"caller_type\\\":\\\"API_V2_INVOICE\\\",\\\"spam_info\\\":{}},\\\"archived\\\":false},\\\"invoicer\\\":{\\\"name\\\":{\\\"given_name\\\":\\\"David\\\",\\\"surname\\\":\\\"Larusso\\\",\\\"full_name\\\":\\\"David Larusso\\\"},\\\"address\\\":{\\\"address_line_1\\\":\\\"123 Townsend St\\\",\\\"address_line_2\\\":\\\"Floor 6\\\",\\\"admin_area_2\\\":\\\"San Francisco\\\",\\\"admin_area_1\\\":\\\"CA\\\",\\\"postal_code\\\":\\\"94107\\\",\\\"country_code\\\":\\\"US\\\"},\\\"phones\\\":[{\\\"country_code\\\":\\\"001\\\",\\\"national_number\\\":\\\"4085551234\\\",\\\"phone_type\\\":\\\"MOBILE\\\"}],\\\"website\\\":\\\"www.example.com\\\",\\\"tax_id\\\":\\\"XX-XXXXXXX\\\",\\\"additional_notes\\\":\\\"<Any additional information. Includes business hours.>\\\",\\\"logo_url\\\":\\\"https://example.com/logo.png\\\"},\\\"primary_recipients\\\":[{\\\"billing_info\\\":{\\\"name\\\":{\\\"given_name\\\":\\\"Stephanie\\\",\\\"surname\\\":\\\"Meyers\\\",\\\"full_name\\\":\\\"Stephanie Meyers\\\"},\\\"address\\\":{\\\"address_line_1\\\":\\\"1234 Main Street\\\",\\\"admin_area_2\\\":\\\"Anytown\\\",\\\"admin_area_1\\\":\\\"CA\\\",\\\"postal_code\\\":\\\"98765\\\",\\\"country_code\\\":\\\"US\\\"},\\\"email_address\\\":\\\"foobuyer@example.com\\\"},\\\"shipping_info\\\":{\\\"name\\\":{\\\"given_name\\\":\\\"Stephanie\\\",\\\"surname\\\":\\\"Meyers\\\",\\\"full_name\\\":\\\"Stephanie Meyers\\\"},\\\"address\\\":{\\\"address_line_1\\\":\\\"1234 Main Street\\\",\\\"admin_area_2\\\":\\\"Anytown\\\",\\\"admin_area_1\\\":\\\"CA\\\",\\\"postal_code\\\":\\\"98765\\\",\\\"country_code\\\":\\\"US\\\"}}}],\\\"items\\\":[{\\\"id\\\":\\\"ITEM-4M535543K7257150H\\\",\\\"name\\\":\\\"Yoga Mat\\\",\\\"description\\\":\\\"Elastic mat to practice yoga.\\\",\\\"quantity\\\":\\\"1\\\",\\\"unit_amount\\\":{\\\"currency_code\\\":\\\"USD\\\",\\\"value\\\":\\\"50.00\\\"},\\\"tax\\\":{\\\"id\\\":\\\"TAX-1R2044969B8060438\\\",\\\"name\\\":\\\"Sales Tax\\\",\\\"percent\\\":\\\"7.25\\\",\\\"amount\\\":{\\\"currency_code\\\":\\\"USD\\\",\\\"value\\\":\\\"3.27\\\"}},\\\"discount\\\":{\\\"percent\\\":\\\"5\\\",\\\"amount\\\":{\\\"currency_code\\\":\\\"USD\\\",\\\"value\\\":\\\"-2.50\\\"}},\\\"unit_of_measure\\\":\\\"QUANTITY\\\"},{\\\"id\\\":\\\"ITEM-0SE42747HP857643T\\\",\\\"name\\\":\\\"Yoga t-shirt\\\",\\\"quantity\\\":\\\"1\\\",\\\"unit_amount\\\":{\\\"currency_code\\\":\\\"USD\\\",\\\"value\\\":\\\"10.00\\\"},\\\"tax\\\":{\\\"id\\\":\\\"TAX-1R2044969B8060438\\\",\\\"name\\\":\\\"Sales Tax\\\",\\\"percent\\\":\\\"7.25\\\",\\\"amount\\\":{\\\"currency_code\\\":\\\"USD\\\",\\\"value\\\":\\\"0.34\\\"}},\\\"discount\\\":{\\\"amount\\\":{\\\"currency_code\\\":\\\"USD\\\",\\\"value\\\":\\\"-5.00\\\"}},\\\"unit_of_measure\\\":\\\"QUANTITY\\\"}],\\\"configuration\\\":{\\\"tax_calculated_after_discount\\\":true,\\\"tax_inclusive\\\":false,\\\"allow_tip\\\":true,\\\"partial_payment\\\":{\\\"allow_partial_payment\\\":true,\\\"minimum_amount_due\\\":{\\\"currency_code\\\":\\\"USD\\\",\\\"value\\\":\\\"20.00\\\"}},\\\"allow_only_pay_by_bank\\\":false,\\\"template_id\\\":\\\"TEMP-0P400848HY4308238\\\"},\\\"amount\\\":{\\\"breakdown\\\":{\\\"item_total\\\":{\\\"currency_code\\\":\\\"USD\\\",\\\"value\\\":\\\"60.00\\\"},\\\"discount\\\":{\\\"invoice_discount\\\":{\\\"percent\\\":\\\"5\\\",\\\"amount\\\":{\\\"currency_code\\\":\\\"USD\\\",\\\"value\\\":\\\"-2.63\\\"}},\\\"item_discount\\\":{\\\"currency_code\\\":\\\"USD\\\",\\\"value\\\":\\\"-7.50\\\"}},\\\"tax_total\\\":{\\\"currency_code\\\":\\\"USD\\\",\\\"value\\\":\\\"4.34\\\"},\\\"shipping\\\":{\\\"amount\\\":{\\\"currency_code\\\":\\\"USD\\\",\\\"value\\\":\\\"10.00\\\"},\\\"tax\\\":{\\\"id\\\":\\\"TAX-1R2044969B8060438\\\",\\\"name\\\":\\\"Sales Tax\\\",\\\"percent\\\":\\\"7.25\\\",\\\"amount\\\":{\\\"currency_code\\\":\\\"USD\\\",\\\"value\\\":\\\"0.73\\\"}}},\\\"custom\\\":{\\\"label\\\":\\\"Packing Charges\\\",\\\"amount\\\":{\\\"currency_code\\\":\\\"USD\\\",\\\"value\\\":\\\"10.00\\\"}}},\\\"currency_code\\\":\\\"USD\\\",\\\"value\\\":\\\"74.21\\\"},\\\"due_amount\\\":{\\\"currency_code\\\":\\\"USD\\\",\\\"value\\\":\\\"74.21\\\"},\\\"links\\\":[{\\\"href\\\":\\\"https://api.sandbox.paypal.com/v2/invoicing/invoices/INV2-NS4E-L7P4-RZ6B-KNZY\\\",\\\"rel\\\":\\\"self\\\",\\\"method\\\":\\\"GET\\\"},{\\\"href\\\":\\\"https://api.sandbox.paypal.com/v2/invoicing/invoices/INV2-NS4E-L7P4-RZ6B-KNZY/send\\\",\\\"rel\\\":\\\"send\\\",\\\"method\\\":\\\"POST\\\"},{\\\"href\\\":\\\"https://api.sandbox.paypal.com/v2/invoicing/invoices/INV2-NS4E-L7P4-RZ6B-KNZY\\\",\\\"rel\\\":\\\"replace\\\",\\\"method\\\":\\\"PUT\\\"},{\\\"href\\\":\\\"https://api.sandbox.paypal.com/v2/invoicing/invoices/INV2-NS4E-L7P4-RZ6B-KNZY\\\",\\\"rel\\\":\\\"delete\\\",\\\"method\\\":\\\"DELETE\\\"},{\\\"href\\\":\\\"https://api.sandbox.paypal.com/v2/invoicing/invoices/INV2-NS4E-L7P4-RZ6B-KNZY/payments\\\",\\\"rel\\\":\\\"record-payment\\\",\\\"method\\\":\\\"POST\\\"}],\\\"unilateral\\\":false}\",\n \"headers\": {\n \"Strict-Transport-Security\": \"max-age=31536000; includeSubDomains\",\n \"Cache-Control\": \"max-age=0, no-cache, no-store, must-revalidate\",\n \"Vary\": \"Accept-Encoding\",\n \"Content-Type\": \"application/json\"\n }\n },\n \"persistent\": true\n },\n {\n \"id\": \"2791b6fe-bbbe-4102-a3fd-721fb9ba1557\",\n \"name\": \"Create v2 invoicing invoices\",\n \"request\": {\n \"urlPathTemplate\": \"/v2/invoicing/invoices\",\n \"method\": \"POST\",\n \"bodyPatterns\": [\n {\n \"equalToJson\": \"{\\n \\\"detail\\\": {\\n \\\"invoice_number\\\": \\\"17494664982\\\",\\n \\\"invoice_date\\\": \\\"2022-02-04\\\",\\n \\\"payment_term\\\": {\\n \\\"term_type\\\": \\\"NET_10\\\",\\n \\\"due_date\\\": \\\"2022-02-14\\\"\\n },\\n \\\"currency_code\\\": \\\"USD\\\",\\n \\\"reference\\\": \\\"<The reference data. Includes a post office (PO) number.>\\\",\\n \\\"note\\\": \\\"<A note to the invoice recipient. Also appears on the invoice notification email.>\\\",\\n \\\"terms_and_conditions\\\": \\\"<The general terms of the invoice. Can include return or cancellation policy and other terms and conditions.>\\\",\\n \\\"memo\\\": \\\"<A private bookkeeping note for merchant.>\\\"\\n },\\n \\\"invoicer\\\": {\\n \\\"name\\\": {\\n \\\"given_name\\\": \\\"David\\\",\\n \\\"surname\\\": \\\"Larusso\\\"\\n },\\n \\\"address\\\": {\\n \\\"address_line_1\\\": \\\"123 Townsend St\\\",\\n \\\"address_line_2\\\": \\\"Floor 6\\\",\\n \\\"admin_area_2\\\": \\\"San Francisco\\\",\\n \\\"admin_area_1\\\": \\\"CA\\\",\\n \\\"postal_code\\\": \\\"94107\\\",\\n \\\"country_code\\\": \\\"US\\\"\\n },\\n \\\"phones\\\": [\\n {\\n \\\"country_code\\\": \\\"001\\\",\\n \\\"national_number\\\": \\\"4085551234\\\",\\n \\\"phone_type\\\": \\\"MOBILE\\\"\\n }\\n ],\\n \\\"website\\\": \\\"www.example.com\\\",\\n \\\"tax_id\\\": \\\"XX-XXXXXXX\\\",\\n \\\"logo_url\\\": \\\"https://example.com/logo.png\\\",\\n \\\"additional_notes\\\": \\\"<Any additional information. Includes business hours.>\\\"\\n },\\n \\\"primary_recipients\\\": [\\n {\\n \\\"billing_info\\\": {\\n \\\"name\\\": {\\n \\\"given_name\\\": \\\"Stephanie\\\",\\n \\\"surname\\\": \\\"Meyers\\\"\\n },\\n \\\"address\\\": {\\n \\\"address_line_1\\\": \\\"1234 Main Street\\\",\\n \\\"admin_area_2\\\": \\\"Anytown\\\",\\n \\\"admin_area_1\\\": \\\"CA\\\",\\n \\\"postal_code\\\": \\\"98765\\\",\\n \\\"country_code\\\": \\\"US\\\"\\n },\\n \\\"email_address\\\": \\\"foobuyer@example.com\\\",\\n \\\"phones\\\": [\\n {\\n \\\"country_code\\\": \\\"001\\\",\\n \\\"national_number\\\": \\\"4884551234\\\",\\n \\\"phone_type\\\": \\\"HOME\\\"\\n }\\n ],\\n \\\"additional_info_value\\\": \\\"add-info\\\"\\n },\\n \\\"shipping_info\\\": {\\n \\\"name\\\": {\\n \\\"given_name\\\": \\\"Stephanie\\\",\\n \\\"surname\\\": \\\"Meyers\\\"\\n },\\n \\\"address\\\": {\\n \\\"address_line_1\\\": \\\"1234 Main Street\\\",\\n \\\"admin_area_2\\\": \\\"Anytown\\\",\\n \\\"admin_area_1\\\": \\\"CA\\\",\\n \\\"postal_code\\\": \\\"98765\\\",\\n \\\"country_code\\\": \\\"US\\\"\\n }\\n }\\n }\\n ],\\n \\\"items\\\": [\\n {\\n \\\"name\\\": \\\"Yoga Mat\\\",\\n \\\"description\\\": \\\"Elastic mat to practice yoga.\\\",\\n \\\"quantity\\\": \\\"1\\\",\\n \\\"unit_amount\\\": {\\n \\\"currency_code\\\": \\\"USD\\\",\\n \\\"value\\\": \\\"50.00\\\"\\n },\\n \\\"tax\\\": {\\n \\\"name\\\": \\\"Sales Tax\\\",\\n \\\"percent\\\": \\\"7.25\\\"\\n },\\n \\\"discount\\\": {\\n \\\"percent\\\": \\\"5\\\"\\n },\\n \\\"unit_of_measure\\\": \\\"QUANTITY\\\"\\n },\\n {\\n \\\"name\\\": \\\"Yoga t-shirt\\\",\\n \\\"quantity\\\": \\\"1\\\",\\n \\\"unit_amount\\\": {\\n \\\"currency_code\\\": \\\"USD\\\",\\n \\\"value\\\": \\\"10.00\\\"\\n },\\n \\\"tax\\\": {\\n \\\"name\\\": \\\"Sales Tax\\\",\\n \\\"percent\\\": \\\"7.25\\\"\\n },\\n \\\"discount\\\": {\\n \\\"amount\\\": {\\n \\\"currency_code\\\": \\\"USD\\\",\\n \\\"value\\\": \\\"5.00\\\"\\n }\\n },\\n \\\"unit_of_measure\\\": \\\"QUANTITY\\\"\\n }\\n ],\\n \\\"configuration\\\": {\\n \\\"partial_payment\\\": {\\n \\\"allow_partial_payment\\\": true,\\n \\\"minimum_amount_due\\\": {\\n \\\"currency_code\\\": \\\"USD\\\",\\n \\\"value\\\": \\\"20.00\\\"\\n }\\n },\\n \\\"allow_tip\\\": true,\\n \\\"tax_calculated_after_discount\\\": true,\\n \\\"tax_inclusive\\\": false\\n },\\n \\\"amount\\\": {\\n \\\"breakdown\\\": {\\n \\\"custom\\\": {\\n \\\"label\\\": \\\"Packing Charges\\\",\\n \\\"amount\\\": {\\n \\\"currency_code\\\": \\\"USD\\\",\\n \\\"value\\\": \\\"10.00\\\"\\n }\\n },\\n \\\"shipping\\\": {\\n \\\"amount\\\": {\\n \\\"currency_code\\\": \\\"USD\\\",\\n \\\"value\\\": \\\"10.00\\\"\\n },\\n \\\"tax\\\": {\\n \\\"name\\\": \\\"Sales Tax\\\",\\n \\\"percent\\\": \\\"7.25\\\"\\n }\\n },\\n \\\"discount\\\": {\\n \\\"invoice_discount\\\": {\\n \\\"percent\\\": \\\"5\\\"\\n }\\n }\\n }\\n }\\n}\",\n \"ignoreArrayOrder\": true,\n \"ignoreExtraElements\": true\n }\n ]\n },\n \"response\": {\n \"status\": 201,\n \"body\": \"{\\\"id\\\":\\\"INV2-NS4E-L7P4-RZ6B-KNZY\\\",\\\"status\\\":\\\"DRAFT\\\",\\\"detail\\\":{\\\"reference\\\":\\\"<The reference data. Includes a post office (PO) number.>\\\",\\\"currency_code\\\":\\\"USD\\\",\\\"note\\\":\\\"<A note to the invoice recipient. Also appears on the invoice notification email.>\\\",\\\"terms_and_conditions\\\":\\\"<The general terms of the invoice. Can include return or cancellation policy and other terms and conditions.>\\\",\\\"memo\\\":\\\"<A private bookkeeping note for merchant.>\\\",\\\"additional_data\\\":\\\"<Any additional information. Includes business hours.>\\\",\\\"category_code\\\":\\\"SHIPPABLE\\\",\\\"invoice_number\\\":\\\"17494664982\\\",\\\"invoice_date\\\":\\\"2022-02-04\\\",\\\"payment_term\\\":{\\\"term_type\\\":\\\"NET_10\\\",\\\"due_date\\\":\\\"2022-02-14\\\"},\\\"viewed_by_recipient\\\":false,\\\"group_draft\\\":false,\\\"metadata\\\":{\\\"create_time\\\":\\\"2025-06-09T10:54:58Z\\\",\\\"last_update_time\\\":\\\"2025-06-09T10:54:58Z\\\",\\\"created_by_flow\\\":\\\"REGULAR_SINGLE\\\",\\\"recipient_view_url\\\":\\\"https://www.sandbox.paypal.com/invoice/p/#NS4EL7P4RZ6BKNZY\\\",\\\"invoicer_view_url\\\":\\\"https://www.sandbox.paypal.com/invoice/details/INV2-NS4E-L7P4-RZ6B-KNZY\\\",\\\"caller_type\\\":\\\"API_V2_INVOICE\\\",\\\"spam_info\\\":{}},\\\"archived\\\":false},\\\"invoicer\\\":{\\\"name\\\":{\\\"given_name\\\":\\\"David\\\",\\\"surname\\\":\\\"Larusso\\\",\\\"full_name\\\":\\\"David Larusso\\\"},\\\"address\\\":{\\\"address_line_1\\\":\\\"123 Townsend St\\\",\\\"address_line_2\\\":\\\"Floor 6\\\",\\\"admin_area_2\\\":\\\"San Francisco\\\",\\\"admin_area_1\\\":\\\"CA\\\",\\\"postal_code\\\":\\\"94107\\\",\\\"country_code\\\":\\\"US\\\"},\\\"phones\\\":[{\\\"country_code\\\":\\\"001\\\",\\\"national_number\\\":\\\"4085551234\\\",\\\"phone_type\\\":\\\"MOBILE\\\"}],\\\"website\\\":\\\"www.example.com\\\",\\\"tax_id\\\":\\\"XX-XXXXXXX\\\",\\\"additional_notes\\\":\\\"<Any additional information. Includes business hours.>\\\",\\\"logo_url\\\":\\\"https://example.com/logo.png\\\"},\\\"primary_recipients\\\":[{\\\"billing_info\\\":{\\\"name\\\":{\\\"given_name\\\":\\\"Stephanie\\\",\\\"surname\\\":\\\"Meyers\\\",\\\"full_name\\\":\\\"Stephanie Meyers\\\"},\\\"address\\\":{\\\"address_line_1\\\":\\\"1234 Main Street\\\",\\\"admin_area_2\\\":\\\"Anytown\\\",\\\"admin_area_1\\\":\\\"CA\\\",\\\"postal_code\\\":\\\"98765\\\",\\\"country_code\\\":\\\"US\\\"},\\\"email_address\\\":\\\"foobuyer@example.com\\\"},\\\"shipping_info\\\":{\\\"name\\\":{\\\"given_name\\\":\\\"Stephanie\\\",\\\"surname\\\":\\\"Meyers\\\",\\\"full_name\\\":\\\"Stephanie Meyers\\\"},\\\"address\\\":{\\\"address_line_1\\\":\\\"1234 Main Street\\\",\\\"admin_area_2\\\":\\\"Anytown\\\",\\\"admin_area_1\\\":\\\"CA\\\",\\\"postal_code\\\":\\\"98765\\\",\\\"country_code\\\":\\\"US\\\"}}}],\\\"items\\\":[{\\\"id\\\":\\\"ITEM-4M535543K7257150H\\\",\\\"name\\\":\\\"Yoga Mat\\\",\\\"description\\\":\\\"Elastic mat to practice yoga.\\\",\\\"quantity\\\":\\\"1\\\",\\\"unit_amount\\\":{\\\"currency_code\\\":\\\"USD\\\",\\\"value\\\":\\\"50.00\\\"},\\\"tax\\\":{\\\"id\\\":\\\"TAX-1R2044969B8060438\\\",\\\"name\\\":\\\"Sales Tax\\\",\\\"percent\\\":\\\"7.25\\\",\\\"amount\\\":{\\\"currency_code\\\":\\\"USD\\\",\\\"value\\\":\\\"3.27\\\"}},\\\"discount\\\":{\\\"percent\\\":\\\"5\\\",\\\"amount\\\":{\\\"currency_code\\\":\\\"USD\\\",\\\"value\\\":\\\"-2.50\\\"}},\\\"unit_of_measure\\\":\\\"QUANTITY\\\"},{\\\"id\\\":\\\"ITEM-0SE42747HP857643T\\\",\\\"name\\\":\\\"Yoga t-shirt\\\",\\\"quantity\\\":\\\"1\\\",\\\"unit_amount\\\":{\\\"currency_code\\\":\\\"USD\\\",\\\"value\\\":\\\"10.00\\\"},\\\"tax\\\":{\\\"id\\\":\\\"TAX-1R2044969B8060438\\\",\\\"name\\\":\\\"Sales Tax\\\",\\\"percent\\\":\\\"7.25\\\",\\\"amount\\\":{\\\"currency_code\\\":\\\"USD\\\",\\\"value\\\":\\\"0.34\\\"}},\\\"discount\\\":{\\\"amount\\\":{\\\"currency_code\\\":\\\"USD\\\",\\\"value\\\":\\\"-5.00\\\"}},\\\"unit_of_measure\\\":\\\"QUANTITY\\\"}],\\\"configuration\\\":{\\\"tax_calculated_after_discount\\\":true,\\\"tax_inclusive\\\":false,\\\"allow_tip\\\":true,\\\"partial_payment\\\":{\\\"allow_partial_payment\\\":true,\\\"minimum_amount_due\\\":{\\\"currency_code\\\":\\\"USD\\\",\\\"value\\\":\\\"20.00\\\"}},\\\"allow_only_pay_by_bank\\\":false,\\\"template_id\\\":\\\"TEMP-0P400848HY4308238\\\"},\\\"amount\\\":{\\\"breakdown\\\":{\\\"item_total\\\":{\\\"currency_code\\\":\\\"USD\\\",\\\"value\\\":\\\"60.00\\\"},\\\"discount\\\":{\\\"invoice_discount\\\":{\\\"percent\\\":\\\"5\\\",\\\"amount\\\":{\\\"currency_code\\\":\\\"USD\\\",\\\"value\\\":\\\"-2.63\\\"}},\\\"item_discount\\\":{\\\"currency_code\\\":\\\"USD\\\",\\\"value\\\":\\\"-7.50\\\"}},\\\"tax_total\\\":{\\\"currency_code\\\":\\\"USD\\\",\\\"value\\\":\\\"4.34\\\"},\\\"shipping\\\":{\\\"amount\\\":{\\\"currency_code\\\":\\\"USD\\\",\\\"value\\\":\\\"10.00\\\"},\\\"tax\\\":{\\\"id\\\":\\\"TAX-1R2044969B8060438\\\",\\\"name\\\":\\\"Sales Tax\\\",\\\"percent\\\":\\\"7.25\\\",\\\"amount\\\":{\\\"currency_code\\\":\\\"USD\\\",\\\"value\\\":\\\"0.73\\\"}}},\\\"custom\\\":{\\\"label\\\":\\\"Packing Charges\\\",\\\"amount\\\":{\\\"currency_code\\\":\\\"USD\\\",\\\"value\\\":\\\"10.00\\\"}}},\\\"currency_code\\\":\\\"USD\\\",\\\"value\\\":\\\"74.21\\\"},\\\"due_amount\\\":{\\\"currency_code\\\":\\\"USD\\\",\\\"value\\\":\\\"74.21\\\"},\\\"links\\\":[{\\\"href\\\":\\\"https://api.sandbox.paypal.com/v2/invoicing/invoices/INV2-NS4E-L7P4-RZ6B-KNZY\\\",\\\"rel\\\":\\\"self\\\",\\\"method\\\":\\\"GET\\\"},{\\\"href\\\":\\\"https://api.sandbox.paypal.com/v2/invoicing/invoices/INV2-NS4E-L7P4-RZ6B-KNZY/send\\\",\\\"rel\\\":\\\"send\\\",\\\"method\\\":\\\"POST\\\"},{\\\"href\\\":\\\"https://api.sandbox.paypal.com/v2/invoicing/invoices/INV2-NS4E-L7P4-RZ6B-KNZY\\\",\\\"rel\\\":\\\"replace\\\",\\\"method\\\":\\\"PUT\\\"},{\\\"href\\\":\\\"https://api.sandbox.paypal.com/v2/invoicing/invoices/INV2-NS4E-L7P4-RZ6B-KNZY\\\",\\\"rel\\\":\\\"delete\\\",\\\"method\\\":\\\"DELETE\\\"},{\\\"href\\\":\\\"https://api.sandbox.paypal.com/v2/invoicing/invoices/INV2-NS4E-L7P4-RZ6B-KNZY/payments\\\",\\\"rel\\\":\\\"record-payment\\\",\\\"method\\\":\\\"POST\\\"}],\\\"unilateral\\\":false}\",\n \"headers\": {\n \"Strict-Transport-Security\": \"max-age=31536000; includeSubDomains\",\n \"Cache-Control\": \"max-age=0, no-cache, no-store, must-revalidate\",\n \"Vary\": \"Accept-Encoding\",\n \"Location\": \"https://api-m.sandbox.paypal.com:8443/v2/invoicing/invoices/INV2-NS4E-L7P4-RZ6B-KNZY\",\n \"Content-Type\": \"application/json\"\n }\n },\n \"persistent\": true\n }\n ]\n}")

req, _ := http.NewRequest("POST", url, payload)

req.Header.Add("Authorization", "<api-key>")
req.Header.Add("Content-Type", "application/json")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.post("https://wmc.wiremockapi.cloud/v1/mock-apis/{mockApiId}/mappings/import")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"mappings\": [\n {\n \"id\": \"7e6d6733-881e-416d-9f6c-bad8d5015d0f\",\n \"name\": \"Get v2 invoicing invoices by invoiceId\",\n \"request\": {\n \"urlPathTemplate\": \"/v2/invoicing/invoices/{invoiceId}\",\n \"method\": \"GET\",\n \"pathParameters\": {\n \"invoiceId\": {\n \"equalTo\": \"INV2-NS4E-L7P4-RZ6B-KNZY\"\n }\n }\n },\n \"response\": {\n \"status\": 200,\n \"body\": \"{\\\"id\\\":\\\"INV2-NS4E-L7P4-RZ6B-KNZY\\\",\\\"status\\\":\\\"DRAFT\\\",\\\"detail\\\":{\\\"reference\\\":\\\"<The reference data. Includes a post office (PO) number.>\\\",\\\"currency_code\\\":\\\"USD\\\",\\\"note\\\":\\\"<A note to the invoice recipient. Also appears on the invoice notification email.>\\\",\\\"terms_and_conditions\\\":\\\"<The general terms of the invoice. Can include return or cancellation policy and other terms and conditions.>\\\",\\\"memo\\\":\\\"<A private bookkeeping note for merchant.>\\\",\\\"additional_data\\\":\\\"<Any additional information. Includes business hours.>\\\",\\\"category_code\\\":\\\"SHIPPABLE\\\",\\\"invoice_number\\\":\\\"17494664982\\\",\\\"invoice_date\\\":\\\"2022-02-04\\\",\\\"payment_term\\\":{\\\"term_type\\\":\\\"NET_10\\\",\\\"due_date\\\":\\\"2022-02-14\\\"},\\\"viewed_by_recipient\\\":false,\\\"group_draft\\\":false,\\\"metadata\\\":{\\\"create_time\\\":\\\"2025-06-09T10:54:58Z\\\",\\\"last_update_time\\\":\\\"2025-06-09T10:54:58Z\\\",\\\"created_by_flow\\\":\\\"REGULAR_SINGLE\\\",\\\"recipient_view_url\\\":\\\"https://www.sandbox.paypal.com/invoice/p/#NS4EL7P4RZ6BKNZY\\\",\\\"invoicer_view_url\\\":\\\"https://www.sandbox.paypal.com/invoice/details/INV2-NS4E-L7P4-RZ6B-KNZY\\\",\\\"caller_type\\\":\\\"API_V2_INVOICE\\\",\\\"spam_info\\\":{}},\\\"archived\\\":false},\\\"invoicer\\\":{\\\"name\\\":{\\\"given_name\\\":\\\"David\\\",\\\"surname\\\":\\\"Larusso\\\",\\\"full_name\\\":\\\"David Larusso\\\"},\\\"address\\\":{\\\"address_line_1\\\":\\\"123 Townsend St\\\",\\\"address_line_2\\\":\\\"Floor 6\\\",\\\"admin_area_2\\\":\\\"San Francisco\\\",\\\"admin_area_1\\\":\\\"CA\\\",\\\"postal_code\\\":\\\"94107\\\",\\\"country_code\\\":\\\"US\\\"},\\\"phones\\\":[{\\\"country_code\\\":\\\"001\\\",\\\"national_number\\\":\\\"4085551234\\\",\\\"phone_type\\\":\\\"MOBILE\\\"}],\\\"website\\\":\\\"www.example.com\\\",\\\"tax_id\\\":\\\"XX-XXXXXXX\\\",\\\"additional_notes\\\":\\\"<Any additional information. Includes business hours.>\\\",\\\"logo_url\\\":\\\"https://example.com/logo.png\\\"},\\\"primary_recipients\\\":[{\\\"billing_info\\\":{\\\"name\\\":{\\\"given_name\\\":\\\"Stephanie\\\",\\\"surname\\\":\\\"Meyers\\\",\\\"full_name\\\":\\\"Stephanie Meyers\\\"},\\\"address\\\":{\\\"address_line_1\\\":\\\"1234 Main Street\\\",\\\"admin_area_2\\\":\\\"Anytown\\\",\\\"admin_area_1\\\":\\\"CA\\\",\\\"postal_code\\\":\\\"98765\\\",\\\"country_code\\\":\\\"US\\\"},\\\"email_address\\\":\\\"foobuyer@example.com\\\"},\\\"shipping_info\\\":{\\\"name\\\":{\\\"given_name\\\":\\\"Stephanie\\\",\\\"surname\\\":\\\"Meyers\\\",\\\"full_name\\\":\\\"Stephanie Meyers\\\"},\\\"address\\\":{\\\"address_line_1\\\":\\\"1234 Main Street\\\",\\\"admin_area_2\\\":\\\"Anytown\\\",\\\"admin_area_1\\\":\\\"CA\\\",\\\"postal_code\\\":\\\"98765\\\",\\\"country_code\\\":\\\"US\\\"}}}],\\\"items\\\":[{\\\"id\\\":\\\"ITEM-4M535543K7257150H\\\",\\\"name\\\":\\\"Yoga Mat\\\",\\\"description\\\":\\\"Elastic mat to practice yoga.\\\",\\\"quantity\\\":\\\"1\\\",\\\"unit_amount\\\":{\\\"currency_code\\\":\\\"USD\\\",\\\"value\\\":\\\"50.00\\\"},\\\"tax\\\":{\\\"id\\\":\\\"TAX-1R2044969B8060438\\\",\\\"name\\\":\\\"Sales Tax\\\",\\\"percent\\\":\\\"7.25\\\",\\\"amount\\\":{\\\"currency_code\\\":\\\"USD\\\",\\\"value\\\":\\\"3.27\\\"}},\\\"discount\\\":{\\\"percent\\\":\\\"5\\\",\\\"amount\\\":{\\\"currency_code\\\":\\\"USD\\\",\\\"value\\\":\\\"-2.50\\\"}},\\\"unit_of_measure\\\":\\\"QUANTITY\\\"},{\\\"id\\\":\\\"ITEM-0SE42747HP857643T\\\",\\\"name\\\":\\\"Yoga t-shirt\\\",\\\"quantity\\\":\\\"1\\\",\\\"unit_amount\\\":{\\\"currency_code\\\":\\\"USD\\\",\\\"value\\\":\\\"10.00\\\"},\\\"tax\\\":{\\\"id\\\":\\\"TAX-1R2044969B8060438\\\",\\\"name\\\":\\\"Sales Tax\\\",\\\"percent\\\":\\\"7.25\\\",\\\"amount\\\":{\\\"currency_code\\\":\\\"USD\\\",\\\"value\\\":\\\"0.34\\\"}},\\\"discount\\\":{\\\"amount\\\":{\\\"currency_code\\\":\\\"USD\\\",\\\"value\\\":\\\"-5.00\\\"}},\\\"unit_of_measure\\\":\\\"QUANTITY\\\"}],\\\"configuration\\\":{\\\"tax_calculated_after_discount\\\":true,\\\"tax_inclusive\\\":false,\\\"allow_tip\\\":true,\\\"partial_payment\\\":{\\\"allow_partial_payment\\\":true,\\\"minimum_amount_due\\\":{\\\"currency_code\\\":\\\"USD\\\",\\\"value\\\":\\\"20.00\\\"}},\\\"allow_only_pay_by_bank\\\":false,\\\"template_id\\\":\\\"TEMP-0P400848HY4308238\\\"},\\\"amount\\\":{\\\"breakdown\\\":{\\\"item_total\\\":{\\\"currency_code\\\":\\\"USD\\\",\\\"value\\\":\\\"60.00\\\"},\\\"discount\\\":{\\\"invoice_discount\\\":{\\\"percent\\\":\\\"5\\\",\\\"amount\\\":{\\\"currency_code\\\":\\\"USD\\\",\\\"value\\\":\\\"-2.63\\\"}},\\\"item_discount\\\":{\\\"currency_code\\\":\\\"USD\\\",\\\"value\\\":\\\"-7.50\\\"}},\\\"tax_total\\\":{\\\"currency_code\\\":\\\"USD\\\",\\\"value\\\":\\\"4.34\\\"},\\\"shipping\\\":{\\\"amount\\\":{\\\"currency_code\\\":\\\"USD\\\",\\\"value\\\":\\\"10.00\\\"},\\\"tax\\\":{\\\"id\\\":\\\"TAX-1R2044969B8060438\\\",\\\"name\\\":\\\"Sales Tax\\\",\\\"percent\\\":\\\"7.25\\\",\\\"amount\\\":{\\\"currency_code\\\":\\\"USD\\\",\\\"value\\\":\\\"0.73\\\"}}},\\\"custom\\\":{\\\"label\\\":\\\"Packing Charges\\\",\\\"amount\\\":{\\\"currency_code\\\":\\\"USD\\\",\\\"value\\\":\\\"10.00\\\"}}},\\\"currency_code\\\":\\\"USD\\\",\\\"value\\\":\\\"74.21\\\"},\\\"due_amount\\\":{\\\"currency_code\\\":\\\"USD\\\",\\\"value\\\":\\\"74.21\\\"},\\\"links\\\":[{\\\"href\\\":\\\"https://api.sandbox.paypal.com/v2/invoicing/invoices/INV2-NS4E-L7P4-RZ6B-KNZY\\\",\\\"rel\\\":\\\"self\\\",\\\"method\\\":\\\"GET\\\"},{\\\"href\\\":\\\"https://api.sandbox.paypal.com/v2/invoicing/invoices/INV2-NS4E-L7P4-RZ6B-KNZY/send\\\",\\\"rel\\\":\\\"send\\\",\\\"method\\\":\\\"POST\\\"},{\\\"href\\\":\\\"https://api.sandbox.paypal.com/v2/invoicing/invoices/INV2-NS4E-L7P4-RZ6B-KNZY\\\",\\\"rel\\\":\\\"replace\\\",\\\"method\\\":\\\"PUT\\\"},{\\\"href\\\":\\\"https://api.sandbox.paypal.com/v2/invoicing/invoices/INV2-NS4E-L7P4-RZ6B-KNZY\\\",\\\"rel\\\":\\\"delete\\\",\\\"method\\\":\\\"DELETE\\\"},{\\\"href\\\":\\\"https://api.sandbox.paypal.com/v2/invoicing/invoices/INV2-NS4E-L7P4-RZ6B-KNZY/payments\\\",\\\"rel\\\":\\\"record-payment\\\",\\\"method\\\":\\\"POST\\\"}],\\\"unilateral\\\":false}\",\n \"headers\": {\n \"Strict-Transport-Security\": \"max-age=31536000; includeSubDomains\",\n \"Cache-Control\": \"max-age=0, no-cache, no-store, must-revalidate\",\n \"Vary\": \"Accept-Encoding\",\n \"Content-Type\": \"application/json\"\n }\n },\n \"persistent\": true\n },\n {\n \"id\": \"2791b6fe-bbbe-4102-a3fd-721fb9ba1557\",\n \"name\": \"Create v2 invoicing invoices\",\n \"request\": {\n \"urlPathTemplate\": \"/v2/invoicing/invoices\",\n \"method\": \"POST\",\n \"bodyPatterns\": [\n {\n \"equalToJson\": \"{\\n \\\"detail\\\": {\\n \\\"invoice_number\\\": \\\"17494664982\\\",\\n \\\"invoice_date\\\": \\\"2022-02-04\\\",\\n \\\"payment_term\\\": {\\n \\\"term_type\\\": \\\"NET_10\\\",\\n \\\"due_date\\\": \\\"2022-02-14\\\"\\n },\\n \\\"currency_code\\\": \\\"USD\\\",\\n \\\"reference\\\": \\\"<The reference data. Includes a post office (PO) number.>\\\",\\n \\\"note\\\": \\\"<A note to the invoice recipient. Also appears on the invoice notification email.>\\\",\\n \\\"terms_and_conditions\\\": \\\"<The general terms of the invoice. Can include return or cancellation policy and other terms and conditions.>\\\",\\n \\\"memo\\\": \\\"<A private bookkeeping note for merchant.>\\\"\\n },\\n \\\"invoicer\\\": {\\n \\\"name\\\": {\\n \\\"given_name\\\": \\\"David\\\",\\n \\\"surname\\\": \\\"Larusso\\\"\\n },\\n \\\"address\\\": {\\n \\\"address_line_1\\\": \\\"123 Townsend St\\\",\\n \\\"address_line_2\\\": \\\"Floor 6\\\",\\n \\\"admin_area_2\\\": \\\"San Francisco\\\",\\n \\\"admin_area_1\\\": \\\"CA\\\",\\n \\\"postal_code\\\": \\\"94107\\\",\\n \\\"country_code\\\": \\\"US\\\"\\n },\\n \\\"phones\\\": [\\n {\\n \\\"country_code\\\": \\\"001\\\",\\n \\\"national_number\\\": \\\"4085551234\\\",\\n \\\"phone_type\\\": \\\"MOBILE\\\"\\n }\\n ],\\n \\\"website\\\": \\\"www.example.com\\\",\\n \\\"tax_id\\\": \\\"XX-XXXXXXX\\\",\\n \\\"logo_url\\\": \\\"https://example.com/logo.png\\\",\\n \\\"additional_notes\\\": \\\"<Any additional information. Includes business hours.>\\\"\\n },\\n \\\"primary_recipients\\\": [\\n {\\n \\\"billing_info\\\": {\\n \\\"name\\\": {\\n \\\"given_name\\\": \\\"Stephanie\\\",\\n \\\"surname\\\": \\\"Meyers\\\"\\n },\\n \\\"address\\\": {\\n \\\"address_line_1\\\": \\\"1234 Main Street\\\",\\n \\\"admin_area_2\\\": \\\"Anytown\\\",\\n \\\"admin_area_1\\\": \\\"CA\\\",\\n \\\"postal_code\\\": \\\"98765\\\",\\n \\\"country_code\\\": \\\"US\\\"\\n },\\n \\\"email_address\\\": \\\"foobuyer@example.com\\\",\\n \\\"phones\\\": [\\n {\\n \\\"country_code\\\": \\\"001\\\",\\n \\\"national_number\\\": \\\"4884551234\\\",\\n \\\"phone_type\\\": \\\"HOME\\\"\\n }\\n ],\\n \\\"additional_info_value\\\": \\\"add-info\\\"\\n },\\n \\\"shipping_info\\\": {\\n \\\"name\\\": {\\n \\\"given_name\\\": \\\"Stephanie\\\",\\n \\\"surname\\\": \\\"Meyers\\\"\\n },\\n \\\"address\\\": {\\n \\\"address_line_1\\\": \\\"1234 Main Street\\\",\\n \\\"admin_area_2\\\": \\\"Anytown\\\",\\n \\\"admin_area_1\\\": \\\"CA\\\",\\n \\\"postal_code\\\": \\\"98765\\\",\\n \\\"country_code\\\": \\\"US\\\"\\n }\\n }\\n }\\n ],\\n \\\"items\\\": [\\n {\\n \\\"name\\\": \\\"Yoga Mat\\\",\\n \\\"description\\\": \\\"Elastic mat to practice yoga.\\\",\\n \\\"quantity\\\": \\\"1\\\",\\n \\\"unit_amount\\\": {\\n \\\"currency_code\\\": \\\"USD\\\",\\n \\\"value\\\": \\\"50.00\\\"\\n },\\n \\\"tax\\\": {\\n \\\"name\\\": \\\"Sales Tax\\\",\\n \\\"percent\\\": \\\"7.25\\\"\\n },\\n \\\"discount\\\": {\\n \\\"percent\\\": \\\"5\\\"\\n },\\n \\\"unit_of_measure\\\": \\\"QUANTITY\\\"\\n },\\n {\\n \\\"name\\\": \\\"Yoga t-shirt\\\",\\n \\\"quantity\\\": \\\"1\\\",\\n \\\"unit_amount\\\": {\\n \\\"currency_code\\\": \\\"USD\\\",\\n \\\"value\\\": \\\"10.00\\\"\\n },\\n \\\"tax\\\": {\\n \\\"name\\\": \\\"Sales Tax\\\",\\n \\\"percent\\\": \\\"7.25\\\"\\n },\\n \\\"discount\\\": {\\n \\\"amount\\\": {\\n \\\"currency_code\\\": \\\"USD\\\",\\n \\\"value\\\": \\\"5.00\\\"\\n }\\n },\\n \\\"unit_of_measure\\\": \\\"QUANTITY\\\"\\n }\\n ],\\n \\\"configuration\\\": {\\n \\\"partial_payment\\\": {\\n \\\"allow_partial_payment\\\": true,\\n \\\"minimum_amount_due\\\": {\\n \\\"currency_code\\\": \\\"USD\\\",\\n \\\"value\\\": \\\"20.00\\\"\\n }\\n },\\n \\\"allow_tip\\\": true,\\n \\\"tax_calculated_after_discount\\\": true,\\n \\\"tax_inclusive\\\": false\\n },\\n \\\"amount\\\": {\\n \\\"breakdown\\\": {\\n \\\"custom\\\": {\\n \\\"label\\\": \\\"Packing Charges\\\",\\n \\\"amount\\\": {\\n \\\"currency_code\\\": \\\"USD\\\",\\n \\\"value\\\": \\\"10.00\\\"\\n }\\n },\\n \\\"shipping\\\": {\\n \\\"amount\\\": {\\n \\\"currency_code\\\": \\\"USD\\\",\\n \\\"value\\\": \\\"10.00\\\"\\n },\\n \\\"tax\\\": {\\n \\\"name\\\": \\\"Sales Tax\\\",\\n \\\"percent\\\": \\\"7.25\\\"\\n }\\n },\\n \\\"discount\\\": {\\n \\\"invoice_discount\\\": {\\n \\\"percent\\\": \\\"5\\\"\\n }\\n }\\n }\\n }\\n}\",\n \"ignoreArrayOrder\": true,\n \"ignoreExtraElements\": true\n }\n ]\n },\n \"response\": {\n \"status\": 201,\n \"body\": \"{\\\"id\\\":\\\"INV2-NS4E-L7P4-RZ6B-KNZY\\\",\\\"status\\\":\\\"DRAFT\\\",\\\"detail\\\":{\\\"reference\\\":\\\"<The reference data. Includes a post office (PO) number.>\\\",\\\"currency_code\\\":\\\"USD\\\",\\\"note\\\":\\\"<A note to the invoice recipient. Also appears on the invoice notification email.>\\\",\\\"terms_and_conditions\\\":\\\"<The general terms of the invoice. Can include return or cancellation policy and other terms and conditions.>\\\",\\\"memo\\\":\\\"<A private bookkeeping note for merchant.>\\\",\\\"additional_data\\\":\\\"<Any additional information. Includes business hours.>\\\",\\\"category_code\\\":\\\"SHIPPABLE\\\",\\\"invoice_number\\\":\\\"17494664982\\\",\\\"invoice_date\\\":\\\"2022-02-04\\\",\\\"payment_term\\\":{\\\"term_type\\\":\\\"NET_10\\\",\\\"due_date\\\":\\\"2022-02-14\\\"},\\\"viewed_by_recipient\\\":false,\\\"group_draft\\\":false,\\\"metadata\\\":{\\\"create_time\\\":\\\"2025-06-09T10:54:58Z\\\",\\\"last_update_time\\\":\\\"2025-06-09T10:54:58Z\\\",\\\"created_by_flow\\\":\\\"REGULAR_SINGLE\\\",\\\"recipient_view_url\\\":\\\"https://www.sandbox.paypal.com/invoice/p/#NS4EL7P4RZ6BKNZY\\\",\\\"invoicer_view_url\\\":\\\"https://www.sandbox.paypal.com/invoice/details/INV2-NS4E-L7P4-RZ6B-KNZY\\\",\\\"caller_type\\\":\\\"API_V2_INVOICE\\\",\\\"spam_info\\\":{}},\\\"archived\\\":false},\\\"invoicer\\\":{\\\"name\\\":{\\\"given_name\\\":\\\"David\\\",\\\"surname\\\":\\\"Larusso\\\",\\\"full_name\\\":\\\"David Larusso\\\"},\\\"address\\\":{\\\"address_line_1\\\":\\\"123 Townsend St\\\",\\\"address_line_2\\\":\\\"Floor 6\\\",\\\"admin_area_2\\\":\\\"San Francisco\\\",\\\"admin_area_1\\\":\\\"CA\\\",\\\"postal_code\\\":\\\"94107\\\",\\\"country_code\\\":\\\"US\\\"},\\\"phones\\\":[{\\\"country_code\\\":\\\"001\\\",\\\"national_number\\\":\\\"4085551234\\\",\\\"phone_type\\\":\\\"MOBILE\\\"}],\\\"website\\\":\\\"www.example.com\\\",\\\"tax_id\\\":\\\"XX-XXXXXXX\\\",\\\"additional_notes\\\":\\\"<Any additional information. Includes business hours.>\\\",\\\"logo_url\\\":\\\"https://example.com/logo.png\\\"},\\\"primary_recipients\\\":[{\\\"billing_info\\\":{\\\"name\\\":{\\\"given_name\\\":\\\"Stephanie\\\",\\\"surname\\\":\\\"Meyers\\\",\\\"full_name\\\":\\\"Stephanie Meyers\\\"},\\\"address\\\":{\\\"address_line_1\\\":\\\"1234 Main Street\\\",\\\"admin_area_2\\\":\\\"Anytown\\\",\\\"admin_area_1\\\":\\\"CA\\\",\\\"postal_code\\\":\\\"98765\\\",\\\"country_code\\\":\\\"US\\\"},\\\"email_address\\\":\\\"foobuyer@example.com\\\"},\\\"shipping_info\\\":{\\\"name\\\":{\\\"given_name\\\":\\\"Stephanie\\\",\\\"surname\\\":\\\"Meyers\\\",\\\"full_name\\\":\\\"Stephanie Meyers\\\"},\\\"address\\\":{\\\"address_line_1\\\":\\\"1234 Main Street\\\",\\\"admin_area_2\\\":\\\"Anytown\\\",\\\"admin_area_1\\\":\\\"CA\\\",\\\"postal_code\\\":\\\"98765\\\",\\\"country_code\\\":\\\"US\\\"}}}],\\\"items\\\":[{\\\"id\\\":\\\"ITEM-4M535543K7257150H\\\",\\\"name\\\":\\\"Yoga Mat\\\",\\\"description\\\":\\\"Elastic mat to practice yoga.\\\",\\\"quantity\\\":\\\"1\\\",\\\"unit_amount\\\":{\\\"currency_code\\\":\\\"USD\\\",\\\"value\\\":\\\"50.00\\\"},\\\"tax\\\":{\\\"id\\\":\\\"TAX-1R2044969B8060438\\\",\\\"name\\\":\\\"Sales Tax\\\",\\\"percent\\\":\\\"7.25\\\",\\\"amount\\\":{\\\"currency_code\\\":\\\"USD\\\",\\\"value\\\":\\\"3.27\\\"}},\\\"discount\\\":{\\\"percent\\\":\\\"5\\\",\\\"amount\\\":{\\\"currency_code\\\":\\\"USD\\\",\\\"value\\\":\\\"-2.50\\\"}},\\\"unit_of_measure\\\":\\\"QUANTITY\\\"},{\\\"id\\\":\\\"ITEM-0SE42747HP857643T\\\",\\\"name\\\":\\\"Yoga t-shirt\\\",\\\"quantity\\\":\\\"1\\\",\\\"unit_amount\\\":{\\\"currency_code\\\":\\\"USD\\\",\\\"value\\\":\\\"10.00\\\"},\\\"tax\\\":{\\\"id\\\":\\\"TAX-1R2044969B8060438\\\",\\\"name\\\":\\\"Sales Tax\\\",\\\"percent\\\":\\\"7.25\\\",\\\"amount\\\":{\\\"currency_code\\\":\\\"USD\\\",\\\"value\\\":\\\"0.34\\\"}},\\\"discount\\\":{\\\"amount\\\":{\\\"currency_code\\\":\\\"USD\\\",\\\"value\\\":\\\"-5.00\\\"}},\\\"unit_of_measure\\\":\\\"QUANTITY\\\"}],\\\"configuration\\\":{\\\"tax_calculated_after_discount\\\":true,\\\"tax_inclusive\\\":false,\\\"allow_tip\\\":true,\\\"partial_payment\\\":{\\\"allow_partial_payment\\\":true,\\\"minimum_amount_due\\\":{\\\"currency_code\\\":\\\"USD\\\",\\\"value\\\":\\\"20.00\\\"}},\\\"allow_only_pay_by_bank\\\":false,\\\"template_id\\\":\\\"TEMP-0P400848HY4308238\\\"},\\\"amount\\\":{\\\"breakdown\\\":{\\\"item_total\\\":{\\\"currency_code\\\":\\\"USD\\\",\\\"value\\\":\\\"60.00\\\"},\\\"discount\\\":{\\\"invoice_discount\\\":{\\\"percent\\\":\\\"5\\\",\\\"amount\\\":{\\\"currency_code\\\":\\\"USD\\\",\\\"value\\\":\\\"-2.63\\\"}},\\\"item_discount\\\":{\\\"currency_code\\\":\\\"USD\\\",\\\"value\\\":\\\"-7.50\\\"}},\\\"tax_total\\\":{\\\"currency_code\\\":\\\"USD\\\",\\\"value\\\":\\\"4.34\\\"},\\\"shipping\\\":{\\\"amount\\\":{\\\"currency_code\\\":\\\"USD\\\",\\\"value\\\":\\\"10.00\\\"},\\\"tax\\\":{\\\"id\\\":\\\"TAX-1R2044969B8060438\\\",\\\"name\\\":\\\"Sales Tax\\\",\\\"percent\\\":\\\"7.25\\\",\\\"amount\\\":{\\\"currency_code\\\":\\\"USD\\\",\\\"value\\\":\\\"0.73\\\"}}},\\\"custom\\\":{\\\"label\\\":\\\"Packing Charges\\\",\\\"amount\\\":{\\\"currency_code\\\":\\\"USD\\\",\\\"value\\\":\\\"10.00\\\"}}},\\\"currency_code\\\":\\\"USD\\\",\\\"value\\\":\\\"74.21\\\"},\\\"due_amount\\\":{\\\"currency_code\\\":\\\"USD\\\",\\\"value\\\":\\\"74.21\\\"},\\\"links\\\":[{\\\"href\\\":\\\"https://api.sandbox.paypal.com/v2/invoicing/invoices/INV2-NS4E-L7P4-RZ6B-KNZY\\\",\\\"rel\\\":\\\"self\\\",\\\"method\\\":\\\"GET\\\"},{\\\"href\\\":\\\"https://api.sandbox.paypal.com/v2/invoicing/invoices/INV2-NS4E-L7P4-RZ6B-KNZY/send\\\",\\\"rel\\\":\\\"send\\\",\\\"method\\\":\\\"POST\\\"},{\\\"href\\\":\\\"https://api.sandbox.paypal.com/v2/invoicing/invoices/INV2-NS4E-L7P4-RZ6B-KNZY\\\",\\\"rel\\\":\\\"replace\\\",\\\"method\\\":\\\"PUT\\\"},{\\\"href\\\":\\\"https://api.sandbox.paypal.com/v2/invoicing/invoices/INV2-NS4E-L7P4-RZ6B-KNZY\\\",\\\"rel\\\":\\\"delete\\\",\\\"method\\\":\\\"DELETE\\\"},{\\\"href\\\":\\\"https://api.sandbox.paypal.com/v2/invoicing/invoices/INV2-NS4E-L7P4-RZ6B-KNZY/payments\\\",\\\"rel\\\":\\\"record-payment\\\",\\\"method\\\":\\\"POST\\\"}],\\\"unilateral\\\":false}\",\n \"headers\": {\n \"Strict-Transport-Security\": \"max-age=31536000; includeSubDomains\",\n \"Cache-Control\": \"max-age=0, no-cache, no-store, must-revalidate\",\n \"Vary\": \"Accept-Encoding\",\n \"Location\": \"https://api-m.sandbox.paypal.com:8443/v2/invoicing/invoices/INV2-NS4E-L7P4-RZ6B-KNZY\",\n \"Content-Type\": \"application/json\"\n }\n },\n \"persistent\": true\n }\n ]\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://wmc.wiremockapi.cloud/v1/mock-apis/{mockApiId}/mappings/import")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"mappings\": [\n {\n \"id\": \"7e6d6733-881e-416d-9f6c-bad8d5015d0f\",\n \"name\": \"Get v2 invoicing invoices by invoiceId\",\n \"request\": {\n \"urlPathTemplate\": \"/v2/invoicing/invoices/{invoiceId}\",\n \"method\": \"GET\",\n \"pathParameters\": {\n \"invoiceId\": {\n \"equalTo\": \"INV2-NS4E-L7P4-RZ6B-KNZY\"\n }\n }\n },\n \"response\": {\n \"status\": 200,\n \"body\": \"{\\\"id\\\":\\\"INV2-NS4E-L7P4-RZ6B-KNZY\\\",\\\"status\\\":\\\"DRAFT\\\",\\\"detail\\\":{\\\"reference\\\":\\\"<The reference data. Includes a post office (PO) number.>\\\",\\\"currency_code\\\":\\\"USD\\\",\\\"note\\\":\\\"<A note to the invoice recipient. Also appears on the invoice notification email.>\\\",\\\"terms_and_conditions\\\":\\\"<The general terms of the invoice. Can include return or cancellation policy and other terms and conditions.>\\\",\\\"memo\\\":\\\"<A private bookkeeping note for merchant.>\\\",\\\"additional_data\\\":\\\"<Any additional information. Includes business hours.>\\\",\\\"category_code\\\":\\\"SHIPPABLE\\\",\\\"invoice_number\\\":\\\"17494664982\\\",\\\"invoice_date\\\":\\\"2022-02-04\\\",\\\"payment_term\\\":{\\\"term_type\\\":\\\"NET_10\\\",\\\"due_date\\\":\\\"2022-02-14\\\"},\\\"viewed_by_recipient\\\":false,\\\"group_draft\\\":false,\\\"metadata\\\":{\\\"create_time\\\":\\\"2025-06-09T10:54:58Z\\\",\\\"last_update_time\\\":\\\"2025-06-09T10:54:58Z\\\",\\\"created_by_flow\\\":\\\"REGULAR_SINGLE\\\",\\\"recipient_view_url\\\":\\\"https://www.sandbox.paypal.com/invoice/p/#NS4EL7P4RZ6BKNZY\\\",\\\"invoicer_view_url\\\":\\\"https://www.sandbox.paypal.com/invoice/details/INV2-NS4E-L7P4-RZ6B-KNZY\\\",\\\"caller_type\\\":\\\"API_V2_INVOICE\\\",\\\"spam_info\\\":{}},\\\"archived\\\":false},\\\"invoicer\\\":{\\\"name\\\":{\\\"given_name\\\":\\\"David\\\",\\\"surname\\\":\\\"Larusso\\\",\\\"full_name\\\":\\\"David Larusso\\\"},\\\"address\\\":{\\\"address_line_1\\\":\\\"123 Townsend St\\\",\\\"address_line_2\\\":\\\"Floor 6\\\",\\\"admin_area_2\\\":\\\"San Francisco\\\",\\\"admin_area_1\\\":\\\"CA\\\",\\\"postal_code\\\":\\\"94107\\\",\\\"country_code\\\":\\\"US\\\"},\\\"phones\\\":[{\\\"country_code\\\":\\\"001\\\",\\\"national_number\\\":\\\"4085551234\\\",\\\"phone_type\\\":\\\"MOBILE\\\"}],\\\"website\\\":\\\"www.example.com\\\",\\\"tax_id\\\":\\\"XX-XXXXXXX\\\",\\\"additional_notes\\\":\\\"<Any additional information. Includes business hours.>\\\",\\\"logo_url\\\":\\\"https://example.com/logo.png\\\"},\\\"primary_recipients\\\":[{\\\"billing_info\\\":{\\\"name\\\":{\\\"given_name\\\":\\\"Stephanie\\\",\\\"surname\\\":\\\"Meyers\\\",\\\"full_name\\\":\\\"Stephanie Meyers\\\"},\\\"address\\\":{\\\"address_line_1\\\":\\\"1234 Main Street\\\",\\\"admin_area_2\\\":\\\"Anytown\\\",\\\"admin_area_1\\\":\\\"CA\\\",\\\"postal_code\\\":\\\"98765\\\",\\\"country_code\\\":\\\"US\\\"},\\\"email_address\\\":\\\"foobuyer@example.com\\\"},\\\"shipping_info\\\":{\\\"name\\\":{\\\"given_name\\\":\\\"Stephanie\\\",\\\"surname\\\":\\\"Meyers\\\",\\\"full_name\\\":\\\"Stephanie Meyers\\\"},\\\"address\\\":{\\\"address_line_1\\\":\\\"1234 Main Street\\\",\\\"admin_area_2\\\":\\\"Anytown\\\",\\\"admin_area_1\\\":\\\"CA\\\",\\\"postal_code\\\":\\\"98765\\\",\\\"country_code\\\":\\\"US\\\"}}}],\\\"items\\\":[{\\\"id\\\":\\\"ITEM-4M535543K7257150H\\\",\\\"name\\\":\\\"Yoga Mat\\\",\\\"description\\\":\\\"Elastic mat to practice yoga.\\\",\\\"quantity\\\":\\\"1\\\",\\\"unit_amount\\\":{\\\"currency_code\\\":\\\"USD\\\",\\\"value\\\":\\\"50.00\\\"},\\\"tax\\\":{\\\"id\\\":\\\"TAX-1R2044969B8060438\\\",\\\"name\\\":\\\"Sales Tax\\\",\\\"percent\\\":\\\"7.25\\\",\\\"amount\\\":{\\\"currency_code\\\":\\\"USD\\\",\\\"value\\\":\\\"3.27\\\"}},\\\"discount\\\":{\\\"percent\\\":\\\"5\\\",\\\"amount\\\":{\\\"currency_code\\\":\\\"USD\\\",\\\"value\\\":\\\"-2.50\\\"}},\\\"unit_of_measure\\\":\\\"QUANTITY\\\"},{\\\"id\\\":\\\"ITEM-0SE42747HP857643T\\\",\\\"name\\\":\\\"Yoga t-shirt\\\",\\\"quantity\\\":\\\"1\\\",\\\"unit_amount\\\":{\\\"currency_code\\\":\\\"USD\\\",\\\"value\\\":\\\"10.00\\\"},\\\"tax\\\":{\\\"id\\\":\\\"TAX-1R2044969B8060438\\\",\\\"name\\\":\\\"Sales Tax\\\",\\\"percent\\\":\\\"7.25\\\",\\\"amount\\\":{\\\"currency_code\\\":\\\"USD\\\",\\\"value\\\":\\\"0.34\\\"}},\\\"discount\\\":{\\\"amount\\\":{\\\"currency_code\\\":\\\"USD\\\",\\\"value\\\":\\\"-5.00\\\"}},\\\"unit_of_measure\\\":\\\"QUANTITY\\\"}],\\\"configuration\\\":{\\\"tax_calculated_after_discount\\\":true,\\\"tax_inclusive\\\":false,\\\"allow_tip\\\":true,\\\"partial_payment\\\":{\\\"allow_partial_payment\\\":true,\\\"minimum_amount_due\\\":{\\\"currency_code\\\":\\\"USD\\\",\\\"value\\\":\\\"20.00\\\"}},\\\"allow_only_pay_by_bank\\\":false,\\\"template_id\\\":\\\"TEMP-0P400848HY4308238\\\"},\\\"amount\\\":{\\\"breakdown\\\":{\\\"item_total\\\":{\\\"currency_code\\\":\\\"USD\\\",\\\"value\\\":\\\"60.00\\\"},\\\"discount\\\":{\\\"invoice_discount\\\":{\\\"percent\\\":\\\"5\\\",\\\"amount\\\":{\\\"currency_code\\\":\\\"USD\\\",\\\"value\\\":\\\"-2.63\\\"}},\\\"item_discount\\\":{\\\"currency_code\\\":\\\"USD\\\",\\\"value\\\":\\\"-7.50\\\"}},\\\"tax_total\\\":{\\\"currency_code\\\":\\\"USD\\\",\\\"value\\\":\\\"4.34\\\"},\\\"shipping\\\":{\\\"amount\\\":{\\\"currency_code\\\":\\\"USD\\\",\\\"value\\\":\\\"10.00\\\"},\\\"tax\\\":{\\\"id\\\":\\\"TAX-1R2044969B8060438\\\",\\\"name\\\":\\\"Sales Tax\\\",\\\"percent\\\":\\\"7.25\\\",\\\"amount\\\":{\\\"currency_code\\\":\\\"USD\\\",\\\"value\\\":\\\"0.73\\\"}}},\\\"custom\\\":{\\\"label\\\":\\\"Packing Charges\\\",\\\"amount\\\":{\\\"currency_code\\\":\\\"USD\\\",\\\"value\\\":\\\"10.00\\\"}}},\\\"currency_code\\\":\\\"USD\\\",\\\"value\\\":\\\"74.21\\\"},\\\"due_amount\\\":{\\\"currency_code\\\":\\\"USD\\\",\\\"value\\\":\\\"74.21\\\"},\\\"links\\\":[{\\\"href\\\":\\\"https://api.sandbox.paypal.com/v2/invoicing/invoices/INV2-NS4E-L7P4-RZ6B-KNZY\\\",\\\"rel\\\":\\\"self\\\",\\\"method\\\":\\\"GET\\\"},{\\\"href\\\":\\\"https://api.sandbox.paypal.com/v2/invoicing/invoices/INV2-NS4E-L7P4-RZ6B-KNZY/send\\\",\\\"rel\\\":\\\"send\\\",\\\"method\\\":\\\"POST\\\"},{\\\"href\\\":\\\"https://api.sandbox.paypal.com/v2/invoicing/invoices/INV2-NS4E-L7P4-RZ6B-KNZY\\\",\\\"rel\\\":\\\"replace\\\",\\\"method\\\":\\\"PUT\\\"},{\\\"href\\\":\\\"https://api.sandbox.paypal.com/v2/invoicing/invoices/INV2-NS4E-L7P4-RZ6B-KNZY\\\",\\\"rel\\\":\\\"delete\\\",\\\"method\\\":\\\"DELETE\\\"},{\\\"href\\\":\\\"https://api.sandbox.paypal.com/v2/invoicing/invoices/INV2-NS4E-L7P4-RZ6B-KNZY/payments\\\",\\\"rel\\\":\\\"record-payment\\\",\\\"method\\\":\\\"POST\\\"}],\\\"unilateral\\\":false}\",\n \"headers\": {\n \"Strict-Transport-Security\": \"max-age=31536000; includeSubDomains\",\n \"Cache-Control\": \"max-age=0, no-cache, no-store, must-revalidate\",\n \"Vary\": \"Accept-Encoding\",\n \"Content-Type\": \"application/json\"\n }\n },\n \"persistent\": true\n },\n {\n \"id\": \"2791b6fe-bbbe-4102-a3fd-721fb9ba1557\",\n \"name\": \"Create v2 invoicing invoices\",\n \"request\": {\n \"urlPathTemplate\": \"/v2/invoicing/invoices\",\n \"method\": \"POST\",\n \"bodyPatterns\": [\n {\n \"equalToJson\": \"{\\n \\\"detail\\\": {\\n \\\"invoice_number\\\": \\\"17494664982\\\",\\n \\\"invoice_date\\\": \\\"2022-02-04\\\",\\n \\\"payment_term\\\": {\\n \\\"term_type\\\": \\\"NET_10\\\",\\n \\\"due_date\\\": \\\"2022-02-14\\\"\\n },\\n \\\"currency_code\\\": \\\"USD\\\",\\n \\\"reference\\\": \\\"<The reference data. Includes a post office (PO) number.>\\\",\\n \\\"note\\\": \\\"<A note to the invoice recipient. Also appears on the invoice notification email.>\\\",\\n \\\"terms_and_conditions\\\": \\\"<The general terms of the invoice. Can include return or cancellation policy and other terms and conditions.>\\\",\\n \\\"memo\\\": \\\"<A private bookkeeping note for merchant.>\\\"\\n },\\n \\\"invoicer\\\": {\\n \\\"name\\\": {\\n \\\"given_name\\\": \\\"David\\\",\\n \\\"surname\\\": \\\"Larusso\\\"\\n },\\n \\\"address\\\": {\\n \\\"address_line_1\\\": \\\"123 Townsend St\\\",\\n \\\"address_line_2\\\": \\\"Floor 6\\\",\\n \\\"admin_area_2\\\": \\\"San Francisco\\\",\\n \\\"admin_area_1\\\": \\\"CA\\\",\\n \\\"postal_code\\\": \\\"94107\\\",\\n \\\"country_code\\\": \\\"US\\\"\\n },\\n \\\"phones\\\": [\\n {\\n \\\"country_code\\\": \\\"001\\\",\\n \\\"national_number\\\": \\\"4085551234\\\",\\n \\\"phone_type\\\": \\\"MOBILE\\\"\\n }\\n ],\\n \\\"website\\\": \\\"www.example.com\\\",\\n \\\"tax_id\\\": \\\"XX-XXXXXXX\\\",\\n \\\"logo_url\\\": \\\"https://example.com/logo.png\\\",\\n \\\"additional_notes\\\": \\\"<Any additional information. Includes business hours.>\\\"\\n },\\n \\\"primary_recipients\\\": [\\n {\\n \\\"billing_info\\\": {\\n \\\"name\\\": {\\n \\\"given_name\\\": \\\"Stephanie\\\",\\n \\\"surname\\\": \\\"Meyers\\\"\\n },\\n \\\"address\\\": {\\n \\\"address_line_1\\\": \\\"1234 Main Street\\\",\\n \\\"admin_area_2\\\": \\\"Anytown\\\",\\n \\\"admin_area_1\\\": \\\"CA\\\",\\n \\\"postal_code\\\": \\\"98765\\\",\\n \\\"country_code\\\": \\\"US\\\"\\n },\\n \\\"email_address\\\": \\\"foobuyer@example.com\\\",\\n \\\"phones\\\": [\\n {\\n \\\"country_code\\\": \\\"001\\\",\\n \\\"national_number\\\": \\\"4884551234\\\",\\n \\\"phone_type\\\": \\\"HOME\\\"\\n }\\n ],\\n \\\"additional_info_value\\\": \\\"add-info\\\"\\n },\\n \\\"shipping_info\\\": {\\n \\\"name\\\": {\\n \\\"given_name\\\": \\\"Stephanie\\\",\\n \\\"surname\\\": \\\"Meyers\\\"\\n },\\n \\\"address\\\": {\\n \\\"address_line_1\\\": \\\"1234 Main Street\\\",\\n \\\"admin_area_2\\\": \\\"Anytown\\\",\\n \\\"admin_area_1\\\": \\\"CA\\\",\\n \\\"postal_code\\\": \\\"98765\\\",\\n \\\"country_code\\\": \\\"US\\\"\\n }\\n }\\n }\\n ],\\n \\\"items\\\": [\\n {\\n \\\"name\\\": \\\"Yoga Mat\\\",\\n \\\"description\\\": \\\"Elastic mat to practice yoga.\\\",\\n \\\"quantity\\\": \\\"1\\\",\\n \\\"unit_amount\\\": {\\n \\\"currency_code\\\": \\\"USD\\\",\\n \\\"value\\\": \\\"50.00\\\"\\n },\\n \\\"tax\\\": {\\n \\\"name\\\": \\\"Sales Tax\\\",\\n \\\"percent\\\": \\\"7.25\\\"\\n },\\n \\\"discount\\\": {\\n \\\"percent\\\": \\\"5\\\"\\n },\\n \\\"unit_of_measure\\\": \\\"QUANTITY\\\"\\n },\\n {\\n \\\"name\\\": \\\"Yoga t-shirt\\\",\\n \\\"quantity\\\": \\\"1\\\",\\n \\\"unit_amount\\\": {\\n \\\"currency_code\\\": \\\"USD\\\",\\n \\\"value\\\": \\\"10.00\\\"\\n },\\n \\\"tax\\\": {\\n \\\"name\\\": \\\"Sales Tax\\\",\\n \\\"percent\\\": \\\"7.25\\\"\\n },\\n \\\"discount\\\": {\\n \\\"amount\\\": {\\n \\\"currency_code\\\": \\\"USD\\\",\\n \\\"value\\\": \\\"5.00\\\"\\n }\\n },\\n \\\"unit_of_measure\\\": \\\"QUANTITY\\\"\\n }\\n ],\\n \\\"configuration\\\": {\\n \\\"partial_payment\\\": {\\n \\\"allow_partial_payment\\\": true,\\n \\\"minimum_amount_due\\\": {\\n \\\"currency_code\\\": \\\"USD\\\",\\n \\\"value\\\": \\\"20.00\\\"\\n }\\n },\\n \\\"allow_tip\\\": true,\\n \\\"tax_calculated_after_discount\\\": true,\\n \\\"tax_inclusive\\\": false\\n },\\n \\\"amount\\\": {\\n \\\"breakdown\\\": {\\n \\\"custom\\\": {\\n \\\"label\\\": \\\"Packing Charges\\\",\\n \\\"amount\\\": {\\n \\\"currency_code\\\": \\\"USD\\\",\\n \\\"value\\\": \\\"10.00\\\"\\n }\\n },\\n \\\"shipping\\\": {\\n \\\"amount\\\": {\\n \\\"currency_code\\\": \\\"USD\\\",\\n \\\"value\\\": \\\"10.00\\\"\\n },\\n \\\"tax\\\": {\\n \\\"name\\\": \\\"Sales Tax\\\",\\n \\\"percent\\\": \\\"7.25\\\"\\n }\\n },\\n \\\"discount\\\": {\\n \\\"invoice_discount\\\": {\\n \\\"percent\\\": \\\"5\\\"\\n }\\n }\\n }\\n }\\n}\",\n \"ignoreArrayOrder\": true,\n \"ignoreExtraElements\": true\n }\n ]\n },\n \"response\": {\n \"status\": 201,\n \"body\": \"{\\\"id\\\":\\\"INV2-NS4E-L7P4-RZ6B-KNZY\\\",\\\"status\\\":\\\"DRAFT\\\",\\\"detail\\\":{\\\"reference\\\":\\\"<The reference data. Includes a post office (PO) number.>\\\",\\\"currency_code\\\":\\\"USD\\\",\\\"note\\\":\\\"<A note to the invoice recipient. Also appears on the invoice notification email.>\\\",\\\"terms_and_conditions\\\":\\\"<The general terms of the invoice. Can include return or cancellation policy and other terms and conditions.>\\\",\\\"memo\\\":\\\"<A private bookkeeping note for merchant.>\\\",\\\"additional_data\\\":\\\"<Any additional information. Includes business hours.>\\\",\\\"category_code\\\":\\\"SHIPPABLE\\\",\\\"invoice_number\\\":\\\"17494664982\\\",\\\"invoice_date\\\":\\\"2022-02-04\\\",\\\"payment_term\\\":{\\\"term_type\\\":\\\"NET_10\\\",\\\"due_date\\\":\\\"2022-02-14\\\"},\\\"viewed_by_recipient\\\":false,\\\"group_draft\\\":false,\\\"metadata\\\":{\\\"create_time\\\":\\\"2025-06-09T10:54:58Z\\\",\\\"last_update_time\\\":\\\"2025-06-09T10:54:58Z\\\",\\\"created_by_flow\\\":\\\"REGULAR_SINGLE\\\",\\\"recipient_view_url\\\":\\\"https://www.sandbox.paypal.com/invoice/p/#NS4EL7P4RZ6BKNZY\\\",\\\"invoicer_view_url\\\":\\\"https://www.sandbox.paypal.com/invoice/details/INV2-NS4E-L7P4-RZ6B-KNZY\\\",\\\"caller_type\\\":\\\"API_V2_INVOICE\\\",\\\"spam_info\\\":{}},\\\"archived\\\":false},\\\"invoicer\\\":{\\\"name\\\":{\\\"given_name\\\":\\\"David\\\",\\\"surname\\\":\\\"Larusso\\\",\\\"full_name\\\":\\\"David Larusso\\\"},\\\"address\\\":{\\\"address_line_1\\\":\\\"123 Townsend St\\\",\\\"address_line_2\\\":\\\"Floor 6\\\",\\\"admin_area_2\\\":\\\"San Francisco\\\",\\\"admin_area_1\\\":\\\"CA\\\",\\\"postal_code\\\":\\\"94107\\\",\\\"country_code\\\":\\\"US\\\"},\\\"phones\\\":[{\\\"country_code\\\":\\\"001\\\",\\\"national_number\\\":\\\"4085551234\\\",\\\"phone_type\\\":\\\"MOBILE\\\"}],\\\"website\\\":\\\"www.example.com\\\",\\\"tax_id\\\":\\\"XX-XXXXXXX\\\",\\\"additional_notes\\\":\\\"<Any additional information. Includes business hours.>\\\",\\\"logo_url\\\":\\\"https://example.com/logo.png\\\"},\\\"primary_recipients\\\":[{\\\"billing_info\\\":{\\\"name\\\":{\\\"given_name\\\":\\\"Stephanie\\\",\\\"surname\\\":\\\"Meyers\\\",\\\"full_name\\\":\\\"Stephanie Meyers\\\"},\\\"address\\\":{\\\"address_line_1\\\":\\\"1234 Main Street\\\",\\\"admin_area_2\\\":\\\"Anytown\\\",\\\"admin_area_1\\\":\\\"CA\\\",\\\"postal_code\\\":\\\"98765\\\",\\\"country_code\\\":\\\"US\\\"},\\\"email_address\\\":\\\"foobuyer@example.com\\\"},\\\"shipping_info\\\":{\\\"name\\\":{\\\"given_name\\\":\\\"Stephanie\\\",\\\"surname\\\":\\\"Meyers\\\",\\\"full_name\\\":\\\"Stephanie Meyers\\\"},\\\"address\\\":{\\\"address_line_1\\\":\\\"1234 Main Street\\\",\\\"admin_area_2\\\":\\\"Anytown\\\",\\\"admin_area_1\\\":\\\"CA\\\",\\\"postal_code\\\":\\\"98765\\\",\\\"country_code\\\":\\\"US\\\"}}}],\\\"items\\\":[{\\\"id\\\":\\\"ITEM-4M535543K7257150H\\\",\\\"name\\\":\\\"Yoga Mat\\\",\\\"description\\\":\\\"Elastic mat to practice yoga.\\\",\\\"quantity\\\":\\\"1\\\",\\\"unit_amount\\\":{\\\"currency_code\\\":\\\"USD\\\",\\\"value\\\":\\\"50.00\\\"},\\\"tax\\\":{\\\"id\\\":\\\"TAX-1R2044969B8060438\\\",\\\"name\\\":\\\"Sales Tax\\\",\\\"percent\\\":\\\"7.25\\\",\\\"amount\\\":{\\\"currency_code\\\":\\\"USD\\\",\\\"value\\\":\\\"3.27\\\"}},\\\"discount\\\":{\\\"percent\\\":\\\"5\\\",\\\"amount\\\":{\\\"currency_code\\\":\\\"USD\\\",\\\"value\\\":\\\"-2.50\\\"}},\\\"unit_of_measure\\\":\\\"QUANTITY\\\"},{\\\"id\\\":\\\"ITEM-0SE42747HP857643T\\\",\\\"name\\\":\\\"Yoga t-shirt\\\",\\\"quantity\\\":\\\"1\\\",\\\"unit_amount\\\":{\\\"currency_code\\\":\\\"USD\\\",\\\"value\\\":\\\"10.00\\\"},\\\"tax\\\":{\\\"id\\\":\\\"TAX-1R2044969B8060438\\\",\\\"name\\\":\\\"Sales Tax\\\",\\\"percent\\\":\\\"7.25\\\",\\\"amount\\\":{\\\"currency_code\\\":\\\"USD\\\",\\\"value\\\":\\\"0.34\\\"}},\\\"discount\\\":{\\\"amount\\\":{\\\"currency_code\\\":\\\"USD\\\",\\\"value\\\":\\\"-5.00\\\"}},\\\"unit_of_measure\\\":\\\"QUANTITY\\\"}],\\\"configuration\\\":{\\\"tax_calculated_after_discount\\\":true,\\\"tax_inclusive\\\":false,\\\"allow_tip\\\":true,\\\"partial_payment\\\":{\\\"allow_partial_payment\\\":true,\\\"minimum_amount_due\\\":{\\\"currency_code\\\":\\\"USD\\\",\\\"value\\\":\\\"20.00\\\"}},\\\"allow_only_pay_by_bank\\\":false,\\\"template_id\\\":\\\"TEMP-0P400848HY4308238\\\"},\\\"amount\\\":{\\\"breakdown\\\":{\\\"item_total\\\":{\\\"currency_code\\\":\\\"USD\\\",\\\"value\\\":\\\"60.00\\\"},\\\"discount\\\":{\\\"invoice_discount\\\":{\\\"percent\\\":\\\"5\\\",\\\"amount\\\":{\\\"currency_code\\\":\\\"USD\\\",\\\"value\\\":\\\"-2.63\\\"}},\\\"item_discount\\\":{\\\"currency_code\\\":\\\"USD\\\",\\\"value\\\":\\\"-7.50\\\"}},\\\"tax_total\\\":{\\\"currency_code\\\":\\\"USD\\\",\\\"value\\\":\\\"4.34\\\"},\\\"shipping\\\":{\\\"amount\\\":{\\\"currency_code\\\":\\\"USD\\\",\\\"value\\\":\\\"10.00\\\"},\\\"tax\\\":{\\\"id\\\":\\\"TAX-1R2044969B8060438\\\",\\\"name\\\":\\\"Sales Tax\\\",\\\"percent\\\":\\\"7.25\\\",\\\"amount\\\":{\\\"currency_code\\\":\\\"USD\\\",\\\"value\\\":\\\"0.73\\\"}}},\\\"custom\\\":{\\\"label\\\":\\\"Packing Charges\\\",\\\"amount\\\":{\\\"currency_code\\\":\\\"USD\\\",\\\"value\\\":\\\"10.00\\\"}}},\\\"currency_code\\\":\\\"USD\\\",\\\"value\\\":\\\"74.21\\\"},\\\"due_amount\\\":{\\\"currency_code\\\":\\\"USD\\\",\\\"value\\\":\\\"74.21\\\"},\\\"links\\\":[{\\\"href\\\":\\\"https://api.sandbox.paypal.com/v2/invoicing/invoices/INV2-NS4E-L7P4-RZ6B-KNZY\\\",\\\"rel\\\":\\\"self\\\",\\\"method\\\":\\\"GET\\\"},{\\\"href\\\":\\\"https://api.sandbox.paypal.com/v2/invoicing/invoices/INV2-NS4E-L7P4-RZ6B-KNZY/send\\\",\\\"rel\\\":\\\"send\\\",\\\"method\\\":\\\"POST\\\"},{\\\"href\\\":\\\"https://api.sandbox.paypal.com/v2/invoicing/invoices/INV2-NS4E-L7P4-RZ6B-KNZY\\\",\\\"rel\\\":\\\"replace\\\",\\\"method\\\":\\\"PUT\\\"},{\\\"href\\\":\\\"https://api.sandbox.paypal.com/v2/invoicing/invoices/INV2-NS4E-L7P4-RZ6B-KNZY\\\",\\\"rel\\\":\\\"delete\\\",\\\"method\\\":\\\"DELETE\\\"},{\\\"href\\\":\\\"https://api.sandbox.paypal.com/v2/invoicing/invoices/INV2-NS4E-L7P4-RZ6B-KNZY/payments\\\",\\\"rel\\\":\\\"record-payment\\\",\\\"method\\\":\\\"POST\\\"}],\\\"unilateral\\\":false}\",\n \"headers\": {\n \"Strict-Transport-Security\": \"max-age=31536000; includeSubDomains\",\n \"Cache-Control\": \"max-age=0, no-cache, no-store, must-revalidate\",\n \"Vary\": \"Accept-Encoding\",\n \"Location\": \"https://api-m.sandbox.paypal.com:8443/v2/invoicing/invoices/INV2-NS4E-L7P4-RZ6B-KNZY\",\n \"Content-Type\": \"application/json\"\n }\n },\n \"persistent\": true\n }\n ]\n}"

response = http.request(request)
puts response.read_body

Authorizations

Authorization
string
header
required

Your API key prefixed by 'Token '

Path Parameters

mockApiId
string
required

The ID of the Mock API

Required string length: 5 - 10
Example:

"jjl8y"

Body

application/json
mappings
object[]
meta
object

Response

200

Successfully imported