Skip to content

Unable to use temporary address in checkout API #2845

@joelsaupe

Description

@joelsaupe

Steps to reproduce

Add an address to an order via the API.

Expected behavior

Be able to use a temporary address in checkout similar to the frontend. It would be nice for there to be a boolean that could be sent with the shipping address to tell it to persist or not.

Actual behavior

The API always persists the address to a user's address book if there's a user and a bill_address_id and the state is transitioning out of the address step. So there's no way to add a temporary address under these conditions and it means that if the user goes back and edits the address info to add a new one, the new address won't be added to the address book unlike the first.

if !temporary_address && user && user.respond_to?(:persist_order_address) && bill_address_id

before_transition from: :address, do: :persist_user_address!

System configuration

Solidus 2.6

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions