setCustomAttributesOnCreditMemo mutation
This mutation is automatically available on Adobe Commerce as a Cloud Service (SaaS) projects. Adobe Commerce on-premises and Cloud infrastructure (PaaS) projects can install separate modules to provide this functionality.
The setCustomAttributesOnCreditMemo
mutation sets custom attributes on a credit memo. The mutation accepts a credit memo ID and an array of custom attribute key/value pairs. It returns the updated credit memo. All ID values are treated as strings.
To remove a custom attribute, rerun the mutation without the previously applied custom attribute.
Syntax
Copied to your clipboardmutation {setCustomAttributesOnCreditMemo(input: CreditMemoCustomAttributesInput){CreditMemoOutput}}
Reference
The setCustomAttributesOnCreditMemo
reference provides detailed information about the types and fields defined in this mutation.
Example usage
The following example sets two custom attributes on a credit memo with the ID MzQ=
.
Request:
Copied to your clipboardmutation {setCustomAttributesOnCreditMemo(input: {credit_memo_id: "MzQ=",custom_attributes: [{attribute_code: "attribute_one",value: "value_one"},{attribute_code: "attribute_two",value: "value_two"},]}), {credit_memo {idcustom_attributes {attribute_codevalue}}}}
Response:
Copied to your clipboard{"data": {"setCustomAttributesOnCreditMemo": {"credit_memo": {"id": "MzQ=","custom_attributes": [{"attribute_code": "attribute_one","value": "value_one"},{"attribute_code": "attribute_two","value": "value_two"}]}}}}