> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.tabs.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.tabs.com/_mcp/server.

# Create credit memo

POST https://integrators.prod.api.tabsplatform.com/v3/credit-memos
Content-Type: application/json

Reference: https://docs.tabs.com/api-reference/credit-memos/createCreditMemo

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: Tabs External API
  version: 1.0.0
paths:
  /v3/credit-memos:
    post:
      operationId: integrators-api-credit-memos-controller-create-credit-memo
      summary: Create credit memo
      tags:
        - creditMemos
      parameters:
        - name: Authorization
          in: header
          required: true
          schema:
            type: string
      responses:
        '201':
          description: Credit memo created successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreditMemoDto'
        '400':
          description: Bad request - Invalid input data
          content:
            application/json:
              schema:
                description: Any type
        '500':
          description: Internal server error - Failed to create credit memo
          content:
            application/json:
              schema:
                description: Any type
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateCreditMemoRequestDto'
servers:
  - url: https://integrators.prod.api.tabsplatform.com
    description: https://integrators.prod.api.tabsplatform.com
components:
  schemas:
    CreateCreditMemoItemDto:
      type: object
      properties:
        invoiceLineItemId:
          type: string
          description: Invoice line item ID
        quantity:
          type: number
          format: double
          description: Quantity
        amount:
          type: number
          format: double
          description: Amount
        itemId:
          type: string
          description: Integration item ID. Optional if invoiceLineItemId is provided.
      required:
        - quantity
        - amount
      title: CreateCreditMemoItemDto
    ApplyOnCreateDto:
      type: object
      properties:
        invoiceId:
          type: string
          description: Invoice ID to apply credit memo to
      title: ApplyOnCreateDto
    CreateCreditMemoRequestDto:
      type: object
      properties:
        customerId:
          type: string
          description: Customer ID
        issueDate:
          type: string
          description: Issue date
        memo:
          type: string
          description: Memo
        reason:
          type: string
          description: Reason
        items:
          type: array
          items:
            $ref: '#/components/schemas/CreateCreditMemoItemDto'
          description: Credit memo items
        applyOnCreate:
          $ref: '#/components/schemas/ApplyOnCreateDto'
          description: >-
            Apply on create parameters. Do not include if you want to apply the
            credit memo to an invoice later.
      required:
        - customerId
        - issueDate
        - reason
        - items
      title: CreateCreditMemoRequestDto
    CreditMemoCustomerDto:
      type: object
      properties:
        id:
          type: string
          description: Customer ID
        name:
          type: string
          description: Customer name
        nameWithPrefix:
          type: string
          description: Customer name with prefix
      required:
        - id
        - name
      title: CreditMemoCustomerDto
    CreditMemoItemDto:
      type: object
      properties:
        id:
          type: string
          description: Item ID
        name:
          type: string
          description: Item name
        externalId:
          type: string
          description: External ID
      required:
        - id
        - name
      title: CreditMemoItemDto
    CreditMemoErpClassDto:
      type: object
      properties:
        id:
          type: string
          description: ERP Class ID
        name:
          type: string
          description: ERP Class name
      required:
        - id
        - name
      title: CreditMemoErpClassDto
    CreditMemoLineItemDto:
      type: object
      properties:
        id:
          type: string
          description: Line item ID
        name:
          type: string
          description: Line item name
        note:
          type: string
          description: Line item note
        quantity:
          type: number
          format: double
          description: Quantity
        amount:
          type: number
          format: double
          description: Amount
        salesTaxAmount:
          type: number
          format: double
          description: Sales tax amount
        item:
          $ref: '#/components/schemas/CreditMemoItemDto'
          description: Item details
        erpClass:
          $ref: '#/components/schemas/CreditMemoErpClassDto'
          description: ERP Class details
        contraRevenueScheduleId:
          type: string
          description: Contra revenue schedule ID
      required:
        - id
        - name
        - quantity
        - amount
        - salesTaxAmount
        - contraRevenueScheduleId
      title: CreditMemoLineItemDto
    CreditMemoApplicationDto:
      type: object
      properties:
        id:
          type: string
          description: Application ID
        creditMemoId:
          type: string
          description: Credit memo ID
        invoiceId:
          type: string
          description: Invoice ID
        amountApplied:
          type: number
          format: double
          description: Amount applied
        invoiceNumber:
          type: string
          description: Invoice number
        invoicePrefix:
          type: string
          description: Invoice prefix
        appliedAt:
          type: string
          format: date-time
          description: Applied at
      required:
        - id
        - creditMemoId
        - invoiceId
        - amountApplied
        - invoiceNumber
        - invoicePrefix
        - appliedAt
      title: CreditMemoApplicationDto
    CreditMemoExternalIdDto:
      type: object
      properties:
        externalId:
          type: string
          description: External ID
        sourceType:
          type: string
          description: Source type
      required:
        - externalId
        - sourceType
      title: CreditMemoExternalIdDto
    CreditMemoDto:
      type: object
      properties:
        creditMemoId:
          type: string
          description: Credit memo ID
        creditMemoNumber:
          type: string
          description: Credit memo number
        creditMemoPrefix:
          type: string
          description: Credit memo prefix
        customerId:
          type: string
          description: Customer ID
        manufacturerId:
          type: string
          description: Manufacturer ID
        issueDate:
          type: string
          format: date-time
          description: Issue date
        total:
          type: number
          format: double
          description: Total amount
        memo:
          type: string
          description: Memo
        reason:
          type: string
          description: Reason
        status:
          type: string
          description: Status
        customer:
          $ref: '#/components/schemas/CreditMemoCustomerDto'
          description: Customer information
        items:
          type: array
          items:
            $ref: '#/components/schemas/CreditMemoLineItemDto'
          description: Line items
        applications:
          type: array
          items:
            $ref: '#/components/schemas/CreditMemoApplicationDto'
          description: Applications
        externalIds:
          type: array
          items:
            $ref: '#/components/schemas/CreditMemoExternalIdDto'
          description: External IDs
        createdAt:
          type: string
          format: date-time
          description: Created at
        lastUpdatedAt:
          type: string
          format: date-time
          description: Last updated at
        syncStatus:
          type: string
          description: Sync status
      required:
        - creditMemoId
        - creditMemoNumber
        - creditMemoPrefix
        - customerId
        - manufacturerId
        - issueDate
        - total
        - status
        - customer
        - items
        - applications
        - externalIds
        - createdAt
        - lastUpdatedAt
        - syncStatus
      title: CreditMemoDto
  securitySchemes:
    custom-header:
      type: apiKey
      in: header
      name: Authorization

```

## Examples



**Request**

```json
{
  "customerId": "123e4567-e89b-12d3-a456-426614174000",
  "issueDate": "2023-01-10",
  "reason": "Product defect",
  "items": [
    {
      "quantity": 1,
      "amount": 100
    }
  ]
}
```

**Response**

```json
{
  "creditMemoId": "123e4567-e89b-12d3-a456-426614174000",
  "creditMemoNumber": "CM-001",
  "creditMemoPrefix": "CM",
  "customerId": "123e4567-e89b-12d3-a456-426614174000",
  "manufacturerId": "123e4567-e89b-12d3-a456-426614174000",
  "issueDate": "2023-01-01T00:00:00.000Z",
  "total": 100,
  "status": "OPEN",
  "customer": {
    "id": "123e4567-e89b-12d3-a456-426614174000",
    "name": "Acme Corp",
    "nameWithPrefix": "CUST-001 Acme Corp"
  },
  "items": [
    {
      "id": "123e4567-e89b-12d3-a456-426614174000",
      "name": "Product A",
      "quantity": 1,
      "amount": 100,
      "salesTaxAmount": 8.25,
      "contraRevenueScheduleId": "123e4567-e89b-12d3-a456-426614174000",
      "note": "Credit for defective product",
      "item": {
        "id": "123e4567-e89b-12d3-a456-426614174000",
        "name": "Product A",
        "externalId": "EXT-123"
      },
      "erpClass": {
        "id": "123e4567-e89b-12d3-a456-426614174000",
        "name": "Revenue"
      }
    }
  ],
  "applications": [
    {
      "id": "123e4567-e89b-12d3-a456-426614174000",
      "creditMemoId": "123e4567-e89b-12d3-a456-426614174000",
      "invoiceId": "123e4567-e89b-12d3-a456-426614174000",
      "amountApplied": 100,
      "invoiceNumber": "INV-001",
      "invoicePrefix": "INV",
      "appliedAt": "2023-01-01T00:00:00.000Z"
    }
  ],
  "externalIds": [
    {
      "externalId": "EXT-123",
      "sourceType": "NETSUITE"
    }
  ],
  "createdAt": "2023-01-01T00:00:00.000Z",
  "lastUpdatedAt": "2023-01-01T00:00:00.000Z",
  "syncStatus": "NOT_SYNCED",
  "memo": "Credit for defective product",
  "reason": "Product defect"
}
```

**SDK Code**

```python
import requests

url = "https://integrators.prod.api.tabsplatform.com/v3/credit-memos"

payload = {
    "customerId": "123e4567-e89b-12d3-a456-426614174000",
    "issueDate": "2023-01-10",
    "reason": "Product defect",
    "items": [
        {
            "quantity": 1,
            "amount": 100
        }
    ]
}
headers = {
    "Authorization": "<apiKey>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript
const url = 'https://integrators.prod.api.tabsplatform.com/v3/credit-memos';
const options = {
  method: 'POST',
  headers: {Authorization: '<apiKey>', 'Content-Type': 'application/json'},
  body: '{"customerId":"123e4567-e89b-12d3-a456-426614174000","issueDate":"2023-01-10","reason":"Product defect","items":[{"quantity":1,"amount":100}]}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://integrators.prod.api.tabsplatform.com/v3/credit-memos"

	payload := strings.NewReader("{\n  \"customerId\": \"123e4567-e89b-12d3-a456-426614174000\",\n  \"issueDate\": \"2023-01-10\",\n  \"reason\": \"Product defect\",\n  \"items\": [\n    {\n      \"quantity\": 1,\n      \"amount\": 100\n    }\n  ]\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Authorization", "<apiKey>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://integrators.prod.api.tabsplatform.com/v3/credit-memos")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = '<apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"customerId\": \"123e4567-e89b-12d3-a456-426614174000\",\n  \"issueDate\": \"2023-01-10\",\n  \"reason\": \"Product defect\",\n  \"items\": [\n    {\n      \"quantity\": 1,\n      \"amount\": 100\n    }\n  ]\n}"

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://integrators.prod.api.tabsplatform.com/v3/credit-memos")
  .header("Authorization", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"customerId\": \"123e4567-e89b-12d3-a456-426614174000\",\n  \"issueDate\": \"2023-01-10\",\n  \"reason\": \"Product defect\",\n  \"items\": [\n    {\n      \"quantity\": 1,\n      \"amount\": 100\n    }\n  ]\n}")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://integrators.prod.api.tabsplatform.com/v3/credit-memos', [
  'body' => '{
  "customerId": "123e4567-e89b-12d3-a456-426614174000",
  "issueDate": "2023-01-10",
  "reason": "Product defect",
  "items": [
    {
      "quantity": 1,
      "amount": 100
    }
  ]
}',
  'headers' => [
    'Authorization' => '<apiKey>',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://integrators.prod.api.tabsplatform.com/v3/credit-memos");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"customerId\": \"123e4567-e89b-12d3-a456-426614174000\",\n  \"issueDate\": \"2023-01-10\",\n  \"reason\": \"Product defect\",\n  \"items\": [\n    {\n      \"quantity\": 1,\n      \"amount\": 100\n    }\n  ]\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "Authorization": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = [
  "customerId": "123e4567-e89b-12d3-a456-426614174000",
  "issueDate": "2023-01-10",
  "reason": "Product defect",
  "items": [
    [
      "quantity": 1,
      "amount": 100
    ]
  ]
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://integrators.prod.api.tabsplatform.com/v3/credit-memos")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```