Updating a return

Webservice URL : https://sws.spartoo.eu/mp/xml_maj_returns.php

This webservice allows you to update a return status.

If you need to provide a return label for the customer, there are two ways possible:
  • The label is hosted on your homepage: Specify the variable label_link containing the link to the label
  • You want us to host the label on our servers: Specify the variable label_file containing the label file
Once the return is expedited, or the time limit reached, you can specify the variable or the status variable to
  • either accept the return ( status 4 )
  • or refuse the return ( status 3 )


> See the list of return status possible

> See the list of return statuses

List of parameters

The parameters of this webservice must be saved in POST

Parameter Description
partner Must contain your unique identifier code:
rID Return ID to be updated
status (optional) New return status ( 3 or 4 )


XML format returned


<root>
	<returns>
		<return>
			<partenaire>string</partenaire>
			<rID>int</rID>
			<label_link>url</label_link>
			<label_file>url</label_file>
			<errors>
				<error>
					<id>int</id>
					<description>string</description>
				</error>
			</errors>
		<return>
	</returns>
	<statut>
		<id>int</id>
		<description>string</description>
	</statut>
</root>


List of webservice error codes


Code Description
1 No error with parameters
-1 The parameter partenaire has not been set up or it is empty
-2 The parameter partenaire does not exist
-5 The rID/oID parameter or the status parameter is missing
-6 The order or return were not found, verify the OID / RID parameter or the partner parameter.
-7 Problem in the return chronology
  • The status 4 only applies if the return is in status 2 or 3
  • The status 3 only applies if the return is in status 2
-9 The new status is identical to the current status
-22 Error receiving file
-23 Unknown error when receiving file
-24 The label link is too long
-25 The link provided is identical to the current link
-428 Your account has been deactivated. You will no longer have access to our online services.
-429 You have made too many online requests during this 1-hour time period.

XML return examples


Example of a response to a web service request KO :

<root>
	<returns>
		<return>
			<partenaire>1EC51BF31B486658</partenaire>
			<rID>	</rID>
			<label_link>http://www.spartoo.fr/pj.php?file_id_crypt=...</label_link>
			<errors>
				<error>
					<id>-6</id>
					<description>
						La commande ou le retour n’ont pas été trouvés, vérifiez le paramètre oID / rID ou le paramètre partenaire.
					</description>
				</error>
			</errors>
		</return>
	</returns>
	<statut>
		<id>6</id>
		<description>retour refusé</description>
	</statut>
</root>

Example of a response to a web service request OK :

<root>
	<returns>
		<return>
			<partenaire>1EC51BF31B486658</partenaire>
			<rID>8883777</rID>
			<label_link>http://www.spartoo.fr/pj.php?file_id_crypt=...</label_link>
			<errors>
				<error>
					<id>1</id>
					<description>Pas d'erreur de paramètres</description>
				</error>
			</errors>
		</return>
	</returns>
	<statut>
		<id>4</id>
		<description>retour accepté</description>
	</statut>
</root>

💡 Conseils d'intégration pour les étiquettes de retour

  • label_link : L'URL fournie pour l'étiquette de retour ne doit pas dépasser 255 caractères (limite stricte de l'API). Si vous utilisez des paramètres d'URL ou d'authentification longs, veuillez raccourcir le lien au préalable.
  • label_file : Si vous soumettez directement le fichier de l'étiquette, vous devez transmettre le contenu binaire brut (raw binary content) du fichier (et non une chaîne encodée en Base64). Les formats acceptés sont le PDF (.pdf) et les formats d'images (.jpg, .jpeg, .png, .gif) pour une taille maximale de 10 Mo.



Saitoo - Assistant (mp)
Bonjour ! Comment puis-je vous aider aujourd'hui ?