> For the complete documentation index, see [llms.txt](https://docs.platform.softwareone.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.platform.softwareone.com/developer-resources/rest-api/billing-api/credit-memo/create-credit-memo.md).

# Create credit memo

## Creates new credit memos.

> Bulk async operation. Requires MPT-Upsert and MPT-Async headers.\
> Returns 202 Accepted with MPT-Task-Id header for tracking the async operation.

```json
{"openapi":"3.0.1","info":{"title":"Marketplace API","version":"5.0.5843-g491c2e59"},"servers":[{"url":"https://api.platform.softwareone.com"}],"paths":{"/public/v1/billing/credit-memos":{"post":{"tags":["CreditMemos"],"summary":"Creates new credit memos.","description":"Bulk async operation. Requires MPT-Upsert and MPT-Async headers.\nReturns 202 Accepted with MPT-Task-Id header for tracking the async operation.","parameters":[{"name":"creditMemo","in":"query","description":"The credit memo to create.","schema":{"allOf":[{"$ref":"#/components/schemas/CreditMemo"}],"description":"Represents a credit memo in the billing system."}}],"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreditMemo"}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Internal Server Error"}}}}},"components":{"schemas":{"CreditMemo":{"type":"object","properties":{"audit":{"allOf":[{"$ref":"#/components/schemas/CreditMemoAuditBag"}],"description":"Represents a container for audit-related events for a credit memo"},"$meta":{"allOf":[{"$ref":"#/components/schemas/PlatformMetadata"}],"nullable":true},"revision":{"type":"integer","format":"int32"},"id":{"type":"string","description":"The unique identifier of the credit memo."},"countryCode":{"type":"string","description":"The country code."},"documentNo":{"type":"string","description":"The document number assigned by the ERP system."},"attributes":{"allOf":[{"$ref":"#/components/schemas/BillingErpAttributes"}],"description":"ERP attributes associated with the entity."},"erpData":{"allOf":[{"$ref":"#/components/schemas/CreditMemoErpData"}],"description":"ERP-specific data related to the credit memo."},"externalIds":{"allOf":[{"$ref":"#/components/schemas/ErpExternalIds"}],"description":"Credit memo external ids."},"agreement":{"type":"object","allOf":[{"$ref":"#/components/schemas/AgreementRef"}]},"buyer":{"type":"object","allOf":[{"$ref":"#/components/schemas/BuyerRef"}]},"client":{"type":"object","allOf":[{"$ref":"#/components/schemas/AccountRef"}]},"licensee":{"type":"object","allOf":[{"$ref":"#/components/schemas/LicenseeRef"}]},"lines":{"type":"array","items":{"$ref":"#/components/schemas/CreditMemoLine"},"description":"The list of credit memo lines associated with the credit memo."},"price":{"allOf":[{"$ref":"#/components/schemas/CreditMemoPriceSummary"}],"description":"Pricing details of the credit memo."},"product":{"type":"object","allOf":[{"$ref":"#/components/schemas/ProductRef"}]},"seller":{"type":"object","allOf":[{"$ref":"#/components/schemas/SellerRef"}]},"status":{"allOf":[{"$ref":"#/components/schemas/CreditMemoStatus"}],"description":"The current status of the credit memo."},"vendor":{"type":"object","allOf":[{"$ref":"#/components/schemas/AccountRef"}]},"statement":{"type":"object","allOf":[{"$ref":"#/components/schemas/StatementRef"}]},"analytics":{"allOf":[{"$ref":"#/components/schemas/AnalyticsInfo"}],"description":"Analytics information related to the credit memo."},"cloudiqInvoiceReference":{"type":"string","description":"Cloud iQ invoice reference.","nullable":true},"cloudiqReportLayout":{"type":"integer","description":"Cloud iQ report layout.","format":"int32","nullable":true}},"additionalProperties":false,"description":"Represents a credit memo in the billing system."},"CreditMemoAuditBag":{"type":"object","properties":{"created":{"allOf":[{"$ref":"#/components/schemas/PlatformObjectEvent"}],"nullable":true},"updated":{"allOf":[{"$ref":"#/components/schemas/PlatformObjectEvent"}],"nullable":true},"issued":{"allOf":[{"$ref":"#/components/schemas/PlatformObjectEvent"}],"description":"Contains details about the most recent event when the credit memo reached the \"Issued\" status.","nullable":true}},"additionalProperties":false,"description":"Represents a container for audit-related events for a credit memo"},"PlatformObjectEvent":{"type":"object","properties":{"at":{"type":"string","format":"date-time","nullable":true},"by":{"type":"object","allOf":[{"$ref":"#/components/schemas/PlatformIdentityRef"}]}},"additionalProperties":false},"PlatformIdentityRef":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"icon":{"type":"string","nullable":true},"revision":{"type":"integer","format":"int32"}},"additionalProperties":false},"PlatformMetadata":{"type":"object","properties":{"omitted":{"type":"array","items":{"type":"string"}}},"additionalProperties":false},"BillingErpAttributes":{"type":"object","properties":{"postingDate":{"type":"string","description":"The date when the invoice was posted.","format":"date-time","nullable":true},"documentDate":{"type":"string","description":"The date when the document was created.","format":"date-time","nullable":true},"externalDocumentNo":{"type":"string","description":"The external document number associated with the invoice.","nullable":true},"externalDocumentNo2":{"type":"string","description":"The second external document number associated with the invoice.","nullable":true},"yourReference":{"type":"string","description":"Can be the custom reference (free text) or the statement ID (fixed format).","nullable":true}},"additionalProperties":false,"description":"Attributes related to ERP systems for an invoice or credit memo."},"CreditMemoErpData":{"type":"object","properties":{"addresses":{"allOf":[{"$ref":"#/components/schemas/ErpAddressList"}],"description":"The list of addresses associated with the credit memo."},"appliesToDocNo":{"type":"string","description":"The document number to which this credit memo applies.","nullable":true},"currencyCode":{"type":"string","description":"The currency code of the credit memo.","nullable":true},"documentDate":{"type":"string","description":"The document date of the credit memo.","format":"date-time","nullable":true},"documentNo":{"type":"string","description":"The document number of the credit memo."},"externalDocumentNo":{"type":"string","description":"The external document number of the credit memo.","nullable":true},"externalDocumentNo2":{"type":"string","description":"The second external document number of the credit memo.","nullable":true},"insideSalesCode":{"type":"string","description":"The inside sales code associated with the credit memo.","nullable":true},"navisionCountryCode":{"type":"string","description":"The Navision country code of the credit memo."},"postingDate":{"type":"string","description":"The posting date of the credit memo.","format":"date-time"},"revision":{"type":"integer","description":"The revision of the invoice, used for versioning control.","format":"int64","nullable":true},"rowVersion":{"type":"integer","description":"The row version of the credit memo, used for concurrency control.","format":"int64","nullable":true},"responsibilityCenterCode":{"type":"string","description":"The responsibility center code of the credit memo.","nullable":true},"salesPersonCode":{"type":"string","description":"The sales person code of the credit memo.","nullable":true},"shipmentMethodCode":{"type":"string","description":"The shipment method code of the credit memo.","nullable":true},"vatRegistrationNo":{"type":"string","description":"The VAT registration number of the credit memo.","nullable":true},"yourReference":{"type":"string","description":"The reference provided by the customer.","nullable":true}},"additionalProperties":false,"description":"Represents ERP-specific data related to a credit memo."},"ErpAddressList":{"type":"object","properties":{"billTo":{"allOf":[{"$ref":"#/components/schemas/ErpAddress"}],"description":"The bill to address."},"licenseTo":{"allOf":[{"$ref":"#/components/schemas/ErpAddress"}],"description":"The license to address.","nullable":true},"sellTo":{"allOf":[{"$ref":"#/components/schemas/ErpAddress"}],"description":"The sell to address.","nullable":true},"shipTo":{"allOf":[{"$ref":"#/components/schemas/ErpAddress"}],"description":"The ship to address.","nullable":true}},"additionalProperties":false,"description":"Represents a list of addresses for billing purposes."},"ErpAddress":{"type":"object","properties":{"name":{"type":"string","description":"The primary name associated with the address."},"name2":{"type":"string","description":"The secondary name associated with the address.","nullable":true},"email":{"type":"string","description":"The email associated with the address.","nullable":true},"customerNo":{"type":"string","description":"The customer number associated with the address.","nullable":true},"addressLine1":{"type":"string","description":"The first line of the address."},"addressLine2":{"type":"string","description":"The second line of the address.","nullable":true},"addressLine3":{"type":"string","description":"The third line of the address.","nullable":true},"city":{"type":"string","description":"The city of the address.","nullable":true},"postCode":{"type":"string","description":"The postal code of the address.","nullable":true},"county":{"type":"string","description":"The county/state/region of the address.","nullable":true},"country":{"type":"string","description":"The country of the address.","nullable":true},"contactName":{"type":"string","description":"The contact name associated with the address.","nullable":true},"contactNo":{"type":"string","description":"The contact number associated with the address.","nullable":true},"contactEmail":{"type":"string","description":"The contact email associated with the address.","nullable":true},"contactPhone":{"type":"string","description":"The contact phone number associated with the address.","nullable":true},"code":{"type":"string","description":"The code associated with the address.","nullable":true}},"additionalProperties":false,"description":"Represents an address with various details such as name, address lines, city, postcode, country, and contact name."},"ErpExternalIds":{"type":"object","properties":{"statement":{"type":"string","description":"Statement identifier.","nullable":true},"customer":{"type":"string","description":"Bill to customer identifier.","nullable":true},"agreement":{"type":"string","description":"Agreement identifier.","nullable":true}},"additionalProperties":false,"description":"Represents invoice references ."},"AgreementRef":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"icon":{"type":"string","nullable":true},"revision":{"type":"integer","format":"int32"},"status":{"allOf":[{"$ref":"#/components/schemas/AgreementStatus"}]}},"additionalProperties":false},"AgreementStatus":{"enum":["New","Draft","Provisioning","Updating","Active","Terminated","Failed","Deleted"],"type":"string"},"BuyerRef":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"icon":{"type":"string","nullable":true},"revision":{"type":"integer","format":"int32"}},"additionalProperties":false},"AccountRef":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"icon":{"type":"string","nullable":true},"revision":{"type":"integer","format":"int32"},"type":{"allOf":[{"$ref":"#/components/schemas/AccountType"}],"nullable":true},"status":{"allOf":[{"$ref":"#/components/schemas/AccountStatus"}],"nullable":true}},"additionalProperties":false},"AccountType":{"enum":["Client","Vendor","Operations"],"type":"string"},"AccountStatus":{"enum":["Active","Enabled","Disabled"],"type":"string"},"LicenseeRef":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"icon":{"type":"string","nullable":true},"revision":{"type":"integer","format":"int32"},"externalId":{"type":"string","nullable":true}},"additionalProperties":false},"CreditMemoLine":{"type":"object","properties":{"id":{"type":"string","description":"The unique identifier for the credit memo line."},"description":{"type":"string","description":"The description of the credit memo line.","nullable":true},"description2":{"type":"string","description":"The secondary description (aka additional info) of the credit memo line.","nullable":true},"documentNo":{"type":"string","description":"The document number associated with the credit memo line."},"erpData":{"allOf":[{"$ref":"#/components/schemas/CreditMemoLineErpData"}],"description":"The ERP-specific data related to the credit memo line."},"itemNo":{"type":"string","description":"The item number for the credit memo line.","nullable":true},"lineNo":{"type":"integer","description":"The line number for the credit memo line.","format":"int32"},"period":{"allOf":[{"$ref":"#/components/schemas/DatePeriod"}],"description":"The period associated with the credit memo line."},"price":{"allOf":[{"$ref":"#/components/schemas/CreditMemoLinePrice"}],"description":"The price details for the credit memo line."},"cloudiqTenant":{"type":"string","description":"Cloud iQ tenant.","nullable":true}},"additionalProperties":false,"description":"Represents a line item in a credit memo, containing details such as amounts, descriptions, and identifiers."},"CreditMemoLineErpData":{"type":"object","properties":{"contractNo":{"type":"string","description":"The contract number associated with the credit memo line.","nullable":true},"countryOfUsage":{"type":"string","description":"The country of usage for the credit memo line.","nullable":true},"dataOrigin":{"type":"integer","description":"The data origin for the credit memo line.","format":"int32","nullable":true},"externalPositionNo":{"type":"string","description":"The external position number for the credit memo line.","nullable":true},"navisionCountryCode":{"type":"string","description":"The Navision country code for the credit memo line."},"parentItemNo":{"type":"string","description":"The parent item number for the credit memo line.","nullable":true},"primary":{"allOf":[{"$ref":"#/components/schemas/ErpCode"}],"description":"The primary code details for the credit memo line, if any."},"secondary":{"allOf":[{"$ref":"#/components/schemas/ErpCode"}],"description":"The secondary code details for the credit memo line, if any."},"rowVersion":{"type":"integer","description":"The row version of the credit memo line, for concurrency control.","format":"int64","nullable":true},"responsibilityCenterCode":{"type":"string","description":"The responsibility center code for the credit memo line.","nullable":true},"swoPurchaseOrderNo":{"type":"string","description":"The SWO purchase order number for the credit memo line.","nullable":true},"type":{"type":"integer","description":"The type of the credit memo line.","format":"int32","nullable":true},"unitOfMeasure":{"type":"string","description":"The unit of measure for the credit memo line.","nullable":true},"varAgreementNo":{"type":"string","description":"The VAR agreement number for the credit memo line.","nullable":true},"varPartnerNo":{"type":"string","description":"The VAR partner number for the credit memo line.","nullable":true}},"additionalProperties":false,"description":"Represents ERP-specific data related to a credit memo line."},"ErpCode":{"type":"object","properties":{"identifier":{"type":"string","description":"The unique identifier for the ERP code."},"value":{"type":"string","description":"The value of the ERP code.","nullable":true},"version":{"type":"string","description":"The version of the ERP code.","nullable":true}},"additionalProperties":false,"description":"Represents ERP-specific data related to a credit memo line or invoice line."},"DatePeriod":{"type":"object","properties":{"start":{"type":"string","description":"The start date and time of the period.","format":"date-time"},"end":{"type":"string","description":"The end date and time of the period.","format":"date-time"}},"additionalProperties":false,"description":"Represents the period during which a charge is applicable."},"CreditMemoLinePrice":{"type":"object","properties":{"amount":{"type":"number","description":"The amount for the credit memo line, visible to clients or operations.","format":"double","nullable":true},"amountIncludingVat":{"type":"number","description":"The amount including VAT for the credit memo line, visible to clients or operations.","format":"double","nullable":true},"discountAmount":{"type":"number","description":"The discount amount for the credit memo line, visible to clients or operations.","format":"double","nullable":true},"invoiceDiscountAmount":{"type":"number","description":"The invoice discount amount for the credit memo line, visible to clients or operations.","format":"double","nullable":true},"lineAmount":{"type":"number","description":"The line amount for the credit memo line, visible to clients or operations.","format":"double","nullable":true},"purchaseCurrencyCode":{"type":"string","description":"The currency used for the purchase price, visible only to operations.","nullable":true},"purchaseCurrencyFactor":{"type":"number","description":"The factor applied to the purchase currency, visible only to operations.","format":"double","nullable":true},"purchasePrice":{"type":"number","description":"The purchase price for the credit memo line, visible only to operations.","format":"double"},"purchasePriceLcy":{"type":"number","description":"The purchase price in local currency for the credit memo line, visible only to operations.","format":"double"},"purchasePriceTotal":{"type":"number","description":"The total purchase price for the credit memo line, visible only to operations.","format":"double"},"purchasePriceTotalLcy":{"type":"number","description":"The total purchase price in local currency for the credit memo line, visible only to operations.","format":"double"},"quantity":{"type":"integer","description":"The quantity for the credit memo line.","format":"int32"},"salesMarkup":{"type":"number","description":"The sales markup for the credit memo line, visible only to operations.","format":"double","nullable":true},"salesMargin":{"type":"number","description":"The sales margin for the credit memo line, visible only to operations.","format":"double","nullable":true},"unitPrice":{"type":"number","description":"The unit price for the credit memo line.","format":"double","nullable":true},"vatBaseAmount":{"type":"number","description":"The VAT base amount for the credit memo line.","format":"double"},"vatCalculationType":{"type":"integer","description":"The VAT calculation type for the credit memo line.","format":"int32","nullable":true},"vatPercent":{"type":"number","description":"The VAT percentage for the credit memo line.","format":"double","nullable":true}},"additionalProperties":false,"description":"Represents the price details of a credit memo line."},"CreditMemoPriceSummary":{"type":"object","properties":{"currency":{"type":"string","description":"The currency of the credit memo."},"currencyFactor":{"type":"number","description":"The factor applied to the currency, used for conversion or adjustments.","format":"double","nullable":true},"currencyFactor2":{"type":"number","description":"The second factor applied to the currency, used for conversion or adjustments.","format":"double","nullable":true},"margin":{"type":"number","description":"The margin value of the credit memo, visible to operations.","format":"double","nullable":true},"markup":{"type":"number","description":"The markup value of the credit memo, visible to operations.","format":"double","nullable":true},"totalPP":{"type":"number","description":"The total purchase price (PP) of the credit memo, visible to operations.","format":"double","nullable":true},"totalSP":{"type":"number","description":"The total selling price (SP) of the credit memo, visible to clients or operations.","format":"double","nullable":true},"totalST":{"type":"number","description":"The total sales tax (ST) of the credit memo, visible to clients or operations.","format":"double","nullable":true},"totalGT":{"type":"number","description":"The total gross amount (GT) of the credit memo, visible to clients or operations.","format":"double","nullable":true}},"additionalProperties":false,"description":"Represents a summary of price details for a credit memo."},"ProductRef":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"icon":{"type":"string","nullable":true},"revision":{"type":"integer","format":"int32"},"externalIds":{"allOf":[{"$ref":"#/components/schemas/ProductExternalIdBag"}]},"status":{"type":"string"}},"additionalProperties":false},"ProductExternalIdBag":{"type":"object","properties":{"operations":{"type":"string","nullable":true},"defaultErpItem":{"type":"string","nullable":true}},"additionalProperties":false},"SellerRef":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"icon":{"type":"string","nullable":true},"revision":{"type":"integer","format":"int32"},"externalId":{"type":"string","nullable":true}},"additionalProperties":false},"CreditMemoStatus":{"enum":["Issued"],"type":"string"},"StatementRef":{"type":"object","properties":{"revision":{"type":"integer","format":"int32"},"id":{"type":"string","description":"The unique identifier of the statement."}},"additionalProperties":false,"description":"Represents a billing statement in the system, containing details about transactions, pricing, and associated entities."},"AnalyticsInfo":{"type":"object","properties":{"status":{"allOf":[{"$ref":"#/components/schemas/AnalyticsStatus"}],"description":"The current status of the analytics operation."}},"additionalProperties":false,"description":"Analytics insofmation."},"AnalyticsStatus":{"enum":["Pending","Running","Ready","Failed"],"type":"string","description":"Specifies the status of an analytics operation."},"ProblemDetails":{"type":"object","properties":{"type":{"type":"string","nullable":true},"title":{"type":"string","nullable":true},"status":{"type":"integer","format":"int32","nullable":true},"detail":{"type":"string","nullable":true},"instance":{"type":"string","nullable":true}},"additionalProperties":{}}}}}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.platform.softwareone.com/developer-resources/rest-api/billing-api/credit-memo/create-credit-memo.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
