curl --request POST \
--url https://wmc.wiremockapi.cloud/v1/mock-apis/{mockApiId}/imports \
--header 'Authorization: <api-key>' \
--header 'Content-Type: */*' \
--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}/imports"
payload = "{\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}"
headers = {
"Authorization": "<api-key>",
"Content-Type": "*/*"
}
response = requests.post(url, data=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': '*/*'},
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}'
};
fetch('https://wmc.wiremockapi.cloud/v1/mock-apis/{mockApiId}/imports', 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}/imports",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "{\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}",
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: */*"
],
]);
$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}/imports"
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", "*/*")
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}/imports")
.header("Authorization", "<api-key>")
.header("Content-Type", "*/*")
.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}/imports")
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"] = '*/*'
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{
"mappings": [
{
"id": "7e6d6733-881e-416d-9f6c-bad8d5015d0f"
},
{
"id": "2791b6fe-bbbe-4102-a3fd-721fb9ba1557"
}
]
}{
"job": {
"id": "8e2f3641-5f0a-45a2-9d1b-39cf16b2d0e7",
"jobType": "multi-import",
"status": "RUNNING",
"started": "2024-09-05T10:20:46.143759190Z",
"links": {
"self": "/v1/mock-apis/0ozge/jobs/8e2f3641-5f0a-45a2-9d1b-39cf16b2d0e7"
}
}
}{
"errors": [
{
"title": "Invalid query parameter format",
"detail": "The offset parameter value must be a positive integer"
}
]
}Credentials are required to access this resource.Import into a mock API
Import any supported format into your Mock API. The supplied data will be converted into stubs that your Mock API will be populated with. Supported formats include WireMock mappings JSON files, OpenAPI specifications, Postman collections, HAR (HTTP Archive) logs, WireMock request log JSON files and WireMock directories.
Imports run as background jobs. The endpoint will wait up to the configured sync timeout (PT3S - 3 seconds - by default) for the import to finish:
- If the import finishes successfully within the timeout, a
200is returned containing the import result. - If the import fails within the timeout, a
400is returned containing the errors. - If the import is still running when the timeout elapses, a
202is returned containing the job’s details, including a link that can be polled for the job’s status and outcome.
The sync timeout can be modified, or disabled entirely, by supplying an import config in the config part of a multipart request - see the syncTimeout field of the import config for details.
curl --request POST \
--url https://wmc.wiremockapi.cloud/v1/mock-apis/{mockApiId}/imports \
--header 'Authorization: <api-key>' \
--header 'Content-Type: */*' \
--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}/imports"
payload = "{\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}"
headers = {
"Authorization": "<api-key>",
"Content-Type": "*/*"
}
response = requests.post(url, data=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': '*/*'},
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}'
};
fetch('https://wmc.wiremockapi.cloud/v1/mock-apis/{mockApiId}/imports', 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}/imports",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "{\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}",
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: */*"
],
]);
$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}/imports"
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", "*/*")
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}/imports")
.header("Authorization", "<api-key>")
.header("Content-Type", "*/*")
.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}/imports")
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"] = '*/*'
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{
"mappings": [
{
"id": "7e6d6733-881e-416d-9f6c-bad8d5015d0f"
},
{
"id": "2791b6fe-bbbe-4102-a3fd-721fb9ba1557"
}
]
}{
"job": {
"id": "8e2f3641-5f0a-45a2-9d1b-39cf16b2d0e7",
"jobType": "multi-import",
"status": "RUNNING",
"started": "2024-09-05T10:20:46.143759190Z",
"links": {
"self": "/v1/mock-apis/0ozge/jobs/8e2f3641-5f0a-45a2-9d1b-39cf16b2d0e7"
}
}
}{
"errors": [
{
"title": "Invalid query parameter format",
"detail": "The offset parameter value must be a positive integer"
}
]
}Credentials are required to access this resource.Path Parameters
The ID of the Mock API
5 - 10"jjl8y"
Body
A JSON file containing WireMock stub mappings.
Show child attributes
Show child attributes
Response
Successfully imported. The import finished within the sync timeout, so the import result is returned directly