logo
Find anything /
Sign In

Introduction

YouCan Ship API allows you to integrate your application with the various services that YouCan Ship offers such as:

  • Processing Packages
  • Processing Addresses
  • Processing Collect Money

It is a REST API, accepts form-encoded or JSON-encoded request bodies, and returns JSON-encoded responses with structured resource responses. It also uses standard HTTP status codes to indicate success or failure of the request.

JUST GETTING STARTED ?

If you're interested in implementing YouCan Ship as a Management Packages provider, you can use the following guide to get started.

Errors

YouCan Ship uses conventional HTTP response codes to indicate the success or failure of an API request. In general: Codes in the 2xx range indicate success. Codes in the 4xx range indicate an error that failed given the information provided (e.g., a required parameter was omitted, a charge failed, etc.). Codes in the 5xx range indicate an error with YouCan Ship's servers (these are rare). Some 4xx errors could be handled programmatically.

Errors


error string

A human-readable message providing more details about the error.


Validation Error object

Contains children

Child attributes

Validation Error.message string

A human-readable message providing more details about the error.

200 - OK
Everything worked as expected.
201 - Created
The object has been successfully created.
202 - Accepted
The object has been successfully accepted.
400 - Bad Request
The request was unacceptable, often due to missing a required parameter.
401 - Unauthorized
No valid API key provided.
422 - Unprocessable Entity
Validation error.
404 - Not Found
The requested resource doesn't exist.
500 - Server Errors
Something went wrong on YouCan Ship's end. (These are rare.)

Account

Accounts are the source of truth used to perform any action while consuming our API. We have provided all necessary account related actions, thus making it easier to exploit different aspects of our system.

Register for an account

As mentioned above, an account is required to consume any endpoint. In order to sign up, you are required to send the object below with your request.

Note: all fields below are required.

Registration


full_name string

Full name of the account owner. The full name characters length must be between 3 to 100.


email string

Email of the account owner. Email can be used to access ones YouCan Ship account.


phone string

Phone number of the account owner.


password string

Password of the account. Password must contain at least 8 characters in length.

Returns


Returns a success message when account is created.

post /register
    
      $ curl --location --request POST 'https://ship.youcan.shop/api/auth/register' \
  --form 'full_name="full_name"' \
  --form 'email="[email protected]"' \
  --form 'phone="0612345678"' \
  --form 'password="password"' \
  --header 'Accept: application/json'
    
  
Response
    
      {
  "message": "Account registered successfully."
}
    
  

Authentication

YouCan Ship relies on JSON Web Tokens for authentication. The token generated must be provided in any request as a bearer token, requests sent with an invalid token are rejected.

Note: your token is key to perform a lot of actions in your account, don't share it with anyone else that has malicious to avoid any unwanted consequence.

Authentication


email string

Email account used while creating account.


password string

Password of the account. Password must match the email used to create the account.

Returns


Returns a JSON web token when successful.

post /login
    
      $ curl --location --request POST 'https://ship.youcan.shop/api/auth/login \
  --form 'email="[email protected]"' \
  --form 'password="password"' \
  --header 'Accept: application/json'
    
  
Response
    
      {
  "token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOi8vZGV2Y2Fuc2hpcHkuY29tL2FwaS9zZWxsZXJzL2F1dGgvbG9naW4iLCJpYXQiOjE2NTI3ODEzNzcsImV4cCI6MTY1NTM3MzM3NywibmJmIjoxNjUyNzgxMzc3LCJqdGkiOiIxQlBnSVU1UWJ2Umh2cm5KIiwic3ViIjoiZTE5ODY0NWQtODZhYS00YmVlLThjOTYtNzI4YTYwNDcwZjE1IiwicHJ2IjoiYzA5OTgwY2U0ZGIzNWM0ODYzNmIxZGM2YmM0MGRmYjBkZDFhZTVlNCIsInVzZXIiOnsiaWQiOiJlMTk4NjQ1ZC04NmFhLTRiZWUtOGM5Ni03MjhhNjA0NzBmMTUiLCJmdWxsX25jbWUiOiJDbGludG9uIFJob2RlcyIsInBob25lIjoiMDYyMDQ0NTg1NiJ9fQ.HEQ50AjvZKxsumuq7XKRIr3IePdLbBhaIdImhDrcA_I",
  "as": "seller"
}
    
  

Refresh auth token

When you initially receive a refresh token it'll have an expiration time which in some cases may be inconvenient if you are performing long time span actions. In that case an endpoint to programmatically refresh your token is available.

post /refresh
    
      $ curl --location --request POST 'https://ship.youcan.shop/api/auth/refresh-token' \
  --header 'Accept: application/json' \
  --header 'Authorization: Bearer YOUR_TOKEN_eyJpc3...'
    
  
Response
    
      {
  "token": "YOUR_TOKEN_eyJpc3MiOiJodHRwOlwvXC9wYXkuZG90c2hvcC5jb21cL2....",
  "expires_in": 3600
}
    
  

Logout

In cases where you want to invalidate your token, you can call this endpoint to logout, by doing so, you can make sure that the token is no longer valid.

post /logout
    
      $ curl --location --request POST 'https://ship.youcan.shop/api/auth/logout' \
  --header 'Accept: application/json' \
  --header 'Authorization: Bearer YOUR_TOKEN_eyJpc3...'
    
  
Response
    
      {
  "token": "YOUR_TOKEN_eyJpc3MiOiJodHRwOlwvXC9wYXkuZG90c2hvcC5jb21cL2....",
  "expires_in": 3600
  }
    
  

Addresses

Adresses means, with respect to a physical location, the street name and number, city, state, and the postal code. If, by reason of rural location or otherwise, a street name and number, city, or town does not exist, "address" shall mean an appropriate description fixing as nearly as possible the actual physical location.

The address object

The address object


id string

The object's unique identifier.


code string

A code to your address.


first_name string

The first name of the address owner.


last_name string

The last name of the address owner.


first_line string

The exact address where is your home or depot.


phone string

Phone number of the address owner.


zip-code string

A series of digits designating a specific locality.


city string

The city in which the item to be shipped is located.


seller_id string

The identifier of the account which created the address.


is_default boolean

Default or not.

The address object
    
      {
  "id": "inv_b722cb58-0ba1-428d-99e4-b54ded47d9f6",
  "code": "T123",
  "first_name": "Jack",
  "last_name": "Morton",
  "first_line": "IMM 123 Lotis al Baraka",
  "phone": "0622222222",
  "zip_code": "12345",
  "city": "Rabat",
  "seller_id": "f12f476c-a30d-40f9-9d5d-ba043072aba1",
  "is_default": false
}
    
  

Create an address

This endpoint creates an address.

Create an address


code optional

A code to your address.


first_name required

The first name of the address owner.


last_name required

The last name of the address owner.


address required

The exact address where is your home or depot.


phone required

Phone number of the address owner.


zip-code required

A series of digits designating a specific locality.


city required

The city in wich the item to be shipped is located.

Returns


Returns an address object if the request was successful.

post /address
    
      $ curl --location --request POST 'https://YouCanship.com/api/sellers/address' \
  --form 'code="tes ref"' \
  --form 'first_name="Jack"' \
  --form 'last_name="Morton"' \
  --form 'address="IMM 123 Lotis Al Baraka"' \
  --form 'phone="0669336603"' \
  --form 'zip_code="12345"' \
  --form 'city="Rabat"' \
  --header 'Accept: application/json' \
  --header 'Authorization: Bearer YOUR_TOKEN_eyJpc3...'
    
  
The response object
    
      {
  "data": {
    "id": "inv_b722cb58-0ba1-428d-99e4-b54ded47d9f6",
    "code": "T123",
    "full_name": "Jack Morton",
    "address": "IMM 123 Lotis Al Baraka",
    "phone": "0620001200",
    "zip_code": "12345",
    "city": "Rabat",
  }
}
    
  

Update an address

This endpoint updates an address.

Update an address


code optional

A code to your address.


first_name required

The first name of the address owner.


last_name required

The last name of the address owner.


phone required

Phone number of the address owner.


first_line required

Address of the address owner.


zip-code optional

A series of digits designating a specific locality.


city required

The city in which the item to be shipped is located. It can be passed as id or name.

Returns


Returns a successfully message.

post /addresses
    
      $ curl --location 'https://ship.canshipy.com/api/addresses/99190dbe-67ed-486f-a90d-382184116b89' \
  --header 'Accept: application/json' \
  --header 'Authorization: Bearer ...' \
  --form 'code="1122222"' \
  --form 'first_name="Jack"' \
  --form 'last_name="Jack"' \
  --form 'phone="0621567876"' \
  --form 'city="Oujda"' \
  --form 'first_line="IMM 123 Lotis Al Baraka"' \
  --form 'zip_code="1000"''
    
  
The response object
    
      {
  "message": "Address updated successfully"
}
    
  

List all addresses

Returns a list of address objects related to the current authenticated account.

list all addresses


code optional

A code to your address.


first_name required

The first name of the address owner.


last_name required

The last name of the address owner.


first_line required

The exact address where is your home or depot.


phone required

Phone number of the address owner.


zip-code required

A series of digits designating a specific locality.


city required

The city in which the item to be shipped is located.

Returns


Returns a collection of addresses objects. If no address is found, returns an empty collection.

get /addresses
    
      $ curl --location -g --request GET 'https://ship.youcan.shop/api/addresses' \
  --header 'Accept: application/json' \
  --header 'Authorization: Bearer YOUR_TOKEN_eyJpc3...'
    
  
The address object
    
      {
  "data": [
      {
        "id": "inv_b722cb58-0ba1-428d-99e4-b54ded47d9f6",
        "code": "T123",
        "full_name": "Jack Morton",
        "address": "IMM 123 Lotis Al Baraka",
        "phone": "0620001200",
        "zip_code": "12345",
        "city": "Rabat",
      },
      {...}
  ],
  "meta": {...}
}
    
  

List a specific address

Returns a specific address objects related to the current authenticated account.

List a specific address


code optional

A code to your address.


first_name required

The first name of the address owner.


last_name required

The last name of the address owner.


first_line required

The exact address where is your home or depot.


phone required

Phone number of the address owner.


zip-code required

A series of digits designating a specific locality.


city required

The city in which the item to be shipped is located.

Returns


Returns a collection of address objects. If no address is found, it returns an empty collection.

get /addresses/{address_id}
    
      $ curl --location -g --request GET 'https://ship.youcan.shop/api/addresses/{address_id}' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer YOUR_TOKEN_eyJpc3...'
    
  
The response object
    
      {
  "data": {
    "id": "inv_b722cb58-0ba1-428d-99e4-b54ded47d9f6",
    "code": "T123",
    "full_name": "Jack Morton",
    "first_line": "IMM 123 Lotis Al Baraka",
    "phone": "0620001200",
    "zip_code": "12345",
    "city": "Rabat",
  }
}
    
  

Cities

Cities means a densely populated and organized human settlement where people live, work, and engage in various activities, such as business, industry, culture, and governance, all within a specific geographical area. These areas are typically managed by a local government or municipal authority.

Endpoints

List all cities

Returns a list of city objects related to the current authenticated account.

list all addresses


id required

The identifier city key


name required

The name of the city


zip-code required

A series of digits designating a specific locality.

Returns


Returns a collection of cities objects. If no city is found, returns an empty collection.

get /cities
    
      $ curl --location -g --request GET 'https://ship.youcan.shop/api/cities' \
  --header 'Accept: application/json' \
  --header 'Authorization: Bearer YOUR_TOKEN_eyJpc3...'
    
  
The city object
    
      {
  "data": [
    {
      "id": "1453",
      "name": "Aazanen",
      "zip_code": "62022"
    },
    ...
  ],
}
    
  

Packages

Packages means a document, group of documents, related or unrelated, bundled into a single entity for electronic transfer.

The package object

The package object


id string

The object's unique identifier.


ref string

A reference to your package.


pickup_address_id string

The identifier of the address who will receive the package.


money_collect_type integer

How you will get your money. [1] Normal | [2] Instant.


payment_method string

Type of payment method. [1] COD | [2] Prepaid.


shipping_company_id string

The of shipping company identifier.


customer_first_name string

The first name of the customer.


customer_last_name string

The last name of the customer.


customer_phone string

Phone number of the customer.


customer_city string

City of the customer.


customer_address string

Address of the customer.


package_value string

The monetary value of the package.


collect_money string

Received amount.


delivery_price integer

Shipping price.


return_to_seller_price integer

Amout refunded if the order is not delivered.


delivery_status integer

The status of invoice. [1] pending | [2] assigned | [3] picked_up | [4] delivered | [5] cash_return | [-1] canceled


seller_id string

The identifier of the account which created the package.


seller_note optional

Take some notes.

The package object
    
      {
    "id": "inv_b722cb58-0ba1-428d-99e4-b54ded47d9f6",
    "ref": "T123",
    "pickup_address_id": "b722cb58-0ba1-428d-99e4-b54ded47d9f6",
    "money_collect_type": 1,
    "payment_method": 2,
    "shipping_company_id": "4ed6d99443180e",
    "seller_note": "Breakable Item",
   "customer_first_name": "Jhon",
    "customer_last_name": "Martan",
    "customer_phone": "0620112233",
    "customer_city": "Rabat",
    "customer_address": "IMM 123 Lotis Al Baraka",
    "package_value": 26,
    "collect_money": 26,
    "delivery_price": 40,
    "return_to_seller_price": 40,
    "delivery_status": 1,
    "seller_id": "f12f476c-a30d-40f9-9d5d-ba043072aba1",
  }
    
  

Create a package

This endpoint create a package.

Create a package


ref optional

A reference to your package.


pickup_address_id required

The identifier of the address who will receive the package.


money_collect_type required

How you will get your money. [1] Normal | [2] Instant.


payment_method required

Type of payment method. [1] COD | [2] Prepaid.


shipping_company_id required

The of shipping company identifier.


customer_first_name required

The first name of the customer.


customer_last_name required

The last name of the customer.


customer_phone required

Phone number of the customer.


customer_city required

City of the customer.


customer_address required

Address of the customer.


package_value required

The monetary value of the package.


collect_money required

Received amount.


seller_note optional

Take some notes.


meta_fields optional

Additional metadata fields.

Returns


Returns a package object if the request is successful.

post /packages
    
      $ curl --location --request POST 'https://ship.youcan.shop/api/package' \
  --form 'ref="Ref123"' \
  --form 'pickup_address_id="f12f476c-a30d-40f9-9d5d-ba043072aba1"' \
  --form 'money_collect_type=1' \
  --form 'payment_method=2' \
  --form 'seller_note="Breakable Item"' \
  --form 'shipping_company_id="4ed6d99443180e"' \
  --form 'customer_first_name="Jhon"' \
  --form 'customer_last_name="Martan"' \
  --form 'customer_phone="0620112233"' \
  --form 'customer_city="Rabat"' \
  --form 'customer_address="IMM 123 Lotis Al Baraka"' \
  --form 'package_value=22' \
  --form 'collect_money=29' \
  --header 'Accept: application/json' \
  --header 'Authorization: Bearer YOUR_TOKEN_eyJpc3...'
    
  
The response object
    
      {
    "data": {
      "id": "inv_b722cb58-0ba1-428d-99e4-b54ded47d9f6",
      "ref": "Ref123",
      "customer_full_name": "Jhon Martan",
      "customer_city: "Rabat",
      "customer_phone": "0620001200",
      "customer_address": "IMM 123 Lotis Al Baraka",
      "payment_method": 2,
      "package_value": 46,
      "collect_money": 51,
      "shipping_company_id": "4ed6d99443180e",
      "seller_note": "Breakable Item"
      "delivery_status": 1,
      "meta_fields": {
         "affiliate_ref": "COD-120129"
      },
      "seller": {
        "id": "ae780751-c050-4794-b68a-a7611487f5b9",
        "full_name": "Dan Sheddy",
        "phone": "065244722"
      }
    }
  }
    
  

List all packages

Returns a list of package objects related to the current authenticated account.

List packages


ref optional

A reference to your package.


pickup_address_id required

The identifier of the address who will receive the package.


money_collect_type required

How you will get your money. [1] Normal | [2] Instant.


payment_method required

Type of payment method. [1] COD | [2] Prepaid.


shipping_company_id required

The of shipping company identifier.


customer_first_name required

The first name of the customer.


customer_last_name required

The last name of the customer.


customer_phone required

Phone of the customer.


customer_city required

City of the customer.


customer_address required

Address of the customer.


package_value required

The monetary value of the package.


collect_money required

Received amount.


seller_note optional

Take some notes.

Returns


Returns a paginated collection of object packages . If no package is found, it returns an empty collection.

get /packages
    
      $ curl --location -g --request GET 'https://ship.youcan.shop/api/packages' \
  --header 'Accept: application/json' \
  --header 'Authorization: Bearer YOUR_TOKEN_eyJpc3...'
    
  
The package object
    
      {
    "data": [
        {
          "id": "inv_b722cb58-0ba1-428d-99e4-b54ded47d9f6",
          "ref": "Ref123",
          "customer_full_name": "Jhon Martan",
          "customer_city: "Rabat",
          "customer_phone": "0620001200",
          "customer_address": "IMM 123 Lotis Al Baraka",
          "payment_method": 2,
          "package_value": 46,
          "collect_money": 51,
          "shipping_company_id": "4ed6d99443180e",
          "seller_note": "Breakable Item"
          "delivery_status": 1,
          "seller": 
            {
              "id": "ae780751-c050-4794-b68a-a7611487f5b9",
              "full_name": "Dan Sheddy",
              "phone": "065244722"
            }
        },
        {...}
    ],
    "meta": {...}
  }
    
  

Retrieve a package

Returns a specific package object related to the current authenticated account.

Show a package


ref optional

A reference to your package.


pickup_address_id required

The identifier of the address who will receive the package.


money_collect_type required

How you will get your money. [1] Normal | [2] Instant.


payment_method required

Type of payment method. [1] COD | [2] Prepaid.


shipping_company_id required

The shipping company identifier.


customer_first_name required

The first name of the customer.


customer_last_name required

The last name of the customer.


customer_phone required

Phone of the customer.


customer_city required

City of the customer.


customer_address required

Address of the customer.


package_value required

The monetary value of the package.


collect_money required

Received amount.


seller_note optional

Take some notes.

Returns


Returns a collection of package object. If no package is found, it returns an empty collection.

get /packages/{package_id}
    
      $ curl --location -g --request GET 'https://ship.youcan.shop/api/packages/{package_id}' \
  --header 'Accept: application/json' \
  --header 'Authorization: Bearer YOUR_TOKEN_eyJpc3...'
    
  
The response object
    
      {
    "data": {
      "id": "inv_b722cb58-0ba1-428d-99e4-b54ded47d9f6",
      "ref": "Ref123",
      "customer_full_name": "Jhon Martan",
      "customer_city: "Rabat",
      "customer_phone": "0620001200",
      "customer_address": "IMM 123 Lotis Al Baraka",
      "payment_method": 2,
      "package_value": 46,
      "collect_money": 51,
      "shipping_company_id": "4ed6d99443180e",
      "seller_note": "Breakable Item",
      "delivery_status": 1,
      "seller":{
        "id": "ae780751-c050-4794-b68a-a7611487f5b9",
        "full_name": "Dan Sheddy",
        "phone": "065244722"
      }
    }
  }
    
  

Create a package from file

This endpoint creates a package from a file.

Create packages from file


packages_file required

A file to create your packages.

Returns


Returns a package object if the request is successful.

post /packages/bulk
    
      $ curl --location --request POST 'https://ship.youcan.shop/api/packages/bulk' \
  --form 'packages_file="exempleFile.csv"' \
  --header 'Accept: application/json' \
  --header 'Authorization: Bearer YOUR_TOKEN_eyJpc3...'
    
  
The response object
    
      {
  "create_orders": [
    {
      "data": {
        "id": "inv_b722cb58-0ba1-428d-99e4-b54ded47d9f6",
        "ref": "Ref123",
        "customer_full_name": "Jhon Martan",
        "customer_city": "Rabat",
        "customer_phone": "0620001200",
        "customer_address": "IMM 123 Lotis Al Baraka",
        "payment_method": 2,
        "package_value": 46,
        "collect_money": 51,
        "seller_note": "Lorem ipsum",
        "delivery_status": 1,
        "seller": {
          "id": "ae780751-c050-4794-b68a-a7611487f5b9",
          "full_name": "loik opli",
          "phone": "065244722"
        }
      }
    },
    {
      "data": {
        "id": "a0b3e84b-8102-4ee7-b683-be93fc22e311",
        "ref": "A2",
        "customer_full_name": "Mohamed Ibrahimi",
        "customer_address": "1 Ibno battouta",
        "customer_city": "Meknes",
        "customer_phone": "6764616161",
        "payment_method": 2,
        "package_value": 249,
        "collect_money": 249,
        "delivery_status": 1,
        "seller_note": "no comment",
        "created_at": "2022-05-19T09:42:24+00:00",
        "external_id": null,
        "seller": {
          "id": "ae780751-c050-4794-b68a-a7611487f5b9",
          "full_name": "loik opli",
          "phone": "065244722"
        }
      }
    }
  ],
  "failed-orders": []
}
    
  

Show Tracking Histories

Retrieves the tracking histories of a specific package associated with the currently authenticated account.

Show tracking histories


status

Numerical representation of the tracking status.


text

Textual description of the tracking status.


is_final string

Indicates if the tracking history has reached a terminal state (true if so).


happened_at

Timestamp when the tracking event occurred.

Returns


Returns a collection of package object. If no package is found, it returns an empty collection.

get /packages/tracking/{tracking_number}
    
      $ curl --location -g --request GET 'https://ship.youcan.shop/api/tracking/{tracking_number}' \
  --header 'Accept: application/json' \
  --header 'Authorization: Bearer YOUR_TOKEN_eyJpc3...'
    
  
The response object
    
      {
    "data": [
      {
        "status": 7,
        "text": "confirmed",
        "is_final": false,
        "happened_at": "2023-07-25 15:08"
      },
      {
        "status": 7,
        "text": "confirmed",
        "is_final": false,
        "happened_at": "2023-07-25 15:08"
      },
      {
        "status": 9,
        "text": "to shipping company hub",
        "is_final": false,
        "happened_at": "2023-07-25 20:34"
      },
      {
        "status": 9,
        "text": "to shipping company hub",
        "is_final": false,
        "happened_at": "2023-07-26 08:32"
      },
      {
        "status": 10,
        "text": "on the way to customer",
        "is_final": false,
        "happened_at": "2023-07-26 09:15"
      },
      {
        "status": 4,
        "text": "delivered",
        "is_final": true,
        "happened_at": "2023-07-26 14:39"
      }
    ]
  }
    
  

Receipts

Receipts Contains the money a seller should be paid

List all receipts

Returns a list of receipts objects related to the current authenticated account.

List receipts


id

The id of your receipt.


amount

The total amount the current seller should be paid


total_collected_money

The sum of all collected money


platform_fees

total amount of YouCan Ship fees


shipping_company_fees

total amount of Shipping company fees


status

The status of receipt, either it will be pending = 1, unpaid = 0 or paid = 3


receipt_pdf

In case you want to download the receipt. this property contains a link to download it.

Returns


Returns a paginated collection of receipts . If no receipts is found, it returns an empty collection.
Additionally if you would like to receipt only receipts with specific status you can use this filter, add a query to list only receipts with specific status, like this ?filters[0][field]=status&filters[0][value]=unpaid.

get /receipts
    
      $ curl --location -g --request GET 'https://ship.youcan.shop/api/receipts' \
  --header 'Accept: application/json' \
  --header 'Authorization: Bearer YOUR_TOKEN_eyJpc3...'
    
  
The package object
    
      {
    "data": [
        {
          "id": "998aaf59-c76d-44cb-ae14-3b1e37361c0f",
          "amount": 1185,
          "total_collected_money": 1200,
          "platform_fees": 5,
          "shipping_company_fees": 10,
          "status": 0
        }
        {...}
    ],
    "meta": {...}
  }
    
  

List a specific receipt

Returns a specific receipt object related to the current authenticated account.

Show a receipt


id

The id of your receipt.


amount

The total amount the current seller should be paid


total_collected_money

The sum of all collected money


platform_fees

total amount of YouCan Ship fees


shipping_company_fees

total amount of Shipping company fees


status

The status of receipt, either it will be pending = 1, unpaid = 0 or paid = 3


receipt_pdf

In case you want to download the receipt. this property contains a link to download it.

Returns


Returns the receipt object. If no receipt is found, it returns an error message.

get /receipts/{receipt_id}
    
      $ curl --location -g --request GET 'https://ship.youcan.shop/api/receipts/{receipt_id}' \
  --header 'Accept: application/json' \
  --header 'Authorization: Bearer YOUR_TOKEN_eyJpc3...'
    
  
The response object
    
      {
    "data": {
      "id": "998aaf59-c76d-44cb-ae14-3b1e37361c0f",
      "amount": 1185,
      "total_collected_money": 1200,
      "platform_fees": 5,
      "shipping_company_fees": 10,
      "status": 0,
      "receipt_pdf": "https://ship.youcan.shop/api/receipts/998aaf59-c76d-44cb-ae14-3b1e37361c0f/print"
    }
  }
    
  

Tickets

Tickets is simply a support ticket. in this section you will introduce how to submit tickets.

Create a ticket

This endpoint to create a ticket.

Create a ticket


department required

You can pass one of the following values (account_manager, billing, onboarding, operations, pickup, technical)


category required

You can pass a category based on the department selected. check this json

    
      {
    "account_manager": [
        "other"
    ],
    "billing": [
        "calculation_mismatch",
        "no_remittance",
        "others",
        "rate_issue",
        "weight_issue"
    ],
    "onboarding": [
        "agreement_correction",
        "client_profile_update",
        "new_pickup_address_added_or_update",
        "order_placing_demo",
        "others"
    ],
    "operation": [
        "address_update_and_contact_number_update",
        "cod_amount_change_request",
        "customer_received_but_showing_rto",
        "customer_received_but_showing_undelivered",
        "fake_attempt_by_courier",
        "fe_collected_extra_amount_from_customer",
        "fe_misbehaved_with_consignee",
        "fe_misguide_to_the_consignee",
        "money_deducted_twice",
        "product_return_request",
        "re_attempt",
        "revoke_rto_and_urgent_delivery",
        "the_customer_wants_open_delivery",
        "urgent_delivery"
    ],
    "pickup": [
        "fake_remark_by_pickup_agent",
        "new_pickup",
        "part_pickup_done",
        "pickup_boy_is_rude_with_seller",
        "pickup_completed_but_showing_created",
        "pickup_pending",
        "pickup_time_issue",
        "urgent_pickup"
    ],
    "technical": [
        "api",
        "bulk_order_creation",
        "order_synced",
        "others",
        "shipment_label",
        "single_order_creation"
    ]
}
    
  

subject required

The subject of issue


description required

The description of this issue.


attachements[] optional

List of attachements. (pdf, jpeg, jpg, png or gif)

Returns


Returns a 202 response successful response indicating the creation of ticket with a message.

post /tickets
    
      $ curl --location 'https://ship.youcan.shop/api/tickets' \
  --header 'Authorization: Bearer ...' \
  --form 'department="account_manager"' \
  --form 'category="other"' \
  --form 'subject="subject here"' \
  --form 'description="description here"' \
  --form 'attachements[]=@"/path/to/attachment.jpg"'
    
  

Shipping Companies

Shipping Companies Contains all of the companies affiliated with packages delivery

List all shipping companies

Returns a list of all shipping companies.

list all shipping companies


id

The identification number of the shipping company.


name

The name of the shipping company.


description

A little description about the activity of a shipping company.


html

A link to the website of the shipping company.


video

A short video clip of about the shipping company.


A logo of the shipping company .


shipping_price

The shipping price of a certain shipping company.


return_price

The price of taken by the shipping company if the package is not delivered.


is_enabled

It indicates if the seller has enabled the shipping company or not.

Returns


Returns a collection of shipping companies objects. If no shipping company is found, it returns an empty collection.

get /shipping-companies
    
      $ curl --location -g --request GET 'https://ship.youcan.shop/api/shipping-companies' \
  --header 'Accept: application/json' \
  --header 'Authorization: Bearer YOUR_TOKEN_eyJpc3...'
    
  
The Shipping Company object
    
      {
  "data": [
    {
      "id": "c05e9e15-dc64-4a55-8da0-1761a5f2aff8",
      "name": "Tawssil",
      "description": "Tawssil est une marque du groupe
                      Cash Plus pensée pour booster la chaine
                      de valeur de nos clients.",
      "html": null,
      "video": null,
      "logo": "https://transfer.cashplus.ma/static_cdn/img/tawssil/logo.png",
      "shipping_price": 30,
      "return_price": 10,
      "is_enabled": false
    },
    {}
  ],
  "meta": {}
}
    
  

Shipping company status

Shows the status of the shipping company.

shipping company status


message

The current status of a shipping company, enabled or disabled.


id

The identification number of the shipping company.


name

The name of the shipping company.


description

A little description about the activity of a shipping company.


html

A link to the website of the shipping company.


video

A short video clip of about the shipping company.


A logo of the shipping company .


shipping_price

The shipping price of a certain shipping company.


return_price

The price of taken by the shipping company if the package is not delivered.


is_enabled

It indicates if the seller has enabled the shipping company or not.

Returns


Returns shipping company details with a message to indicate if enabled or disabled.

post /shipping-companies-status
    
      $ curl --location -g --request GET 'https://ship.youcan.shop/api/shipping-companies/{id}/? enable : disable' \
  --header 'Accept: application/json' \
  --header 'Authorization: Bearer YOUR_TOKEN_eyJpc3...'
    
  
The Shipping Company object
    
      {
  "message": "Shipping company is successfully enabled",
  "payload": [
  "data": [
    {
      "id": "c05e9e15-dc64-4a55-8da0-1761a5f2aff8",
      "name": "Tawssil",
      "description": "Tawssil est une marque du groupe
                      Cash Plus pensée pour booster la chaine
                      de valeur de nos clients.",
      "html": null,
      "video": null,
      "logo": "https://transfer.cashplus.ma/static_cdn/img/tawssil/logo.png",
      "shipping_price": 30,
      "return_price": 10,
      "is_enabled": false
    }
  ],
    {}
  ],
  "meta": {}
}