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

# CustomShippingMethodCode

> What is needed to write or edit a custom shipping method: the custom rate contract, starter code, and optionally one method's current source.

**Required scopes:** [`checkout_read`](https://developers.redo.com/docs/api-reference/v3/reference/scopes#scope-checkout_read)

**contractId** `String!` *required*

The custom rate contract every script is checked against.

**sampleInput** `String!` *required*

A representative `Input` value as JSON, showing the cart, destination, origin, and coverage data the script receives.

**shippingMethod** `[CustomShippingMethodSource](/docs/api-reference/v3/reference/checkout/custom-shipping-method-source)`

The requested method's current code. Null when no method was requested.

**fields**

**checkoutExperienceId** `ID!` *required*

The checkout experience the method belongs to.

**code** `String!` *required*

The method's current TypeScript source. Edit it and send it back as `code` to updateShippingMethod.

**name** `String!` *required*

Merchant-facing label of the method. Shoppers see the name the code returns instead.

**shippingMethodId** `ID!` *required*

The custom shipping method.

**starterCode** `String!` *required*

A minimal working script to start a new custom method from.

**typeDefinitions** `String!` *required*

TypeScript declarations of the contract: `Input`, `Output`, and the ambient `money` helper. Code that does not type-check against these is rejected on write.


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