22
33The question we are most asked is: ** How to add a custom carrier?**
44
5- We have experimented and studied approximately ~ 25 shipping carriers API/web services to design the Purplship structure as is.
5+ We have experimented and studied approximately ~ 25 shipping carriers API/web services to design the purplship structure as is.
66
7- The good news is that making adding a custom carrier easy fits perfectly in Purplship vision.
7+ The good news is that making adding a custom carrier easy fits perfectly in purplship vision.
88
99!!! caution
1010 To integrate a custom carrier at this stage, you will need:
@@ -23,8 +23,8 @@ The good news is that making adding a custom carrier easy fits perfectly in Purp
2323 1 . Generate Python data types from the carrier API schemas using the type generators bellow
2424 2 . Package the generated data types as a library in [ purplship-carriers] ( https://github.com/PurplShip/purplship-carriers )
2525
26- 1 . Create a Purplship extension package
27- 1 . Create a new Purplship extension by copying [ .templates/carrier] ( https://github.com/PurplShip/purplship/tree/main/.templates/carrier )
26+ 1 . Create a purplship extension package
27+ 1 . Create a new purplship extension by copying [ .templates/carrier] ( https://github.com/PurplShip/purplship/tree/main/.templates/carrier )
2828 into [ extensions/[ carrier-name]] ( https://github.com/PurplShip/purplship/tree/main/extensions )
2929
3030 2 . Rename all instance for [ carrier] to the appropriate carrier name you are integrating. This must be done for files
@@ -42,37 +42,37 @@ The good news is that making adding a custom carrier easy fits perfectly in Purp
4242
4343### Extension anatomy
4444
45- Considering the vision we aimed to achieve with Purplship , the codebase has been modularized with a clear separation of
45+ Considering the vision we aimed to achieve with purplship , the codebase has been modularized with a clear separation of
4646concerns to decouple clearly the carrier integration from the integration abstraction. Additionally, each carrier
4747integration is done in an isolated self-contained package.
4848
4949As a result, we have a very modular ecosystem where one can only select the carrier integrations of interest without
5050carrying the whole codebase.
5151
52- ** Most importantly, this flexibility allows the integration of additional carrier services under the Purplship umbrella.**
52+ ** Most importantly, this flexibility allows the integration of additional carrier services under the purplship umbrella.**
5353
5454!!! info
55- Purplship makes shipping API integration easy for a single carrier and in a multi-carrier scenario, the benefit
55+ purplship makes shipping API integration easy for a single carrier and in a multi-carrier scenario, the benefit
5656 is exponential.
5757
5858
5959#### Module convention
6060
61- Two modules are required to create a Purplship extension.
61+ Two modules are required to create a purplship extension.
6262
6363!!! abstract "` purplship.mappers.[carrier_name] ` "
64- This is where the Purplship abstract classes are implemented. Also, the Metadata require to identified
64+ This is where the purplship abstract classes are implemented. Also, the Metadata require to identified
6565 the extension is also provided there.
6666
6767 > on runtime, purplship retrieves all mappers by going trought the ` purplship.mappers ` modules
6868
6969!!! abstract "` purplship.providers.[carrier_name] ` "
70- This is where the mapping between Purplship Unified API data is mapped on the carrier data type corresponding requests
70+ This is where the mapping between purplship Unified API data is mapped on the carrier data type corresponding requests
7171
7272#### extension signature
7373
74- The Mapper is the cornerstone of Purplship 's abstraction. A ` Metadata ` declared at ` purplship.mappers.[carrier_name].__init__ `
75- specifies the integration classes required to define a Purplship compatible extension.
74+ The Mapper is the cornerstone of purplship 's abstraction. A ` Metadata ` declared at ` purplship.mappers.[carrier_name].__init__ `
75+ specifies the integration classes required to define a purplship compatible extension.
7676
7777``` text
7878from purplship.core.metadata import Metadata
@@ -150,7 +150,7 @@ The mapper function implementations consists of instantiating carrier specific r
150150=== "Mapper"
151151
152152 ```python
153- # Import Purplship unified API models
153+ # Import purplship unified API models
154154 from purplship.core.models import PickupRequest
155155
156156 # Import requirements from the DHL generated data types library (py-dhl)
@@ -271,7 +271,7 @@ The mapper function implementations consists of instantiating carrier specific r
271271
272272### Generated schema data types
273273
274- To keep to robustness and simplify the maintenance of the codebase, In Purplship , we use Python data types reflecting
274+ To keep to robustness and simplify the maintenance of the codebase, In purplship , we use Python data types reflecting
275275the schemas of carriers we want to integrate.
276276That said, defining every schema object's structure can be tedious, long and unproductive. Therefore, code generators
277277are used to generate Python data types based of the schema format definition.
@@ -305,7 +305,7 @@ to define yours.
305305#### Multi requests
306306
307307Generally, the carrier web services expose one API endpoint to accomplish most operations describe supported by
308- the Purplship unified interface. In some case, more than one API call are required to fulfil certain operation.
308+ the purplship unified interface. In some case, more than one API call are required to fulfil certain operation.
309309
310310##### Abstraction
311311
0 commit comments