API : clients
GET /customers
Cette méthode retourne la liste de tous vos clients existants.
URL de la ressource
GET https://app.snipcart.com/api/customers
En-têtes
Nom | Valeur | Obligatoire? | Description |
---|---|---|---|
Accept |
application/json |
Oui | Notre API n'accepte que le type de contenu application/json, vous devez donc toujours spécifier l'en-tête Accept: application/json dans chaque requête que vous effectuez. |
Paramètres
Nom | Obligatoire? | Type | Description |
---|---|---|---|
offset |
Oui | int | Nombre de résultats à ignorer. La valeur par défaut est 0. |
limit |
Oui | int | Nombre de résultats à récupérer. La valeur par défaut est 20. |
status |
Non | string | L'état de vos clients, `Confirmed` signifie que les clients ont créé un compte et `Unconfirmed` sont ceux qui ont complété en tant qu'invités. |
email |
Non | string | Le courriel du client qui a passé la commande. |
name |
Non | string | Le nom du client qui a passé la commande. |
from |
Non | datetime | Retourne uniquement les clients créés après cette date. |
to |
Non | datetime | Retourne uniquement les clients créés avant cette date. |
Exemple de requête
curl -H "Accept: application/json" \
https://app.snipcart.com/api/customers?offset=0&limit=50&status=confirmed \
-u {API_KEY}:
Exemple de réponse
{
totalItems: 10,
offset: 0,
limit: 50,
items: [
{
"id": "c8de947a-2483-4e36-9052-031e2aa3f0ac",
"email": "geeks@snipcart.com",
"billingAddressName": "Geeks Snipcart",
"billingAddressCompanyName": "Snipcart",
"billingAddressAddress1": "4885 1ere Avenue",
"billingAddressAddress2": null,
"billingAddressCity": "Québec",
"billingAddressCountry": "CA",
"billingAddressProvince": "QC",
"billingAddressPostalCode": "G1H2T5",
"billingAddressPhone": "",
"shippingAddressName": "Geeks Snipcart",
"shippingAddressCompanyName": "Snipcart",
"shippingAddressAddress1": "4885 1ere Avenue",
"shippingAddressAddress2": null,
"shippingAddressCity": "Québec",
"shippingAddressCountry": "CA",
"shippingAddressProvince": "QC",
"shippingAddressPostalCode": "G1H2T5",
"shippingAddressPhone": "",
"shippingAddressSameAsBilling": true,
"sessionToken": null,
"status": "Confirmed",
"statistics": {
"ordersCount": 10,
"ordersAmount": 1000.00
}
},
...
]
}
GET /customers/{id}
Cette méthode retourne un client spécifique.
URL de la ressource
GET https://app.snipcart.com/api/customers/{id}
En-têtes
Nom | Valeur | Obligatoire? | Description |
---|---|---|---|
Accept |
application/json |
Oui | Notre API n'accepte que le type de contenu application/json, vous devez donc toujours spécifier l'en-tête Accept: application/json dans chaque requête que vous effectuez. |
Paramètres
Nom | Obligatoire? | Type | Description |
---|---|---|---|
id |
Oui | Guid | L'identifiant unique du client. |
Exemple de requête
curl -H "Accept: application/json" \
https://app.snipcart.com/api/customers/c8de947a-2483-4e36-9052-031e2aa3f0ac \
-u {API_KEY}:
Exemple de réponse
{
"id": "c8de947a-2483-4e36-9052-031e2aa3f0ac",
"email": "geeks@snipcart.com",
"billingAddressName": "Geeks Snipcart",
"billingAddressCompanyName": "Snipcart",
"billingAddressAddress1": "4885 1ere Avenue",
"billingAddressAddress2": null,
"billingAddressCity": "Québec",
"billingAddressCountry": "CA",
"billingAddressProvince": "QC",
"billingAddressPostalCode": "G1H2T5",
"billingAddressPhone": "",
"shippingAddressName": "Geeks Snipcart",
"shippingAddressCompanyName": "Snipcart",
"shippingAddressAddress1": "4885 1ere Avenue",
"shippingAddressAddress2": null,
"shippingAddressCity": "Québec",
"shippingAddressCountry": "CA",
"shippingAddressProvince": "QC",
"shippingAddressPostalCode": "G1H2T5",
"shippingAddressPhone": "",
"shippingAddressSameAsBilling": true,
"sessionToken": null,
"status": "Unconfirmed"
"statistics": {
"ordersCount": 10,
"ordersAmount": 1000.00
}
}
GET /customers/{id}/orders
Cette méthode retourne une liste de commandes.
URL de la ressource
GET https://app.snipcart.com/api/customers/{id}
En-têtes
Nom | Valeur | Obligatoire? | Description |
---|---|---|---|
Accept |
application/json |
Oui | Notre API n'accepte que le type de contenu application/json, vous devez donc toujours spécifier l'en-tête Accept: application/json dans chaque requête que vous effectuez. |
Paramètres
Nom | Obligatoire? | Type | Description |
---|---|---|---|
id |
Oui | Guid | L'identifiant unique du client. |
Exemple de requête
curl -H "Accept: application/json" \
https://app.snipcart.com/api/customers/c8de947a-2483-4e36-9052-031e2aa3f0ac/orders \
-u {API_KEY}:
Exemple de réponse
[
{
"token": "d16e2f60-39f1-4a4c-b1c3-8a2e166d3f70",
"creationDate": "2013-10-21T20:36:26.46Z",
"modificationDate": "2013-10-21T20:36:26.46Z",
"status": "Processed",
"paymentMethod": "CreditCard",
"invoiceNumber": "SNIP-0001",
"email": "geeks@snipcart.com",
"cardHolderName": "Geeks Snipcart",
"creditCardLast4Digits": "4242",
"billingAddressName": "Geeks Snipcart",
"billingAddressCompanyName": "Snipcart",
"billingAddressAddress1": "4885 1ere Avenue",
"billingAddressAddress2": "",
"billingAddressCity": "Québec",
"billingAddressCountry": "CA",
"billingAddressProvince": "QC",
"billingAddressPostalCode": "G1H2T5",
"billingAddressPhone": "1-877-301-4813",
"notes": null,
"shippingAddressName": "Geeks Snipcart",
"shippingAddressCompanyName": "Snipcart",
"shippingAddressAddress1": "4885 1ere Avenue",
"shippingAddressAddress2": "",
"shippingAddressCity": "Québec",
"shippingAddressCountry": "CA",
"shippingAddressProvince": "QC",
"shippingAddressPostalCode": "G1H2T5",
"shippingAddressPhone": "1-877-301-4813",
"shippingAddressSameAsBilling": true,
"finalGrandTotal": 443,
"shippingFees": 0,
"shippingMethod": "Free shipping",
"items": [],
"taxes": [],
"promocodes": [],
"willBePaidLater": false,
"customFieldsJson": "[]",
"paymentTransactionId": "gateway_payment_id",
},
...
]