Skip to content

Conversation

@Jlazofacto
Copy link
Contributor

@Jlazofacto Jlazofacto commented Dec 29, 2025

Note

Adds comprehensive Argentina examples to the Postman collection and removes a deprecated Chile request.

  • New Argentina folder with requests for V1/auth, V1/accounts, and V1/documents covering Invoice A/B/C/E and Credit/Debit Note A/B/C/E, including reference-based variants
  • Test scripts validate responses and save session_token_argentina for bearer auth
  • Removed Chile request for "Create new documents - Purchase invoice"
  • Updated collection metadata (_postman_id)

Written by Cursor Bugbot for commit 60e4f57. This will update automatically on new commits. Configure here.

Summary by CodeRabbit

  • New Features

    • Added Argentina region support with comprehensive endpoints for documents, accounts, authentication, and varied document scenarios (invoices, credit/debit notes, export/import variants).
  • Documentation

    • Expanded API reference with Argentina-specific scenarios and extensive sample payloads.
    • Updated collection metadata with a share link and refreshed identifier.
  • Bug Fixes / Removals

    • Removed legacy Chile purchase-invoice endpoint.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 29, 2025

📝 Walkthrough

Walkthrough

Replaced a Chile invoice item in the Postman collection JSON with a comprehensive Argentina region block (sandbox credentials, auth tests, account creation, many document endpoints and payloads). Updated collection metadata _postman_id and added _collection_link. No other files changed.

Changes

Cohort / File(s) Summary
Postman API Collection Updates
koywe-billing.postman_collection.json
Removed one Chile "Create new documents - Purchase invoice" item. Added a new top-level "Argentina" region with sandbox credentials, authentication tests, account creation, and numerous document endpoints (invoices, credit/debit notes, export/import variants, multiple document_type_id scenarios) including full request bodies and bearer-auth variations. Updated _postman_id value and added _collection_link metadata.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐇 I nibbled through JSON light and bright,
Argentina bloomed endpoints in the night,
Tokens tucked under sandbox leaves,
Invoices and notes among payload sheaves,
I hop away, leaving tiny byte-trails behind.

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 inconclusive)
Check name Status Explanation Resolution
Title check ❓ Inconclusive The title 'Ejemplos argentina json' is vague and does not clearly describe the main changes. While it references Argentina and JSON, it lacks specificity about what was added to the Postman collection and why the Chile example was removed. Use a more descriptive title such as 'Add Argentina examples to Postman collection' or 'Add Argentina API examples and remove Chile purchase invoice' to clearly convey the primary change.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR is being reviewed by Cursor Bugbot

Details

Your team is on the Bugbot Free tier. On this plan, Bugbot will review limited PRs each billing cycle for each member of your team.

To receive Bugbot reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🧹 Nitpick comments (2)
koywe-billing.postman_collection.json (2)

3-7: Metadata ID and collection link – consider whether _collection_link should live in source control

_postman_id rotation is expected when re-exporting a collection, so that change is fine. The new _collection_link embeds a user/workspace-specific share URL; if this repo is shared broadly or across environments, consider removing that field from the committed JSON or documenting that it may drift every time someone re-exports the collection.


6903-7016: Duplicate “... Copy” request in Argentina section

The item “Create new documents - Debit Note E with reference to reference_document_id (...) Copy” appears to duplicate the preceding Debit Note E example with only the name changed.

Unless you intentionally want two separate variants, consider removing the Copy item or renaming/specializing it so each example demonstrates a distinct scenario.

📜 Review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 9ceac46 and f6813c4.

📒 Files selected for processing (1)
  • koywe-billing.postman_collection.json
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Cursor Bugbot
🔇 Additional comments (1)
koywe-billing.postman_collection.json (1)

6415-6656: Verify receiver_country_id values in Argentina debit/credit note examples

In several Argentina debit/credit note examples (A/B/E variants), the header.receiver_country_id is "83", while other Argentina examples consistently use "88" for both issuer and receiver. This looks like a leftover from another country’s payload.

Please double‑check that "83" is really intended here and adjust to "88" if these are meant to be purely Argentina scenarios.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Fix all issues with AI agents
In @koywe-billing.postman_collection.json:
- Around line 6328-6441: The request name string "Create new documents - Credit
Note E with reference to reference_document_id (Nota de débito E con referencia
de reference_document_id)" is inconsistent with the payload's document_type_id
"124" (which denotes a credit note); update the name so both languages match the
payload—e.g., change the Spanish phrase "Nota de débito E" to "Nota de crédito
E" (or alternatively change the English phrase to "Debit Note E" if the payload
should be a debit) by editing the request "name" value to reflect the chosen,
consistent document type.
- Around line 6098-6211: The request body for "Create new documents - Credit
Note B with reference to reference_document_id" uses the wrong C-type IDs;
update header.document_type_id from "120" to "116" and update the reference
object's document_type_id from "119" to "115" so the Credit Note B
(header.document_type_id) correctly references a B-type invoice
(reference.document_type_id). Ensure only those two string values are changed in
the JSON payload for the request named "Create new documents - Credit Note B
with reference to reference_document_id".
🧹 Nitpick comments (2)
koywe-billing.postman_collection.json (2)

5445-5447: Non-standard requests field in Postman script objects

Argentina scripts add "requests": {} alongside "packages": {}, which isn’t present in other country scripts. Postman should ignore unknown fields, but for consistency and to avoid future schema validation noise you may want to drop "requests" unless you rely on a specific Postman feature that needs it.


6887-7016: Duplicate “Debit Note E” request with “Copy” suffix

The “Create new documents - Debit Note E with reference to reference_document_id … Copy” request appears to be a duplicate of the preceding Debit Note E example (same document_type_id, structure, and semantics), just with “Copy” in the name.

Unless you intentionally need two identical examples, consider removing the “Copy” item to keep the collection concise and avoid confusion for users browsing Argentina samples.

📜 Review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between f6813c4 and e0dc52d.

📒 Files selected for processing (1)
  • koywe-billing.postman_collection.json
🔇 Additional comments (2)
koywe-billing.postman_collection.json (2)

3-7: Confirm committing _collection_link and regenerated _postman_id

The new _postman_id and added _collection_link look like a fresh Postman export. That’s fine, but please confirm _collection_link (with your workspace/user IDs) is meant to live in the repo and isn’t tied to a private workspace that might change or expose anything unintended.


5400-7017: Argentina block structure and examples look consistent overall

Aside from the few points noted above, the Argentina section is well-structured:

  • Sandbox auth + session_token_argentina env var wired into all AR bearer auths.
  • Coverage across Invoice A/B/C/E and corresponding credit/debit notes with both reference_number and reference_document_id flows.
  • Totals match line-level amounts and tax breakdowns.

Nice expansion of region-specific examples.

Comment on lines +6098 to +6211
"name": "Create new documents - Credit Note B with reference to reference_document_id (Nota de crédito B con referencia de reference_document_id)",
"event": [
{
"listen": "test",
"script": {
"exec": [
"var template = `\r",
"<canvas id=\"myChart\" height=\"75\"></canvas>\r",
"\r",
"<script src=\"https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.5.0/Chart.min.js\"></script> \r",
"\r",
"<script>\r",
" var ctx = document.getElementById(\"myChart\");\r",
"\r",
" var myChart = new Chart(ctx, {\r",
" type: \"bar\",\r",
" data: {\r",
" labels: [\"Net Amount\", \"Taxes Amount\", \"Total Amount\"],\r",
" datasets: [{\r",
" data: [],\r",
" // Change these colours to customize the chart\r",
" backgroundColor: [\"#003f5c\", \"#58508d\", \"#bc5090\"],\r",
" }]\r",
" },\r",
" options: {\r",
" legend: { display: false },\r",
" title: {\r",
" display: true,\r",
" text: 'Document Totals'\r",
" },\r",
" scales: {\r",
" xAxes: [{\r",
" display: true,\r",
" scaleLabel: {\r",
" display: true,\r",
" labelString: 'Categories'\r",
" }\r",
" }],\r",
" yAxes: [{\r",
" display: true,\r",
" scaleLabel: {\r",
" display: true,\r",
" labelString: 'Amount'\r",
" }\r",
" }]\r",
" }\r",
" }\r",
"\r",
" });\r",
"\r",
" // Access the data passed to pm.visualizer.set() from the JavaScript\r",
" pm.getData(function (err, value) {\r",
" myChart.data.datasets[0].data = [value.response.totals.net_amount, value.response.totals.taxes_amount, value.response.totals.total_amount];\r",
" myChart.update();\r",
" });\r",
"\r",
"</script>`;\r",
"\r",
"function constructVisualizerPayload() {\r",
" var res = pm.response.json();\r",
" \r",
" var visualizerData = {\r",
" totals: res.totals\r",
" };\r",
"\r",
" return {response: visualizerData};\r",
"}\r",
"\r",
"pm.visualizer.set(template, constructVisualizerPayload());"
],
"type": "text/javascript",
"packages": {},
"requests": {}
}
}
],
"request": {
"auth": {
"type": "bearer",
"bearer": [
{
"key": "token",
"value": "{{session_token_argentina}}",
"type": "string"
}
]
},
"method": "POST",
"header": [],
"body": {
"mode": "raw",
"raw": "{\r\n \"header\":{\r\n \"account_id\": 29240,\r\n \"document_type_id\":\"120\",\r\n \"issue_date\": \"2025-10-24\",\r\n \"issuer_tax_id_code\": \"20357265992\",\r\n \"issuer_tax_id_type\": \"AR-CUIT\",\r\n \"issuer_legal_name\": \"Tecnologias Avanzadas S.A.\",\r\n \"issuer_address\": \"Av. Corrientes 1234\",\r\n \"issuer_district\": \"San Nicolas\",\r\n \"issuer_city\": \"Ciudad Autonoma de Buenos Aires\",\r\n \"issuer_department\": \"Buenos Aires\",\r\n \"issuer_country_id\": \"88\",\r\n \"issuer_phone\": \"011-4321-5678\",\r\n \"issuer_activity\": \"Servicios de desarrollo de software\",\r\n \"issuer_postalcode\": \"1043\",\r\n \"receiver_tax_id_code\": \"30274688781\",\r\n \"receiver_tax_id_type\": \"AR-CUIT\",\r\n \"receiver_legal_name\": \"ESCUELA KEMPER URGATES\",\r\n \"receiver_address\": \"Calle Belgrano 456\",\r\n \"receiver_district\": \"Centro\",\r\n \"receiver_city\": \"Cordoba\",\r\n \"receiver_department\": \"Cordoba\",\r\n \"receiver_country_id\": \"88\",\r\n \"receiver_phone\": \"0351-487-2233\",\r\n \"receiver_activity\": \"Servicios educativos\",\r\n \"receiver_postalcode\": \"5000\",\r\n \"payment_conditions\": \"0\",\r\n \"currency_id\": 1,\r\n \"branch_office_code\": 12,\r\n \"additional\":{\r\n \"ar_header\":{\r\n \"invoice_concept\": 1,\r\n \"items_quantity\": 1,\r\n \"service_date_from\": \"2025-10-14\",\r\n \"service_date_to\": \"2025-10-14\",\r\n \"service_payment_due_date\": \"2025-10-14\",\r\n \"receiver_vat_condition_id\": 1\r\n }\r\n }\r\n },\r\n \"details\": [\r\n {\r\n \"quantity\": 1,\r\n \"line_description\": \"Prueba Koywe\",\r\n \"unit_measure\": \"NIU\",\r\n \"unit_price\": 150,\r\n \"long_description\": \"Test descripcion\",\r\n \"modifier_amount\": 0,\r\n \"total_taxes\": 34.05,\r\n \"modifier_percentage\": 0,\r\n \"total_amount_line\": 184.05,\r\n \"sku\": \"3245\",\r\n \"taxes\": [\r\n {\r\n \"tax_type_id\":\"474\",\r\n \"tax_percentage\":21,\r\n \"tax_amount\":21,\r\n \"tax_base_amount\": 100\r\n },\r\n {\r\n \"tax_type_id\":\"475\",\r\n \"tax_percentage\":10.5,\r\n \"tax_amount\":5.25,\r\n \"tax_base_amount\": 50\r\n },\r\n {\r\n \"tax_type_id\":\"484\",\r\n \"tax_percentage\":5.2,\r\n \"tax_amount\":7.8,\r\n \"tax_base_amount\": 150\r\n }\r\n ]\r\n }\r\n ],\r\n \"references\": [\r\n\t {\r\n\t\t \"document_type_id\": \"119\",\r\n\t\t \"reference_number\": \"68\",\r\n\t\t \"reference_code\": \"01\",\r\n\t\t \"description\": \"Anulacion solicitada por el emisor\",\r\n\t\t \"reference_branch_office_code\": 12,\r\n\t\t \"reference_date\": \"2025-10-17\"\r\n\t }\r\n ],\r\n \"totals\":{\r\n \"net_amount\":150,\r\n \"vat_amount\":34.05,\r\n \"total_amount\":184.05\r\n }\r\n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "https://api-billing.koywe.com/V1/documents",
"protocol": "https",
"host": [
"api-billing",
"koywe",
"com"
],
"path": [
"V1",
"documents"
]
}
},
"response": []
},
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

# First, let's find the file and explore its structure
fd "koywe-billing.postman_collection.json" -type f

Repository: koyweforest/api-billing-postman

Length of output: 245


🏁 Script executed:

# Search for all document type IDs and their associated names in the collection
rg '"document_type_id"' koywe-billing.postman_collection.json -B 5 -A 2 | head -200

Repository: koyweforest/api-billing-postman

Length of output: 433


🏁 Script executed:

# Also search for the example names to map them to document type IDs
rg '"name".*[Cc]redit.*[Nn]ote|"name".*[Ii]nvoice' koywe-billing.postman_collection.json -i | head -50

Repository: koyweforest/api-billing-postman

Length of output: 3501


🏁 Script executed:

# Get a count of lines to understand file size
wc -l koywe-billing.postman_collection.json

Repository: koyweforest/api-billing-postman

Length of output: 117


🏁 Script executed:

# Search for Invoice A/B/C/E with document_type_id
rg -A 50 '"name".*Invoice [ABCE].*Electronic' koywe-billing.postman_collection.json | grep -E '"name".*Invoice [ABCE]|"document_type_id"' | head -20

Repository: koyweforest/api-billing-postman

Length of output: 367


🏁 Script executed:

# Search for Credit Note A/B/C/E with document_type_id
rg -A 50 '"name".*Credit Note [ABCE]' koywe-billing.postman_collection.json | grep -E '"name".*Credit Note|"document_type_id"' | head -20

Repository: koyweforest/api-billing-postman

Length of output: 685


🏁 Script executed:

# Get context around the specific Credit Note B at lines 6098-6211
sed -n '6095,6115p' koywe-billing.postman_collection.json

Repository: koyweforest/api-billing-postman

Length of output: 884


🏁 Script executed:

# Search for all document_type_id values and extract their context in the Credit Note B section
sed -n '6098,6211p' koywe-billing.postman_collection.json | grep -E '"document_type_id"|"name"'

Repository: koyweforest/api-billing-postman

Length of output: 227


🏁 Script executed:

# Look at the raw JSON in the body of Credit Note B request - find document_type_id and references
sed -n '6098,6211p' koywe-billing.postman_collection.json | grep -B 2 -A 2 '"document_type_id"'

Repository: koyweforest/api-billing-postman

Length of output: 57


🏁 Script executed:

# Extract the full request body section to see document_type_id and references
sed -n '6120,6180p' koywe-billing.postman_collection.json

Repository: koyweforest/api-billing-postman

Length of output: 2254


🏁 Script executed:

# Find all Invoice A/B/C/E examples and their document_type_id values
rg -B 5 '"name".*Invoice [ABCE].*Electronic' koywe-billing.postman_collection.json -A 80 | grep -E '"name".*Invoice|"document_type_id".*[0-9]' | head -30

Repository: koyweforest/api-billing-postman

Length of output: 367


🏁 Script executed:

python3 << 'EOF'
import json

# Load the Postman collection
with open('koywe-billing.postman_collection.json', 'r') as f:
    collection = json.load(f)

# Function to extract document_type_id and references from requests
def find_document_types(items, level=0, path=""):
    results = []
    if isinstance(items, list):
        for item in items:
            if isinstance(item, dict):
                # Check if this is a request item with a name
                if "name" in item and any(keyword in item["name"] for keyword in ["Invoice", "Credit Note"]):
                    name = item["name"]
                    doc_type_id = None
                    ref_doc_type_id = None
                    
                    # Look for document_type_id in request body
                    if "request" in item and "body" in item["request"]:
                        body = item["request"]["body"]
                        if "raw" in body:
                            try:
                                body_json = json.loads(body["raw"])
                                if "header" in body_json:
                                    doc_type_id = body_json["header"].get("document_type_id")
                                if "references" in body_json and body_json["references"]:
                                    ref_doc_type_id = body_json["references"][0].get("document_type_id")
                            except:
                                pass
                    
                    results.append({
                        "name": name,
                        "document_type_id": doc_type_id,
                        "reference_document_type_id": ref_doc_type_id
                    })
                
                # Recurse into items
                if "item" in item:
                    results.extend(find_document_types(item["item"], level + 1, path + "/" + item.get("name", "")))
    
    return results

# Extract all Invoice/Credit Note examples
results = find_document_types(collection.get("item", []))

# Filter for A/B/C/E patterns from Argentina
argentina_examples = [r for r in results if any(x in r["name"] for x in ["Invoice A", "Invoice B", "Invoice C", "Invoice E", "Credit Note A", "Credit Note B", "Credit Note C", "Credit Note E"]) and "Argentina" not in r["name"]]

# Sort by name for easier reading
argentina_examples.sort(key=lambda x: x["name"])

print("Argentina Invoice/Credit Note Examples (A/B/C/E pattern):\n")
for ex in argentina_examples:
    print(f"Name: {ex['name']}")
    print(f"  document_type_id: {ex['document_type_id']}")
    print(f"  reference_document_type_id: {ex['reference_document_type_id']}")
    print()
EOF

Repository: koyweforest/api-billing-postman

Length of output: 161


🏁 Script executed:

# Find the line numbers for each Credit Note example name
rg -n '"name".*Credit Note [ABC]' koywe-billing.postman_collection.json | grep "Electronic\|Argentina"

Repository: koyweforest/api-billing-postman

Length of output: 57


🏁 Script executed:

# Search for document_type_id in raw request bodies - look for the header section
rg -n '"document_type_id"' koywe-billing.postman_collection.json | head -40

Repository: koyweforest/api-billing-postman

Length of output: 160


🏁 Script executed:

# Let's examine the structure around line 6098 more carefully to find document_type_id
sed -n '6140,6160p' koywe-billing.postman_collection.json

Repository: koyweforest/api-billing-postman

Length of output: 930


🏁 Script executed:

# Search for document_type_id values in the raw JSON (look for :"digits pattern)
rg '"document_type_id":"[0-9]+' koywe-billing.postman_collection.json | head -50

Repository: koyweforest/api-billing-postman

Length of output: 57


🏁 Script executed:

# Search for "reference_document_type_id" with values
rg '"reference_document_type_id"' koywe-billing.postman_collection.json -A 1 | head -40

Repository: koyweforest/api-billing-postman

Length of output: 57


🏁 Script executed:

# Let's look at the raw JSON body section more directly - search around line 6145-6180 where the JSON body starts
sed -n '6145,6200p' koywe-billing.postman_collection.json | grep -E '"document_type_id"|"reference_document_type_id"' -A 1

Repository: koyweforest/api-billing-postman

Length of output: 57


🏁 Script executed:

# Search for the literal document_type_id values - look for patterns like "120", "119" etc
rg '"120"|"119"|"115"|"111"|"116"' koywe-billing.postman_collection.json -B 2 -A 2 | head -100

Repository: koyweforest/api-billing-postman

Length of output: 57


🏁 Script executed:

# Since the JSON is escaped in a raw string, let's look directly at the raw section
sed -n '6145,6170p' koywe-billing.postman_collection.json

Repository: koyweforest/api-billing-postman

Length of output: 1032


🏁 Script executed:

# Look for the "raw" key which contains the JSON body
rg -n '"raw": "' koywe-billing.postman_collection.json | grep -A 5 6145

Repository: koyweforest/api-billing-postman

Length of output: 57


🏁 Script executed:

# Search directly for the string containing "header" and "document_type_id" near line 6150
sed -n '6150,6165p' koywe-billing.postman_collection.json

Repository: koyweforest/api-billing-postman

Length of output: 677


🏁 Script executed:

# Find where the JSON body with "header" starts
rg -n '"header"' koywe-billing.postman_collection.json | tail -20

Repository: koyweforest/api-billing-postman

Length of output: 586


🏁 Script executed:

# Let's search for all instances of document_type_id":\"120 in the file
rg 'document_type_id.*120' koywe-billing.postman_collection.json -B 5 -A 5

Repository: koyweforest/api-billing-postman

Length of output: 6913


🏁 Script executed:

# Find all Invoice A/B/C/E examples and their document_type_ids
rg -n 'Create new documents - Invoice [ABCE]' koywe-billing.postman_collection.json | head -10

Repository: koyweforest/api-billing-postman

Length of output: 470


🏁 Script executed:

# Search for document_type_id values near those Invoice examples
sed -n '5950,5990p' koywe-billing.postman_collection.json | grep -E 'document_type_id|reference_document_type_id' -A 1

Repository: koyweforest/api-billing-postman

Length of output: 2590


🏁 Script executed:

# Get Credit Note A document_type_id
sed -n '5840,5900p' koywe-billing.postman_collection.json | grep 'document_type_id' -A 1

Repository: koyweforest/api-billing-postman

Length of output: 2468


🏁 Script executed:

# Get Credit Note C document_type_id
sed -n '6300,6350p' koywe-billing.postman_collection.json | grep 'document_type_id' -A 1

Repository: koyweforest/api-billing-postman

Length of output: 3337


🏁 Script executed:

# Find line numbers for all Credit Note A/B/C/E examples
rg -n 'Create new documents - Credit Note [ABCE]' koywe-billing.postman_collection.json

Repository: koyweforest/api-billing-postman

Length of output: 705


🏁 Script executed:

# Get Credit Note A's document_type_id
sed -n '5975,6035p' koywe-billing.postman_collection.json | grep 'document_type_id' -A 1 -B 1

Repository: koyweforest/api-billing-postman

Length of output: 57


🏁 Script executed:

# Get Credit Note E's document_type_id and references
sed -n '6415,6475p' koywe-billing.postman_collection.json | grep 'document_type_id' -A 1 -B 1

Repository: koyweforest/api-billing-postman

Length of output: 2666


🏁 Script executed:

# Now let's check Invoice A, B, C document_type_ids
sed -n '5610,5650p' koywe-billing.postman_collection.json | grep 'document_type_id' -A 1 -B 1

Repository: koyweforest/api-billing-postman

Length of output: 3995


🏁 Script executed:

# Check Invoice B document_type_id
sed -n '5725,5765p' koywe-billing.postman_collection.json | grep 'document_type_id' -A 1 -B 1

Repository: koyweforest/api-billing-postman

Length of output: 3995


🏁 Script executed:

# Get Credit Note A document_type_id
sed -n '5983,6098p' koywe-billing.postman_collection.json | grep 'document_type_id' -A 1 -B 1 | head -20

Repository: koyweforest/api-billing-postman

Length of output: 3359


🏁 Script executed:

# Get Credit Note C document_type_id and its references
sed -n '6213,6328p' koywe-billing.postman_collection.json | grep 'document_type_id' -A 1 -B 1

Repository: koyweforest/api-billing-postman

Length of output: 3359


Credit Note B is incorrectly configured with C-type document IDs

The "Credit Note B" example uses document_type_id: "120" and references document_type_id: "119", which are both C-type IDs. This contradicts the established pattern across A/B/C/E examples:

  • Invoice A (111) → Credit Note A (112)
  • Invoice B (115) → Credit Note B should use (116), not (120)
  • Invoice C (119) → Credit Note C (120)
  • Invoice E (123) → Credit Note E (124)

Credit Note B should instead use document_type_id: "116" and reference the B-type invoice document_type_id: "115" to maintain consistency.

🤖 Prompt for AI Agents
In @koywe-billing.postman_collection.json around lines 6098 - 6211, The request
body for "Create new documents - Credit Note B with reference to
reference_document_id" uses the wrong C-type IDs; update header.document_type_id
from "120" to "116" and update the reference object's document_type_id from
"119" to "115" so the Credit Note B (header.document_type_id) correctly
references a B-type invoice (reference.document_type_id). Ensure only those two
string values are changed in the JSON payload for the request named "Create new
documents - Credit Note B with reference to reference_document_id".

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Fix all issues with AI agents
In @koywe-billing.postman_collection.json:
- Around line 6328-6425: The collection item's display name mixes credit/debit
terminology: update the "name" field for the request whose body sets
"document_type_id": "124" so both English and Spanish match the actual document
type (change either "Credit Note E" or "Nota de débito E" to the correct term),
ensuring the human-facing string and the payload (document_type_id 124) are
consistent to avoid confusion when browsing the collection.
- Around line 5523-5751: The examples for "Create new documents - Invoice A
(Electronic Invoice A)" and "Create new documents - Invoice B (Electronic
Invoice B)" have ar_header.items_quantity set to 1 while the details array
contains 2 items; update ar_header.items_quantity to 2 in both request bodies
(look for ar_header.items_quantity inside the additional.ar_header object in
each invoice request) so the header matches the number of detail lines and
avoids backend validation errors.
📜 Review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between e0dc52d and e54bcde.

📒 Files selected for processing (1)
  • koywe-billing.postman_collection.json
🔇 Additional comments (3)
koywe-billing.postman_collection.json (3)

3-7: Postman metadata update is fine; verify that _collection_link is meant to be committed

Updating _postman_id and adding _collection_link matches a fresh Postman export and looks structurally correct. Just confirm that this share URL is intended to live in the public repo and won’t break if the workspace/collection is moved or made private.


5403-5521: Argentina sandbox auth flow and session_token_argentina wiring look consistent

The test script, environment variable name (session_token_argentina), and its use as a bearer token in subsequent Argentina requests are all consistent with the existing country patterns in the collection. Please just double‑check that the client_secret and password here are sandbox/demo credentials and not production values before merging.


6405-6669: Verify receiver_country_id values in Argentina debit/credit note E and debit note A/B examples

In several Argentina examples under the export/notes section, the embedded JSON bodies set receiver_country_id to "83" while:

  • all other Argentina examples use "88" for Argentina, and
  • the receiver’s tax ID type is AR-CUIT, suggesting an Argentinian counterparty.

This may be a copy‑paste leftover from the Peru examples (where 83 is used). Please confirm whether these are meant to be domestic AR–AR documents (likely receiver_country_id: "88") or truly foreign receivers (in which case tax id type and other fields might also need adjusting).

Comment on lines +6328 to +6425
"name": "Create new documents - Credit Note E with reference to reference_document_id (Nota de débito E con referencia de reference_document_id)",
"event": [
{
"listen": "test",
"script": {
"exec": [
"var template = `\r",
"<canvas id=\"myChart\" height=\"75\"></canvas>\r",
"\r",
"<script src=\"https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.5.0/Chart.min.js\"></script> \r",
"\r",
"<script>\r",
" var ctx = document.getElementById(\"myChart\");\r",
"\r",
" var myChart = new Chart(ctx, {\r",
" type: \"bar\",\r",
" data: {\r",
" labels: [\"Net Amount\", \"Taxes Amount\", \"Total Amount\"],\r",
" datasets: [{\r",
" data: [],\r",
" // Change these colours to customize the chart\r",
" backgroundColor: [\"#003f5c\", \"#58508d\", \"#bc5090\"],\r",
" }]\r",
" },\r",
" options: {\r",
" legend: { display: false },\r",
" title: {\r",
" display: true,\r",
" text: 'Document Totals'\r",
" },\r",
" scales: {\r",
" xAxes: [{\r",
" display: true,\r",
" scaleLabel: {\r",
" display: true,\r",
" labelString: 'Categories'\r",
" }\r",
" }],\r",
" yAxes: [{\r",
" display: true,\r",
" scaleLabel: {\r",
" display: true,\r",
" labelString: 'Amount'\r",
" }\r",
" }]\r",
" }\r",
" }\r",
"\r",
" });\r",
"\r",
" // Access the data passed to pm.visualizer.set() from the JavaScript\r",
" pm.getData(function (err, value) {\r",
" myChart.data.datasets[0].data = [value.response.totals.net_amount, value.response.totals.taxes_amount, value.response.totals.total_amount];\r",
" myChart.update();\r",
" });\r",
"\r",
"</script>`;\r",
"\r",
"function constructVisualizerPayload() {\r",
" var res = pm.response.json();\r",
" \r",
" var visualizerData = {\r",
" totals: res.totals\r",
" };\r",
"\r",
" return {response: visualizerData};\r",
"}\r",
"\r",
"pm.visualizer.set(template, constructVisualizerPayload());"
],
"type": "text/javascript",
"packages": {},
"requests": {}
}
}
],
"request": {
"auth": {
"type": "bearer",
"bearer": [
{
"key": "token",
"value": "{{session_token_argentina}}",
"type": "string"
}
]
},
"method": "POST",
"header": [],
"body": {
"mode": "raw",
"raw": "{\r\n \"header\":{\r\n \"account_id\": 29240,\r\n \"document_type_id\":\"124\",\r\n \"received_issued_flag\":0,\r\n \"issue_date\":\"2025-10-24\",\r\n \"issuer_tax_id_code\":\"20610383727\",\r\n \"issuer_tax_id_type\":\"AR-CUIT\",\r\n \"issuer_legal_name\":\"<string>\",\r\n \"issuer_address\":\"<string>\",\r\n \"issuer_district\":\"<string>\",\r\n \"issuer_city\":\"<string>\",\r\n \"issuer_department\":\"<string>\",\r\n \"issuer_country_id\":\"88\",\r\n \"issuer_phone\":\"<string>\",\r\n \"issuer_activity\":\"<string>\",\r\n\t \"issuer_postalcode\":\"12345456\",\r\n \"receiver_tax_id_code\":\"20111111112\",\r\n \"receiver_tax_id_type\":\"AR-CUIT\",\r\n \"receiver_legal_name\":\"ESCUELA KEMPER URGATES\",\r\n \"receiver_address\":\"string\",\r\n \"receiver_district\":\"string\",\r\n \"receiver_city\":\"string\",\r\n \"receiver_department\":\"string\",\r\n \"receiver_country_id\":\"83\",\r\n \"receiver_phone\":\"<string>\",\r\n \"receiver_activity\":\"<string>\",\r\n\t \"receiver_postalcode\":\"12343456\",\r\n \"payment_conditions\":\"0\",\r\n \"currency_id\":1,\r\n \"branch_office_code\": 12,\r\n \"additional\":{\r\n \"ar_header\":{\r\n \"invoice_concept\": 1,\r\n \"items_quantity\": 1,\r\n \"service_date_from\": \"2025-10-24\",\r\n \"service_date_to\": \"2025-10-24\",\r\n \"service_payment_due_date\": \"2025-10-24\",\r\n \"receiver_vat_condition_id\": 9,\r\n \"existing_permission\": \"N\",\r\n \"language_code\": 1\r\n }\r\n }\r\n },\r\n \"details\": [\r\n {\r\n \"quantity\": 1,\r\n \"line_description\": \"Prueba Koywe\",\r\n \"unit_measure\": \"UN\",\r\n \"unit_price\": 5000,\r\n \"long_description\": \"Test descripcion\",\r\n \"modifier_amount\": 0,\r\n \"total_taxes\": 0,\r\n \"modifier_percentage\": 0,\r\n \"total_amount_line\": 5000,\r\n \"sku\": \"3245\"\r\n }\r\n ],\r\n \"references\": [\r\n\t {\r\n\t\t \"document_type_id\": \"123\",\r\n\t\t \"reference_number\": \"15\",\r\n\t\t \"reference_code\": \"01\",\r\n\t\t \"description\": \"Anulacion solicitada por el emisor\",\r\n\t\t \"reference_branch_office_code\": 12,\r\n\t\t \"reference_date\": \"2025-10-24\"\r\n\t }\r\n ],\r\n \"totals\":{\r\n \"net_amount\":5000,\r\n \"total_amount\":5000\r\n }\r\n}",
"options": {
"raw": {
"language": "json"
}
}
},
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Item name for “Credit Note E” mixes credit/debit terminology

The name string says “Create new documents - Credit Note E … (Nota de débito E …)”, mixing “credit note” in English with “nota de débito” (debit note) in Spanish. To avoid confusion when browsing the collection, align both languages to the actual document type (credit vs debit) that document_type_id 124 represents in your spec.

🤖 Prompt for AI Agents
In @koywe-billing.postman_collection.json around lines 6328 - 6425, The
collection item's display name mixes credit/debit terminology: update the "name"
field for the request whose body sets "document_type_id": "124" so both English
and Spanish match the actual document type (change either "Credit Note E" or
"Nota de débito E" to the correct term), ensuring the human-facing string and
the payload (document_type_id 124) are consistent to avoid confusion when
browsing the collection.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (2)
koywe-billing.postman_collection.json (2)

5407-5478: Non-standard script.requests field in test scripts

In the new Argentina items, script objects include both "packages": {} and "requests": {}. Existing country folders only use "packages": {}; requests is not a standard Postman script field and appears unused.

You can drop "requests": {} from these scripts for cleanliness and to stay aligned with Postman’s schema, unless you have a custom consumer relying on it.

Also applies to: 5522-5750


5982-6900: Chart.js visualizer duplication across many Argentina examples

The Chart.js test/visualizer script is duplicated verbatim across many Argentina document items. That’s fine functionally, but it will be harder to maintain if you ever tweak the visualizer.

If Postman’s collection/folder-level scripts fit your workflow, consider moving this visualizer into a shared test script (e.g., at folder level) and reusing it to avoid copy‑paste across each AR document example.

📜 Review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between e54bcde and 60e4f57.

📒 Files selected for processing (1)
  • koywe-billing.postman_collection.json
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Cursor Bugbot
🔇 Additional comments (4)
koywe-billing.postman_collection.json (4)

3-7: _postman_id change looks fine but check for external tooling dependencies

Updating _postman_id is expected when re-exporting from Postman. Just make sure no external automation or docs still reference the old collection ID before merging.


5397-5519: Argentina folder structure and auth flow are consistent with other regions

The new Argentina folder mirrors the pattern for Chile/Colombia/México/Perú (sandbox auth → session token → region-specific account/docs), and session_token_argentina is used consistently in bearer auth. This is a good, coherent addition to the collection.

Please run the full AR flow in Postman (auth → create account → at least one invoice) once in the sandbox to confirm all IDs and credentials are valid in the current environment.


5522-5980: Argentina invoice examples look internally consistent and useful

The A/B/C/E invoice examples have coherent headers, AR-specific additional blocks (ar_header), line-level taxes whose sums match total_taxes, and totals that add up correctly. Combined with the Chart.js visualizer, this should be very helpful for integrators testing AFIP flows.


6059-6325: Potential mismatches in document_type_id usage for Credit Notes B/C

Within the Argentina credit note examples there are a few spots that look copy‑pasted and may confuse users:

  • “Create new documents - Credit Note B …”:
    • Header document_type_id: "120".
    • references[0].document_type_id: "119" (which you use for the Invoice C example), not "115" (your Invoice B example).
  • “Create new documents - Credit Note C …”:
    • Header document_type_id: also "120" (same as Credit Note B), while the description calls it Credit Note C.
    • references[0].document_type_id: "119" (Invoice C), which might be intentional, but then the title “Credit Note C” plus reused document_type_id is ambiguous.

This may still be valid for your API, but from the collection alone the mapping between invoice/credit-note types is not obvious.

Please double‑check against your AFIP/AR document-type catalog and adjust any of the following if needed:

  • The header document_type_id for “Credit Note C …”.
  • The references[*].document_type_id for “Credit Note B …” if it is meant to reference your “Invoice B” example rather than “Invoice C”.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants