> ## Documentation Index
> Fetch the complete documentation index at: https://docs.slm.m1amdocs.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Creating Custom-Defined Merchant Cancel Reason Codes

If none of the Predefined Merchant Codes meets your needs, you can create your own Custom-Defined Merchant Codes and store them for later use when you cancel AutoBills. Cancel reasons include a code (an alphanumeric string of up to 16 characters) and a description (a string of up to 255 characters).The following example shows how to use an AutoBill object to submit a new `cancelReason` object for later use. Note that this example creates a custom reason code, but does not assign it to the object or cancel an AutoBill.

```
 
 $autobill = AutoBill->new(
 auth_login => $userid,
 auth_password => $password
 );
 $code = "NH5001";
 $desc = "Customer went to a competitor";
 
 $cancelReasonObj = CancelReason->new(
 reason_code => $code,
 description => $desc
 );
 $rc = $autobill->updateCancelReason($cancelReasonObj);
 if ($rc->{return}->returnCode == 200)
 {
  print "Cancel Reason code $code ready for use.";
 }
```

**Parent topic:**[Canceling AutoBills](../topics/Canceling_AutoBills)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.