Skip to content

Add issued_to field to Orders APIs #61

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 6, 2022
Merged

Add issued_to field to Orders APIs #61

merged 1 commit into from
Jun 6, 2022

Conversation

holtbp
Copy link
Contributor

@holtbp holtbp commented Jun 3, 2022

What

Added support for issued_to field to Order create and place APIs (and returned in Order response).

Why

This allows our partners to create orders and place orders on behalf of other parties.

SDK Release Checklist

  • Have you added an integration test for the changes?
  • Have you built the library locally and made queries against it successfully?
  • Did you update the changelog?
  • Did you bump the package version?
  • If endpoints were removed, did you manually remove the corresponding files? (this should be rare)
  • For breaking changes, did you plan for the release of the new SDK versions and deploy the API to production?

@holtbp holtbp requested a review from a team June 3, 2022 22:17
@holtbp holtbp force-pushed the bh-issued_to branch 4 times, most recently from 2961bcd to b97276c Compare June 3, 2022 23:41
@@ -1036,6 +1042,7 @@ def create_shipping_estimate_with_http_info(
all_params.append("currency")
all_params.append("amount")
all_params.append("unit")
all_params.append("issued_to")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I hope you see what I meant about the python library ;-)

Copy link
Contributor

@pcothenet pcothenet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well done!

@holtbp
Copy link
Contributor Author

holtbp commented Jun 6, 2022

Output from testing package locally:

{
   "data":[
      {
         "allocation_state":"allocated",
         "allocations":[
            {
               "id":"all_test_d93bafdd66f770dc41f4c527df629ab1",
               "mass_g":100000,
               "production":false
            }
         ],
         "amount":100000,
         "created_at":datetime.datetime(2022, 6, 6, 17, 30, 19, "tzinfo=tzutc())",
         "currency":"USD",
         "id":"ord_test_522141c04170fb09769bfb37503d2baf",
         "inventory":[
            {
               "amount":100000,
               "currency":"USD",
               "price":5000,
               "project":{
                  "id":"pro_test_2b67b11a030b66e0a6dd61a56b49079a",
                  "name":"Patch's DAC Test Offset ""Project"
               },
               "unit":"g",
               "vintage_year":2022
            }
         ],
         "issued_to":{
            "email":"test@usepatch.com",
            "name":"None"
         },
         "mass_g":100000,
         "metadata":{
            
         },
         "patch_fee":100,
         "patch_fee_cents_usd":100,
         "price":5000,
         "price_cents_usd":5000,
         "production":false,
         "registry_url":"https://registry.patch.io/orders/ord_test_522141c04170fb09769bfb37503d2baf",
         "state":"processing",
         "unit":"g"
      },
      {
         "allocation_state":"allocated",
         "allocations":[
            {
               "id":"all_test_59be862ef35070204de0e0624313dd2e",
               "mass_g":30988,
               "production":false
            },
            {
               "id":"all_test_65d373c10c5bd87093d3cc960a3498ae",
               "mass_g":69012,
               "production":false
            }
         ],
         "amount":100000,
         "created_at":datetime.datetime(2022, 6, 6, 17, 30, 18, "tzinfo=tzutc())",
         "currency":"USD",
         "id":"ord_test_41a65b424e64208c6f7e5a0d820fb342",
         "inventory":[
            {
               "amount":100000,
               "currency":"USD",
               "price":5000,
               "project":{
                  "id":"pro_test_2b67b11a030b66e0a6dd61a56b49079a",
                  "name":"Patch's DAC Test Offset ""Project"
               },
               "unit":"g",
               "vintage_year":2022
            }
         ],
         "issued_to":{
            "email":"test@usepatch.com",
            "name":"None"
         },
         "mass_g":100000,
         "metadata":{
            
         },
         "patch_fee":100,
         "patch_fee_cents_usd":100,
         "price":5000,
         "price_cents_usd":5000,
         "production":false,
         "registry_url":"https://registry.patch.io/orders/ord_test_41a65b424e64208c6f7e5a0d820fb342",
         "state":"processing",
         "unit":"g"
      },
      {
         "allocation_state":"allocated",
         "allocations":[
            {
               "id":"all_test_4d494173b6fab7c7fc0bfa49d9cafcd9",
               "mass_g":100000,
               "production":false
            }
         ],
         "amount":100000,
         "created_at":datetime.datetime(2022, 6, 6, 17, 30, 18, "tzinfo=tzutc())",
         "currency":"USD",
         "id":"ord_test_c102c8ac954b4fa774e5dcaecaa3456f",
         "inventory":[
            {
               "amount":100000,
               "currency":"USD",
               "price":5000,
               "project":{
                  "id":"pro_test_2b67b11a030b66e0a6dd61a56b49079a",
                  "name":"Patch's DAC Test Offset ""Project"
               },
               "unit":"g",
               "vintage_year":2022
            }
         ],
         "issued_to":{
            "email":"test@usepatch.com",
            "name":"None"
         },
         "mass_g":100000,
         "metadata":{
            
         },
         "patch_fee":100,
         "patch_fee_cents_usd":100,
         "price":5000,
         "price_cents_usd":5000,
         "production":false,
         "registry_url":"https://registry.patch.io/orders/ord_test_c102c8ac954b4fa774e5dcaecaa3456f",
         "state":"processing",
         "unit":"g"
      },
      {
         "allocation_state":"allocated",
         "allocations":[
            {
               "id":"all_test_8a0e7c03d78925687b02eb8f4568347d",
               "mass_g":100000,
               "production":false
            }
         ],
         "amount":100000,
         "created_at":datetime.datetime(2022, 6, 6, 17, 30, 18, "tzinfo=tzutc())",
         "currency":"USD",
         "id":"ord_test_6fb66b394e8074137a33c7a0dc528573",
         "inventory":[
            {
               "amount":100000,
               "currency":"USD",
               "price":5000,
               "project":{
                  "id":"pro_test_2b67b11a030b66e0a6dd61a56b49079a",
                  "name":"Patch's DAC Test Offset ""Project"
               },
               "unit":"g",
               "vintage_year":2022
            }
         ],
         "issued_to":{
            "email":"test@usepatch.com",
            "name":"None"
         },
         "mass_g":100000,
         "metadata":{
            
         },
         "patch_fee":100,
         "patch_fee_cents_usd":100,
         "price":5000,
         "price_cents_usd":5000,
         "production":false,
         "registry_url":"https://registry.patch.io/orders/ord_test_6fb66b394e8074137a33c7a0dc528573",
         "state":"processing",
         "unit":"g"
      },
      {
         "allocation_state":"allocated",
         "allocations":[
            {
               "id":"all_test_e94a6df43123071a9f3bc0d2cf553e07",
               "mass_g":100000,
               "production":false
            }
         ],
         "amount":100000,
         "created_at":datetime.datetime(2022, 6, 6, 17, 30, 17, "tzinfo=tzutc())",
         "currency":"USD",
         "id":"ord_test_5539120b1032ca5621a8ecb731131994",
         "inventory":[
            {
               "amount":100000,
               "currency":"USD",
               "price":5000,
               "project":{
                  "id":"pro_test_2b67b11a030b66e0a6dd61a56b49079a",
                  "name":"Patch's DAC Test Offset ""Project"
               },
               "unit":"g",
               "vintage_year":2022
            }
         ],
         "issued_to":{
            "email":"test@usepatch.com",
            "name":"None"
         },
         "mass_g":100000,
         "metadata":{
            
         },
         "patch_fee":100,
         "patch_fee_cents_usd":100,
         "price":5000,
         "price_cents_usd":5000,
         "production":false,
         "registry_url":"https://registry.patch.io/orders/ord_test_5539120b1032ca5621a8ecb731131994",
         "state":"processing",
         "unit":"g"
      },
      {
         "allocation_state":"allocated",
         "allocations":[
            {
               "id":"all_test_9788bff719ca81e15f0a1f284666e681",
               "mass_g":100000,
               "production":false
            }
         ],
         "amount":100000,
         "created_at":datetime.datetime(2022, 6, 6, 17, 30, 17, "tzinfo=tzutc())",
         "currency":"USD",
         "id":"ord_test_da346d8a38ee0e5f47087d3bdcd323da",
         "inventory":[
            {
               "amount":100000,
               "currency":"USD",
               "price":5000,
               "project":{
                  "id":"pro_test_2b67b11a030b66e0a6dd61a56b49079a",
                  "name":"Patch's DAC Test Offset ""Project"
               },
               "unit":"g",
               "vintage_year":2022
            }
         ],
         "issued_to":{
            "email":"test@usepatch.com",
            "name":"None"
         },
         "mass_g":100000,
         "metadata":{
            
         },
         "patch_fee":100,
         "patch_fee_cents_usd":100,
         "price":5000,
         "price_cents_usd":5000,
         "production":false,
         "registry_url":"https://registry.patch.io/orders/ord_test_da346d8a38ee0e5f47087d3bdcd323da",
         "state":"processing",
         "unit":"g"
      },
      {
         "allocation_state":"allocated",
         "allocations":[
            {
               "id":"all_test_7e63ed22134ab4b214eb35d9bdd70103",
               "mass_g":100000,
               "production":false
            }
         ],
         "amount":100000,
         "created_at":datetime.datetime(2022, 6, 6, 17, 30, 16, "tzinfo=tzutc())",
         "currency":"USD",
         "id":"ord_test_0ce5c616511ad013fc559d5e0b46824d",
         "inventory":[
            {
               "amount":100000,
               "currency":"USD",
               "price":5000,
               "project":{
                  "id":"pro_test_2b67b11a030b66e0a6dd61a56b49079a",
                  "name":"Patch's DAC Test Offset ""Project"
               },
               "unit":"g",
               "vintage_year":2022
            }
         ],
         "issued_to":{
            "email":"test@usepatch.com",
            "name":"None"
         },
         "mass_g":100000,
         "metadata":{
            
         },
         "patch_fee":100,
         "patch_fee_cents_usd":100,
         "price":5000,
         "price_cents_usd":5000,
         "production":false,
         "registry_url":"https://registry.patch.io/orders/ord_test_0ce5c616511ad013fc559d5e0b46824d",
         "state":"processing",
         "unit":"g"
      },
      {
         "allocation_state":"allocated",
         "allocations":[
            {
               "id":"all_test_6d29c1280dd665723556d12b7394f155",
               "mass_g":100000,
               "production":false
            }
         ],
         "amount":100000,
         "created_at":datetime.datetime(2022, 6, 6, 17, 30, 16, "tzinfo=tzutc())",
         "currency":"USD",
         "id":"ord_test_8594676498f72608cdf112d7700b5ac4",
         "inventory":[
            {
               "amount":100000,
               "currency":"USD",
               "price":5000,
               "project":{
                  "id":"pro_test_2b67b11a030b66e0a6dd61a56b49079a",
                  "name":"Patch's DAC Test Offset ""Project"
               },
               "unit":"g",
               "vintage_year":2022
            }
         ],
         "issued_to":{
            "email":"test@usepatch.com",
            "name":"None"
         },
         "mass_g":100000,
         "metadata":{
            
         },
         "patch_fee":100,
         "patch_fee_cents_usd":100,
         "price":5000,
         "price_cents_usd":5000,
         "production":false,
         "registry_url":"https://registry.patch.io/orders/ord_test_8594676498f72608cdf112d7700b5ac4",
         "state":"processing",
         "unit":"g"
      },
      {
         "allocation_state":"allocated",
         "allocations":[
            {
               "id":"all_test_8be0d6abdf876423b3120350b8d2f349",
               "mass_g":529435,
               "production":false
            },
            {
               "id":"all_test_067a245c290137d570e3acb6f52a9e7d",
               "mass_g":443292,
               "production":false
            }
         ],
         "amount":972727,
         "created_at":datetime.datetime(2022, 6, 6, 17, 29, 29, "tzinfo=tzutc())",
         "currency":"EUR",
         "id":"ord_test_dd1f477a628678e6b1e3391acc250d5b",
         "inventory":[
            {
               "amount":972727,
               "currency":"EUR",
               "price":91,
               "project":{
                  "id":"pro_test_0de1a59eed9ff8474e09077ddb3714b2",
                  "name":"Patch's Reforestation Test ""Offset Project"
               },
               "unit":"g",
               "vintage_year":2022
            }
         ],
         "issued_to":{
            "email":"None",
            "name":"None"
         },
         "mass_g":972727,
         "metadata":{
            
         },
         "patch_fee":9,
         "patch_fee_cents_usd":10,
         "price":91,
         "price_cents_usd":97,
         "production":false,
         "registry_url":"https://registry.patch.io/orders/ord_test_dd1f477a628678e6b1e3391acc250d5b",
         "state":"placed",
         "unit":"g"
      },
      {
         "allocation_state":"allocated",
         "allocations":[
            {
               "id":"all_test_7afd2a512e2a542a62230478a772a056",
               "mass_g":100,
               "production":false
            }
         ],
         "amount":100,
         "created_at":datetime.datetime(2022, 6, 6, 17, 29, 29, "tzinfo=tzutc())",
         "currency":"USD",
         "id":"ord_test_10f08f75f24ba43f8932c2522b146522",
         "inventory":[
            {
               "amount":100,
               "currency":"USD",
               "price":1,
               "project":{
                  "id":"pro_test_0de1a59eed9ff8474e09077ddb3714b2",
                  "name":"Patch's Reforestation Test ""Offset Project"
               },
               "unit":"g",
               "vintage_year":2022
            }
         ],
         "issued_to":{
            "email":"None",
            "name":"None"
         },
         "mass_g":100,
         "metadata":{
            
         },
         "patch_fee":1,
         "patch_fee_cents_usd":1,
         "price":1,
         "price_cents_usd":1,
         "production":false,
         "registry_url":"https://registry.patch.io/orders/ord_test_10f08f75f24ba43f8932c2522b146522",
         "state":"placed",
         "unit":"g"
      },
      {
         "allocation_state":"allocated",
         "allocations":[
            {
               "id":"all_test_96359ae0e2c8e3b0bbb67225553f777c",
               "mass_g":100,
               "production":false
            }
         ],
         "amount":100,
         "created_at":datetime.datetime(2022, 6, 6, 17, 29, 29, "tzinfo=tzutc())",
         "currency":"USD",
         "id":"ord_test_f5ff9476f166a768dd656d10134396d5",
         "inventory":[
            {
               "amount":100,
               "currency":"USD",
               "price":1,
               "project":{
                  "id":"pro_test_0de1a59eed9ff8474e09077ddb3714b2",
                  "name":"Patch's Reforestation Test ""Offset Project"
               },
               "unit":"g",
               "vintage_year":2022
            }
         ],
         "issued_to":{
            "email":"None",
            "name":"None"
         },
         "mass_g":100,
         "metadata":{
            
         },
         "patch_fee":1,
         "patch_fee_cents_usd":1,
         "price":1,
         "price_cents_usd":1,
         "production":false,
         "registry_url":"https://registry.patch.io/orders/ord_test_f5ff9476f166a768dd656d10134396d5",
         "state":"placed",
         "unit":"g"
      },
      {
         "allocation_state":"allocated",
         "allocations":[
            {
               "id":"all_test_edf0adb5433f2f7d6cbbab14482cd8b4",
               "mass_g":100,
               "production":false
            }
         ],
         "amount":100,
         "created_at":datetime.datetime(2022, 6, 6, 17, 29, 28, "tzinfo=tzutc())",
         "currency":"USD",
         "id":"ord_test_fabf2842b1574e83fe36aa76a25533c3",
         "inventory":[
            {
               "amount":100,
               "currency":"USD",
               "price":1,
               "project":{
                  "id":"pro_test_0de1a59eed9ff8474e09077ddb3714b2",
                  "name":"Patch's Reforestation Test ""Offset Project"
               },
               "unit":"g",
               "vintage_year":2022
            }
         ],
         "issued_to":{
            "email":"None",
            "name":"None"
         },
         "mass_g":100,
         "metadata":{
            "external_id":"order-123"
         },
         "patch_fee":1,
         "patch_fee_cents_usd":1,
         "price":1,
         "price_cents_usd":1,
         "production":false,
         "registry_url":"https://registry.patch.io/orders/ord_test_fabf2842b1574e83fe36aa76a25533c3",
         "state":"placed",
         "unit":"g"
      },
      {
         "allocation_state":"pending",
         "allocations":[
            
         ],
         "amount":100,
         "created_at":datetime.datetime(2022, 6, 6, 17, 29, 28, "tzinfo=tzutc())",
         "currency":"USD",
         "id":"ord_test_650942d1bc9abda2a045292b2a785caf",
         "inventory":[
            {
               "amount":100,
               "currency":"USD",
               "price":1,
               "project":{
                  "id":"pro_test_0de1a59eed9ff8474e09077ddb3714b2",
                  "name":"Patch's Reforestation Test ""Offset Project"
               },
               "unit":"g",
               "vintage_year":2022
            }
         ],
         "issued_to":{
            "email":"None",
            "name":"None"
         },
         "mass_g":100,
         "metadata":{
            
         },
         "patch_fee":1,
         "patch_fee_cents_usd":1,
         "price":1,
         "price_cents_usd":1,
         "production":false,
         "registry_url":"https://registry.patch.io/orders/ord_test_650942d1bc9abda2a045292b2a785caf",
         "state":"cancelled",
         "unit":"g"
      },
      {
         "allocation_state":"allocated",
         "allocations":[
            {
               "id":"all_test_9e25acc47f3604810e55e9b4d9d3cc89",
               "mass_g":100,
               "production":false
            }
         ],
         "amount":100,
         "created_at":datetime.datetime(2022, 6, 6, 17, 29, 28, "tzinfo=tzutc())",
         "currency":"USD",
         "id":"ord_test_b74fb1f665ab917373ec6edfc9746c60",
         "inventory":[
            {
               "amount":100,
               "currency":"USD",
               "price":1,
               "project":{
                  "id":"pro_test_0de1a59eed9ff8474e09077ddb3714b2",
                  "name":"Patch's Reforestation Test ""Offset Project"
               },
               "unit":"g",
               "vintage_year":2022
            }
         ],
         "issued_to":{
            "email":"None",
            "name":"None"
         },
         "mass_g":100,
         "metadata":{
            
         },
         "patch_fee":1,
         "patch_fee_cents_usd":1,
         "price":1,
         "price_cents_usd":1,
         "production":false,
         "registry_url":"https://registry.patch.io/orders/ord_test_b74fb1f665ab917373ec6edfc9746c60",
         "state":"placed",
         "unit":"g"
      },
      {
         "allocation_state":"allocated",
         "allocations":[
            {
               "id":"all_test_2fa23c29697510d6e416732ef7a0b018",
               "mass_g":100,
               "production":false
            }
         ],
         "amount":100,
         "created_at":datetime.datetime(2022, 6, 6, 17, 29, 27, "tzinfo=tzutc())",
         "currency":"USD",
         "id":"ord_test_e40b0dccb534522e8358f6be062c8780",
         "inventory":[
            {
               "amount":100,
               "currency":"USD",
               "price":1,
               "project":{
                  "id":"pro_test_0de1a59eed9ff8474e09077ddb3714b2",
                  "name":"Patch's Reforestation Test ""Offset Project"
               },
               "unit":"g",
               "vintage_year":2022
            }
         ],
         "issued_to":{
            "email":"issuee@companyc.com",
            "name":"Bob Dylan"
         },
         "mass_g":100,
         "metadata":{
            
         },
         "patch_fee":1,
         "patch_fee_cents_usd":1,
         "price":1,
         "price_cents_usd":1,
         "production":false,
         "registry_url":"https://registry.patch.io/orders/ord_test_e40b0dccb534522e8358f6be062c8780",
         "state":"placed",
         "unit":"g"
      }
   ],
   "error":"None",
   "meta":{
      "next_page":2,
      "prev_page":"None"
   },
   "success":true
}

@holtbp holtbp merged commit 8880d42 into main Jun 6, 2022
@holtbp holtbp deleted the bh-issued_to branch June 6, 2022 18:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants