Skip to main content
POST
/
transactions
Create a transaction
curl --request POST \
  --url https://base_url/api/v1/transactions \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "corporation_id": "b6d009b0-d174-463f-b030-94643c28e209",
  "transacted_at": "2023-12-25",
  "tax_date_override": "2023-12-25",
  "calculation_date_override": "2023-12-25",
  "reporting_date_override": "2023-12-25",
  "invoice_currency": "USD",
  "invoice_number": "<string>",
  "subtotal": 1,
  "discount": 0.99,
  "shipping_and_handling": 1,
  "total": 1,
  "tax_collected": 1,
  "transaction_type": "SALE",
  "calculation_id": "<string>",
  "parent_invoice_id": "<string>",
  "refund_type": "FULL",
  "customer_details": {
    "shipping_address": {
      "address_line_1": "1776 Main St",
      "address_line_2": "Apt. #123",
      "address_line_3": "<string>",
      "postal_code": "90401",
      "city": "Santa Monica",
      "state": "CA",
      "country": "US"
    },
    "customer_id": "<string>",
    "customer_external_id": "<string>"
  },
  "line_items": {
    "items": [
      {
        "amount": 123,
        "line_number": "<string>",
        "quantity": 123,
        "price_per_unit": 123,
        "discount_amount": 1,
        "tax_collected": 123,
        "tax_code": "<string>",
        "product_id": "<string>",
        "product_sku": "<string>",
        "exemption_type": "PURPOSE_RESALE",
        "exemption_reason": "<string>",
        "exemption_certificate_id": "<string>"
      }
    ]
  },
  "tax_included": true,
  "exemption_type": "PURPOSE_RESALE"
}'
{
  "data": {
    "id": "2535af08-a139-4d0c-9827-1651e46dfbcf",
    "corporation_id": "b6d009b0-d174-463f-b030-94643c28e209",
    "transacted_at": "2023-12-25",
    "tax_date_override": "2023-12-25",
    "invoice_currency": "USD",
    "subtotal": 1,
    "discount": 0.99,
    "shipping_and_handling": 1,
    "total": 1,
    "tax_collected": 1,
    "transaction_type": "SALE",
    "transaction_status": "LOCKED",
    "calculation_id": "<string>",
    "customer_details": {
      "shipping_address": {
        "address_line_1": "1776 Main St",
        "address_line_2": "Apt. #123",
        "address_line_3": "<string>",
        "postal_code": "90401",
        "city": "Santa Monica",
        "state": "CA",
        "country": "US"
      },
      "customer_id": "<string>",
      "customer_external_id": "<string>"
    },
    "source_platform": "RAZORPAY",
    "line_items": {
      "items": [
        {
          "amount": 123,
          "quantity": 123,
          "tax_collected": 123,
          "tax_code": "<string>",
          "product_id": "<string>",
          "product_sku": "<string>",
          "exemption_type": "PURPOSE_RESALE"
        }
      ]
    },
    "exemption_type": "PURPOSE_RESALE",
    "parent_invoice_id": "<string>"
  },
  "message": "Successfully created transaction."
}

Authorizations

Authorization
string
header
required

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

Body

application/json
corporation_id
string
required

The unique identifier for the corporation associated with this transaction.

Example:

"b6d009b0-d174-463f-b030-94643c28e209"

transacted_at
string<date>
required

ISO 8601 formatted date string indicating date on which the transaction took place.

invoice_currency
string
required

ISO 4217 alpha-3 currency code for the transaction.

Example:

"USD"

transaction_type
enum<string>
required

Type of the transaction. Can be SALE for standard sales or RETURN for returns/refunds. For RETURN transactions, additional fields like parent_invoice_id and refund_type are required.

Available options:
SALE,
RETURN,
REFUND
customer_details
object
required
line_items
object
required
tax_date_override
string<date>

ISO 8601 formatted date string indicating the date on which the tax liability should be recognized for filings and for nexus tracking, if different from the transacted_at date.

calculation_date_override
string<date>

ISO 8601 formatted date string indicating the date to use for tax rate lookups, useful for ensuring returns use the same rates as the original sale.

reporting_date_override
string<date>

ISO 8601 formatted date string indicating when this transaction should appear in reports, if different from transacted_at.

invoice_number
string

Invoice or receipt number for this transaction.

subtotal
number

Total amount before tax, shipping, handling, and discounts.

Required range: x >= 0
discount
number

Total discount amount applied to the transaction.

Required range: x >= 0
Example:

0.99

shipping_and_handling
number

Total shipping and handling charges.

Required range: x >= 0
total
number

This is the total amount charged to the customer, which includes the subtotal, shipping and handling fees, tax, and reflects any applied discounts.

Required range: x >= 0
tax_collected
number

Numeric value representing the amount of sales tax paid by the customer for this transaction.

Required range: x >= 0
calculation_id
string

Optional ID of a previous calculation used for this transaction.

parent_invoice_id
string

Required for RETURN transactions. The ID of the original sale transaction being returned. This links the return to the original sale for proper tax accounting.

refund_type
enum<string>

Required for RETURN transactions. Specifies whether this is a full or partial return.

  • FULL: The entire transaction amount is refunded
  • PARTIAL: Only specific items or amounts are refunded
Available options:
FULL,
PARTIAL
tax_included
boolean

Whether tax is included in the line item prices.

exemption_type
enum<string>

If this field is present, this transaction will be considered exempt.

Available options:
PURPOSE_RESALE,
ENTITY_TYPE_NONPROFIT,
GOVERNMENT,
MANUFACTURER,
AGRICULTURAL,
OTHER

Response

Transaction creation response

data
object
message
string
Example:

"Successfully created transaction."