Inhalte aufrufen

Profilbild

WebApi: Set Billing and Shipping address to customer


  • Bitte melden Sie sich an, um eine Antwort zu verfassen.
4 Antworten zu diesem Thema

#1 TripleNico

TripleNico

    Advanced Member

  • Members
  • PunktPunktPunkt
  • 124 Beiträge

Geschrieben: 18 May 2020 - 15:16

How do you assing a address to a customer? There is an endpoint $"{serverBaseUrlOData}Customers({CustomerID})/Addresses({AddressID})" but this doesn't labels a adres as Shipping or Billing address



#2 Marcus Gesing

Marcus Gesing

    SmartStore AG

  • Administrators
  • 3801 Beiträge

Geschrieben: 19 May 2020 - 12:14

The assignment should actually take place via the customer entity (navigation property Customer.BillingAddress or Customer.ShippingAddress).
But I have not found a way to make this assignment via the API. I suspect that the ASP.NET Web API cannot do this out-of-box and that it will have to be upgraded manually. I've created an issue for this.

Marcus Gesing

Smartstore AG


#3 TripleNico

TripleNico

    Advanced Member

  • Members
  • PunktPunktPunkt
  • 124 Beiträge

Geschrieben: 19 May 2020 - 13:22

Thanks for looking into this! Maybe an extension will help, like assign addresId to BillingAddressId? Like the way it is currently displayed in the database?



#4 Marcus Gesing

Marcus Gesing

    SmartStore AG

  • Administrators
  • 3801 Beiträge

Geschrieben: 19 May 2020 - 17:13

Unfortunately not. There is no BillingAddressId. The relationship is covered by Entity Framework.


Marcus Gesing

Smartstore AG


#5 TripleNico

TripleNico

    Advanced Member

  • Members
  • PunktPunktPunkt
  • 124 Beiträge

Geschrieben: 20 May 2020 - 07:55

Ah that explains it why it is more difficult. Will track the github issue, hopefully you will find a way ;-)