openapi: 3.0.0 info: description: The Companies API allows developers to manage marketplace companies and their user memberships. title: Companies AI Embed Invoice API license: name: Apache License, Version 2.0 url: http://www.apache.org/licenses/LICENSE-2.0 version: v296.0-SNAPSHOT servers: - url: https://marketplace.appdirect.com/api - url: https://virtserver.swaggerhub.com tags: - name: Invoice x-displayName: Invoices paths: /billing/v1/companies/{companyId}/users/{userId}/invoices: get: description: List all of the invoices for the given user tags: - Invoice summary: List all invoices for a user operationId: resource_Other_readUserInvoices_GET parameters: - description: User's company UUID name: companyId in: path required: true schema: type: string - description: User UUID name: userId in: path required: true schema: type: string - description: Number of results to fetch. Used for paging. name: count in: query schema: type: integer default: 250 - description: Exclude invoices with no charges (free) name: excludeFree in: query schema: type: boolean - description: From date name: fromDate in: query schema: type: number - description: Sort field name: sortField in: query schema: type: string enum: - DATE - INVOICE_ID - TOTAL default: INVOICE_ID - description: Sort order name: sortOrder in: query schema: type: string enum: - ASC - DESC default: ASC - description: First result index. Used for paging. name: start in: query schema: type: integer default: 0 - description: Invoice status name: status in: query schema: type: string enum: - CARRIED - PAID - UNPAID - VOIDED - description: To date name: toDate in: query schema: type: number responses: '200': headers: X-Total-Count: schema: type: integer description: OK content: application/xml: schema: description: OK type: array items: $ref: '#/components/schemas/InvoiceListingWS' application/json: schema: description: OK type: array items: $ref: '#/components/schemas/InvoiceListingWS' examples: response: value: - invoiceId: 20 referenceNumber: null creationDate: 1481002410613 dueDate: 1481353200000 status: PAID total: 10 orderIds: - '2030' currency: USD user: id: a18c91e8-d5d5-4fb8-915c-726535a0bc8a href: http://appdirect/api/account/v1/users/a18c91e8-d5d5-4fb8-915c-726535a0bc8a company: id: 644eb32e-4afa-4699-9dae-5d3394320968 href: http://appdirect/api/account/v1/companies/644eb32e-4afa-4699-9dae-5d3394320968 links: - rel: user href: http://appdirect/api/account/v2/users/a18c91e8-d5d5-4fb8-915c-726535a0bc8a - rel: company href: http://appdirect/api/account/v2/companies/644eb32e-4afa-4699-9dae-5d3394320968 - rel: self href: http://appdirect/api/billing/v1/invoices/20 headers: examples: response: value: X-Total-Count: 1 '404': description: Not Found x-codeSamples: - lang: Shell + Curl source: "curl --request GET \\\n --url 'https://marketplace.appdirect.com/api/billing/v1/companies/%7BcompanyId%7D/users/%7BuserId%7D/invoices?count=SOME_INTEGER_VALUE&excludeFree=SOME_BOOLEAN_VALUE&fromDate=SOME_NUMBER_VALUE&sortField=SOME_STRING_VALUE&sortOrder=SOME_STRING_VALUE&start=SOME_INTEGER_VALUE&status=SOME_STRING_VALUE&toDate=SOME_NUMBER_VALUE'" - lang: Node + Request source: "const request = require('request');\n\nconst options = {\n method: 'GET',\n url: 'https://marketplace.appdirect.com/api/billing/v1/companies/%7BcompanyId%7D/users/%7BuserId%7D/invoices',\n qs: {\n count: 'SOME_INTEGER_VALUE',\n excludeFree: 'SOME_BOOLEAN_VALUE',\n fromDate: 'SOME_NUMBER_VALUE',\n sortField: 'SOME_STRING_VALUE',\n sortOrder: 'SOME_STRING_VALUE',\n start: 'SOME_INTEGER_VALUE',\n status: 'SOME_STRING_VALUE',\n toDate: 'SOME_NUMBER_VALUE'\n }\n};\n\nrequest(options, function (error, response, body) {\n if (error) throw new Error(error);\n\n console.log(body);\n});\n" - lang: Java + Okhttp source: "OkHttpClient client = new OkHttpClient();\n\nRequest request = new Request.Builder()\n .url(\"https://marketplace.appdirect.com/api/billing/v1/companies/%7BcompanyId%7D/users/%7BuserId%7D/invoices?count=SOME_INTEGER_VALUE&excludeFree=SOME_BOOLEAN_VALUE&fromDate=SOME_NUMBER_VALUE&sortField=SOME_STRING_VALUE&sortOrder=SOME_STRING_VALUE&start=SOME_INTEGER_VALUE&status=SOME_STRING_VALUE&toDate=SOME_NUMBER_VALUE\")\n .get()\n .build();\n\nResponse response = client.newCall(request).execute();" /billing/v1/companies/{companyId}/invoices: get: description: List all of the invoices for the given company tags: - Invoice summary: List all invoices for a company operationId: resource_Other_readCompanyInvoices_GET parameters: - description: Company UUID name: companyId in: path required: true schema: type: string - description: Number of results to fetch. Used for paging. name: count in: query schema: type: integer default: 250 - description: Exclude invoices with no charges (free) name: excludeFree in: query schema: type: boolean - description: From date name: fromDate in: query schema: type: number - description: Sort field name: sortField in: query schema: type: string enum: - DATE - INVOICE_ID - TOTAL default: INVOICE_ID - description: Sort order name: sortOrder in: query schema: type: string enum: - ASC - DESC default: DESC - description: First result index. Used for paging. name: start in: query schema: type: integer default: 0 - description: Invoice status name: status in: query schema: type: string enum: - CARRIED - PAID - UNPAID - VOIDED - description: To date name: toDate in: query schema: type: number responses: '200': description: OK content: application/json: schema: description: OK type: array items: $ref: '#/components/schemas/InvoiceListingWS' examples: response: value: - invoiceId: 20 referenceNumber: null creationDate: 1481002410613 dueDate: 1481353200000 status: PAID total: 10 orderIds: - '2030' currency: USD user: id: a18c91e8-d5d5-4fb8-915c-726535a0bc8a href: http://appdirect/api/account/v1/users/a18c91e8-d5d5-4fb8-915c-726535a0bc8a company: id: 644eb32e-4afa-4699-9dae-5d3394320968 href: http://appdirect/api/account/v1/companies/644eb32e-4afa-4699-9dae-5d3394320968 links: - rel: user href: http://appdirect/api/account/v2/users/a18c91e8-d5d5-4fb8-915c-726535a0bc8a - rel: company href: http://appdirect/api/account/v2/companies/644eb32e-4afa-4699-9dae-5d3394320968 - rel: self href: http://appdirect/api/billing/v1/invoices/20 application/xml: schema: description: OK type: array items: $ref: '#/components/schemas/InvoiceListingWS' '404': description: Not Found x-codeSamples: - lang: Shell + Curl source: "curl --request GET \\\n --url 'https://marketplace.appdirect.com/api/billing/v1/companies/%7BcompanyId%7D/invoices?count=SOME_INTEGER_VALUE&excludeFree=SOME_BOOLEAN_VALUE&fromDate=SOME_NUMBER_VALUE&sortField=SOME_STRING_VALUE&sortOrder=SOME_STRING_VALUE&start=SOME_INTEGER_VALUE&status=SOME_STRING_VALUE&toDate=SOME_NUMBER_VALUE'" - lang: Node + Request source: "const request = require('request');\n\nconst options = {\n method: 'GET',\n url: 'https://marketplace.appdirect.com/api/billing/v1/companies/%7BcompanyId%7D/invoices',\n qs: {\n count: 'SOME_INTEGER_VALUE',\n excludeFree: 'SOME_BOOLEAN_VALUE',\n fromDate: 'SOME_NUMBER_VALUE',\n sortField: 'SOME_STRING_VALUE',\n sortOrder: 'SOME_STRING_VALUE',\n start: 'SOME_INTEGER_VALUE',\n status: 'SOME_STRING_VALUE',\n toDate: 'SOME_NUMBER_VALUE'\n }\n};\n\nrequest(options, function (error, response, body) {\n if (error) throw new Error(error);\n\n console.log(body);\n});\n" - lang: Java + Okhttp source: "OkHttpClient client = new OkHttpClient();\n\nRequest request = new Request.Builder()\n .url(\"https://marketplace.appdirect.com/api/billing/v1/companies/%7BcompanyId%7D/invoices?count=SOME_INTEGER_VALUE&excludeFree=SOME_BOOLEAN_VALUE&fromDate=SOME_NUMBER_VALUE&sortField=SOME_STRING_VALUE&sortOrder=SOME_STRING_VALUE&start=SOME_INTEGER_VALUE&status=SOME_STRING_VALUE&toDate=SOME_NUMBER_VALUE\")\n .get()\n .build();\n\nResponse response = client.newCall(request).execute();" /billing/v1/invoices/{invoiceNumber}/payments: get: description: List all payment data for an invoice tags: - Invoice summary: List All Invoice Payments operationId: resource_Other_readInvoicePayments_GET parameters: - description: Invoice number. name: invoiceNumber in: path required: true schema: type: integer - description: Number of results to fetch. Used for paging. name: count in: query schema: type: string default: '250' - description: From date. name: fromDate in: query schema: type: number - description: Payment method. name: method in: query schema: type: string enum: - ADP_INVOICE - ARIBAPAY - BT_BILL - CLICKANDBUY - CLOUDFOUNDRY - CREDIT_CARD - CUMULA_BILL - DTAG - EXTERNAL_INVOICE - KREDITKARTE - LASTSCHRIFT_MRNEXNET - MANO_TEO_BILL - MANUAL - MARKETPLACE_CREDITS - NETS_ARVATO_INVOICE - NEXTEL - PAYPAL - ROGERS_CC_DTMF - ROGERS_CC_POS - SNAP - TBILL - THISTLE - TOICLEARING - description: Payment result. name: result in: query schema: type: string enum: - FAILED - GATEWAY_NOT_AVAILABLE - MANUAL - SUCCESSFUL - description: Sort field. name: sortField in: query schema: type: string enum: - AMOUNT - DATE - PAYMENT_ID default: PAYMENT_ID - description: Sort order. name: sortOrder in: query schema: type: string enum: - ASC - DESC default: ASC - description: First result index. Used for paging. name: start in: query schema: type: string default: '0' - description: To date. name: toDate in: query schema: type: number responses: '200': description: OK content: application/json: schema: description: OK type: array items: $ref: '#/components/schemas/PaymentWS' examples: response: value: - paymentNumber: 2 date: 1481003382652 amount: 10 currency: USD result: SUCCESSFUL method: CREDIT_CARD transactionId: 123456abcdef user: id: 72ae0d01-8036-4203-95c0-4c2fb424ff6d href: http://appdirect/api/account/v1/users/72ae0d01-8036-4203-95c0-4c2fb424ff6d company: id: 5aae5a52-cec3-4cb2-87b4-6352624d2a31 href: http://appdirect/api/account/v1/companies/5aae5a52-cec3-4cb2-87b4-6352624d2a31 gatewayResponse: avs: true cvv: true code: null message: null links: - rel: self href: http://appdirect/api/billing/v1/payments/2 application/xml: schema: description: OK type: array items: $ref: '#/components/schemas/PaymentWS' '204': description: No Content content: application/json: schema: description: No Content type: array items: $ref: '#/components/schemas/PaymentWS' application/xml: schema: description: No Content type: array items: $ref: '#/components/schemas/PaymentWS' '401': description: Unauthorized '404': description: Not Found x-codeSamples: - lang: Shell + Curl source: "curl --request GET \\\n --url 'https://marketplace.appdirect.com/api/billing/v1/invoices/%7BinvoiceNumber%7D/payments?count=SOME_STRING_VALUE&fromDate=SOME_NUMBER_VALUE&method=SOME_STRING_VALUE&result=SOME_STRING_VALUE&sortField=SOME_STRING_VALUE&sortOrder=SOME_STRING_VALUE&start=SOME_STRING_VALUE&toDate=SOME_NUMBER_VALUE'" - lang: Node + Request source: "const request = require('request');\n\nconst options = {\n method: 'GET',\n url: 'https://marketplace.appdirect.com/api/billing/v1/invoices/%7BinvoiceNumber%7D/payments',\n qs: {\n count: 'SOME_STRING_VALUE',\n fromDate: 'SOME_NUMBER_VALUE',\n method: 'SOME_STRING_VALUE',\n result: 'SOME_STRING_VALUE',\n sortField: 'SOME_STRING_VALUE',\n sortOrder: 'SOME_STRING_VALUE',\n start: 'SOME_STRING_VALUE',\n toDate: 'SOME_NUMBER_VALUE'\n }\n};\n\nrequest(options, function (error, response, body) {\n if (error) throw new Error(error);\n\n console.log(body);\n});\n" - lang: Java + Okhttp source: "OkHttpClient client = new OkHttpClient();\n\nRequest request = new Request.Builder()\n .url(\"https://marketplace.appdirect.com/api/billing/v1/invoices/%7BinvoiceNumber%7D/payments?count=SOME_STRING_VALUE&fromDate=SOME_NUMBER_VALUE&method=SOME_STRING_VALUE&result=SOME_STRING_VALUE&sortField=SOME_STRING_VALUE&sortOrder=SOME_STRING_VALUE&start=SOME_STRING_VALUE&toDate=SOME_NUMBER_VALUE\")\n .get()\n .build();\n\nResponse response = client.newCall(request).execute();" post: description: If the invoice is unpaid, will process the payment and return the result. Will return an exception otherwise tags: - Invoice summary: Pay an Invoice operationId: resource_Other_payInvoice_POST parameters: - description: The unique identifier for the invoice provided by the channel. name: invoiceNumber in: path required: true schema: type: integer requestBody: content: application/json: schema: $ref: '#/components/schemas/PaymentWS' application/xml: schema: $ref: '#/components/schemas/PaymentWS' description: Payment data object. responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/PaymentWS' application/xml: schema: $ref: '#/components/schemas/PaymentWS' '400': description: Bad Request '401': description: Unauthorized '404': description: Not Found '409': description: Conflict x-codeSamples: - lang: Shell + Curl source: "curl --request POST \\\n --url https://marketplace.appdirect.com/api/billing/v1/invoices/%7BinvoiceNumber%7D/payments \\\n --header 'content-type: application/json' \\\n --data '{\"links\":[{\"href\":\"...\",\"rel\":\"...\"},{\"href\":\"...\",\"rel\":\"...\"}],\"amount\":12345,\"company\":{\"href\":\"...\",\"id\":\"...\"},\"currency\":\"INR\",\"date\":12345,\"gatewayResponse\":{\"avs\":true,\"code\":\"...\",\"cvv\":true,\"message\":\"...\"},\"id\":12345,\"method\":\"PAYPAL\",\"result\":\"GATEWAY_NOT_AVAILABLE\",\"transactionId\":\"...\",\"user\":{\"href\":\"...\",\"id\":\"...\"}}'" - lang: Node + Request source: "const request = require('request');\n\nconst options = {\n method: 'POST',\n url: 'https://marketplace.appdirect.com/api/billing/v1/invoices/%7BinvoiceNumber%7D/payments',\n headers: {'content-type': 'application/json'},\n body: {\n links: [{href: '...', rel: '...'}, {href: '...', rel: '...'}],\n amount: 12345,\n company: {href: '...', id: '...'},\n currency: 'INR',\n date: 12345,\n gatewayResponse: {avs: true, code: '...', cvv: true, message: '...'},\n id: 12345,\n method: 'PAYPAL',\n result: 'GATEWAY_NOT_AVAILABLE',\n transactionId: '...',\n user: {href: '...', id: '...'}\n },\n json: true\n};\n\nrequest(options, function (error, response, body) {\n if (error) throw new Error(error);\n\n console.log(body);\n});\n" - lang: Java + Okhttp source: "OkHttpClient client = new OkHttpClient();\n\nMediaType mediaType = MediaType.parse(\"application/json\");\nRequestBody body = RequestBody.create(mediaType, \"{\\\"links\\\":[{\\\"href\\\":\\\"...\\\",\\\"rel\\\":\\\"...\\\"},{\\\"href\\\":\\\"...\\\",\\\"rel\\\":\\\"...\\\"}],\\\"amount\\\":12345,\\\"company\\\":{\\\"href\\\":\\\"...\\\",\\\"id\\\":\\\"...\\\"},\\\"currency\\\":\\\"INR\\\",\\\"date\\\":12345,\\\"gatewayResponse\\\":{\\\"avs\\\":true,\\\"code\\\":\\\"...\\\",\\\"cvv\\\":true,\\\"message\\\":\\\"...\\\"},\\\"id\\\":12345,\\\"method\\\":\\\"PAYPAL\\\",\\\"result\\\":\\\"GATEWAY_NOT_AVAILABLE\\\",\\\"transactionId\\\":\\\"...\\\",\\\"user\\\":{\\\"href\\\":\\\"...\\\",\\\"id\\\":\\\"...\\\"}}\");\nRequest request = new Request.Builder()\n .url(\"https://marketplace.appdirect.com/api/billing/v1/invoices/%7BinvoiceNumber%7D/payments\")\n .post(body)\n .addHeader(\"content-type\", \"application/json\")\n .build();\n\nResponse response = client.newCall(request).execute();" /billing/v1/invoices: get: description: List all invoice data tags: - Invoice summary: List All Invoices operationId: resource_Other_readInvoices_GET parameters: - description: Number of results to fetch. Used for paging. name: count in: query schema: type: string default: '250' - description: Exclude invoices with no charges. name: excludeFree in: query schema: type: boolean - description: From date. name: fromDate in: query schema: type: number - description: Sort field. name: sortField in: query schema: type: string enum: - DATE - INVOICE_ID - TOTAL default: INVOICE_ID - description: Sort order. name: sortOrder in: query schema: type: string enum: - ASC - DESC default: ASC - description: First result index. Used for paging. name: start in: query schema: type: string default: '0' - description: Invoice status. name: status in: query schema: type: string enum: - CARRIED - PAID - UNPAID - VOIDED - description: To date. name: toDate in: query schema: type: number - description: Filter invoices with purchases made by user with this role. name: buyerRole in: query schema: type: string enum: - ALL - CUSTOMER - RESELLER - SALES_SUPPORT responses: '200': description: OK content: application/json: schema: description: OK type: array items: $ref: '#/components/schemas/InvoiceListingWS' examples: response: value: - invoiceId: 1 referenceNumber: null creationDate: 1481003387753 dueDate: 1481353200000 status: PAID total: 10 orderIds: - '2030' currency: USD user: id: eefdf767-9197-4402-ba0d-614cfec17ee1 href: http://appdirect/api/account/v1/users/eefdf767-9197-4402-ba0d-614cfec17ee1 company: id: 5a95127f-4b06-459c-bdb1-da80568de2fd href: http://appdirect/api/account/v1/companies/5a95127f-4b06-459c-bdb1-da80568de2fd links: - rel: user href: http://appdirect/api/account/v2/users/eefdf767-9197-4402-ba0d-614cfec17ee1 - rel: company href: http://appdirect/api/account/v2/companies/5a95127f-4b06-459c-bdb1-da80568de2fd - rel: self href: http://appdirect/api/billing/v1/invoices/1 application/xml: schema: description: OK type: array items: $ref: '#/components/schemas/InvoiceListingWS' '204': description: No Content content: application/json: schema: description: No Content type: array items: $ref: '#/components/schemas/InvoiceListingWS' application/xml: schema: description: No Content type: array items: $ref: '#/components/schemas/InvoiceListingWS' '401': description: Unauthorized '404': description: Not Found x-codeSamples: - lang: Shell + Curl source: "curl --request GET \\\n --url 'https://marketplace.appdirect.com/api/billing/v1/invoices?count=SOME_STRING_VALUE&excludeFree=SOME_BOOLEAN_VALUE&fromDate=SOME_NUMBER_VALUE&sortField=SOME_STRING_VALUE&sortOrder=SOME_STRING_VALUE&start=SOME_STRING_VALUE&status=SOME_STRING_VALUE&toDate=SOME_NUMBER_VALUE&buyerRole=SOME_STRING_VALUE'" - lang: Node + Request source: "const request = require('request');\n\nconst options = {\n method: 'GET',\n url: 'https://marketplace.appdirect.com/api/billing/v1/invoices',\n qs: {\n count: 'SOME_STRING_VALUE',\n excludeFree: 'SOME_BOOLEAN_VALUE',\n fromDate: 'SOME_NUMBER_VALUE',\n sortField: 'SOME_STRING_VALUE',\n sortOrder: 'SOME_STRING_VALUE',\n start: 'SOME_STRING_VALUE',\n status: 'SOME_STRING_VALUE',\n toDate: 'SOME_NUMBER_VALUE',\n buyerRole: 'SOME_STRING_VALUE'\n }\n};\n\nrequest(options, function (error, response, body) {\n if (error) throw new Error(error);\n\n console.log(body);\n});\n" - lang: Java + Okhttp source: "OkHttpClient client = new OkHttpClient();\n\nRequest request = new Request.Builder()\n .url(\"https://marketplace.appdirect.com/api/billing/v1/invoices?count=SOME_STRING_VALUE&excludeFree=SOME_BOOLEAN_VALUE&fromDate=SOME_NUMBER_VALUE&sortField=SOME_STRING_VALUE&sortOrder=SOME_STRING_VALUE&start=SOME_STRING_VALUE&status=SOME_STRING_VALUE&toDate=SOME_NUMBER_VALUE&buyerRole=SOME_STRING_VALUE\")\n .get()\n .build();\n\nResponse response = client.newCall(request).execute();" /billing/v1/invoices/{invoiceNumber}: get: description: Read an invoice tags: - Invoice summary: Retrieve an Invoice operationId: resource_Other_readInvoice_GET parameters: - description: The unique identifier for the invoice provided by the channel. name: invoiceNumber in: path required: true schema: type: integer responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/InvoiceWS' examples: response: value: invoiceId: 1 referenceNumber: null creationDate: 1481003386696 dueDate: 1481353200000 status: PAID total: 10 orderIds: - '2030' currency: USD user: id: f090d591-8909-43ed-883d-71fb09ef3941 href: http://appdirect/api/account/v1/users/f090d591-8909-43ed-883d-71fb09ef3941 company: id: ba550905-e0ea-48f2-a04f-0763e999d89c href: http://appdirect/api/account/v1/companies/ba550905-e0ea-48f2-a04f-0763e999d89c invoiceLines: - id: 23 type: ITEM itemId: null description: Invoice Line description quantity: 1 price: null percentage: null total: null periodStart: null periodEnd: null paymentPlanId: 1367 editionId: 1210 productId: 788 pricingUnit: USER delegatedToInvoice: null includedInvoices: null links: - rel: user href: http://appdirect/api/account/v2/users/f090d591-8909-43ed-883d-71fb09ef3941 - rel: company href: http://appdirect/api/account/v2/companies/ba550905-e0ea-48f2-a04f-0763e999d89c - rel: self href: http://appdirect/api/billing/v1/invoices/1 application/xml: schema: $ref: '#/components/schemas/InvoiceWS' '401': description: Unauthorized '404': description: Not Found x-codeSamples: - lang: Shell + Curl source: "curl --request GET \\\n --url https://marketplace.appdirect.com/api/billing/v1/invoices/%7BinvoiceNumber%7D" - lang: Node + Request source: "const request = require('request');\n\nconst options = {\n method: 'GET',\n url: 'https://marketplace.appdirect.com/api/billing/v1/invoices/%7BinvoiceNumber%7D'\n};\n\nrequest(options, function (error, response, body) {\n if (error) throw new Error(error);\n\n console.log(body);\n});\n" - lang: Java + Okhttp source: "OkHttpClient client = new OkHttpClient();\n\nRequest request = new Request.Builder()\n .url(\"https://marketplace.appdirect.com/api/billing/v1/invoices/%7BinvoiceNumber%7D\")\n .get()\n .build();\n\nResponse response = client.newCall(request).execute();" patch: x-appdirect-visible: false description: Currently only used to void an invoice by updating the invoice status tags: - Invoice summary: Patch method to partially update an invoice operationId: resource_Other_patchInvoice_PATCH parameters: - description: The unique identifier of the invoice that should be patched. name: invoiceNumber in: path required: true schema: type: integer requestBody: content: application/json: schema: $ref: '#/components/schemas/InvoiceWS' application/xml: schema: $ref: '#/components/schemas/InvoiceWS' responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/InvoiceWS' application/xml: schema: $ref: '#/components/schemas/InvoiceWS' '400': description: Bad Request '401': description: Unauthorized '404': description: Not Found x-codeSamples: - lang: Shell + Curl source: "curl --request PATCH \\\n --url https://marketplace.appdirect.com/api/billing/v1/invoices/%7BinvoiceNumber%7D \\\n --header 'content-type: application/json' \\\n --data '{\"links\":[{\"href\":\"...\",\"rel\":\"...\"},{\"href\":\"...\",\"rel\":\"...\"}],\"company\":{\"href\":\"...\",\"id\":\"...\"},\"creationDate\":12345,\"currency\":\"KRW\",\"dueDate\":12345,\"invoiceId\":12345,\"referenceNumber\":\"...\",\"status\":\"VOIDED\",\"total\":12345,\"user\":{\"href\":\"...\",\"id\":\"...\"},\"orderIds\":[\"1234\"],\"delegatedToInvoice\":{\"href\":\"...\",\"id\":\"...\"},\"includedInvoices\":[{\"href\":\"...\",\"id\":\"...\"},{\"href\":\"...\",\"id\":\"...\"}],\"invoiceLines\":[{\"description\":\"...\",\"id\":12345,\"itemId\":12345,\"percentage\":12345,\"periodEnd\":12345,\"periodStart\":12345,\"price\":12345,\"quantity\":12345,\"total\":12345,\"type\":\"ITEM\"},{\"description\":\"...\",\"id\":12345,\"itemId\":12345,\"percentage\":12345,\"periodEnd\":12345,\"periodStart\":12345,\"price\":12345,\"quantity\":12345,\"total\":12345,\"type\":\"TAX\"}]}'" - lang: Node + Request source: "const request = require('request');\n\nconst options = {\n method: 'PATCH',\n url: 'https://marketplace.appdirect.com/api/billing/v1/invoices/%7BinvoiceNumber%7D',\n headers: {'content-type': 'application/json'},\n body: {\n links: [{href: '...', rel: '...'}, {href: '...', rel: '...'}],\n company: {href: '...', id: '...'},\n creationDate: 12345,\n currency: 'KRW',\n dueDate: 12345,\n invoiceId: 12345,\n referenceNumber: '...',\n status: 'VOIDED',\n total: 12345,\n user: {href: '...', id: '...'},\n orderIds: ['1234'],\n delegatedToInvoice: {href: '...', id: '...'},\n includedInvoices: [{href: '...', id: '...'}, {href: '...', id: '...'}],\n invoiceLines: [\n {\n description: '...',\n id: 12345,\n itemId: 12345,\n percentage: 12345,\n periodEnd: 12345,\n periodStart: 12345,\n price: 12345,\n quantity: 12345,\n total: 12345,\n type: 'ITEM'\n },\n {\n description: '...',\n id: 12345,\n itemId: 12345,\n percentage: 12345,\n periodEnd: 12345,\n periodStart: 12345,\n price: 12345,\n quantity: 12345,\n total: 12345,\n type: 'TAX'\n }\n ]\n },\n json: true\n};\n\nrequest(options, function (error, response, body) {\n if (error) throw new Error(error);\n\n console.log(body);\n});\n" - lang: Java + Okhttp source: "OkHttpClient client = new OkHttpClient();\n\nMediaType mediaType = MediaType.parse(\"application/json\");\nRequestBody body = RequestBody.create(mediaType, \"{\\\"links\\\":[{\\\"href\\\":\\\"...\\\",\\\"rel\\\":\\\"...\\\"},{\\\"href\\\":\\\"...\\\",\\\"rel\\\":\\\"...\\\"}],\\\"company\\\":{\\\"href\\\":\\\"...\\\",\\\"id\\\":\\\"...\\\"},\\\"creationDate\\\":12345,\\\"currency\\\":\\\"KRW\\\",\\\"dueDate\\\":12345,\\\"invoiceId\\\":12345,\\\"referenceNumber\\\":\\\"...\\\",\\\"status\\\":\\\"VOIDED\\\",\\\"total\\\":12345,\\\"user\\\":{\\\"href\\\":\\\"...\\\",\\\"id\\\":\\\"...\\\"},\\\"orderIds\\\":[\\\"1234\\\"],\\\"delegatedToInvoice\\\":{\\\"href\\\":\\\"...\\\",\\\"id\\\":\\\"...\\\"},\\\"includedInvoices\\\":[{\\\"href\\\":\\\"...\\\",\\\"id\\\":\\\"...\\\"},{\\\"href\\\":\\\"...\\\",\\\"id\\\":\\\"...\\\"}],\\\"invoiceLines\\\":[{\\\"description\\\":\\\"...\\\",\\\"id\\\":12345,\\\"itemId\\\":12345,\\\"percentage\\\":12345,\\\"periodEnd\\\":12345,\\\"periodStart\\\":12345,\\\"price\\\":12345,\\\"quantity\\\":12345,\\\"total\\\":12345,\\\"type\\\":\\\"ITEM\\\"},{\\\"description\\\":\\\"...\\\",\\\"id\\\":12345,\\\"itemId\\\":12345,\\\"percentage\\\":12345,\\\"periodEnd\\\":12345,\\\"periodStart\\\":12345,\\\"price\\\":12345,\\\"quantity\\\":12345,\\\"total\\\":12345,\\\"type\\\":\\\"TAX\\\"}]}\");\nRequest request = new Request.Builder()\n .url(\"https://marketplace.appdirect.com/api/billing/v1/invoices/%7BinvoiceNumber%7D\")\n .patch(body)\n .addHeader(\"content-type\", \"application/json\")\n .build();\n\nResponse response = client.newCall(request).execute();" components: schemas: GatewayResponseWS: type: object title: GatewayResponse properties: avs: description: True if address is validated. type: boolean code: description: Code. type: string nullable: true cvv: description: True if credit card is validated. type: boolean message: description: Message. type: string nullable: true example: avs: true code: '...' cvv: true message: '...' SaleRepUserWS: type: object title: SaleRepUser properties: uuid: type: string nullable: true name: type: string nullable: true isReseller: type: boolean isSalesSupport: type: boolean example: uuid: fd94512f-7fd6-4063-bb8c-bec18ba6f509 name: Sample Reseller User isReseller: true isSalesSupport: false nullable: true PaymentMethod: type: string description: The supported payment methods title: PaymentMethod enum: - CREDIT_CARD - PAYPAL - MANUAL - EXTERNAL_INVOICE - MARKETPLACE_CREDITS SaleRepCompanyWS: type: object title: SaleRepCompany properties: uuid: type: string nullable: true name: type: string nullable: true isReseller: type: boolean isSalesSupport: type: boolean example: uuid: 36f631b9-caef-4f19-be41-e70173f17f0d name: Sample Reseller isReseller: true isSalesSupport: false nullable: true InvoiceStatus: type: string title: InvoiceStatus enum: - PAID - UNPAID - CARRIED - VOIDED InvoiceLineWS: type: object title: InvoiceLine properties: description: description: Description type: string id: description: ID type: number nullable: true itemId: description: 'Deprecated: Item ID' type: number nullable: true percentage: description: Percentage type: number nullable: true periodEnd: description: Period end type: number nullable: true periodStart: description: Period start type: number nullable: true price: description: Item price type: number nullable: true quantity: description: Quantity type: number nullable: true total: description: Total type: number nullable: true type: $ref: '#/components/schemas/InvoiceLineTypeWS' paymentPlanId: description: Payment Plan ID type: number nullable: true editionId: description: Edition ID type: number nullable: true productId: description: Product ID type: number nullable: true pricingUnit: description: Pricing Unit type: string nullable: true vendor: $ref: '#/components/schemas/VendorWS' saleRepCompany: $ref: '#/components/schemas/SaleRepCompanyWS' saleRepUser: $ref: '#/components/schemas/SaleRepUserWS' example: description: '...' id: 12345 itemId: 12345 percentage: 12345 periodEnd: 12345 periodStart: 12345 price: 12345 quantity: 12345 total: 12345 orderIds: - '12345' type: SUB_ACCOUNT vendor: uuid: 3ea46469-36a7-4216-966b-5f0c61c72faa name: Sample Vendor saleRepCompany: uuid: 36f631b9-caef-4f19-be41-e70173f17f0d name: Sample Reseller isReseller: true isSalesSupport: true saleRepUser: uuid: fd94512f-7fd6-4063-bb8c-bec18ba6f509 name: Sample Reseller User isReseller: true isSalesSupport: true InvoiceLineTypeWS: type: string title: InvoiceLineType enum: - ITEM - DISCOUNT - TAX - DELEGATED_INVOICE - TERMINATION_FEE - SUB_ACCOUNT nullable: true InvoiceListingWS: allOf: - $ref: '#/components/schemas/ResourceSupport' - type: object title: InvoiceListing properties: company: $ref: '#/components/schemas/LinkWS' creationDate: description: Creation date for the invoice. type: number nullable: true orderIds: type: array description: Array of Order IDs items: type: string currency: $ref: '#/components/schemas/Currency' dueDate: description: Due date for the invoice. type: number nullable: true invoiceId: description: Invoice ID. type: number nullable: true referenceNumber: description: Reference number. type: string nullable: true status: $ref: '#/components/schemas/InvoiceStatus' total: description: Invoice total. type: number nullable: true user: $ref: '#/components/schemas/LinkWS' example: company: href: '...' id: '...' creationDate: 12345 currency: DKK dueDate: 12345 invoiceId: 12345 links: - href: '...' rel: '...' - href: '...' rel: '...' referenceNumber: '...' status: PAID total: 12345 user: href: '...' id: '...' LinkWS: type: object title: LinkWS properties: href: type: string id: type: string example: href: '...' id: '...' nullable: true Link: type: object title: Link properties: href: type: string rel: type: string example: href: '...' rel: '...' nullable: true PaymentWS: allOf: - $ref: '#/components/schemas/ResourceSupport' - type: object title: Payment properties: amount: description: Payment amount. type: number nullable: true company: $ref: '#/components/schemas/LinkWS' currency: $ref: '#/components/schemas/Currency' date: description: Payment date. type: number nullable: true gatewayResponse: $ref: '#/components/schemas/GatewayResponseWS' id: description: Payment number. type: number nullable: true method: $ref: '#/components/schemas/PaymentMethod' result: $ref: '#/components/schemas/PaymentResult' transactionId: description: Transaction ID. type: string nullable: true user: $ref: '#/components/schemas/LinkWS' example: amount: 12345 company: href: '...' id: '...' currency: INR date: 12345 gatewayResponse: avs: true code: '...' cvv: true message: '...' id: 12345 links: - href: '...' rel: '...' - href: '...' rel: '...' method: PAYPAL result: GATEWAY_NOT_AVAILABLE transactionId: '...' user: href: '...' id: '...' InvoiceWS: allOf: - $ref: '#/components/schemas/InvoiceListingWS' - type: object title: Invoice properties: delegatedToInvoice: $ref: '#/components/schemas/LinkWS' includedInvoices: description: List of links to the included invoices type: array items: $ref: '#/components/schemas/LinkWS' nullable: true invoiceLines: description: List of Invoice lines type: array items: $ref: '#/components/schemas/InvoiceLineWS' example: company: href: '...' id: '...' orderIds: - '1234' creationDate: 12345 currency: KRW delegatedToInvoice: href: '...' id: '...' dueDate: 12345 includedInvoices: - href: '...' id: '...' - href: '...' id: '...' invoiceId: 12345 invoiceLines: - description: '...' id: 12345 itemId: 12345 percentage: 12345 periodEnd: 12345 periodStart: 12345 price: 12345 quantity: 12345 total: 12345 type: ITEM - description: '...' id: 12345 itemId: 12345 percentage: 12345 periodEnd: 12345 periodStart: 12345 price: 12345 quantity: 12345 total: 12345 type: TAX links: - href: '...' rel: '...' - href: '...' rel: '...' referenceNumber: '...' status: VOIDED total: 12345 user: href: '...' id: '...' ResourceSupport: type: object title: ResourceSupport description: Resource links properties: links: type: array description: Resource links items: $ref: '#/components/schemas/Link' example: links: - href: '...' rel: '...' - href: '...' rel: '...' nullable: true Currency: description: Supported currencies for the system type: string title: Currency enum: - USD - CAD - EUR - JPY - GBP - KRW - CHF - SEK - SGD - MYR - AUD - MXN - INR - BRL - DKK - NZD - NOK - ZAR - PHP - CNY - SAR - GTQ - IDR - ARS - COP - PEN default: USD PaymentResult: type: string title: PaymentResult enum: - SUCCESSFUL - FAILED - GATEWAY_NOT_AVAILABLE - MANUAL VendorWS: type: object title: Vendor properties: uuid: type: string nullable: true name: type: string nullable: true example: uuid: 3ea46469-36a7-4216-966b-5f0c61c72faa name: Sample Vendor nullable: true