{"templateId":"markdown","sharedDataIds":{"sidebar":"sidebar-sidebars/sdk_sidebars.yaml"},"props":{"metadata":{"markdoc":{"tagList":["code-group"]},"type":"markdown"},"seo":{"title":"Adding shipping information","description":"The specifications of Ratepay's APIs for easy payment transactions.","siteUrl":"https://docs.ratepay.com","keywords":"Ratepay developer portal, Ratepay api portal, Ratepay api reference docs","llmstxt":{"hide":false,"sections":[{"title":"Table of contents","includeFiles":["**/*"],"excludeFiles":[]}],"excludeFiles":[]}},"dynamicMarkdocComponents":[],"compilationErrors":[],"ast":{"$$mdtype":"Tag","name":"article","attributes":{},"children":[{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"adding-shipping-information","__idx":0},"children":["Adding shipping information"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Attaches carrier and tracking details to a specific capture, useful for buyer communications and for"," ","carriers/schemes that expect delivery tracking on file. It's scoped to one capture, not the whole"," ","transaction, since a single order can ship (and be captured) in multiple parts. See the official documentation for"," ",{"$$mdtype":"Tag","name":"a","attributes":{"href":"https://docs.ratepay.com/docs/developer/api_integration/payment_2.0/payment_api_2.0"},"children":["adding shipping information"]},"."]},{"$$mdtype":"Tag","name":"CodeGroup","attributes":{"mode":"tabs"},"children":[{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"java","data-title":"Java","header":{"title":"Java","controls":{"copy":{}}},"source":"import com.ratepay.sdk.ShippingInformationOutcome;\nimport com.ratepay.sdk.model.api.payment.CarrierName;\nimport com.ratepay.sdk.model.api.payment.ShippingInformationRequest;\n\nShippingInformationRequest request = new ShippingInformationRequest(\n    CarrierName.DHL,\n    \"00340434292135100002\"\n);\n\nShippingInformationOutcome outcome =\n    client.sendShippingInformation(ratepayTransactionId, ratepayCaptureId, request, null);\n\nif (outcome.kind() == ShippingInformationOutcome.Kind.ACCEPTED) {\n    var accepted = (ShippingInformationOutcome.Accepted) outcome;\n    System.out.println(\"Recorded: \" + accepted.getRatepayShippingInformationId());\n} else {\n    var declined = (ShippingInformationOutcome.Declined) outcome;\n    System.out.println(\"Declined: \" + declined.getDecline().getCategory());\n}\n","lang":"java"},"children":[]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"kotlin","data-title":"Kotlin","header":{"title":"Kotlin","controls":{"copy":{}}},"source":"import com.ratepay.sdk.ShippingInformationOutcome\nimport com.ratepay.sdk.model.api.payment.CarrierName\nimport com.ratepay.sdk.model.api.payment.ShippingInformationRequest\n\nval request = ShippingInformationRequest(\n    carrierName = CarrierName.DHL,\n    trackingNumber = \"00340434292135100002\",\n)\n\nwhen (val outcome = client.sendShippingInformation(ratepayTransactionId, ratepayCaptureId, request)) {\n    is ShippingInformationOutcome.Accepted -> println(\"Recorded: ${outcome.ratepayShippingInformationId}\")\n    is ShippingInformationOutcome.Declined -> println(\"Declined: ${outcome.decline.category}\")\n}\n","lang":"kotlin"},"children":[]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["trackingNumber"]}," is optional as some carrier/fulfillment setups (e.g. ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["OTHER_WITHOUT_TRACKING"]},") don't have"," ","one. ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["carrierName"]}," accepts a fixed enum (",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["DHL"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["UPS"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["FEDEX"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["GLS"]},", and others). See ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["CarrierName"]}," for"," ","the full list."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"exceptions","__idx":1},"children":["Exceptions"]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Exception"},"children":["Exception"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"HTTP Status Code"},"children":["HTTP Status Code"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["RatepayAuthException"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["401/403"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["RatepayValidationException"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["400"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["RatepayTransactionNotFoundException"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["404"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["RatepayLegalException"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["451"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["RatepayNetworkException"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["5xx/transport"]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"next","__idx":2},"children":["Next"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"a","attributes":{"href":"/docs/developer/sdk/errors-and-resilience/exception-hierarchy"},"children":["Error handling"]}," for the full exception reference across"," ","every operation."]}]}]},"headings":[{"value":"Adding shipping information","id":"adding-shipping-information","depth":1},{"value":"Exceptions","id":"exceptions","depth":2},{"value":"Next","id":"next","depth":2}],"frontmatter":{"seo":{"title":"Adding shipping information"}},"lastModified":"2026-11-04T12:17:22.000Z","pagePropGetterError":{"message":"","name":""}},"slug":"/docs/developer/sdk/guides/adding-shipping-information","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}