Customers represent payers in your integration. Create a customer with your own customer_id to associate their personal details and saved payment instruments with your business records.
To save a card, create a checkout for that customer with purpose = SETUP_RECURRING_PAYMENT, then process it with the payer’s consent and mandate details. See the tokenization guide.
Use the Customers endpoints to create, retrieve, or update customer details and to list or deactivate saved payment instruments. For subsequent payments, process a new checkout with the saved instrument’s token and its associated customer_id.
Create a customer
POST/v0.1/customersRetrieve a customer
GET/v0.1/customers/{customer_id}Update a customer
PUT/v0.1/customers/{customer_id}List payment instruments
GET/v0.1/customers/{customer_id}/payment-instrumentsDeactivate a payment instrument
DELETE/v0.1/customers/{customer_id}/payment-instruments/{token}
The Customer object
Saved payer details identified by the customer_id supplied by your integration. A customer can have saved payment instruments for subsequent payments.
- customer_idstringrequired
Identifier you supply when creating the customer. Use an ID from your own system and retain it for subsequent customer, checkout, and saved-payment-instrument requests.
Example:"831ff8d4cd5958ab5670" - personal_detailsPersonal Details
Personal details for the customer.
ClosePersonal Details- first_namestring
First name of the customer.
Example:"John" - last_namestring
Last name of the customer.
Example:"Doe" - emailstring
Email address of the customer.
Example:"user@example.com" - phonestring
Phone number of the customer.
Example:"+491635559723" - birth_datestringformat: date
Date of birth of the customer in
YYYY-MM-DDformat, without a time or timezone.Example:"1993-12-31" - tax_idstringmax length: 255
Identification number used for tax purposes, such as a CPF in Brazil.
Example:"423.378.593-47" - addressAddress Legacy
Profile's personal address information.
CloseAddress Legacy- citystring
City name from the address.
Example:"Berlin" - countrystring
Two letter country code formatted according to ISO3166-1 alpha-2.
Example:"DE" - line_1string
First line of the address with details of the street name and number.
Example:"Sample street" - line_2string
Second line of the address with details of the building, unit, apartment, and floor numbers.
Example:"ap. 5" - postal_codestring
Postal code from the address.
Example:"10115" - statestring
State name or abbreviation from the address.
Example:"Berlin"
{ "customer_id": "831ff8d4cd5958ab5670", "personal_details": { "first_name": "John", "last_name": "Doe", "email": "user@example.com", "phone": "+491635559723", "birth_date": "1993-12-31", "tax_id": "423.378.593-47", "address": { "city": "Berlin", "country": "DE", "line_1": "Sample street", "line_2": "ap. 5", "postal_code": "10115", "state": "Berlin" } }}Create a customer
Creates a customer using the customer_id you supply. Choose an identifier that maps to the payer in your own system and reuse it when retrieving the customer or associating checkouts and saved payment instruments with them.
payment_instrumentscustomers.writeBody Parameters
- customer_idstringrequired
Identifier you supply when creating the customer. Use an ID from your own system and retain it for subsequent customer, checkout, and saved-payment-instrument requests.
Example:"831ff8d4cd5958ab5670" - personal_detailsPersonal Details
Personal details for the customer.
ClosePersonal Details- first_namestring
First name of the customer.
Example:"John" - last_namestring
Last name of the customer.
Example:"Doe" - emailstring
Email address of the customer.
Example:"user@example.com" - phonestring
Phone number of the customer.
Example:"+491635559723" - birth_datestringformat: date
Date of birth of the customer in
YYYY-MM-DDformat, without a time or timezone.Example:"1993-12-31" - tax_idstringmax length: 255
Identification number used for tax purposes, such as a CPF in Brazil.
Example:"423.378.593-47" - addressAddress Legacy
Profile's personal address information.
CloseAddress Legacy- citystring
City name from the address.
Example:"Berlin" - countrystring
Two letter country code formatted according to ISO3166-1 alpha-2.
Example:"DE" - line_1string
First line of the address with details of the street name and number.
Example:"Sample street" - line_2string
Second line of the address with details of the building, unit, apartment, and floor numbers.
Example:"ap. 5" - postal_codestring
Postal code from the address.
Example:"10115" - statestring
State name or abbreviation from the address.
Example:"Berlin"
Response
Returns the customer resource. See Customer object.
- customer_idstringrequired
Identifier you supply when creating the customer. Use an ID from your own system and retain it for subsequent customer, checkout, and saved-payment-instrument requests.
Example:"831ff8d4cd5958ab5670" - personal_detailsPersonal Details
Personal details for the customer.
ClosePersonal Details- first_namestring
First name of the customer.
Example:"John" - last_namestring
Last name of the customer.
Example:"Doe" - emailstring
Email address of the customer.
Example:"user@example.com" - phonestring
Phone number of the customer.
Example:"+491635559723" - birth_datestringformat: date
Date of birth of the customer in
YYYY-MM-DDformat, without a time or timezone.Example:"1993-12-31" - tax_idstringmax length: 255
Identification number used for tax purposes, such as a CPF in Brazil.
Example:"423.378.593-47" - addressAddress Legacy
Profile's personal address information.
CloseAddress Legacy- citystring
City name from the address.
Example:"Berlin" - countrystring
Two letter country code formatted according to ISO3166-1 alpha-2.
Example:"DE" - line_1string
First line of the address with details of the street name and number.
Example:"Sample street" - line_2string
Second line of the address with details of the building, unit, apartment, and floor numbers.
Example:"ap. 5" - postal_codestring
Postal code from the address.
Example:"10115" - statestring
State name or abbreviation from the address.
Example:"Berlin"
curl https://api.sumup.com/v0.1/customers \ -X POST \ -H "Authorization: Bearer $SUMUP_API_KEY" \ --json '{ "customer_id": "831ff8d4cd5958ab5670" }'sumup customers create \ --first-name "John" \ --last-name "Doe" \ --email "user@example.com" \ --phone "+491635559723" \ --tax-id "423.378.593-47" \ --birth-date "1993-12-31" \ --address-line-1 "Sample street" \ --address-line-2 "ap. 5" \ --address-city "Berlin" \ --address-postal-code "10115" \ --address-state "Berlin" \ --address-country "DE"import SumUp from "@sumup/sdk";
async function main() { const client = new SumUp({ apiKey: "sup_sk_your_api_key" });
const result = await client.customers.create( { "customer_id": "831ff8d4cd5958ab5670" } ); console.log(result);}
main().catch(console.error);using System;using System.Collections.Generic;using System.Threading.Tasks;using SumUp;
public static class Program{ public static async Task Main() { using var client = new SumUpClient(); var response = await client.Customers.CreateAsync( new Customer { CustomerId = "831ff8d4cd5958ab5670", });
Console.WriteLine(response.StatusCode); }}import com.sumup.sdk.SumUpClient;
public final class CreateCustomerSample { public static void main(String[] args) throws Exception { var client = new SumUpClient();
var result = client.customers().create( com.sumup.sdk.models.Customer.builder() .customerId("831ff8d4cd5958ab5670") .build() ); System.out.println(result); }}import os
import sumup
client = sumup.Sumup(api_key=os.environ["SUMUP_API_KEY"])result = client.customers.create( customer_id="831ff8d4cd5958ab5670",)print(result)$sumup = new \SumUp\SumUp();
$result = $sumup->customers->create([ 'customer_id' => '831ff8d4cd5958ab5670',]);package main
import ( "context" "fmt"
"github.com/sumup/sumup-go")
func main() { client := sumup.NewClient() result, err := client.Customers.Create(context.TODO(), sumup.CustomersCreateParams{ CustomerID: "831ff8d4cd5958ab5670", }) if err != nil { panic(err.Error()) }
fmt.Printf("%+v\n", result)}use sumup::{Authorization, Client};#[tokio::main]async fn main() { let client = Client::default() .with_authorization(Authorization::api_key("sup_sk_test_...")); let body = sumup::resources::customers::CreateRequest { customer_id: "831ff8d4cd5958ab5670".to_string(), personal_details: None, }; let response = client.customers().create(body).await.expect("create request failed"); println!("{response:#?}");}{ "customer_id": "831ff8d4cd5958ab5670", "personal_details": { "first_name": "John", "last_name": "Doe", "email": "user@example.com", "phone": "+491635559723", "birth_date": "1993-12-31", "tax_id": "423.378.593-47", "address": { "city": "Berlin", "country": "DE", "line_1": "Sample street", "line_2": "ap. 5", "postal_code": "10115", "state": "Berlin" } }}Content-Type: application/json
The request body is invalid.
Content-Type: application/json
The request is not authorized.
- typestringrequiredformat: uri
A URI reference that identifies the problem type.
Example:"https://developer.sumup.com/problem/not-found" - titlestring
A short, human-readable summary of the problem type.
Example:"Requested resource couldn't be found." - statusinteger
The HTTP status code generated by the origin server for this occurrence of the problem.
Example:404 - detailstring
A human-readable explanation specific to this occurrence of the problem.
Example:"The requested resource doesn't exist or does not belong to you." - instancestringformat: uri
A URI reference that identifies the specific occurrence of the problem.
Example:"https://api.sumup.com/v0.1/checkouts/4e425463-3e1b-431d-83fa-1e51c2925e99"
Content-Type: application/json
The request is authenticated but not permitted for this operation.
- error_messagestring
Short description of the error.
Example:"request_not_allowed" - error_codestring
Platform code for the error.
Example:"FORBIDDEN" - status_codestring
HTTP status code for the error.
Example:"403"
Content-Type: application/json
A customer with the provided identifier already exists.
- messagestring
Short description of the error.
Example:"Resource not found" - error_codestring
Platform code for the error.
Example:"NOT_FOUND"
{ "error_code": "INVALID", "message": "Validation error", "param": "customer_id"}{ "detail": "Unauthorized.", "status": 401, "title": "Unauthorized", "trace_id": "3c77294349d3b5647ea2d990f0d8f017", "type": "https://developer.sumup.com/problem/unauthorized"}{ "error_message": "request_not_allowed", "error_code": "FORBIDDEN", "status_code": "403"}{ "message": "Customer already exists", "error_code": "CUSTOMER_ALREADY_EXISTS"}Retrieve a customer
Retrieves a saved customer using the customer_id you supplied when creating the customer.
payment_instrumentscustomers.readPath Parameters
- customer_idstringrequired
The
customer_idyou supplied when creating the customer.Example:"831ff8d4cd5958ab5670"
Response
Returns the customer resource. See Customer object.
- customer_idstringrequired
Identifier you supply when creating the customer. Use an ID from your own system and retain it for subsequent customer, checkout, and saved-payment-instrument requests.
Example:"831ff8d4cd5958ab5670" - personal_detailsPersonal Details
Personal details for the customer.
ClosePersonal Details- first_namestring
First name of the customer.
Example:"John" - last_namestring
Last name of the customer.
Example:"Doe" - emailstring
Email address of the customer.
Example:"user@example.com" - phonestring
Phone number of the customer.
Example:"+491635559723" - birth_datestringformat: date
Date of birth of the customer in
YYYY-MM-DDformat, without a time or timezone.Example:"1993-12-31" - tax_idstringmax length: 255
Identification number used for tax purposes, such as a CPF in Brazil.
Example:"423.378.593-47" - addressAddress Legacy
Profile's personal address information.
CloseAddress Legacy- citystring
City name from the address.
Example:"Berlin" - countrystring
Two letter country code formatted according to ISO3166-1 alpha-2.
Example:"DE" - line_1string
First line of the address with details of the street name and number.
Example:"Sample street" - line_2string
Second line of the address with details of the building, unit, apartment, and floor numbers.
Example:"ap. 5" - postal_codestring
Postal code from the address.
Example:"10115" - statestring
State name or abbreviation from the address.
Example:"Berlin"
curl https://api.sumup.com/v0.1/customers/{customer_id} \ -X GET \ -H "Authorization: Bearer $SUMUP_API_KEY"sumup customers get "831ff8d4cd5958ab5670"import SumUp from "@sumup/sdk";
async function main() { const client = new SumUp({ apiKey: "sup_sk_your_api_key" });
const result = await client.customers.get( "831ff8d4cd5958ab5670" ); console.log(result);}
main().catch(console.error);using System;using System.Collections.Generic;using System.Threading.Tasks;using SumUp;
public static class Program{ public static async Task Main() { using var client = new SumUpClient(); var response = await client.Customers.GetAsync( "example-id");
Console.WriteLine(response.StatusCode); }}import com.sumup.sdk.SumUpClient;
public final class GetCustomerSample { public static void main(String[] args) throws Exception { var client = new SumUpClient();
var result = client.customers().get( "831ff8d4cd5958ab5670" ); System.out.println(result); }}import os
import sumup
client = sumup.Sumup(api_key=os.environ["SUMUP_API_KEY"])result = client.customers.get( "831ff8d4cd5958ab5670",)print(result)$sumup = new \SumUp\SumUp();
$result = $sumup->customers->get('831ff8d4cd5958ab5670');package main
import ( "context" "fmt"
"github.com/sumup/sumup-go")
func main() { client := sumup.NewClient() result, err := client.Customers.Get(context.TODO(), "831ff8d4cd5958ab5670") if err != nil { panic(err.Error()) }
fmt.Printf("%+v\n", result)}use sumup::{Authorization, Client};#[tokio::main]async fn main() { let client = Client::default() .with_authorization(Authorization::api_key("sup_sk_test_...")); let response = client .customers() .get("CUSTOMER_ID") .await .expect("get request failed"); println!("{response:#?}");}{ "customer_id": "831ff8d4cd5958ab5670", "personal_details": { "first_name": "John", "last_name": "Doe", "email": "user@example.com", "phone": "+491635559723", "birth_date": "1993-12-31", "tax_id": "423.378.593-47", "address": { "city": "Berlin", "country": "DE", "line_1": "Sample street", "line_2": "ap. 5", "postal_code": "10115", "state": "Berlin" } }}Content-Type: application/json
The request is not authorized.
- typestringrequiredformat: uri
A URI reference that identifies the problem type.
Example:"https://developer.sumup.com/problem/not-found" - titlestring
A short, human-readable summary of the problem type.
Example:"Requested resource couldn't be found." - statusinteger
The HTTP status code generated by the origin server for this occurrence of the problem.
Example:404 - detailstring
A human-readable explanation specific to this occurrence of the problem.
Example:"The requested resource doesn't exist or does not belong to you." - instancestringformat: uri
A URI reference that identifies the specific occurrence of the problem.
Example:"https://api.sumup.com/v0.1/checkouts/4e425463-3e1b-431d-83fa-1e51c2925e99"
Content-Type: application/json
The request is authenticated but not permitted for this operation.
- error_messagestring
Short description of the error.
Example:"request_not_allowed" - error_codestring
Platform code for the error.
Example:"FORBIDDEN" - status_codestring
HTTP status code for the error.
Example:"403"
Content-Type: application/json
The requested resource does not exist.
- messagestring
Short description of the error.
Example:"Resource not found" - error_codestring
Platform code for the error.
Example:"NOT_FOUND"
{ "detail": "Unauthorized.", "status": 401, "title": "Unauthorized", "trace_id": "3c77294349d3b5647ea2d990f0d8f017", "type": "https://developer.sumup.com/problem/unauthorized"}{ "error_message": "request_not_allowed", "error_code": "FORBIDDEN", "status_code": "403"}{ "error_code": "NOT_FOUND", "message": "Resource not found"}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.
payment_instrumentscustomers.writePath Parameters
- customer_idstringrequired
The
customer_idyou supplied when creating the customer.Example:"831ff8d4cd5958ab5670"
Body Parameters
- personal_detailsPersonal Details
Personal details for the customer.
ClosePersonal Details- first_namestring
First name of the customer.
Example:"John" - last_namestring
Last name of the customer.
Example:"Doe" - emailstring
Email address of the customer.
Example:"user@example.com" - phonestring
Phone number of the customer.
Example:"+491635559723" - birth_datestringformat: date
Date of birth of the customer in
YYYY-MM-DDformat, without a time or timezone.Example:"1993-12-31" - tax_idstringmax length: 255
Identification number used for tax purposes, such as a CPF in Brazil.
Example:"423.378.593-47" - addressAddress Legacy
Profile's personal address information.
CloseAddress Legacy- citystring
City name from the address.
Example:"Berlin" - countrystring
Two letter country code formatted according to ISO3166-1 alpha-2.
Example:"DE" - line_1string
First line of the address with details of the street name and number.
Example:"Sample street" - line_2string
Second line of the address with details of the building, unit, apartment, and floor numbers.
Example:"ap. 5" - postal_codestring
Postal code from the address.
Example:"10115" - statestring
State name or abbreviation from the address.
Example:"Berlin"
Response
Returns the customer resource. See Customer object.
- customer_idstringrequired
Identifier you supply when creating the customer. Use an ID from your own system and retain it for subsequent customer, checkout, and saved-payment-instrument requests.
Example:"831ff8d4cd5958ab5670" - personal_detailsPersonal Details
Personal details for the customer.
ClosePersonal Details- first_namestring
First name of the customer.
Example:"John" - last_namestring
Last name of the customer.
Example:"Doe" - emailstring
Email address of the customer.
Example:"user@example.com" - phonestring
Phone number of the customer.
Example:"+491635559723" - birth_datestringformat: date
Date of birth of the customer in
YYYY-MM-DDformat, without a time or timezone.Example:"1993-12-31" - tax_idstringmax length: 255
Identification number used for tax purposes, such as a CPF in Brazil.
Example:"423.378.593-47" - addressAddress Legacy
Profile's personal address information.
CloseAddress Legacy- citystring
City name from the address.
Example:"Berlin" - countrystring
Two letter country code formatted according to ISO3166-1 alpha-2.
Example:"DE" - line_1string
First line of the address with details of the street name and number.
Example:"Sample street" - line_2string
Second line of the address with details of the building, unit, apartment, and floor numbers.
Example:"ap. 5" - postal_codestring
Postal code from the address.
Example:"10115" - statestring
State name or abbreviation from the address.
Example:"Berlin"
curl https://api.sumup.com/v0.1/customers/{customer_id} \ -X PUT \ -H "Authorization: Bearer $SUMUP_API_KEY" \ --json '{}'sumup customers update "831ff8d4cd5958ab5670" \ --first-name "John" \ --last-name "Doe" \ --email "user@example.com" \ --phone "+491635559723" \ --tax-id "423.378.593-47" \ --birth-date "1993-12-31" \ --address-line-1 "Sample street" \ --address-line-2 "ap. 5" \ --address-city "Berlin" \ --address-postal-code "10115" \ --address-state "Berlin" \ --address-country "DE"import SumUp from "@sumup/sdk";
async function main() { const client = new SumUp({ apiKey: "sup_sk_your_api_key" });
const result = await client.customers.update( "831ff8d4cd5958ab5670", {} ); console.log(result);}
main().catch(console.error);using System;using System.Collections.Generic;using System.Threading.Tasks;using SumUp;
public static class Program{ public static async Task Main() { using var client = new SumUpClient(); var response = await client.Customers.UpdateAsync( "example-id", new CustomersUpdateRequest { });
Console.WriteLine(response.StatusCode); }}import com.sumup.sdk.SumUpClient;
public final class UpdateCustomerSample { public static void main(String[] args) throws Exception { var client = new SumUpClient();
var result = client.customers().update( "831ff8d4cd5958ab5670", com.sumup.sdk.models.UpdateCustomerRequest.builder() .build() ); System.out.println(result); }}import os
import sumup
client = sumup.Sumup(api_key=os.environ["SUMUP_API_KEY"])result = client.customers.update( "831ff8d4cd5958ab5670",)print(result)$sumup = new \SumUp\SumUp();
$result = $sumup->customers->update('831ff8d4cd5958ab5670', [
]);package main
import ( "context" "fmt"
"github.com/sumup/sumup-go")
func main() { client := sumup.NewClient() result, err := client.Customers.Update(context.TODO(), "831ff8d4cd5958ab5670", sumup.CustomersUpdateParams{}) if err != nil { panic(err.Error()) }
fmt.Printf("%+v\n", result)}use sumup::{Authorization, Client};#[tokio::main]async fn main() { let client = Client::default() .with_authorization(Authorization::api_key("sup_sk_test_...")); let body = sumup::resources::customers::UpdateRequest { ..Default::default() }; let response = client .customers() .update("CUSTOMER_ID", body) .await .expect("update request failed"); println!("{response:#?}");}{ "customer_id": "831ff8d4cd5958ab5670", "personal_details": { "first_name": "John", "last_name": "Doe", "email": "user@example.com", "phone": "+491635559723", "birth_date": "1993-12-31", "tax_id": "423.378.593-47", "address": { "city": "Berlin", "country": "DE", "line_1": "Sample street", "line_2": "ap. 5", "postal_code": "10115", "state": "Berlin" } }}Content-Type: application/json
The request is not authorized.
- typestringrequiredformat: uri
A URI reference that identifies the problem type.
Example:"https://developer.sumup.com/problem/not-found" - titlestring
A short, human-readable summary of the problem type.
Example:"Requested resource couldn't be found." - statusinteger
The HTTP status code generated by the origin server for this occurrence of the problem.
Example:404 - detailstring
A human-readable explanation specific to this occurrence of the problem.
Example:"The requested resource doesn't exist or does not belong to you." - instancestringformat: uri
A URI reference that identifies the specific occurrence of the problem.
Example:"https://api.sumup.com/v0.1/checkouts/4e425463-3e1b-431d-83fa-1e51c2925e99"
Content-Type: application/json
The request is authenticated but not permitted for this operation.
- error_messagestring
Short description of the error.
Example:"request_not_allowed" - error_codestring
Platform code for the error.
Example:"FORBIDDEN" - status_codestring
HTTP status code for the error.
Example:"403"
Content-Type: application/json
The requested resource does not exist.
- messagestring
Short description of the error.
Example:"Resource not found" - error_codestring
Platform code for the error.
Example:"NOT_FOUND"
{ "detail": "Unauthorized.", "status": 401, "title": "Unauthorized", "trace_id": "3c77294349d3b5647ea2d990f0d8f017", "type": "https://developer.sumup.com/problem/unauthorized"}{ "error_message": "request_not_allowed", "error_code": "FORBIDDEN", "status_code": "403"}{ "error_code": "NOT_FOUND", "message": "Resource not found"}List payment instruments
Lists all payment instrument resources that are saved for an identified customer.
payment_instrumentscustomers.readPath Parameters
- customer_idstringrequired
The
customer_idyou supplied when creating the customer.Example:"831ff8d4cd5958ab5670"
Response
Returns the list of saved payment instruments for the customer.
- tokenstringRead only
Token identifying the customer's saved payment card. Pass it as
token, together with the associatedcustomer_idandpayment_type = card, when processing a checkout with this instrument.Example:"bcfc8e5f-3b47-4cb9-854b-3b7a4cce7be3" - activebooleandefault:
true, Read onlyIndicates whether the payment instrument is active and can be used for payments. To deactivate it, send a
DELETErequest to the resource endpoint. - typestringOptions:
cardType of the payment instrument.
Example:"card" - cardobject
Details of the payment card.
CloseAttributes- last_4_digitsstringmin length: 4, max length: 4, Read only
Last 4 digits of the payment card number.
Example:"3456" - typeCard TypeOptions:
ALELOAMEXCONECSCUPDINERSDISCOVEREFTPOSELOELVGIROCARDHIPERCARDINTERACJCBMAESTROMASTERCARDPLUXEESWILETICKETVISAVISA_ELECTRONVISA_VPAYVPAYVRUNKNOWNIssuing card network of the payment card used for the transaction.
Example:"VISA"
- mandateMandate Response
Details of the mandate linked to the saved payment instrument.
CloseMandate Response- typestring
Type of mandate stored for the checkout or payment instrument.
Example:"recurrent" - statusstringOptions:
activeinactiveCurrent lifecycle status of the mandate.
Example:"active" - merchant_codestring
Short unique identifier for the merchant for which the mandate is valid.
Example:"MH4H92C7"
Example:{"type":"recurrent","status":"active","merchant_code":"MH4H92C7"} - created_atstringformat: date-time
The timestamp of when the payment instrument was created.
Example:"2021-03-30T10:06:07.000+00:00"
curl https://api.sumup.com/v0.1/customers/{customer_id}/payment-instruments \ -X GET \ -H "Authorization: Bearer $SUMUP_API_KEY"sumup customers payment-instruments list "831ff8d4cd5958ab5670"import SumUp from "@sumup/sdk";
async function main() { const client = new SumUp({ apiKey: "sup_sk_your_api_key" });
const result = await client.customers.listPaymentInstruments( "831ff8d4cd5958ab5670" ); console.log(result);}
main().catch(console.error);using System;using System.Collections.Generic;using System.Threading.Tasks;using SumUp;
public static class Program{ public static async Task Main() { using var client = new SumUpClient(); var response = await client.Customers.ListPaymentInstrumentsAsync( "example-id");
Console.WriteLine(response.StatusCode); }}import com.sumup.sdk.SumUpClient;
public final class ListPaymentInstrumentsSample { public static void main(String[] args) throws Exception { var client = new SumUpClient();
var result = client.customers().listPaymentInstruments( "831ff8d4cd5958ab5670" ); System.out.println(result); }}import os
import sumup
client = sumup.Sumup(api_key=os.environ["SUMUP_API_KEY"])result = client.customers.list_payment_instruments( "831ff8d4cd5958ab5670",)print(result)$sumup = new \SumUp\SumUp();
$result = $sumup->customers->listPaymentInstruments('831ff8d4cd5958ab5670');package main
import ( "context" "fmt"
"github.com/sumup/sumup-go")
func main() { client := sumup.NewClient() result, err := client.Customers.ListPaymentInstruments(context.TODO(), "831ff8d4cd5958ab5670") if err != nil { panic(err.Error()) }
fmt.Printf("%+v\n", result)}use sumup::{Authorization, Client};#[tokio::main]async fn main() { let client = Client::default() .with_authorization(Authorization::api_key("sup_sk_test_...")); let response = client .customers() .list_payment_instruments("CUSTOMER_ID") .await .expect("list_payment_instruments request failed"); println!("{response:#?}");}[ { "token": "bcfc8e5f-3b47-4cb9-854b-3b7a4cce7be3", "active": true, "type": "card", "mandate": { "type": "recurrent", "status": "active", "merchant_code": "MH4H92C7" }, "card": { "last_4_digits": "0001", "type": "VISA" }, "created_at": "2021-03-30T10:06:07.000+00:00" }]Content-Type: application/json
The request is not authorized.
- typestringrequiredformat: uri
A URI reference that identifies the problem type.
Example:"https://developer.sumup.com/problem/not-found" - titlestring
A short, human-readable summary of the problem type.
Example:"Requested resource couldn't be found." - statusinteger
The HTTP status code generated by the origin server for this occurrence of the problem.
Example:404 - detailstring
A human-readable explanation specific to this occurrence of the problem.
Example:"The requested resource doesn't exist or does not belong to you." - instancestringformat: uri
A URI reference that identifies the specific occurrence of the problem.
Example:"https://api.sumup.com/v0.1/checkouts/4e425463-3e1b-431d-83fa-1e51c2925e99"
Content-Type: application/json
The request is authenticated but not permitted for this operation.
- error_messagestring
Short description of the error.
Example:"request_not_allowed" - error_codestring
Platform code for the error.
Example:"FORBIDDEN" - status_codestring
HTTP status code for the error.
Example:"403"
Content-Type: application/json
The requested resource does not exist.
- messagestring
Short description of the error.
Example:"Resource not found" - error_codestring
Platform code for the error.
Example:"NOT_FOUND"
{ "detail": "Unauthorized.", "status": 401, "title": "Unauthorized", "trace_id": "3c77294349d3b5647ea2d990f0d8f017", "type": "https://developer.sumup.com/problem/unauthorized"}{ "error_message": "request_not_allowed", "error_code": "FORBIDDEN", "status_code": "403"}{ "error_code": "NOT_FOUND", "message": "Resource not found"}Deactivate a payment instrument
Deactivates an identified card payment instrument resource for a customer.
payment_instrumentscustomers.writePath Parameters
- customer_idstringrequired
The
customer_idyou supplied when creating the customer.Example:"831ff8d4cd5958ab5670" - tokenstringrequired
Unique token identifying the card saved as a payment instrument resource.
Example:"bcfc8e5f-3b47-4cb9-854b-3b7a4cce7be3"
Response
Returns empty response.
curl https://api.sumup.com/v0.1/customers/{customer_id}/payment-instruments/{token} \ -X DELETE \ -H "Authorization: Bearer $SUMUP_API_KEY"sumup customers payment-instruments deactivate "831ff8d4cd5958ab5670" "bcfc8e5f-3b47-4cb9-854b-3b7a4cce7be3"import SumUp from "@sumup/sdk";
async function main() { const client = new SumUp({ apiKey: "sup_sk_your_api_key" });
const result = await client.customers.deactivatePaymentInstrument( "831ff8d4cd5958ab5670", "bcfc8e5f-3b47-4cb9-854b-3b7a4cce7be3" ); console.log(result);}
main().catch(console.error);using System;using System.Collections.Generic;using System.Threading.Tasks;using SumUp;
public static class Program{ public static async Task Main() { using var client = new SumUpClient(); var response = await client.Customers.DeactivatePaymentInstrumentAsync( "example-id", "example");
Console.WriteLine(response.StatusCode); }}import com.sumup.sdk.SumUpClient;
public final class DeactivatePaymentInstrumentSample { public static void main(String[] args) throws Exception { var client = new SumUpClient();
client.customers().deactivatePaymentInstrument( "831ff8d4cd5958ab5670", "bcfc8e5f-3b47-4cb9-854b-3b7a4cce7be3" ); }}import os
import sumup
client = sumup.Sumup(api_key=os.environ["SUMUP_API_KEY"])client.customers.deactivate_payment_instrument( "831ff8d4cd5958ab5670", "bcfc8e5f-3b47-4cb9-854b-3b7a4cce7be3",)$sumup = new \SumUp\SumUp();
$result = $sumup->customers->deactivatePaymentInstrument('831ff8d4cd5958ab5670', 'bcfc8e5f-3b47-4cb9-854b-3b7a4cce7be3');package main
import ( "context"
"github.com/sumup/sumup-go")
func main() { client := sumup.NewClient() if err := client.Customers.DeactivatePaymentInstrument(context.TODO(), "831ff8d4cd5958ab5670", "bcfc8e5f-3b47-4cb9-854b-3b7a4cce7be3"); err != nil { panic(err.Error()) }}use sumup::{Authorization, Client};#[tokio::main]async fn main() { let client = Client::default() .with_authorization(Authorization::api_key("sup_sk_test_...")); let response = client .customers() .deactivate_payment_instrument("CUSTOMER_ID", "PAYMENT_INSTRUMENT_TOKEN") .await .expect("deactivate_payment_instrument request failed"); println!("{response:#?}");}Content-Type: application/json
The request is invalid.
- messagestring
Short description of the error.
Example:"Resource not found" - error_codestring
Platform code for the error.
Example:"NOT_FOUND"
Content-Type: application/json
The request is not authorized.
- typestringrequiredformat: uri
A URI reference that identifies the problem type.
Example:"https://developer.sumup.com/problem/not-found" - titlestring
A short, human-readable summary of the problem type.
Example:"Requested resource couldn't be found." - statusinteger
The HTTP status code generated by the origin server for this occurrence of the problem.
Example:404 - detailstring
A human-readable explanation specific to this occurrence of the problem.
Example:"The requested resource doesn't exist or does not belong to you." - instancestringformat: uri
A URI reference that identifies the specific occurrence of the problem.
Example:"https://api.sumup.com/v0.1/checkouts/4e425463-3e1b-431d-83fa-1e51c2925e99"
Content-Type: application/json
The request is authenticated but not permitted for this operation.
- error_messagestring
Short description of the error.
Example:"request_not_allowed" - error_codestring
Platform code for the error.
Example:"FORBIDDEN" - status_codestring
HTTP status code for the error.
Example:"403"
Content-Type: application/json
The requested resource does not exist.
- messagestring
Short description of the error.
Example:"Resource not found" - error_codestring
Platform code for the error.
Example:"NOT_FOUND"
{ "error_code": "INVALID_REQUEST", "message": "bad request"}{ "detail": "Unauthorized.", "status": 401, "title": "Unauthorized", "trace_id": "3c77294349d3b5647ea2d990f0d8f017", "type": "https://developer.sumup.com/problem/unauthorized"}{ "error_message": "request_not_allowed", "error_code": "FORBIDDEN", "status_code": "403"}{ "error_code": "NOT_FOUND", "message": "Resource not found"}