Edit customer

Edit customer details for an order.

curl -X POST 
-H 'authorization: Bearer v4.public.eyJpc3MiOiJs...' 
-H 'content-type: application/json' 
-H 'Idempotency-Key: da7ca8f9-915b-472b-b5f0-81945bff9e4a' 
-d '{
  "billingAddress": {
    "attentionName": "",
    "careOf": "",
    "city": "Stockholm",
    "companyName": "Ledyer AB",
    "country": "SE",
    "postalCode": "11359",
    "streetAddress": "Sveavägen 49"
  },
  "email": "jan.jonsson@business.com",
  "invoiceChannel": {
    "details": "a detail",
  },
  "phone": "004613371337",
  "reference1": "ref #1",
  "reference2": "ref #2",
  "shippingAddress": {
    "attentionName": "Anders",
    "careOf": "",
    "city": "Stockholm",
    "companyName": "Ledyer AB",
    "contact": {
      "email": "anders.andersson@example.com",
      "firstName": "Anders",
      "lastName": "Andersson",
      "phone": "004612341234"
    },
    "country": "SE",
    "postalCode": "11359",
    "streetAddress": "Sveavägen 49"
  }
}'
https://api.sandbox.ledyer.com/v1/orders/:orderId/customer

Request Headers

Idempotency-Key string
A unique key for safely retrying a request without duplicating work.

Path parameters

orderId string
The order ID obtained when the order session was [created](/docs/payment-products/checkout/create-order-session).

Request body

billingAddress companyAddress Optional
The billing address. Replaces the current billing address.
Show child attributes
attentionName string Optional
Attention name
careOf string Optional
Care of
city string
City
companyName string
Company name
contact contact
Contact person details
Show child attributes
email string
Email
firstName string
First name
lastName string
Last name
phone string
Phone
country string Optional
Country
postalCode string
Postal code
streetAddress string Optional
Street address
email string Optional
The customer's email address.
invoiceChannel object Optional
An object containing `details` as a string.
phone string Optional
The customer's phone number.
reference1 string Optional
Merchant reference 1, for example a cost center.
reference2 string Optional
Merchant reference 2, for example a purchase order number.
shippingAddress companyAddress Optional
The shipping address. Replaces the current shipping address.
Show child attributes
attentionName string Optional
Attention name
careOf string Optional
Care of
city string
City
companyName string
Company name
contact contact
Contact person details
Show child attributes
email string
Email
firstName string
First name
lastName string
Last name
phone string
Phone
country string Optional
Country
postalCode string
Postal code
streetAddress string Optional
Street address
{
	"captured": [],
	"capturedAmount": {
		"amount": "0.00",
		"currency": "SEK",
		"formatted": "0.00",
		"formattedWithCurrency": "SEK 0.00",
		"minorUnits": 0
	},
	"createdAt": "2023-02-10T21:28:17.425663Z",
	"customer": {
		"billingAddress": {
			"attentionName": "",
			"careOf": "",
			"city": "Stockholm",
			"companyName": "Ledyer AB",
			"country": "SE",
			"postalCode": "11359",
			"streetAddress": "Sveavägen 49"
		},
		"companyId": "559311-3714",
		"companyName": "Ledyer AB",
		"email": "jan.jonsson@business.com",
		"firstName": "Jan",
		"invoiceChannel": {
			"details": "a detail",
			"type": "email"
		},
		"lastName": "Jonsson",
		"paymentMethod": {
			"provider": "ledyer",
			"type": "invoice"
		},
		"phone": "004613371337",
		"reference1": "ref #1",
		"reference2": "ref #2",
		"shippingAddress": {
			"attentionName": "Anders",
			"careOf": "",
			"city": "Stockholm",
			"companyName": "Ledyer AB",
			"contact": {
				"email": "anders.andersson@example.com",
				"firstName": "Anders",
				"lastName": "Andersson",
				"phone": "004612341234"
			},
			"country": "SE",
			"postalCode": "11359",
			"streetAddress": "Sveavägen 49"
		}
	},
	"events": [
		{
			"amount": {
				"amount": "0.00",
				"currency": "SEK",
				"formatted": "0.00",
				"formattedWithCurrency": "SEK 0.00",
				"minorUnits": 0
			},
			"createdAt": "2023-02-10T21:28:21.992588Z",
			"id": "oe_24w4qABgHvVTEtuebc5MIvqnplx",
			"ledgerId": "in_24w4pVQQYYEMRKJy4VhBmiay4qw",
			"orderId": "or_24w4p5pJogDfyMevIEddZLqyXMG",
			"type": "editCustomer"
		},
		{
			"amount": {
				"amount": "0.00",
				"currency": "SEK",
				"formatted": "0.00",
				"formattedWithCurrency": "SEK 0.00",
				"minorUnits": 0
			},
			"createdAt": "2023-02-10T21:28:18.425663Z",
			"id": "oe_24w4pSYb70kRiEu7FnlQ0ck3iV8",
			"ledgerId": "in_24w4pVQQYYEMRKJy4VhBmiay4qw",
			"orderId": "or_24w4p5pJogDfyMevIEddZLqyXMG",
			"type": "readyForCapture"
		},
		{
			"amount": {
				"amount": "4600.00",
				"currency": "SEK",
				"formatted": "4,600.00",
				"formattedWithCurrency": "SEK 4,600.00",
				"minorUnits": 460000
			},
			"createdAt": "2023-02-10T21:28:17.425663Z",
			"id": "oe_24w4pSYb70kRiEu7FnlQ0ck3iV8",
			"ledgerId": "in_24w4pVQQYYEMRKJy4VhBmiay4qw",
			"orderId": "or_24w4p5pJogDfyMevIEddZLqyXMG",
			"type": "create"
		}
	],
	"expiresAt": "2023-02-24T21:28:17.425663Z",
	"id": "or_24w4p5pJogDfyMevIEddZLqyXMG",
	"merchantId": "ac_1xWqkkS5aIbxCJsoseRhSd0OJyD",
	"merchantReference": "or_24w4p5pJogDfyMevIEddZLqyXMG",
	"orderAmount": {
		"amount": "4600.00",
		"currency": "SEK",
		"formatted": "4,600.00",
		"formattedWithCurrency": "SEK 4,600.00",
		"minorUnits": 460000
	},
	"orderReference": "DXXX5HYZ",
	"paymentMethod": {
		"provider": "ledyer",
		"type": "invoice"
	},
	"refunded": [],
	"refundedAmount": {
		"amount": "0.00",
		"currency": "SEK",
		"formatted": "0.00",
		"formattedWithCurrency": "SEK 0.00",
		"minorUnits": 0
	},
	"riskProfile": {
		"tags": []
	},
	"status": ["uncaptured"],
	"storeId": "970245072",
	"uncaptured": {
		"availableActions": [
			{
				"type": "cancel"
			},
			{
				"type": "capture"
			},
			{
				"type": "partialCapture"
			},
			{
				"type": "editCustomer"
			},
			{
				"type": "editOrder"
			},
			{
				"type": "extendOrderExpiry"
			}
		],
		"createdAt": "2023-02-10T21:28:17.425663541Z",
		"ledgerId": "in_24w4pVQQYYEMRKJy4VhBmiay4qw",
		"note": "",
		"orderLines": [
			{
				"id": "ol_274BCHVWsZhUyROkVCzMJf7iz5V",
				"description": "Coffee Machine X200",
				"quantity": 9,
				"reference": "111-222-333",
				"totalAmount": 450000,
				"totalVatAmount": 90000,
				"type": "physical",
				"unitPrice": 50000,
				"vat": 2500
			},
			{
				"id": "ol_274BCKxRHZHzzRPADiBH9txmmO2",
				"description": "Shipping fee",
				"quantity": 1,
				"reference": "444-555-666",
				"totalAmount": 10000,
				"totalVatAmount": 2000,
				"type": "shippingFee",
				"unitPrice": 10000,
				"vat": 2500
			}
		],
		"status": [],
		"totalOrderAmount": {
			"amount": "4600.00",
			"currency": "SEK",
			"formatted": "4,600.00",
			"formattedWithCurrency": "SEK 4,600.00",
			"minorUnits": 460000
		},
		"totalOrderAmountExclVat": {
			"amount": "3680.00",
			"currency": "SEK",
			"formatted": "3,680.00",
			"formattedWithCurrency": "SEK 3,680.00",
			"minorUnits": 368000
		},
		"totalOrderVatAmount": {
			"amount": "920.00",
			"currency": "SEK",
			"formatted": "920.00",
			"formattedWithCurrency": "SEK 920.00",
			"minorUnits": 92000
		}
	},
	"uncapturedAmount": {
		"amount": "4600.00",
		"currency": "SEK",
		"formatted": "4,600.00",
		"formattedWithCurrency": "SEK 4,600.00",
		"minorUnits": 460000
	},
	"updatedAt": "2023-02-10T21:28:21.992588Z"
}
customer.billingAddress companyAddress
The updated billing address.
Show child attributes
attentionName string Optional
Attention name
careOf string Optional
Care of
city string
City
companyName string
Company name
contact contact
Contact person details
Show child attributes
email string
Email
firstName string
First name
lastName string
Last name
phone string
Phone
country string Optional
Country
postalCode string
Postal code
streetAddress string Optional
Street address
customer.email string
The updated customer email address.
customer.invoiceChannel object
An object with `details` (string) and `type` (email address or GLN number).
customer.phone string
The updated customer phone number.
customer.reference1 string
Merchant reference 1, for example a cost center.
customer.reference2 string
Merchant reference 2, for example a purchase order number.
customer.shippingAddress companyAddress
The updated shipping address.
Show child attributes
attentionName string Optional
Attention name
careOf string Optional
Care of
city string
City
companyName string
Company name
contact contact
Contact person details
Show child attributes
email string
Email
firstName string
First name
lastName string
Last name
phone string
Phone
country string Optional
Country
postalCode string
Postal code
streetAddress string Optional
Street address
events array

A list of order event snapshots. Each event includes an amount object with amount, currency, formatted, formattedWithCurrency, and minorUnits, plus createdAt, orderId, ledgerId, and type.

Supported type values:

  • acknowledge: Order has been acknowledged.
  • authorize: Order has been authorized.
  • cancel: Order has been cancelled.
  • create: Order has been created.
  • edit: Order lines and related order details have been edited since first authorization.
  • editCustomer: Customer details have been edited.
  • editPaymentMethod: Payment method has been changed.
  • extendExpiry: Order expiry has been extended at least once.
  • fullCapture: All order lines have been captured.
  • fullRefund: All order lines have been added to a credit invoice.
  • paid: Order has been paid.
  • partialCapture: Some order lines have been captured.
  • partialRefund: Some order lines have been added to a credit invoice.
  • readyForCapture: Order has been made ready for capture.
  • setReference: Merchant order reference has been updated.
updatedAt string
The timestamp of the latest event in `events`.