Customers Customers cURL {
"id" : "cust_9Cle7TXKkjhwqcWx4Kl5cQYk" ,
"email" : "david@example.net" ,
"mobile" : "+33639980102" ,
"name" : "David Coaster" ,
"created" : 1538562174 ,
"live_mode" : false
}
Perl 1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package Stancer::Customer ;
use Moo ;
use Stancer::Core::Types qw(:all) ;
has created => ( is => 'ro' , isa => InstanceOf [ 'DateTime' ]);
has email => ( is => 'rw' , isa => Varchar [ 5 , 64 ]);
has id => ( is => 'ro' , isa => Char [ 29 ]);
has mobile => ( is => 'rw' , isa => Varchar [ 8 , 16 ]);
has name => ( is => 'rw' , isa => Varchar [ 4 , 64 ]);
1 ;
PHP 1
2
3
4
5
6
7
8
9
10
11
12
13
14
15 <?php
namespace Stancer ;
use DateTime ;
class Customer
{
protected ? DateTime $created ;
protected ? string $email ;
protected ? string $id ;
protected ? string $mobile ;
protected ? string $name ;
public function __construct ( string $id = null ) {}
}
Python 1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28 from datetime import datetime
class Customer ( object ):
_ENDPOINT = 'customers'
@property
def created ( self ) -> datetime :
pass
@property
def email ( self ) -> str :
pass
@email . setter
def email ( self , value : str ):
pass
@property
def id ( self ) -> str :
pass
@property
def mobile ( self ) -> str :
pass
@mobile . setter
def mobile ( self , value : str ):
pass
The customer object is defined as follows:
Field Description Type id Customer's id String, fixed size = 29 email Customer's email String, min = 5, max = 64 mobile Customer's mobile phone String, min = 8, max = 16 name Customer's name String, min = 4, max = 64 created The Unix timestamp representing creation date of the object in local time Int live_mode Test or Live mode Boolean inherited from a payment object if linked, default False
Customers objects created in Test
mode cannot be used in Live mode. Likewise, objects created in Live
mode cannot be used in Test mode.
Create a customer HTTP request Data parameters Parameter Field email Optional mobile Optional name Optional live_mode Optional
Code examples The above command returns JSON structured as follows:
Get customer data HTTP request
/v1/customers/
id_customer
Query parameters Parameter Description id_customer Customer's id
Return parameters The request will return the customer object asssociated with the id_customer
you provided. If the id_customer
does not exist, the API will return a 404 HTTP response code.
Code examples The above command returns JSON structured as follows:
Update a customer HTTP request
/v1/customers/
id_customer
Query parameters Parameter Description id_customer Customer's id
Data parameters Parameter Field email Optional mobile Optional name Optional
Return parameters The above command returns an HTTP 204 code if correctly processed or an HTTP 404 code if the customer does not exist.
Code examples Delete a customer HTTP request
/v1/customers/
id_customer
Query parameters Parameter Description id_customer Customer's id
Return parameters The above command returns an HTTP 204 code if correctly processed or an HTTP 404 code if the customer does not exist.
Code examples