Skip to main content
POST
/
external
/
creditNotes
/
upsert
cURL
curl --request POST \
  --url https://api.valyx.com/external/creditNotes/upsert \
  --header 'Content-Type: application/json' \
  --header 'X-Valyx-Signature: <x-valyx-signature>' \
  --data '
{
  "creditNote": {
    "creditNoteId": "<string>",
    "creditNoteNumber": "<string>",
    "creditNoteDate": "2023-12-25",
    "customerDetails": {
      "buyerId": "<string>",
      "name": "<string>",
      "registeredAddress": {
        "line1": "<string>",
        "line2": "<string>",
        "state": "<string>",
        "city": "<string>",
        "country": "<string>",
        "zipCode": "<string>"
      }
    },
    "creditNoteTotal": 123,
    "creditNoteSubtotal": 123,
    "creditNoteTax": {
      "total": 0,
      "gstTax": {
        "totalGst": 0,
        "totalGstRate": 0,
        "cgst": 0,
        "cgstRate": 0,
        "sgst": 0,
        "sgstRate": 0,
        "igst": 0,
        "igstRate": 0
      },
      "cessTax": {
        "cess": 0,
        "cessRate": 0
      },
      "serviceTax": {
        "serviceTax": 0,
        "serviceTaxRate": 0
      },
      "tdsTax": {
        "tds": 0,
        "tdsRate": 0
      },
      "otherTaxes": [
        {
          "name": "<string>",
          "genericTax": 0,
          "genericTaxRate": 0
        }
      ],
      "cgst": 123,
      "sgst": 123,
      "igst": 123,
      "tds": 0
    },
    "currency": "INR",
    "lineItems": [
      {
        "subTotal": 0,
        "total": 0,
        "lineItemDetails": {
          "name": "<string>",
          "taxRate": 123,
          "pricePerItem": 0,
          "hsnOrSacCode": "<string>",
          "description": "<string>",
          "companyId": "<string>",
          "erpId": "<string>",
          "lineItemId": "<string>"
        },
        "tax": {
          "total": 0,
          "gstTax": {
            "totalGst": 0,
            "totalGstRate": 0,
            "cgst": 0,
            "cgstRate": 0,
            "sgst": 0,
            "sgstRate": 0,
            "igst": 0,
            "igstRate": 0
          },
          "cessTax": {
            "cess": 0,
            "cessRate": 0
          },
          "serviceTax": {
            "serviceTax": 0,
            "serviceTaxRate": 0
          },
          "tdsTax": {
            "tds": 0,
            "tdsRate": 0
          },
          "otherTaxes": [
            {
              "name": "<string>",
              "genericTax": 0,
              "genericTaxRate": 0
            }
          ],
          "cgst": 123,
          "sgst": 123,
          "igst": 123,
          "tds": 0
        },
        "quantity": 1,
        "amount": 0
      }
    ],
    "tags": {},
    "description": "<string>",
    "invoiceId": "<string>",
    "invoiceNumber": "<string>",
    "companyId": "<string>"
  }
}
'
{}

Headers

X-Valyx-Signature
string
required

Auth key for fetching ledger entries

Body

application/json
creditNote
object

Response

200 - application/json

Success

The response is of type object.