All URIs are relative to https://api.sumup.com/{version}
Method | HTTP request | Description |
---|---|---|
customersCustomerIdGet | GET /customers/{customer_id} | Retrieve a customer |
customersCustomerIdPaymentInstrumentsGet | GET /customers/{customer_id}/payment-instruments | List payment instruments |
customersCustomerIdPaymentInstrumentsPost | POST /customers/{customer_id}/payment-instruments | Create a payment instrument |
customersCustomerIdPaymentInstrumentsTokenDelete | DELETE /customers/{customer_id}/payment-instruments/{token} | Deactivate a payment instrument |
customersCustomerIdPut | PUT /customers/{customer_id} | Update a customer |
customersPost | POST /customers | Create a customer |
CustomerResponse customersCustomerIdGet(customerId)
Retrieve a customer
Retrieves an identified saved customer resource through the unique `customer_id` parameter, generated upon customer creation.
import {SumUpRestApi} from 'sumup-rest-api';
let defaultClient = SumUpRestApi.ApiClient.instance;
// Configure OAuth2 access token for authorization: accessToken
let accessToken = defaultClient.authentications['accessToken'];
accessToken.accessToken = 'YOUR ACCESS TOKEN';
let apiInstance = new SumUpRestApi.CustomersApi();
let customerId = "customerId_example"; // String | Unique ID of the saved customer resource.
apiInstance.customersCustomerIdGet(customerId, (error, data, response) => {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
});
Name | Type | Description | Notes |
---|---|---|---|
customerId | String | Unique ID of the saved customer resource. |
- Content-Type: Not defined
- Accept: application/json
[PaymentInstrumentResponse] customersCustomerIdPaymentInstrumentsGet(customerId)
List payment instruments
Lists all payment instrument resources that are saved for an identified customer.
import {SumUpRestApi} from 'sumup-rest-api';
let defaultClient = SumUpRestApi.ApiClient.instance;
// Configure OAuth2 access token for authorization: accessToken
let accessToken = defaultClient.authentications['accessToken'];
accessToken.accessToken = 'YOUR ACCESS TOKEN';
let apiInstance = new SumUpRestApi.CustomersApi();
let customerId = "customerId_example"; // String | Unique ID of the saved customer resource.
apiInstance.customersCustomerIdPaymentInstrumentsGet(customerId, (error, data, response) => {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
});
Name | Type | Description | Notes |
---|---|---|---|
customerId | String | Unique ID of the saved customer resource. |
- Content-Type: Not defined
- Accept: application/json
PaymentInstrumentResponse customersCustomerIdPaymentInstrumentsPost(customerId, opts)
Create a payment instrument
Creates and activates a new payment instrument resource by saving a payment card for an identified customer. Implement to improve customer experience by skipping the step of entering payment instrument details. The token created via this endpoint <b>can not</b> be used for recurring payments by merchants operating within the EU. For more information visit our <a href="https://developer.sumup.com/docs/recurring-payments/\" target="_blank">recurring payments guide</a>.
import {SumUpRestApi} from 'sumup-rest-api';
let defaultClient = SumUpRestApi.ApiClient.instance;
// Configure OAuth2 access token for authorization: accessToken
let accessToken = defaultClient.authentications['accessToken'];
accessToken.accessToken = 'YOUR ACCESS TOKEN';
let apiInstance = new SumUpRestApi.CustomersApi();
let customerId = "customerId_example"; // String | Unique ID of the saved customer resource.
let opts = {
'body': new SumUpRestApi.PaymentInstrumentCard() // PaymentInstrumentCard |
};
apiInstance.customersCustomerIdPaymentInstrumentsPost(customerId, opts, (error, data, response) => {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
});
Name | Type | Description | Notes |
---|---|---|---|
customerId | String | Unique ID of the saved customer resource. | |
body | PaymentInstrumentCard | [optional] |
- Content-Type: application/json
- Accept: application/json
customersCustomerIdPaymentInstrumentsTokenDelete(customerId, token)
Deactivate a payment instrument
Deactivates an identified card payment instrument resource for a customer.
import {SumUpRestApi} from 'sumup-rest-api';
let defaultClient = SumUpRestApi.ApiClient.instance;
// Configure OAuth2 access token for authorization: accessToken
let accessToken = defaultClient.authentications['accessToken'];
accessToken.accessToken = 'YOUR ACCESS TOKEN';
let apiInstance = new SumUpRestApi.CustomersApi();
let customerId = "customerId_example"; // String | Unique ID of the saved customer resource.
let token = "token_example"; // String | Unique token identifying the card saved as a payment instrument resource.
apiInstance.customersCustomerIdPaymentInstrumentsTokenDelete(customerId, token, (error, data, response) => {
if (error) {
console.error(error);
} else {
console.log('API called successfully.');
}
});
Name | Type | Description | Notes |
---|---|---|---|
customerId | String | Unique ID of the saved customer resource. | |
token | String | Unique token identifying the card saved as a payment instrument resource. |
null (empty response body)
- Content-Type: Not defined
- Accept: application/json
CustomerResponse customersCustomerIdPut(customerId, opts)
Update a customer
Updates an identified saved customer resource's personal details. The request only overwrites the parameters included in the request, all other parameters will remain with their initially assigned values.
import {SumUpRestApi} from 'sumup-rest-api';
let defaultClient = SumUpRestApi.ApiClient.instance;
// Configure OAuth2 access token for authorization: accessToken
let accessToken = defaultClient.authentications['accessToken'];
accessToken.accessToken = 'YOUR ACCESS TOKEN';
let apiInstance = new SumUpRestApi.CustomersApi();
let customerId = "customerId_example"; // String | Unique ID of the saved customer resource.
let opts = {
'body': null // Object |
};
apiInstance.customersCustomerIdPut(customerId, opts, (error, data, response) => {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
});
Name | Type | Description | Notes |
---|---|---|---|
customerId | String | Unique ID of the saved customer resource. | |
body | Object | [optional] |
- Content-Type: application/json
- Accept: application/json
CustomerResponse customersPost(opts)
Create a customer
Creates a new saved customer resource which you can later manipulate and save payment instruments to.
import {SumUpRestApi} from 'sumup-rest-api';
let defaultClient = SumUpRestApi.ApiClient.instance;
// Configure OAuth2 access token for authorization: accessToken
let accessToken = defaultClient.authentications['accessToken'];
accessToken.accessToken = 'YOUR ACCESS TOKEN';
let apiInstance = new SumUpRestApi.CustomersApi();
let opts = {
'body': new SumUpRestApi.Customer() // Customer | Details of the customer.
};
apiInstance.customersPost(opts, (error, data, response) => {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
});
Name | Type | Description | Notes |
---|---|---|---|
body | Customer | Details of the customer. | [optional] |
- Content-Type: application/json
- Accept: application/json