2CheckOut: Cant find lineItemId, which is required to stop a recurring sale

StackOverflow https://stackoverflow.com/questions/17772278

  •  03-06-2022
  •  | 
  •  

質問

I need to stop a recurring sale.

The sales always have one item only.

Looking at the documentation for this API call: http://www.2checkout.com/documentation/api/sales/stop-lineitem-recurring/ , it requires a lineItemId.

I dont see any lineItemId in the INS ORDER_CREATED and RECURRING_INSTALLMENT_SUCCESS messages.

Where do I get this field from? I'm assuming its the invoice id which is to be used. Is it correct?

役に立ちましたか?

解決

All 2Checkout sales have a sale_id, and invoice_id and at least one lineitem_id. Recurring sales create a new invoice on each recurring instalment so the sales/detail_sale API call may return multiple invoices. The sale_id can have many invoice_id's and each invoice_id can have many linitems_id's.

If you need to stop the recurring billing on a sale, you need to stop the recurring billing an each active recurring lineitem. The lineitem_id is changed on each new invoice on a recurring sale so when making the stop_lineitem_recurring call it is necessary to use the lineitem_ids from the most recently billed invoice. To make it easier, you can use the 2Checkout client library for the language you are using as each library provides you with a method to stop all recurring lineitems on a sale using the sale ID (order number).

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top