Create a recurring order copy

How to create a recurring order copy via API

To create a new recurring order copy, send a POST request to the /api/recurring_order_copies endpoint, passing the resource arguments in the request body.

Request

POST https://yourdomain.commercelayer.io/api/recurring_order_copies

Arguments

Body Parameter
Type
Required

type

string

Required

attributes.place_target_order

boolean

Optional

attributes.reuse_wallet

boolean

Optional, default is 'true'

attributes.reference

string

Optional

attributes.reference_origin

string

Optional

attributes.metadata

object

Optional

relationships.source_order

object

Required

relationships.order_subscription

object

Required

Example

The following request creates a new recurring order copy:

curl -g -X POST \
  'https://yourdomain.commercelayer.io/api/recurring_order_copies' \
  -H 'Accept: application/vnd.api+json' \
  -H 'Authorization: Bearer your-access-token' \
  -H 'Content-Type: application/vnd.api+json' \
  -d '{
  "data": {
    "type": "recurring_order_copies",
    "relationships": {
      "source_order": {
        "data": {
          "type": "orders",
          "id": "ABCRtyUpBa"
        }
      },
      "order_subscription": {
        "data": {
          "type": "order_subscriptions",
          "id": "BCDRtyUpBa"
        }
      }
    }
  }
}'

Last updated