BillingPaymentsCrypto
BillingPaymentsCrypto
  • Getting Started
    • 👋 Welcome
    • 🔑 Sandbox credentials
    • 🏁 Getting Started
    • 📨 Webhooks
  • Payments API Reference
LogoLogo
Payments API ReferenceBilling

Create tax document

POST
/api/v1/billing/organizations/:organizationId/merchants/:merchantId/documents
POST
/api/v1/billing/organizations/:organizationId/merchants/:merchantId/documents
1curl -X POST https://api.koywe.com/api/v1/billing/organizations/org_12345/merchants/mer_67890/documents \
2 -H "Authorization: Bearer <token>" \
3 -H "Content-Type: application/json" \
4 -d '{
5 "documentTypeId": "string",
6 "country": "AR",
7 "currency": "string",
8 "items": [
9 {
10 "description": "string",
11 "quantity": 1.1,
12 "unitPrice": 1.1,
13 "unitMeasure": "string"
14 }
15 ],
16 "paymentCondition": "0"
17}'
Try it
201Created
1{
2 "documentId": "string",
3 "header": {
4 "documentTypeId": "string",
5 "documentTypeTaxbureau": "string",
6 "documentNumber": 1.1,
7 "receivedIssuedFlag": true,
8 "taxbureauValidationStatus": 1.1,
9 "issueDate": "string",
10 "issuerTaxIdCode": "string",
11 "issuerTaxIdType": "string",
12 "issuerLegalName": "string",
13 "issuerAddress": "string",
14 "issuerDistrict": "string",
15 "issuerCity": "string",
16 "issuerState": "string",
17 "issuerCountry": "string",
18 "issuerPhone": "string",
19 "issuerActivity": "string",
20 "issuerPostalcode": "string",
21 "receiverTaxIdCode": "string",
22 "receiverTaxIdType": "string",
23 "receiverLegalName": "string",
24 "receiverAddress": "string",
25 "receiverDistrict": "string",
26 "receiverCity": "string",
27 "receiverState": "string",
28 "receiverCountry": "string",
29 "receiverPhone": "string",
30 "receiverActivity": "string",
31 "receiverPostalcode": "string",
32 "paymentConditions": "string",
33 "currencySymbol": "string",
34 "transportationDocType": 1.1,
35 "transportationDocBilling": 1.1,
36 "taxPeriodMonth": 1.1,
37 "taxPeriodYear": 1.1,
38 "documentStatus": 1.1,
39 "taxbureauSendId": 1.1,
40 "taxbureauSendDate": "string",
41 "taxbureauSendStatus": 1.1,
42 "taxbureauValidationComments": "string",
43 "saleModality": 1.1,
44 "saleClause": 1.1,
45 "contactId": "string"
46 },
47 "details": [
48 {
49 "quantity": 1.1,
50 "lineDescription": "string",
51 "unitMeasure": "string",
52 "unitPrice": 1.1,
53 "vatStatus": 1.1,
54 "longDescription": "string",
55 "modifierAmount": 1.1,
56 "totalTaxes": 1.1,
57 "modifierPercentage": 1.1,
58 "totalAmountLine": 1.1,
59 "sku": "string",
60 "taxes": [
61 "string"
62 ]
63 }
64 ],
65 "totals": {},
66 "electronicDocument": {
67 "documentXml": "string",
68 "documentPdf": "string",
69 "stampImg": "string"
70 },
71 "references": [
72 {
73 "documentTypeId": "string",
74 "documentTypeTaxbureau": "string",
75 "referenceNumber": "string",
76 "issueDate": "string",
77 "referenceType": 1.1,
78 "description": "string"
79 }
80 ],
81 "paymentLink": {}
82}
Creates a new tax document with issuer, receiver, items and totals information
Was this page helpful?
Previous

Get tax document details

Next
Built with
Get tax document details
Creates a new tax document with issuer, receiver, items and totals information

Authentication

AuthorizationBearer
Bearer authentication of the form `Bearer <token>`, where token is your auth token.

Path parameters

merchantIdstringRequired
Merchant ID
organizationIdstringRequired
Organization ID

Request

Document data to create
documentTypeIdstringRequired

Document type identifier (Provider specific or internal mapping)

countryenumRequired
Country where the document is issued
currencystringRequired

Currency code (e.g., USD, CLP)

itemslist of objectsRequired
List of items in the document
paymentConditionstringRequiredDefaults to 0

Payment condition description. 0 = cash, 30 = 30 days, 0,30 = 50% cash, 50% in 30 days, 0,30,60 = 33% cash, 33% in 30 days, 34% in 60 days.

contactIdstringOptional
ID of the contact (receiver) associated with this document. Optional for non-nominative documents
referencestringOptional
Reference information
notesstringOptional
General notes
exchangeRatedoubleOptional
Exchange rate value (if currency is foreign)
serviceTypestringOptional
Service type information
paymentDueDatestringOptional
Payment due date (YYYY-MM-DD)
issueDatestringOptional
Issue date (YYYY-MM-DD), defaults to today if omitted
paymentStateenumOptional
Payment state
Allowed values:
additionalobjectOptional
Additional country-specific data
referenceslist of objectsOptional
References to credit notes reasons or non-tax documents
saleModalitydoubleOptional
Only for export documents: optional. Valid values: 1 = Sale agreed 2 = Under condition 3 = Free consignment 4 = Consignment with minimum sale 9 = No payment
saleClausedoubleOptional
Only for export documents: optional. Valid values: 1 = CIF (Cost, Insurance and Freight) 2 = CFR (Cost and Freight) 3 = EXW (Ex Works) 4 = FAS (Free Alongside Ship) 5 = FOB (Free on Board) 6 = S/CL 9 = DDP (Delivered Duty Paid) 10 = FCA (Free Carrier) 11 = CPT (Carriage Paid To) 12 = CIP (Carriage and Insurance Paid to) 17 = DAT (Delivered at Terminal) 18 = DAP (Delivered at Place) 8 = Other
paymentLinkstringOptional
Optional payment link URL for the document
generatePaymentLinkbooleanOptionalDefaults to false
Generate payment link for the document
guideTypedoubleOptional
Guide type for the document
transferTypedoubleOptional
Transfer type for the document
netAmountdoubleOptional
Net amount before taxes
taxesAmountdoubleOptional
Total tax amount
totalAmountdoubleOptional
Total amount including taxes

Response

Tax document was successfully created and returns the created document details including issuer, receiver, items, totals and associated electronic documents
documentIdstring
headerobject
detailslist of objects
totalsobject
electronicDocumentobject
referenceslist of objects or null
paymentLinkobject or null

Errors

Tax document was successfully created and returns the created document details including issuer, receiver, items, totals and associated electronic documents

Exchange rate value (if currency is foreign)

ID of the contact (receiver) associated with this document. Optional for non-nominative documents

Payment due date (YYYY-MM-DD)

Issue date (YYYY-MM-DD), defaults to today if omitted

Additional country-specific data

References to credit notes reasons or non-tax documents

Only for export documents: optional. Valid values: 1 = Sale agreed 2 = Under condition 3 = Free consignment 4 = Consignment with minimum sale 9 = No payment

Only for export documents: optional. Valid values: 1 = CIF (Cost, Insurance and Freight) 2 = CFR (Cost and Freight) 3 = EXW (Ex Works) 4 = FAS (Free Alongside Ship) 5 = FOB (Free on Board) 6 = S/CL 9 = DDP (Delivered Duty Paid) 10 = FCA (Free Carrier) 11 = CPT (Carriage Paid To) 12 = CIP (Carriage and Insurance Paid to) 17 = DAT (Delivered at Terminal) 18 = DAP (Delivered at Place) 8 = Other

Bearer authentication of the form Bearer <token>, where token is your auth token.