POST api/invoice/salesWithBuyerData

صورتحساب الکترونیکی نوع اول - الگوی فروش اطلاعات هویتی کامل خریدار نیاز است

Request Information

URI Parameters

None.

Body Parameters

اطلاعات صورتحساب

InvoiceSalesBuyerData
NameDescriptionTypeAdditional information
token

توکن (فقط برای سرویس نمایندگی)

uuid

یک GUID منحصر بفرد برای هر درخواست ارسالی

Required

internalId

کد داخلی صورتحساب

Required

no

شماره مسلسل

Required

dateTime

تاریخ و زمان صدور صورتحساب (شمسی یا میلادی)

Required

invoiceNetPrice

مجموع خالص فاکتور

Required

items

لیست اقلام فاکتور

Collection of InvoicesItem

Required

buyer

خریدار

BuyerData

Required

settlement

نحوه تسویه

SettlementType

Required

payment

مبلغ پرداختی نقدی فقط در نحوه تسویه (نقد/نسیه) اجباری می‌باشد

description

توضیحات فاکتور

invoiceIssue

موضوع صورتحساب (پیش فرض: جدید)

IInvoiceIssue

sourceInternalId

کد داخلی صورتحساب مرجع

send

ارسال به سازمان امورمالیاتی

Request Formats

application/json, text/json

Sample:
{
  "token": "sample string 1",
  "uuid": "sample string 2",
  "internalId": "sample string 3",
  "no": "sample string 4",
  "dateTime": "sample string 5",
  "invoiceNetPrice": 6.0,
  "items": [
    {
      "no": 1,
      "internalId": "sample string 2",
      "stuffId": "sample string 3",
      "description": "sample string 4",
      "qty": 5.0,
      "unit": "sample string 6",
      "unitPrice": 7.0,
      "discount": 8.0,
      "vatRate": 9,
      "otherTaxDescription": "sample string 10",
      "otherTaxRate": 11,
      "govTaxDescription": "sample string 12",
      "govTaxRate": 13
    },
    {
      "no": 1,
      "internalId": "sample string 2",
      "stuffId": "sample string 3",
      "description": "sample string 4",
      "qty": 5.0,
      "unit": "sample string 6",
      "unitPrice": 7.0,
      "discount": 8.0,
      "vatRate": 9,
      "otherTaxDescription": "sample string 10",
      "otherTaxRate": 11,
      "govTaxDescription": "sample string 12",
      "govTaxRate": 13
    }
  ],
  "buyer": {
    "type": 0,
    "nationalCode": "sample string 1",
    "economicCode": "sample string 2",
    "zipCode": "sample string 3",
    "name": "sample string 4",
    "mobile": "sample string 5",
    "address": "sample string 6",
    "phone": "sample string 7",
    "branchCode": 1
  },
  "settlement": 0,
  "payment": 7.0,
  "description": "sample string 8",
  "invoiceIssue": 0,
  "sourceInternalId": 1,
  "send": true
}

application/xml, text/xml

Sample:
<InvoiceSalesBuyerData xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/MegaPayHub.Models.Invoice">
  <buyer>
    <address>sample string 6</address>
    <branchCode>1</branchCode>
    <economicCode>sample string 2</economicCode>
    <mobile>sample string 5</mobile>
    <name>sample string 4</name>
    <nationalCode>sample string 1</nationalCode>
    <phone>sample string 7</phone>
    <type>Person</type>
    <zipCode>sample string 3</zipCode>
  </buyer>
  <dateTime>sample string 5</dateTime>
  <description>sample string 8</description>
  <internalId>sample string 3</internalId>
  <invoiceIssue>New</invoiceIssue>
  <invoiceNetPrice>6</invoiceNetPrice>
  <items>
    <InvoiceItem>
      <description>sample string 4</description>
      <discount>8</discount>
      <govTaxDescription>sample string 12</govTaxDescription>
      <govTaxRate>13</govTaxRate>
      <internalId>sample string 2</internalId>
      <no>1</no>
      <otherTaxDescription>sample string 10</otherTaxDescription>
      <otherTaxRate>11</otherTaxRate>
      <qty>5</qty>
      <stuffId>sample string 3</stuffId>
      <unit>sample string 6</unit>
      <unitPrice>7</unitPrice>
      <vatRate>9</vatRate>
    </InvoiceItem>
    <InvoiceItem>
      <description>sample string 4</description>
      <discount>8</discount>
      <govTaxDescription>sample string 12</govTaxDescription>
      <govTaxRate>13</govTaxRate>
      <internalId>sample string 2</internalId>
      <no>1</no>
      <otherTaxDescription>sample string 10</otherTaxDescription>
      <otherTaxRate>11</otherTaxRate>
      <qty>5</qty>
      <stuffId>sample string 3</stuffId>
      <unit>sample string 6</unit>
      <unitPrice>7</unitPrice>
      <vatRate>9</vatRate>
    </InvoiceItem>
  </items>
  <no>sample string 4</no>
  <payment>7</payment>
  <send>true</send>
  <settlement>Cash</settlement>
  <sourceInternalId>1</sourceInternalId>
  <token>sample string 1</token>
  <uuid>sample string 2</uuid>
</InvoiceSalesBuyerData>

application/x-www-form-urlencoded

Sample:

Sample not available.

Response Information

Resource Description

InvoiceReturn
NameDescriptionTypeAdditional information
megaPayId

کد پیگیری

taxId

شماره منحصر به فرد مالیاتی

status

وضعیت صورتحساب

InvoicePhases

error

شرح خطا

latestTaxId

آخرین شماره منحصر به فرد مالیاتی در صورتی که صورتحساب دارای "اصلاحی"، "ابطالی" یا "برگشت از فروش" باشد

mainTaxId

شماره منحصر به فرد مالیاتی صورتحساب مرجع در صورتی که موضوع صورتحساب "اصلی" نباشد

issue

موضوع صورتحساب

InvoiceIssues

internalId

کد داخلی

uuid

UUID

json

داده ارسالی به سامانه مؤدیان

Response Formats

application/json, text/json

Sample:
{
  "megaPayId": 1,
  "taxId": "sample string 1",
  "status": 0,
  "error": [
    "sample string 1",
    "sample string 2"
  ],
  "latestTaxId": "sample string 2",
  "mainTaxId": "sample string 3",
  "issue": 1,
  "internalId": "sample string 4",
  "uuid": "sample string 5",
  "json": {}
}

application/xml, text/xml

Sample:
<InvoiceReturn xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/MegaPayHub.Models.Invoice">
  <error xmlns:d2p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
    <d2p1:string>sample string 1</d2p1:string>
    <d2p1:string>sample string 2</d2p1:string>
  </error>
  <internalId>sample string 4</internalId>
  <issue>Main</issue>
  <json />
  <latestTaxId>sample string 2</latestTaxId>
  <mainTaxId>sample string 3</mainTaxId>
  <megaPayId>1</megaPayId>
  <status>AwaitingSend</status>
  <taxId>sample string 1</taxId>
  <uuid>sample string 5</uuid>
</InvoiceReturn>